Create payment resource
POST
/accounts/{accountID}/invoices/{invoiceID}/payments
Creates a payment resource to represent that an invoice was paid outside of the Moov platform. If a payment link was created for the invoice, the corresponding payment link is canceled, but a receipt is still sent.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/invoices.write scope.
curl -X POST "https://api.moov.io/accounts/{accountID}/invoices/{invoiceID}/payments" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2027.01.00" \
-d '{
"amount": {
"currency": "USD",
"valueDecimal": "12.987654321"
}
}'mc, _ := moov.NewClient()
accountID := "241bf524-e777-4941-a5e4-d7f3f34d7a00"
invoiceID := "3dfff852-927d-47e8-822c-2fffc57ff6b9"
mc.CreateInvoicePayment(ctx, accountID, invoiceID, moov.CreateInvoicePayment{
ForeignID: moov.PtrOf("EXT-PAY-12345"),
Description: moov.PtrOf("Payment received via wire transfer"),
Amount: moov.AmountDecimal{
Currency: "USD",
ValueDecimal: "500.00",
},
})
The request completed successfully.
{
"invoicePaymentID": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"invoicePaymentType": "external",
"amount": {
"currency": "USD",
"valueDecimal": "500.00"
},
"external": {
"foreignID": "EXT-PAY-12345",
"description": "Payment via external system",
"paymentDate": "2026-01-20T14:45:00Z"
}
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The server could not understand the request due to invalid syntax.
{
"error": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request contained missing or expired authentication.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The user is not authorized to make the request.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The requested resource was not found.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request conflicted with the current state of the target resource.
{
"error": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request was well-formed, but the contents failed validation. Check the request for missing or invalid fields.
{
"amount": {
"currency": "string",
"valueDecimal": "string"
},
"foreignID": "string",
"description": "string",
"paymentDate": "string"
}Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Request was refused due to rate limiting.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed due to an unexpected error.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
The request failed because a downstream service failed to respond.
Response headers
x-request-id
string
required
A unique identifier used to trace requests.
Headers
X-Moov-Version
string
Set this header to v2027.01.00 to use the API described in this specification.
When omitted, the server defaults to v2024.01.00, the earliest supported version, which may not match the behavior documented here.
An unrecognized well-formed version uses the latest supported version that is not newer than the requested version, when one exists.
For example,
v2026.08.00 uses v2026.07.00.
A malformed value, such as 2022, returns a 404 response.
Possible values:
v2027.01.00
Path parameters
accountID
string
required
invoiceID
string
required
Body
application/json
amount
object
required
Show child attributes
amount
currency
string
required
Pattern
A 3-letter ISO 4217 currency code.
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.
description
string
foreignID
string
<=128 characters
paymentDate
string<date-time>
Response
amount
object
required
Show child attributes
amount
currency
string
required
Pattern
A 3-letter ISO 4217 currency code.
valueDecimal
string
required
Pattern
A decimal-formatted numerical string that represents up to 9 decimal place precision.
For example, $12.987654321 is '12.987654321'.
invoicePaymentID
string
<=36 characters
required
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).
invoicePaymentType
string<enum>
required
Possible values:
transfer,
external
external
object
Show child attributes
external
description
string
foreignID
string
paymentDate
string<date-time>
transfer
object
Show child attributes
transfer
transferID
string
<=36 characters
required
A unique identifier for a Moov resource. Supports UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) or typed format with base32-encoded UUID and type suffix (e.g., kuoaydiojf7uszaokc2ggnaaaa_xfer).