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

# Record payment

> Records a payment received from a customer. Optionally settle specific documents by pairing each `hash_id` with an `amount_paying` — partial settlement is supported and the document's payment status tracks what remains. Non-cash payment modes need a bank account configured on your account, otherwise the request fails with `MISSING_BANK_ACCOUNT`. Set `send_sms` or `send_email` to notify the customer.



## OpenAPI

````yaml post /v2/payment
openapi: 3.0.1
info:
  title: SwipeAPI
  version: '2.0'
  description: >-
    The Swipe Partner API — invoicing, payments, and GST compliance for your
    application. Create GST invoices and other documents, manage customers,
    vendors, products and inventory, record payments, and generate e-invoices
    and e-way bills.


    - Docs & guides: https://developers.getswipe.in

    - Quickstart: https://developers.getswipe.in/quickstart

    - Rate limit: 1 request/second per API key

    - All dates are DD-MM-YYYY
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
paths:
  /v2/payment:
    post:
      tags:
        - Payment V2
      summary: Record payment
      description: >-
        Records a payment received from a customer. Optionally settle specific
        documents by pairing each `hash_id` with an `amount_paying` — partial
        settlement is supported and the document's payment status tracks what
        remains. Non-cash payment modes need a bank account configured on your
        account, otherwise the request fails with `MISSING_BANK_ACCOUNT`. Set
        `send_sms` or `send_email` to notify the customer.
      operationId: post_payment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordPayment'
        required: true
      responses:
        '200':
          description: Payment recorded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseV2'
        '400':
          description: Error in recording payment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseV2'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentResponseV2'
components:
  schemas:
    RecordPayment:
      required:
        - amount
        - customer
        - payment_date
        - payment_mode
      properties:
        amount:
          type: number
          description: Amount to be paid
          example: 27
        payment_date:
          type: string
          description: Payment date [DD-MM-YYYY]
          example: 13-06-2024
        bank_details:
          $ref: '#/components/schemas/BankDetails'
        payment_mode:
          type: string
          description: Payment mode
          example: UPI
          enum:
            - Cash
            - Cheque
            - UPI
            - Card
            - Net Banking
            - paylater
            - cardless_emi
            - EMI
            - TDS
            - Credits
            - Opening Balance
        notes:
          type: string
          description: Notes, will be shared with the customer
          example: ''
        send_sms:
          type: boolean
          description: Send SMS, customer will be notified through SMS
          example: true
        send_email:
          type: boolean
          description: Send Email, customer will be notified through Email
          example: true
        exclusive_notes:
          type: string
          description: Exclusive Notes for internal purpose
          example: ''
        customer:
          type: string
          description: Customer ID
          example: CUST123
        documents:
          type: array
          description: Documents to be settled, if any
          example:
            - amount_paying: 27
              hash_id: SLascded
          items:
            $ref: '#/components/schemas/DocumentsList'
      type: object
    PaymentResponseV2:
      properties:
        success:
          type: boolean
          description: Success flag
          example: true
        message:
          type: string
          description: Response message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          description: Errors
        data:
          $ref: '#/components/schemas/PaymentResponseData'
      type: object
    BankDetails:
      required:
        - account_number
        - bank_name
        - branch
        - ifsc
      properties:
        account_number:
          type: string
          description: Account Number
          example: '1234567890'
        ifsc:
          type: string
          description: IFSC Code
          example: SBIN0000001
        bank_name:
          type: string
          description: Bank Name
          example: State Bank of India
        branch:
          type: string
          description: Branch
          example: Mumbai
      type: object
    DocumentsList:
      required:
        - amount_paying
        - hash_id
      properties:
        amount_paying:
          type: number
          description: Amount to be settled for the document
          example: 27
        hash_id:
          type: string
          description: Document Hash ID
          example: SLascded
      type: object
    PaymentResponseData:
      properties:
        serial_number:
          type: string
          description: Serial Number
          example: INV-123
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is an API key from the [API
        Integration](https://app.getswipe.in/user?tab=api_integration) section
        of your dashboard. Keys are scoped to the company they are generated in
        — for testing, [add a separate test
        company](https://community.getswipe.in/t/how-to-add-new-company-on-web/1191)
        and generate the key there, so requests never touch your real books.

````