Cancel Document
The CancelDocument
API is used to cancel a specific document in OCS.io. This operation is important for managing the lifecycle of various documents in the system.
API Overview
Fields Required for Document Cancellation
The following table lists and describes the fields required to cancel a document through the CancelDocument
API:
Field | Description |
---|---|
account |
ID (Ref ID/ External ID ) of the Account. |
documentRefId |
ID (Ref ID) of the Document. Either 'documentRefId', 'documentNo' or 'externalDocumentNo' must be populated. |
documentNo |
Number of the document (generated by RM module). Either 'documentRefId', 'documentNo' or 'externalDocumentNo' must be populated. |
externalDocumentNo |
External number of the document (generated by external system, e.g. OCS or CRM). Either 'documentRefId', 'documentNo' or 'externalDocumentNo' must be populated. |
reason |
Reason for Cancellation. Cancellation Reason must be configured. |
Detailed API documentation and endpoint specifics are available here. |
Request Validations
The following validations are performed when cancelling a document:
-
Account must be provided in the request, it must be already created in the system and must not be in Deactivated State.
-
Payer must be already created in the system.
-
Document must exist in the system.
-
Cancellation Reason must be configured in the system.
Cancel Document Example
Use the following request’s body to cancel a document:
{
"requestId": "{{$guid}}",
"user": "crm",
"account": {
"externalId": "account_external_id"
},
"documentNo": "104000001",
"reason": "cancellation_reason"
}
The outcome of the API call is as follows:
-
It is validated, that Document identified by
documentNo
must belong to the account with External IDaccount_external_id
-
Document with document number
104000001
is cancelled -
The cancellation reason is
cancellation_reason