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

# Get or create the CLABE

> Returns the live CLABE of the one-time payment, or makes a new one when it has none or the last one expired. Asking again while the CLABE is live returns the same one, so a retry never makes a second. The CLABE always belongs to the one-time payment: when the customer pays, it is paid like any other.



## OpenAPI

````yaml POST /developer/v1/one-time-payment/{id}/bank-transfer
openapi: 3.1.0
info:
  title: Compago API
  version: 1.0.0
  description: >-
    Public and private API endpoints for Compago's payment infrastructure. This
    specification currently includes endpoints for one-time payments. More
    endpoints will be added as the platform evolves.
servers:
  - url: https://demo-api-harmony.compago.com/api
  - url: https://api-harmony.compago.com/api
security: []
tags:
  - name: OneTimePayment
    description: Endpoints for creating and processing one-time payment links
  - name: PaymentMethod
    description: >-
      Endpoints for saving cards, charging saved payment methods, holding and
      capturing funds, and processing refunds
  - name: PaymentIntent
    description: >-
      Endpoints for creating and managing card-present payment intents for POS
      terminal integrations
  - name: Payments
    description: Read the payments your organization has taken
  - name: Subscriptions
    description: Read and manage recurring billing agreements
  - name: PaymentLinks
    description: Create, edit and retire hosted checkout links
  - name: Products
    description: Manage the catalogue behind product-based payment links
  - name: Promotions
    description: Read the promotions your organization funds or benefits from
  - name: Salespeople
    description: Read the point-of-sale operators in your organization
  - name: Organization
    description: Read your organization profile and its members
  - name: SavedCards
    description: Read saved payment methods and their payments
  - name: Payouts
    description: >-
      Read the transfers Compago sent to your bank accounts and what each one
      paid
  - name: Events
    description: >-
      Read the webhook events of the last 30 days, to reconcile after your
      endpoint was down
  - name: ApiKeys
    description: Manage your organization's API keys with a key that holds `apiKey:write`.
paths:
  /developer/v1/one-time-payment/{id}/bank-transfer:
    post:
      tags:
        - OneTimePayments
      summary: Get or create the CLABE of a one-time payment
      description: >-
        Returns the live CLABE of the one-time payment, or makes a new one when
        it has none or the last one expired. Asking again while the CLABE is
        live returns the same one, so a retry never makes a second. The CLABE
        always belongs to the one-time payment: when the customer pays, it is
        paid like any other.
      operationId: createPublicOneTimePaymentBankTransfer
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                customer:
                  $ref: '#/components/schemas/BillingInformation'
                  description: >-
                    Only for a one-time payment created without
                    `billingInformation`: who pays. The CLABE is made out to
                    them and they are kept on the payment. Sent for a payment
                    that already has a customer, it is rejected with
                    `CUSTOMER_ALREADY_SET`.
      responses:
        '200':
          description: The live CLABE, asked for before.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBankTransfer'
        '201':
          description: A new CLABE.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicBankTransfer'
        '400':
          description: >-
            `CUSTOMER_REQUIRED` (the payment has no customer and none was sent),
            `CUSTOMER_ALREADY_SET`, `PAYMENT_METHOD_NOT_OFFERED` (the payment
            does not take bank transfers), `SPEI_NOT_OFFERED` (`amount` is below
            your SPEI minimum) or `INVALID_REQUEST`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '401':
          description: Unauthorized. The `x-api-key` header is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '403':
          description: '`INSUFFICIENT_SCOPE`, or the organization is not a merchant.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '404':
          description: Not found, or the resource belongs to another organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '409':
          description: >-
            `ONE_TIME_PAYMENT_ALREADY_PROCESSED`: the payment is paid or
            cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '410':
          description: '`ONE_TIME_PAYMENT_EXPIRED`: the payment itself expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '429':
          description: >-
            Rate limit exceeded. See the `Retry-After` and `X-RateLimit-*`
            headers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '502':
          description: '`SPEI_UNAVAILABLE`: the CLABE could not be made right now. Retry.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '503':
          description: '`SPEI_UNAVAILABLE`: SPEI is not enabled for your account.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    BillingInformation:
      type: object
      description: >-
        The customer's billing details. Optional on create: omit the whole
        object and the payer supplies these on the checkout page. When you do
        send it, every field listed under "required" must be present.
      properties:
        email:
          type: string
          format: email
          example: maria.gonzalez@example.com
          description: Customer's email address
        firstName:
          type: string
          example: María
          description: Customer's first name
        lastName:
          type: string
          example: González
          description: Customer's last name
        phoneNumber:
          type: string
          example: '+5215512345678'
          description: Customer's phone number
        address:
          $ref: '#/components/schemas/Address'
      required:
        - email
        - firstName
        - lastName
        - phoneNumber
    PublicBankTransfer:
      type: object
      description: >-
        The CLABE of a one-time payment: what your own screen shows the customer
        to pay by SPEI.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The CLABE request. Asking again while it is live returns this same
            id.
        status:
          type: string
          enum:
            - AWAITING_TRANSFER
            - PAID
            - EXPIRED
            - CANCELLED
            - RETURNED
          description: >-
            Where the CLABE stands. `AWAITING_TRANSFER`: it takes money and the
            payment is not paid yet. `PAID`: the transfer arrived and became a
            payment. `EXPIRED`: nothing arrived before `expiresAt`. `CANCELLED`:
            the payment was paid another way, or stopped being payable, before
            anything arrived. `RETURNED`: what arrived went back to whoever sent
            it, for example part of the price when the CLABE expired.
        rail:
          type: string
          enum:
            - SPEI
          description: The transfer network. Always `SPEI` today.
        clabe:
          type:
            - string
            - 'null'
          example: '738180000000012345'
          description: >-
            The 18-digit CLABE the customer transfers to. Only while `status` is
            `AWAITING_TRANSFER`; `null` once it stops taking money.
        clabeLast4:
          type: string
          example: '2345'
          description: The last four digits, kept after the CLABE closes.
        bank:
          type: string
          example: FINTOC
          description: The bank of the CLABE, as the customer's banking app shows it.
        beneficiary:
          type: string
          example: Sharepay SA de CV
          description: >-
            The account holder the customer's bank shows when it validates the
            CLABE. Show your business name beside it.
        concept:
          type: string
          example: Compra Mueblería Sol 3F2A1B
          description: >-
            A suggested transfer concept. Optional for the customer: the CLABE
            alone identifies the payment.
        amount:
          type: number
          example: 12000
          description: The price of the one-time payment.
        amountReceived:
          type: number
          example: 0
          description: What has arrived so far. A payment can be paid in several transfers.
        amountDue:
          type: number
          example: 12000
          description: What is still missing while the CLABE is live, `0` otherwise.
        currency:
          type: string
          enum:
            - MXN
        expiresAt:
          type: string
          format: date-time
          description: >-
            When the CLABE stops taking money. Never later than the one-time
            payment's own `expiresAt`.
        createdAt:
          type: string
          format: date-time
        paidAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the transfer that completed the price arrived. Only when
            `status` is `PAID`.
        paymentId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The payment the transfer became, readable at `GET
            /developer/v1/payment/{id}`. Only when `status` is `PAID`.
        url:
          type: string
          format: uri
          description: >-
            The Compago checkout screen of this same CLABE, for a customer who
            would rather open it. Encode it in a QR if you show one.
      required:
        - id
        - status
        - rail
        - clabe
        - clabeLast4
        - bank
        - beneficiary
        - concept
        - amount
        - amountReceived
        - amountDue
        - currency
        - expiresAt
        - createdAt
        - paidAt
        - paymentId
        - url
    PublicError:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description.
        code:
          type: string
          description: Stable machine-readable code. Branch on this, not on `message`.
      required:
        - message
    Address:
      type: object
      description: Physical address for billing purposes
      properties:
        addressLine:
          type: string
          example: Av. Insurgentes Sur 1234
          description: Street address, including number and street name
        city:
          type: string
          example: Ciudad de México
          description: The city where the address is located
        state:
          type: string
          example: CDMX
          description: The state or province where the address is located
          enum:
            - AGU
            - BCN
            - BCS
            - CAM
            - CHP
            - CHH
            - CDMX
            - COA
            - COL
            - DUR
            - MEX
            - GUA
            - GRO
            - HID
            - JAL
            - MIC
            - MOR
            - NAY
            - NLE
            - OAX
            - PUE
            - QUE
            - ROO
            - SLP
            - SIN
            - SON
            - TAB
            - TAM
            - TLA
            - VER
            - YUC
            - ZAC
        zip:
          type: string
          example: '03100'
          description: Zip code or Postal code where the address is located
      required:
        - addressLine
        - city
        - state
        - zip
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.