Cancel Document
The Cancel Document API allows you to cancel a specific document by its unique identifier (documentId). A reason for cancellation must be provided.
API URLs
| Property | Value |
|---|---|
| Sandbox | https://malaysia-sandbox.complyance.io |
| Production | https://malaysia-prod.complyance.io/ |
| Endpoint | /cancelDocument |
| Method | POST |
Headers
| Header | Type | Description | Example | Conditionality |
|---|---|---|---|---|
x-api-key | string | Your API key | 1aN3AQ8ZsggJ0UABAHXVB | Mandatory |
Content-Type | string | Set as application/json | application/json | Mandatory |
Request Body
The request body must be in JSON format.
| Parameter | Type | Description | Example Value |
|---|---|---|---|
documentId | string | Document reference number used by Supplier for internal tracking purpose. | E-INV-01 |
reason | string | The reason for cancelling the document. | Testing Cancellation |
Example Request Body
{
"documentId": "E-INV-01",
"reason": "Testing Cancellation"
}Response
Success Response
HTTP Status Code: 200 OK
Response Body:
{
"uuid": "6FSDTHSGTW0CFCEBKVXVBFHJ10",
"status": "Cancelled",
"error": null
}Error Responses
| HTTP Status Code | Error Code | Description |
|---|---|---|
400 | BAD_REQUEST | The provided input is invalid or missing fields. |
401 | UNAUTHORIZED | The API key is missing or invalid. |
500 | SERVER_ERROR | An internal server error occurred. |
Example Error Response:
{
"errorMessage": "Please check the field documentId"
}Usage Example
Notes
- Ensure the
x-api-keyheader contains a valid API key. - The
reasonparameter is required and should provide a clear explanation for the cancellation. - The API operates in a sandbox environment, so it is suitable for testing purposes.
Success Handling
The API may return the following success responses depending on the validation result or submission status:
| Status Code | Description |
|---|---|
200 | Success – The request was processed successfully. |
Error Handling
The API may return the following error responses depending on the validation result or request issues:
| Error Code | Description |
|---|---|
400 | Bad Request – Invalid data in the request. |
401 | Unauthorized – Invalid or missing API key. |
500 | Internal Server Error – Server encountered an error. |
Ensure that your request body and headers are correctly formatted to avoid errors.