> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rc.cleverhub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Payment Gateway Link

> Creates a payment gateway link for redirecting the customer to complete a payment. Once the payment is made successfully, Hello Clever will notify the status of the payment via the specified `payment_gateway_notification` endpoint. The payment request has various statuses throughout its lifecycle.




## OpenAPI

````yaml /api/openapi/v1-reference.yaml post /v1/payment_gateways/create_payment
openapi: 3.0.3
info:
  title: Payment APIs (AUD only)
  description: >-
    ## Introduction

    The Payment API Solution (AUD) offers developers a comprehensive suite of
    API services to build innovative AUD payment solutions efficiently. These
    APIs enable seamless transactions using various payment methods and
    functionalities, ensuring a robust, reliable, and scalable payment
    infrastructure tailored for the Australian market.

    ### Key Features

    - **Payment Methods**:
      - **Payment Link**: Supports payments via card and PayID.
      - **PayID**: Provides instant payments using a unique identifier.
      - **PayTo**: Enables scheduled or recurring payments.
      - **BSB/Account Number**: Allows direct bank transfers.
      - **Payout**: Manage payouts to designated accounts.

    - **Additional Functionalities**:
      - **Balance Management**: Real-time balance inquiries and updates.
      - **Reporting Services**: Generate detailed transaction and payment reports.

    This documentation provides detailed guidance for integrating these
    capabilities into your application.
  termsOfService: https://helloclever.co/terms
  contact:
    email: support@helloclever.co
  version: 1.0.11
servers:
  - url: https://api.cleverhub.co/api
    description: Sandbox Environment
  - url: https://api-merchant.helloclever.co/api
    description: Production Environment
security: []
paths:
  /v1/payment_gateways/create_payment:
    post:
      tags:
        - Payment Gateway
      summary: Create Payment Gateway Link
      description: >
        Creates a payment gateway link for redirecting the customer to complete
        a payment. Once the payment is made successfully, Hello Clever will
        notify the status of the payment via the specified
        `payment_gateway_notification` endpoint. The payment request has various
        statuses throughout its lifecycle.
      operationId: createPaymentGatewayLink
      parameters:
        - in: header
          name: access-token
          required: true
          schema:
            type: string
          description: >-
            The access token used for authentication, obtained from the
            `/v1/payment_gateways/access_token` endpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - order_id
                - amount
                - description
                - order_success_url
                - order_details
                - payment_gateway_notification
              properties:
                order_id:
                  type: string
                  example: 34097959-a153-48d4-bdab-14332bf7a92d
                  description: Unique identifier for the order created by the merchant.
                amount:
                  type: number
                  example: 100
                  description: The amount to be charged.
                description:
                  type: string
                  example: Order payment
                  description: A brief description of the transaction.
                order_success_url:
                  type: string
                  example: https://yourserver.co/order/success
                  description: URL to redirect the user upon successful payment.
                payment_gateway_notification:
                  type: object
                  required:
                    - endpoint_url
                    - authorization_header
                  properties:
                    authorization_header:
                      type: string
                      example: ANYTHING_ONLY_YOU_KNOW
                      description: Authorization header for security in notifications.
                    endpoint_url:
                      type: string
                      example: https://yourserver.co/endpoint
                      description: Endpoint URL to receive payment status notifications.
                  description: >
                    Specifies the endpoint and authorization header for
                    receiving notifications about payment status updates.
                order_details:
                  type: object
                  required:
                    - billing_details
                    - shipping_details
                    - items
                  properties:
                    billing_details:
                      type: object
                      required:
                        - first_name
                        - last_name
                        - phone
                        - email
                        - country_code
                        - postal_code
                        - city
                        - address
                      properties:
                        first_name:
                          type: string
                          example: Clever
                          description: First name of the customer.
                        last_name:
                          type: string
                          example: Hello
                          description: Last name of the customer.
                        phone:
                          type: string
                          example: '+61412345678'
                          description: Customer's phone number.
                        email:
                          type: string
                          example: test@example.com
                          description: Customer's email address.
                        company:
                          type: string
                          example: Hello Clever
                          description: Name of the customer's company, if applicable.
                        country_code:
                          type: string
                          example: AU
                          description: Country code of the customer's location.
                        state:
                          type: string
                          example: NSW
                          description: State or region of the customer's location.
                        postal_code:
                          type: string
                          example: '2000'
                          description: Postal code of the customer's location.
                        city:
                          type: string
                          example: Sydney
                          description: City of the customer's location.
                        address:
                          type: string
                          example: 388 George Street
                          description: Full address of the customer.
                    shipping_details:
                      type: object
                      required:
                        - first_name
                        - last_name
                        - phone
                        - email
                        - country_code
                        - postal_code
                        - city
                        - address
                      properties:
                        first_name:
                          type: string
                          example: Clever
                          description: First name of the recipient.
                        last_name:
                          type: string
                          example: Hello
                          description: Last name of the recipient.
                        phone:
                          type: string
                          example: '+61412345678'
                          description: Recipient's phone number.
                        email:
                          type: string
                          example: test@example.com
                          description: Recipient's email address.
                        company:
                          type: string
                          example: Hello Clever
                          description: Name of the recipient's company, if applicable.
                        country_code:
                          type: string
                          example: AU
                          description: Country code of the recipient's location.
                        state:
                          type: string
                          example: NSW
                          description: State or region of the recipient's location.
                        postal_code:
                          type: string
                          example: '2000'
                          description: Postal code of the recipient's location.
                        city:
                          type: string
                          example: Sydney
                          description: City of the recipient's location.
                        address:
                          type: string
                          example: 388 George Street
                          description: Full address of the recipient.
                    items:
                      type: array
                      items:
                        type: object
                        required:
                          - id
                          - name
                          - quantity
                          - price
                        properties:
                          id:
                            type: string
                            example: item-123
                            description: Unique identifier for the item.
                          name:
                            type: string
                            example: Product Name
                            description: Name of the item.
                          variant_id:
                            type: string
                            example: variant-456
                            description: Identifier for the item's variant, if applicable.
                          image_url:
                            type: string
                            format: uri
                            example: https://example.com/image.jpg
                            description: URL of the item's image.
                          quantity:
                            type: string
                            example: '2'
                            description: Quantity of the item ordered.
                          price:
                            type: string
                            example: '25.00'
                            description: Price of the item.
                          enable_cashback:
                            type: boolean
                            example: true
                            description: Indicates if cashback is enabled for the item.
      responses:
        '200':
          description: Payment link created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  redirect_url:
                    type: string
                    format: uri
                    description: >
                      The URL to redirect the customer to the Hello Clever
                      payment gateway for completing the payment.
                    example: >-
                      https://v2.paymentgateway.cleverhub.co/oneclick-checkout?payment=eyJ0eXAiOiJKV1QiLCJh...
                  payment_id:
                    type: integer
                    description: >
                      The unique identifier for the payment created in the Hello
                      Clever system.
                    example: 46345
                  order_id:
                    type: string
                    description: >
                      The unique identifier for the order associated with this
                      payment, as provided in the request.
                    example: 34097959-a153-48d4-bdab-14332bf7a92d
        '400':
          description: Bad Request.
        '401':
          description: Unauthorized.
        '404':
          description: Not Found.
        '422':
          description: Unprocessable Entity.

````

## Related topics

- [Authenticate with the Hello Clever API](/api/authentication.md)
- [Payment Gateway 3 API (v3)](/api/v3/introduction.md)
- [Create PayIn](/api/payin/create-payin.md)
