Cancel an invoice
The PUT /pic/link/purchase-invoices/cancel
endpoint allows you to cancel an existing invoice. πΌπ€
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β
{
"inputs": [
PurchaseInvoiceCancellation
]
}
Name | Type | Default | Description |
---|---|---|---|
inputs | Array[ PurchaseInvoiceCancellation ] | Required | List of invoices to cancel |
PurchaseInvoiceCancellation
β
{
"invoiceId": string
}
Name | Type | Default | Description |
---|---|---|---|
invoiceId | string | Required | Identifier of the invoice |
The invoiceId
field can be obtained through the GET /pic/link/purchase-invoices/find
endpoint
Examplesβ
- π₯οΈ cURL
curl --location 'https://<identifier>.api.appliqloud.com/pic/link/purchase-invoices/cancel' \
--request PUT \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"inputs": [
{
"invoiceId": "1"
}
]
}'
Make sure to modify the <identifier>
and <token>
fields with your company identifier and authentication token respectively.
Responsesβ
- β 200
- β οΈ 200 (with errors)
- π 401
- π§ 500
Invoices were successfully cancelled
{
"success": [
{
"header": {
"invoiceId": "1",
"invoiceStatus": "CANCELLED",
"accountingEntityId": "AE1",
"vendorBusinessPartnerId": "1245",
"purchaseOrderId": "450000001",
"invoiceVendorId": "14156",
"headerText": "Invoice",
"invoiceDate": "2024-08-11",
"fiscalYear": "2024",
"totalAmount": 12000.0,
"currencyId": "MXN",
"paidAmount": 0.0,
"plannedPaymentDate": null,
"lastPaymentDate": null,
"rejectionComments": null,
"invoiceFiles": [
{
"fileType": "PDF",
"key": "invoices/d3d3dd51-c701-42f2-b1ff-558f68c3caa9.pdf",
"url":" https://s3.us-west-2.amazonaws.com/dev-apq-demos-bucket/invoices/d3d3dd51-c701-42f2-b1ff-558f68c3caa9.pdf"
}
]
},
"items": [
{
"itemId": "10",
"purchaseOrderItemId": "10",
"unitId": "EA",
"quantity": 2,
"netUnitPrice": 6000.0,
"netTotalPrice": 12000.0,
"taxesAmount": 0.0,
"extraChargesAmount": 0.0,
"totalPrice": 12000.0,
"itemText": null
}
]
}
],
"errors": []
}
There is an error in the request
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "PurchaseInvoiceNotFoundException",
"message": "Purchase invoice 3 not found",
"context": {
"id": "3"
}
}
]
}
Authorization required or credentials are not correct
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "UnauthorizedException",
"message": "Authorization required"
}
Internal server error (contact support@appliqloud.com or open a support ticket)
{
"success": [],
"errors": [
{
"traceId": "3095a0a77f80436ba104eb2fc24ba343"
"cause": "InternalServerError",
"message": "Internal Server Error"
}
]
}