Skip to main content
POST
/
v1
/
invoices
/
{invoiceId}
/
payments
Record a payment
curl --request POST \
  --url https://api.infinity.swiss/v1/invoices/{invoiceId}/payments \
  --header 'Content-Type: application/json' \
  --header 'x-api-token: <api-key>' \
  --data '
{
  "amount": 2,
  "contraAccount": 5499,
  "date": "2023-12-25",
  "originalCurrency": "<string>",
  "exchangeRate": 123
}
'
{
  "invoice": {
    "id": "<string>",
    "isDraft": true,
    "number": "<string>",
    "organisation": "<string>",
    "template": "<string>",
    "openingDate": "2023-12-25",
    "dueDate": "2023-12-25",
    "positions": [
      {
        "name": "<string>",
        "singleAmount": 12000,
        "quantity": 2,
        "contraAccount": 5499,
        "id": "<string>",
        "unit": "<string>",
        "articleNumber": "<string>",
        "description": "<string>",
        "date": "<string>",
        "discountRate": 50,
        "customTextColumns": {
          "customTextColumn1": "<string>",
          "customTextColumn2": "<string>",
          "customTextColumn3": "<string>"
        },
        "totalAmount": 123,
        "vatDebt": 123,
        "originalCurrency": "<string>",
        "exchangeRate": 123
      }
    ],
    "totalAmount": 123,
    "totalNetAmount": 123,
    "totalVatDebt": 123,
    "isQrInvoice": true,
    "totalAmountPaid": 123,
    "totalRestAmount": 123,
    "isPaid": true,
    "isOverpaid": true,
    "isAnnulled": true,
    "recipient": "<string>",
    "customRecipientText": "<string>",
    "title": "<string>",
    "payableInDays": 123,
    "introductoryText": "<string>",
    "closingText": "<string>",
    "originalCurrency": "<string>",
    "exchangeRate": 123,
    "columns": [],
    "emailDeliveries": [
      {
        "recipientEmail": "jsmith@example.com",
        "status": "<string>",
        "timestamp": "2023-11-07T05:31:56Z"
      }
    ],
    "publicPdfUrl": "<string>"
  }
}

Recording a payment

Payments are booked against a contraAccount (typically a bank or cash account) on the given date. For foreign-currency invoices, you may record the payment in either the primary accounting currency or the invoice’s original currency. To record a payment in the original currency, provide both originalCurrency and exchangeRate.

Example

A partial payment of CHF 500.00 received on the bank account 1020:
{
  "amount": 50000,
  "contraAccount": 1020,
  "date": "2026-05-12"
}
The response returns the refreshed invoice, including the updated totalAmountPaid, totalRestAmount, and isPaid fields.

Authorizations

x-api-token
string
header
required

API token for authentication. Obtain from your Infinity account settings.

Path Parameters

invoiceId
string
required

The id of the invoice to record a payment for.

Body

application/json

The payment details.

Request body for recording a payment against an invoice.

amount
integer
required

The payment amount in cents.

Required range: x >= 1
contraAccount
integer
required

The contra account number where the incoming payment is booked (typically a bank or cash account).

Required range: 1000 <= x <= 9999
date
string<date>
required

The payment date in YYYY-MM-DD format.

originalCurrency
string

For foreign-currency payments: the ISO 4217 currency code of the payment. Must be provided together with exchangeRate.

Required string length: 3
exchangeRate
number

For foreign-currency payments: the rate used to convert the payment to the primary accounting currency. Must be provided together with originalCurrency.

Response

The payment was recorded successfully and the refreshed invoice is returned.

invoice
Invoice · object

The full representation of a customer invoice.