---
title: "Records a new customer payment. Optionally include allocations to apply the payment against specific invoices."
method: POST
path: "/api/Payment"
tags: ["Payment"]
---

# Records a new customer payment. Optionally include allocations to apply the payment against specific invoices.

`POST /api/Payment`

## Request body

- NewPayment — Request model for creating a new customer payment. Optionally include allocations to invoices.
  - `Amount` number, double — Total amount of the payment.
  - `PaymentNumber` string — Optional. If not specified will be automatically generated
  - `DateIssued` string, date-time — Date of Payment. If not specified, assumes today.
  - `TransactionPrefix` string — Optional to override the default prefix added to Payment Numbers
  - `CustomerIDFK` integer — Only required if no invoice allocations specified.
  - `ExchangeRate` number, double — Optional. Only used when the Customer's currecy is different from the Avaza account's base currency. Specifies the exchange rate that should apply between the customer currency and base currency. If not provided we will obtain an up to date exchange rate for the Payment Issue Date.
  - `TransactionReference` string — Optional for storing the reference # of the payment method.
  - `Notes` string
  - `PaymentProviderCode` string — Optional for storing the payment provider who was the source of funds.
  - `PaymentAllocations` NewPaymentAllocation[] — List of amounts within this payment that are allocated to invoices. The sum of these be less than or equal to the payment amount.
    - `InvoiceTransactionIDFK` integer — The Avaza Invoice TransactionID that is having a payment amount allocated to it.
    - `AllocationAmount` number, double — The Amount being allocated to the invoice. Expects same currency as invoice currency
    - `AllocationDate` string, date-time — Optional. Defaults to the current time in the Avaza account's timezone. The date the allocation is applied to the invoice. Can be difference from the Payment Date when doing prepayments etc.
  - `SendWebhooks` boolean — If true, fires the invoice_updated webhook event for each invoice that was allocated against. Defaults to false to preserve existing integration behaviour.

## Response `200`

Returns the created payment with allocations.

- Payment — A customer payment including allocations to specific invoices.
  - `TransactionID` integer — Unique identifier for the payment transaction.
  - `AccountIDFK` integer — The Avaza account this payment belongs to.
  - `TransactionPrefix` string — The prefix used in the payment number.
  - `PaymentNumber` string — The full payment number including prefix.
  - `TransactionReference` string — External reference number (e.g. cheque number or bank reference).
  - `CustomerIDFK` integer — The customer company ID this payment is from.
  - `DateIssued` string, date-time — The date the payment was made.
  - `TransactionStatusCode` string — Current status of the payment.
  - `PaymentProviderCode` string — Code identifying the payment provider/method used.
  - `ExchangeRate` number, double — Exchange rate to the account's base currency.
  - `Balance` number, double — Unallocated balance remaining on the payment.
  - `CurrencyCode` string — ISO 3-character currency code for the payment.
  - `TotalAmount` number, double — Total payment amount.
  - `Notes` string — Additional notes on the payment.
  - `DateCreated` string, date-time — Date and time the record was created.
  - `DateUpdated` string, date-time — Date and time the record was last updated.
  - `PaymentAllocations` PaymentAllocation[] — List of allocations applying this payment against specific invoices.
    - `TransactionAllocationID` integer — Unique identifier for this payment allocation.
    - `InvoiceTransactionIDFK` integer — The invoice Transaction ID this payment is allocated against.
    - `PaymentTransactionIDFK` integer — The payment Transaction ID this allocation belongs to.
    - `AllocationDate` string, date-time — The date this allocation was applied.
    - `AllocationAmount` number, double — The amount allocated from the payment to the invoice.
  - `ViewPaymentURL` string — URL to view this payment in the Avaza web application.

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/avaza/apis/avaza-api-documentation.md) · [All operations](https://skmtc.net/avaza/apis/avaza-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/avaza/avaza-api-documentation/versions/1eeadf750514/schema)
