Record payment of an invoice
The POST /pic/link/invoice-payments/create
endpoint allows you to register a payment. ππΌπ€
Authorizationβ
This endpoint requires authentication through Basic Auth
with the username and password of the backend that will consume it. To create and configure a backend, follow the backends tutorial
Request parametersβ
- π£ Path
- π Query
- πͺ Body
This request does not contain parameters of type Path
This request does not contain parameters of type Query
JSON Bodyβ
{
"inputs": [
InvoicePayment
]
}
Name | Type | Default | Description |
---|---|---|---|
inputs | Array[ InvoicePayment ] | Required | List of invoice payments to register |
InvoicePayment
β
{
"paymentId": string,
"purchaseInvoiceId": string,
"paymentDate": string,
"amount": float,
"currencyId": string
}
Name | Type | Default | Description |
---|---|---|---|
paymentId | string | Required | Identifier of payment in the external system |
purchaseInvoiceId | string | Fecha de envΓo de la peticiΓ³n | Identifier of the invoice |
paymentDate | strinf | Required | Payment date |
amount | float | Required | Payment amount |
currencyId | bool | false | Identifier of the currency |
The paymentDate
field must be in YYYY-MM-DD
format in order to be processed correctly.
The purchaseInvoiceId
field must correspond to a valid invoice of a purchase order created from the same backend. You can only register payments on invoices obtained through the GET /pic/link/purchase-invoices/find
endpoint.
Examplesβ
- π₯οΈ cURL
curl --location 'https://<identifier>.api.appliqloud.com/pic/link/invoice-payments/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"inputs": [
{
"paymentId": "6000098",
"purchaseInvoiceId": "1",
"paymentDate": "2024-08-09",
"amount": 1250.0,
"currencyId": "MXN"
}
]
}'
Make sure to modify the <identifier>
and <token>
fields with your company identifier and authentication token respectively.
Responsesβ
- β 201
- β οΈ 201 (with errors)
- π 401
- π§ 500
Payments were registered successfully
{
"success": [
{
"paymentId": "6000098",
"invoicePaymentStatus": "TRANSFERRED",
"purchaseInvoiceId": "1",
"vendorBusinessPartnerId": "1245",
"paymentDate": "2024-08-09",
"amount": 1250.0,
"currency": "USD"
}
],
"errors": []
}
There is an error in the request
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "InvalidPaymentAmountException",
"message": "Payment 6000097 amount (3500.0) exceeds the remaining amount (2250.0) for invoice 3305",
"context": {
"id": "6000097".
"amount": "3500",
"remaining_amount": "2250",
"invoice_id": "3305"
}
}
]
}
Authorization required or credentials are not correct
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"request": "POST /pic/invoices/payments",
"cause": "UnauthorizedException",
"message": "Authorization required"
}
Internal application error (contact support@appliqloud.com or open a support ticket)
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "InternalServerError",
"message": "Internal Server Error"
}
]
}