put
https://{host}/v1/promotions/customer//evaluation//cancel
This API is used to cancel pending carts where a promotion is locked.
Consider a scenario where a particular promotion is applied in a cart but the transaction has not been processed yet. Such a state is called a locked state or pending cart state. This state prevents this promotion from being applied to any other cart. To proceed ahead, the current cart has to be released or canceled. This API can thus be used to cancel any pending carts.
NoteFor an overview on our APIs and for hands-on testing, refer to API overview and Make your first API call documentation.
Prerequisites
- Authentication - Basic or OAuth authentication
- Access group resource - Write access to customer group resource
- customerId and evaluationId
API Endpoint Example
https://eu.api.capillarytech.com/api_gateway/v1/promotions/customer/565039518/evaluations/67e3dd673919452f135e2f23/cancel
Path Parameter
| Parameter (Parameters marked as * are required) | Data Type | Description |
|---|---|---|
| customerId* | Long | Unique Identifier of the customer issuing Cart Promotion |
| evaluationId* | String | Unique identifier that is generated when a cart evaluation is performed. To get evaluationId refer to Post Evaluate Cart Promotion. |
Response Body
{
"data": {
"status": true,
"code": 201,
"message": "Successfully closed pending cart."
},
"errors": []
}{
"errors": [
{
"code": 404,
"message": "Passed evaluation log id is not found"
}
]
}Response Parameter
| Parameter | Data Type | Description |
|---|---|---|
| data | Object | Contains details of the cart evaluation cancellation status; not present if the cancellation is unsuccessful. |
| -status | Boolean | Indicates whether the cart evaluation cancellation was successful. |
| -code | Integer | Response code related to the cart evaluation cancellation. |
| -message | String | Message corresponding to the response code for the cart evaluation cancellation. |
| error | Object | Contains details of any errors that occurred during the cancellation process. |
Error codes
| Code | Description |
|---|---|
| 400 | Invalid request. Check required parameters. Ensure all required parameters (customerId, evaluationId) are provided and valid. |
| 404 | Customer or evaluation not found. Use valid and existing customerId and evaluationId. |
| 701 | Error while calling segmentation engine. Check segmentation engine service connectivity and logs. |
| 702 | Error while getting org entities. Confirm org entities and service health. |
| 703 | Org timezone fetch failed. Verify org timezone configuration and service availability. |
| 707 | The passed promotion type is not supported. Change the promotion type to one supported by the system. |
| 500 | Internal server error. Retry the request after a short delay, and contact support if the error persists. |
