Skip to main content
POST
Record a payment

Authorizations

Authorization
string
header
required

OAuth 2.0 client credentials. The token request also needs the audience form field (the Account ID), which OAuth tooling does not always send; see POST /v1/oauth/token.

Headers

Idempotency-Key
string
required

Required on every POST, at most 255 characters. Use a new UUID for each logical operation. The first request with a key runs, and its answer (any status below 500) is stored for 7 days. A retry with the same key, method, path and body gets the stored answer again with Idempotency-Replayed: true, and nothing runs twice. The same key with a different body or path is 422 idempotency-key-reused; the same key while the first request is still running is 409 idempotency-key-in-progress. A 5xx answer is not stored, so the same key may be retried. A key belongs to the API client's grant (one environment).

Maximum string length: 255

Path Parameters

id
string<uuid>
required

The invoice's id.

Body

application/json

The payment.

A payment to record.

amount
number
required

Amount paid, in kroner. Above zero and at most what is owed.

paidOn
string<date>
required

The date the money was paid; not in the future. Required.

Response

The payment and the invoice's new balance.

A recorded payment and the invoice's new balance.

paymentId
string<uuid>
required

The payment's id. The same Idempotency-Key on the same invoice always gives the same id.

invoiceStatus
string
required

The invoice's status after the payment, for example paid.

paidAmount
number
required

How much has been paid on the invoice in all.

outstandingAmount
number
required

How much is still owed.