# Create payment

Creates a new Payment record. Payment resource in the Animal Health Data Store

Endpoint: POST /site/{siteId}/ahds/v1/payment
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Path parameters:

  - `siteId` (number, required)
    Site identifier

## Request fields (application/json):

  - `allocatedAmount` (string)
    Total amount of the payment that has been allocated to invoices.
    Example: 100.00

  - `amount` (string, required)
    Total payment amount as a decimal string.
    Example: 100.00

  - `availableAmount` (string)
    Unallocated portion of the payment that is still available.
    Example: 100.00

  - `cashAmount` (string)
    Portion of the payment that was paid in cash, if applicable.
    Example: 100.00

  - `cashChange` (string)
    Change returned to the client for cash payments, if applicable.
    Example: 100.00

  - `clientId` (string)
    Identifier of the client associated with this payment.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `comments` (string)
    Internal comments or notes about the payment.
    Example: Example description

  - `currency` (string)
    ISO 4217 currency code for the payment amount.
    Example: CODE-001

  - `extensions` (object)
    Vendor- or practice-specific extensions.

  - `isActive` (boolean, required)
    Indicates whether the payment record is active.
    Example: true

  - `linkedInvoices` (array)
    Invoices to which this payment has been allocated.

  - `linkedInvoices.allocatedAmount` (string, required)
    Amount of this payment allocated to the invoice.
    Example: 100.00

  - `linkedInvoices.invoiceId` (string, required)
    Identifier of the linked invoice.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `ownershipId` (string)
    Identifier for the owning organization or practice.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `paymentDate` (string, required)
    Calendar date the payment was received or processed.
    Example: 2025-01-01

  - `paymentDetails` (string)
    Free-text or structured details about the payment method (e.g., last 4 digits, reference number).
    Example: example

  - `paymentId` (string)
    Canonical unique identifier for the payment.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `paymentMethod` (string, required)
    Method used to make the payment.
    Enum: "cash", "card", "check", "bank_transfer", "online", "other"

  - `roundingFactor` (string)
    Rounding adjustment applied to the payment, if any.
    Example: 100.00

  - `status` (string, required)
    Lifecycle status of the payment.
    Enum: "pending", "completed", "cancelled", "refunded", "failed"

## Response 201:

  - `201` (unknown)
    Payment created successfully

## Response 201 fields (application/json):

  - `allocatedAmount` (string, required)
    Total amount of the payment that has been allocated to invoices.
    Example: 100.00

  - `amount` (string, required)
    Total payment amount as a decimal string.
    Example: 100.00

  - `availableAmount` (string, required)
    Unallocated portion of the payment that is still available.
    Example: 100.00

  - `cashAmount` (string, required)
    Portion of the payment that was paid in cash, if applicable.
    Example: 100.00

  - `cashChange` (string, required)
    Change returned to the client for cash payments, if applicable.
    Example: 100.00

  - `clientId` (string, required)
    Identifier of the client associated with this payment.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `comments` (string, required)
    Internal comments or notes about the payment.
    Example: Example description

  - `createdAt` (string, required)
    Timestamp when the payment record was created.
    Example: 2025-01-01T00:00:00.000Z

  - `currency` (string, required)
    ISO 4217 currency code for the payment amount.
    Example: CODE-001

  - `extensions` (object, required)
    Vendor- or practice-specific extensions.

  - `isActive` (boolean, required)
    Indicates whether the payment record is active.
    Example: true

  - `linkedInvoices` (array, required)
    Invoices to which this payment has been allocated.

  - `linkedInvoices.allocatedAmount` (string, required)
    Amount of this payment allocated to the invoice.
    Example: 100.00

  - `linkedInvoices.invoiceId` (string, required)
    Identifier of the linked invoice.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `ownershipId` (string, required)
    Identifier for the owning organization or practice.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `paymentDate` (string, required)
    Calendar date the payment was received or processed.
    Example: 2025-01-01T00:00:00Z

  - `paymentDetails` (string, required)
    Free-text or structured details about the payment method (e.g., last 4 digits, reference number).
    Example: example

  - `paymentId` (string, required)
    Canonical unique identifier for the payment.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `paymentMethod` (string, required)
    Method used to make the payment.
    Enum: "cash", "card", "check", "bank_transfer", "online", "other"

  - `roundingFactor` (string, required)
    Rounding adjustment applied to the payment, if any.
    Example: 100.00

  - `status` (string, required)
    Lifecycle status of the payment.
    Enum: "pending", "completed", "cancelled", "refunded", "failed"

  - `updatedAt` (string, required)
    Timestamp when the payment record was last updated.
    Example: 2025-01-01T00:00:00.000Z

## Response 400:

  - `400` (unknown)
    Invalid request body

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 409:

  - `409` (unknown)
    Payment with this ID already exists

