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

# Create a payment

> Records a payment against one or more invoices and returns it.

Records a payment from the fields under `payment`. Only the keys shown are accepted; any other returns `400`. A `payment_applied` entry whose processor holds a card token charges the card.

> [!NOTE]
>
> The SDK samples get their client from credentials your app registers once when it starts, as shown in [Authentication](https://exsited.mintlify.site/authentication.md#set-up-a-client). To try the call here, click **Try it**, set `host` to your Exsited API host name and paste an access token from [Get an access token](https://exsited.mintlify.site/api-reference/authentication/get-an-access-token.md). To send a raw JSON body instead of filling in fields, copy the cURL sample and edit its `-d` payload.


## OpenAPI

````yaml POST /payments
openapi: 3.1.0
info:
  title: Exsited API
  version: v4
servers:
  - url: https://{host}/api/v4
    variables:
      host:
        default: your-api-host.example.com
        description: Your Exsited API host name, without https://.
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Accounts
  - name: Account emails
  - name: Account groups
  - name: Communications
  - name: Communication profiles
  - name: Orders
  - name: Quote orders
  - name: Express
  - name: Usages
  - name: Sales reps
  - name: Gift certificates
  - name: Invoices
  - name: Pro-forma invoices
  - name: Payments
  - name: Refunds
  - name: Credit notes
  - name: Credit note applications
  - name: Reconciliations
  - name: Items
  - name: Inventory adjustments
  - name: Units of measurement
  - name: Zones
  - name: Shipping packages
  - name: Shipping rules
  - name: Fulfillment profiles
  - name: Fulfillment terms
  - name: Item fulfillments
  - name: Item receipts
  - name: Bookings
  - name: Rental assets
  - name: Return merchandise authorisations
  - name: Purchase orders
  - name: Purchase invoices
  - name: Purchase payments
  - name: Purchase refunds
  - name: Purchase credit notes
  - name: Purchase credit note applications
  - name: Purchase express
  - name: Return vendor authorizations
  - name: ABA files
  - name: Receive terms
  - name: Labours
  - name: Tasks
  - name: Timesheets
  - name: Milestones
  - name: Employees
  - name: Departments
  - name: Designations
  - name: Teams
  - name: Time periods
  - name: Workflows
  - name: Workflow settings
  - name: Events
  - name: Custom events
  - name: System events
  - name: Approvals
  - name: Approval profiles
  - name: Approval user groups
  - name: Alerts
  - name: Alert responsibility settings
  - name: Alert responsibilities
  - name: Action scripts
  - name: Note groups
  - name: Note attachments
  - name: Instance settings
  - name: Accounting codes
  - name: Additional codes
  - name: Billing periods
  - name: Charging periods
  - name: Pricing periods
  - name: Invoice terms
  - name: Days of the month
  - name: Countries
  - name: Salutations
  - name: Document templates
  - name: Email templates
  - name: Roles
  - name: Operators
  - name: Operator groups
  - name: User settings
  - name: Custom attributes
  - name: Custom components
  - name: Custom features
  - name: Custom fields
  - name: Custom forms
  - name: Attribute attachments
  - name: Portal
  - name: Integration connections
  - name: External databases
  - name: Reports
  - name: Applications
  - name: Organisation
  - name: Child organisations
  - name: Webhooks
paths:
  /payments:
    post:
      tags:
        - Payments
      summary: Create a payment
      description: >-
        Records a payment from the fields under `payment`. Only the keys shown
        are accepted; any other returns `400`. A `payment_applied` entry whose
        processor holds a card token charges the card.
      operationId: payments_create_payment
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                payment:
                  type: object
                  properties:
                    id:
                      type: string
                    date:
                      type: string
                      format: date
                    origin:
                      type: string
                    payment_note:
                      type: string
                    note:
                      type: string
                    invoices:
                      type: array
                      description: The invoices the payment is for.
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: The invoice's `id`.
                          applied:
                            type: string
                            description: The amount applied to this invoice.
                    payment_applied:
                      type: array
                      description: The money received, by processor.
                      items:
                        type: object
                        properties:
                          processor:
                            type: string
                            description: The payment processor, such as `Cash`.
                          amount:
                            type: string
                          reference:
                            type: string
                    credit_applied:
                      type: array
                      description: Credit notes spent on the payment.
                      items:
                        type: object
                        properties:
                          code:
                            type: string
                            description: The credit note's `code`.
                          amount:
                            type: number
                    gift_certificates:
                      type: array
                      items:
                        type: object
                    custom_attributes:
                      type: array
                      items:
                        type: object
              required:
                - payment
            example:
              payment:
                date: '2026-10-01'
                payment_note: October invoice
                payment_applied:
                  - processor: Cash
                    amount: '10.00'
                    reference: RCPT-1001
                invoices:
                  - id: INV-0001
                    applied: '10.00'
      responses:
        '201':
          description: The new payment, under `payment`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentReadResponse'
        '400':
          description: The body has a key the payment does not accept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST "$EXSITED_BASE_URL/api/v4/payments" \
              -H "Authorization: Bearer $ACCESS_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "payment": {
                  "date": "2026-10-01",
                  "payment_note": "October invoice",
                  "payment_applied": [
                    {
                      "processor": "Cash",
                      "amount": "10.00",
                      "reference": "RCPT-1001"
                    }
                  ],
                  "invoices": [
                    {
                      "id": "INV-0001",
                      "applied": "10.00"
                    }
                  ]
                }
              }'
        - lang: python
          label: Python
          source: |
            from exsited import build_client

            client = build_client()

            response = client.payments.create_payment(
                {
                    "payment": {
                        "date": "2026-10-01",
                        "payment_note": "October invoice",
                        "payment_applied": [
                            {"processor": "Cash", "amount": "10.00", "reference": "RCPT-1001"}
                        ],
                        "invoices": [{"id": "INV-0001", "applied": "10.00"}],
                    }
                }
            )
            print(response.data)
        - lang: javascript
          label: JavaScript
          source: |
            import {buildClient} from 'exsited';

            const client = await buildClient();

            const response = await client.payments.createPayment({
                payment: {
                    date: '2026-10-01',
                    payment_note: 'October invoice',
                    payment_applied: [{processor: 'Cash', amount: '10.00', reference: 'RCPT-1001'}],
                    invoices: [{id: 'INV-0001', applied: '10.00'}],
                },
            });
            console.log(response.data);
        - lang: php
          label: PHP
          source: |
            use Exsited\Client\ClientRegistry;

            $client = ClientRegistry::buildClient();

            $response = $client->payments->createPayment([
                'payment' => [
                    'date' => '2026-10-01',
                    'payment_note' => 'October invoice',
                    'payment_applied' => [
                        ['processor' => 'Cash', 'amount' => '10.00', 'reference' => 'RCPT-1001'],
                    ],
                    'invoices' => [['id' => 'INV-0001', 'applied' => '10.00']],
                ],
            ]);
            print_r($response->data);
        - lang: java
          label: Java
          source: >
            import com.exsited.client.ApiResponse;

            import com.exsited.client.ClientRegistry;

            import com.exsited.client.ExsitedClient;

            import
            com.exsited.resources.payments.payments_dto.PaymentsDto.PaymentRead;

            import java.util.List;

            import java.util.Map;


            ExsitedClient client = ClientRegistry.buildClient();


            ApiResponse<PaymentRead> response = client.payments().createPayment(
                    Map.of(
                            "payment", Map.of(
                                    "date", "2026-10-01",
                                    "payment_note", "October invoice",
                                    "payment_applied", List.of(
                                            Map.of(
                                                    "processor", "Cash",
                                                    "amount", "10.00",
                                                    "reference", "RCPT-1001")),
                                    "invoices", List.of(Map.of("id", "INV-0001", "applied", "10.00")))));
            System.out.println(response.getMap());
        - lang: csharp
          label: .NET
          source: >
            using Exsited.Client;


            await using var client = ExsitedClient.BuildClient();


            var response = await client.Payments.CreatePaymentAsync(new
            Dictionary<string, object?>

            {
                ["payment"] = new Dictionary<string, object?>
                {
                    ["date"] = "2026-10-01",
                    ["payment_note"] = "October invoice",
                    ["payment_applied"] = new List<object?>
                    {
                        new Dictionary<string, object?>
                        {
                            ["processor"] = "Cash",
                            ["amount"] = "10.00",
                            ["reference"] = "RCPT-1001",
                        },
                    },
                    ["invoices"] = new List<object?>
                    {
                        new Dictionary<string, object?>
                        {
                            ["id"] = "INV-0001",
                            ["applied"] = "10.00",
                        },
                    },
                },
            });


            Console.WriteLine(response.Json);
        - lang: dart
          label: Dart
          source: |
            import 'package:exsited/exsited.dart';

            final client = buildClient();

            final response = await client.payments.createPayment({
              'payment': {
                'date': '2026-10-01',
                'payment_note': 'October invoice',
                'payment_applied': [
                  {'processor': 'Cash', 'amount': '10.00', 'reference': 'RCPT-1001'},
                ],
                'invoices': [
                  {'id': 'INV-0001', 'applied': '10.00'},
                ],
              },
            });
            print(response.map);
        - lang: go
          label: Go
          source: "import (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\texsited \"github.com/exsited/exsited-sdk-go/v4\"\n)\n\nclient, err := exsited.BuildClient(nil)\nif err != nil {\n\tlog.Fatal(err)\n}\ndefer client.Close()\n\nresponse, err := client.Payments().CreatePayment(context.Background(), map[string]any{\n\t\"payment\": map[string]any{\n\t\t\"date\":         \"2026-10-01\",\n\t\t\"payment_note\": \"October invoice\",\n\t\t\"payment_applied\": []any{\n\t\t\tmap[string]any{\n\t\t\t\t\"processor\": \"Cash\",\n\t\t\t\t\"amount\":    \"10.00\",\n\t\t\t\t\"reference\": \"RCPT-1001\",\n\t\t\t},\n\t\t},\n\t\t\"invoices\": []any{\n\t\t\tmap[string]any{\"id\": \"INV-0001\", \"applied\": \"10.00\"},\n\t\t},\n\t},\n}, nil)\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Println(response.Map)\n"
components:
  schemas:
    PaymentReadResponse:
      type: object
      properties:
        payment:
          $ref: '#/components/schemas/PaymentRead'
    Error:
      type: object
      description: Every failed call returns this body.
      properties:
        object:
          type: string
          description: Always `error`.
        request_id:
          type: string
          description: Quote this to support.
        status:
          type: integer
          description: The HTTP status.
        code:
          type: string
          description: What went wrong, such as `validation_error`.
        message:
          type: string
          description: A short description of the problem.
        doc_url:
          type: string
          description: A link to more about this error.
        errors:
          type: array
          description: One entry per field that failed.
          items:
            type: object
            properties:
              field:
                type: string
              code:
                type: string
              message:
                type: string
              doc_url:
                type: string
    PaymentRead:
      type: object
      properties:
        account:
          $ref: '#/components/schemas/PaymentReadAccount'
        activity_logs:
          type: array
          items: {}
        created_by:
          $ref: '#/components/schemas/PaymentReadCreatedBy'
        created_on:
          type: string
        credit_applied:
          type: array
          items:
            $ref: '#/components/schemas/PaymentReadCreditApplied'
        custom_attributes:
          type: array
          items:
            $ref: '#/components/schemas/PaymentReadCustomAttribute'
        gift_certificate_applied:
          type: array
          items:
            $ref: '#/components/schemas/PaymentReadGiftCertificateApplied'
        id:
          type: string
        invoices:
          type: array
          items:
            $ref: '#/components/schemas/PaymentReadInvoice'
        last_updated_by:
          $ref: '#/components/schemas/PaymentReadLastUpdatedBy'
        last_updated_on:
          type: string
        object:
          type: string
        origin:
          type: string
        payment_applied:
          type: array
          items:
            $ref: '#/components/schemas/PaymentReadPaymentApplied'
        payment_note:
          type: string
        reconcile_status:
          type: string
        status:
          type: string
        version:
          type: integer
    PaymentReadAccount:
      type: object
      properties:
        object:
          type: string
        id:
          type: string
        name:
          type: string
        href:
          type: string
    PaymentReadCreatedBy:
      type: object
      properties:
        name:
          type: string
        object:
          type: string
    PaymentReadCreditApplied:
      type: object
      properties:
        amount:
          type: string
        code:
          type: string
    PaymentReadCustomAttribute:
      type: object
      properties:
        href:
          type: string
        id:
          type: string
        name:
          type: string
        object:
          type: string
        type:
          type: string
        value:
          type: string
    PaymentReadGiftCertificateApplied:
      type: object
      properties:
        amount:
          type: string
        code:
          type: string
    PaymentReadInvoice:
      type: object
      properties:
        applied:
          type: string
        due_date:
          type: string
        id:
          type: string
        issue_date:
          type: string
        outstanding:
          type: string
        total:
          type: string
    PaymentReadLastUpdatedBy:
      type: object
      properties:
        name:
          type: string
        object:
          type: string
    PaymentReadPaymentApplied:
      type: object
      properties:
        amount:
          type: string
        gateway_response: {}
        method:
          type: string
        processor:
          type: string
        reference:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An access token from `POST /api/v4/oauth2/token`. The SDKs get and renew
        it for you.

````

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