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

# Collections API - Generate Checkout

> Generate a Payment Checkout URL for customers to make payment



## OpenAPI

````yaml /api-reference/openapi-3.1.yml post /payments/v1/checkouts
openapi: 3.1.0
info:
  title: Payfonte - OpenAPI 3.1
  description: >-
    This is the minimal API for payfonte collection and disbursements API. To
    view a more elaborate documentation see here.


    Some useful links:

    - [Home](https://payfonte.com)

    - [Payfonte Documentation](https://docs.payfonte.com)
  termsOfService: https://www.payfonte.com/terms
  contact:
    email: tech@payfonte.com
  version: 1.0.0
servers:
  - url: https://sandbox-api.payfonte.com
    description: Sandbox API Base URL
  - url: https://api.payfonte.com
    description: Production API Base URL
security:
  - clientId: []
    clientSecret: []
tags:
  - name: Collections
    description: Everything about your payment collection with payfonte
    externalDocs:
      description: Find out more
      url: https://docs.payfonte.com/#/collections/inline
  - name: Card Collections
    description: Everything about your card payment collections with payfonte
  - name: Disbursements
    description: >
      Find full list of supported Disbursement providers here [Supported
      Providers](https://docs.payfonte.com/#/Disbursements/supported-Disbursements)

      There are 3 main process to carry out a Disbursement on Payfonte

      1. Validate A transfer Recipient

      2. Initiate a Disbursement Request

      3. Verify a Disbursement Request
  - name: Wallets
    description: >-
      A Little bit about our [wallets here]
      (https://docs.payfonte.com/#/introductions/wallets)
paths:
  /payments/v1/checkouts:
    post:
      tags:
        - Collections
      summary: Collections API - Generate Checkout
      description: Generate a Payment Checkout URL for customers to make payment
      operationId: generateCheckoutURL
      requestBody:
        description: Generate A Payment Checkout URL
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateCheckoutURLRequest'
        required: true
      responses:
        '201':
          description: Checkout URL Successfully Generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/GenerateCheckoutURLResponse'
components:
  schemas:
    GenerateCheckoutURLRequest:
      required:
        - country
        - currency
        - user
        - amount
      type: object
      properties:
        country:
          $ref: '#/components/schemas/Country'
          examples:
            - NG
        currency:
          $ref: '#/components/schemas/Currency'
          description: This is the base currency to be charged in.
          examples:
            - NGN
        amount:
          $ref: '#/components/schemas/Amount'
          description: >-
            This is the amount to charge the customer. Amount should be sent in
            the lowest denomination e.g for 100 USD you should send 100 * 100 =
            10000
          examples:
            - 10000
        user:
          $ref: '#/components/schemas/User'
          required:
            - phoneNumber
        reference:
          type: string
          description: >-
            A reference code you'll generate to identify this transaction. This
            must be unique for every transaction. If you don't pass one, we will
            generate one for you.
        redirectURL:
          type: string
          format: uri
          description: >-
            Fully qualified URL to which the customer should be redirected after
            the payment is completed
          example: https://example.com/redirect/success
          examples:
            - https://example.com/redirect/success
        cancelURL:
          type: string
          format: uri
          description: >-
            Fully qualified URL to which the customer should be redirected if
            the cancel the payment session
          example: https://example.com/redirect/cancel
          examples:
            - https://example.com/redirect/cancel
        webhook:
          type: string
          format: uri
          description: >-
            This is a URL, if this is passed we will send the event webhook
            payload to this endpoint. Use this to override the webhook url
            provided on the dashboard for this transaction. Read more on
            [Webhooks](https://docs.payfonte.com/#/collections/webhook)
          example: https://example.com/webhook
          examples:
            - https://example.com/webhook
        metadata:
          $ref: '#/components/schemas/Metadata'
    GenerateCheckoutURLResponse:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: >-
            This is the generated URL the customer should be redirected too for
            payment collection
          examples:
            - >-
              https://checkout-staging.payfonte.com/payfusion/66579afe04916ddcfcf73e7b
        shortURL:
          type: string
          format: uri
          description: >-
            This is a short version of the generated URL. PS: if you want to do
            a POST request redirection. Please use this
          examples:
            - https://l.6bd.co/XXXXX
        reference:
          type: string
          description: Transaction Reference
        amount:
          $ref: '#/components/schemas/Amount'
        currency:
          $ref: '#/components/schemas/Currency'
    Country:
      type: string
      description: 2 character country code
      example: US, NG, CI, SN, CA, UK
      examples:
        - NG
        - US
        - CI
        - SN
        - CA
        - UK
    Currency:
      type: string
      description: 3 character currency code
      example: USD, NGN, XOF, XAF
      examples:
        - NGN
        - USD
        - XOF
        - XAF
    Amount:
      type: integer
      description: >-
        Amount should be in the subunit of the supported currency i.e value *
        100 [Amount
        Specification](https://docs.payfonte.com/guides/introductions/amount-specification)
      format: int64
      example: 100000
      examples:
        - 100000
    User:
      type: object
      properties:
        name:
          type: string
          description: customer's name
          example: Example User
          examples:
            - Example User
        email:
          type: string
          description: customer's email
          example: user@example.com
          format: email
          examples:
            - user@example.com
        phoneNumber:
          type: string
          description: customer's phone number
          example: '2347012345678'
          examples:
            - '2347012345678'
    Metadata:
      type: object
      properties:
        merchantName:
          type: string
          example: Karis Clothing
          examples:
            - Karis Clothing
        trafficType:
          type: string
          example: ECOMMERCE
          examples:
            - ECOMMERCE
  securitySchemes:
    clientId:
      type: apiKey
      name: client-id
      in: header
    clientSecret:
      type: apiKey
      name: client-secret
      in: header

````