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

# Create payment

> Creates a payment for a booking using **Cash** or **UPI**.
Use this when the client pays via cash or UPI outside the app; then use the
[Confirm payment](/api/bookings/confirm-payment) endpoint to mark the payment as completed.

A cash payment can be recorded on a scheduling link that has no cash price. Pass `amount` and, optionally, `currency`. When the scheduling link already has a price, leave both out.

A retry with the same `idempotency_key` returns the payment already recorded. For UPI, a retry with the same `identifier` does too; a cash payment does not keep its `identifier`, so pass `idempotency_key` to make a cash retry safe.

While the booking has an open payment through another provider, the request returns a 422 error. Confirm or reject that payment first.


<Info>Replace `{your-subdomain}` with your workspace’s subdomain. <br /> Learn how to find your subdomain in [Workspace subdomain](/api/workspace-subdomain).</Info>


## OpenAPI

````yaml bundled/bookings.yaml POST /bookings/{booking_id}/payments
openapi: 3.0.3
info:
  title: NeetoCal Bookings APIs
  version: 2.0.0
servers:
  - description: NeetoCal APIs
    url: https://{your-subdomain}.neetocal.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Bookings
    description: >-
      APIs to create, list, and update bookings (reschedule, approve, reject, or
      cancel via the update endpoint).
paths:
  /bookings/{booking_id}/payments:
    post:
      tags:
        - Bookings
      summary: Create a payment
      description: >
        Creates a payment for a booking using **Cash** or **UPI**.

        Use this when the client pays via cash or UPI outside the app; then use
        the

        [Confirm payment](/api/bookings/confirm-payment) endpoint to mark the
        payment as completed.


        A cash payment can be recorded on a scheduling link that has no cash
        price. Pass `amount` and, optionally, `currency`. When the scheduling
        link already has a price, leave both out.


        A retry with the same `idempotency_key` returns the payment already
        recorded. For UPI, a retry with the same `identifier` does too; a cash
        payment does not keep its `identifier`, so pass `idempotency_key` to
        make a cash retry safe.


        While the booking has an open payment through another provider, the
        request returns a 422 error. Confirm or reject that payment first.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - in: path
          name: booking_id
          description: >
            Booking ID (numeric) or booking SID (short ID, up to 10 characters).
            You can get the booking SID from the [Get booking
            details](/api/bookings/get) or [List bookings](/api/bookings/list)
            response.
          required: true
          schema:
            type: string
            example: 8sqtzrs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - payment
              properties:
                payment:
                  allOf:
                    - $ref: '#/components/schemas/payment_create_request'
                    - type: object
                      properties:
                        amount:
                          type: string
                          description: >
                            Amount the client paid, as a decimal such as
                            `150.00`. Only for `cash`, and only when the
                            scheduling link has no cash price. When left out, it
                            defaults to the amount of the scheduling link's
                            default fee under another payment provider; without
                            such a fee the request returns a 422 error. Also
                            returns a 422 error for `upi`, or when the
                            scheduling link has a cash price.
                          example: '150.00'
                        currency:
                          type: string
                          description: >
                            Three-letter ISO 4217 currency code for `amount`,
                            such as `USD`. Defaults to the currency of the
                            scheduling link's price, else the workspace
                            currency.
                          example: USD
            example:
              payment:
                payment_provider: upi
                identifier: ext-123
                idempotency_key: order-1
      responses:
        '201':
          description: >-
            Created - Payment created. Use the returned `id` when confirming the
            payment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/payment'
              example:
                id: 123
                identifier: your-external-payment-id
                status: confirmation_pending
                amount: '100.0'
                currency: USD
        '422':
          description: >-
            Validation error, such as an invalid or expired discount code, or an
            invalid `amount` or `currency`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                amount_required:
                  summary: No price on the scheduling link and no amount passed
                  value:
                    error: >-
                      This meeting has no price. Pass the amount the client
                      paid.
                amount_not_allowed_with_price:
                  summary: Amount passed for a scheduling link that already has a price
                  value:
                    error: >-
                      This meeting already prices this payment at 100.0 USD.
                      Leave out amount and currency.
                amount_only_for_cash:
                  summary: Amount passed with UPI
                  value:
                    error: amount and currency can only be passed for a cash payment.
                invalid_amount:
                  summary: Amount that is not a number greater than zero
                  value:
                    error: >-
                      amount must be a number greater than zero, such as 150.00.
                      Got 'abc'.
                invalid_currency:
                  summary: Currency that is not a three-letter code
                  value:
                    error: >-
                      currency must be a three-letter ISO 4217 code, such as
                      USD. Got 'dollars'.
                other_payment_open:
                  summary: The booking has an open payment through another provider
                  value:
                    error: >-
                      This booking already has a upi payment that is
                      confirmation_pending. Settle or reject that payment before
                      recording a payment through another provider
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
  schemas:
    payment_create_request:
      type: object
      required:
        - payment_provider
      properties:
        payment_provider:
          type: string
          enum:
            - upi
            - cash
          description: >
            Payment method. Use `upi` for manual UPI or `cash` for cash
            payments. Internally mapped to `eupi` / `cash`.
        identifier:
          type: string
          description: Your external payment reference ID.
          example: your-external-payment-id
        idempotency_key:
          type: string
          description: >-
            Optional key for idempotent create. For UPI or Cash, either
            `identifier` or `idempotency_key` (or both) is required.
          example: optional-idempotency-key
        discount_code:
          type: string
          description: >-
            Optional discount code. If present, it is validated
            (invalid/expired/limit reached returns 422).
          example: YOUR_DISCOUNT_CODE
        tip_attributes:
          type: object
          description: Optional tip for the booking.
          properties:
            value:
              type: number
              description: Tip amount.
              example: 10
            is_custom:
              type: boolean
              description: Whether the tip is a custom amount.
              example: false
    payment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Payment record ID. Use this in the confirm endpoint.
          example: f46c9ddf-221d-4238-afb2-280c1c6b3185
        identifier:
          type: string
          description: Your external payment reference ID.
          example: your-external-payment-id
        status:
          type: string
          enum:
            - successful
            - authorized
            - declined
            - pending
            - requires_action
            - requires_confirmation
            - requires_payment_method
            - confirmation_pending
            - initiated
            - rejected
          description: Payment status.
          example: confirmation_pending
        amount:
          type: string
          description: Payment amount.
          example: '100.0'
        currency:
          type: string
          description: Currency code. Follows the ISO 4217 standard.
          example: USD

````

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