Cancel Cart Evaluation - Cart Promotion

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.

👍

Note

For 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 TypeDescription
customerId*LongUnique Identifier of the customer issuing Cart Promotion
evaluationId*StringUnique 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

ParameterData TypeDescription
dataObjectContains details of the cart evaluation cancellation status; not present if the cancellation is unsuccessful.
-statusBooleanIndicates whether the cart evaluation cancellation was successful.
-codeIntegerResponse code related to the cart evaluation cancellation.
-messageStringMessage corresponding to the response code for the cart evaluation cancellation.
errorObjectContains details of any errors that occurred during the cancellation process.

Error codes

CodeDescription
400Invalid request. Check required parameters. Ensure all required parameters (customerId, evaluationId) are provided and valid.
404Customer or evaluation not found. Use valid and existing customerId and evaluationId.
701Error while calling segmentation engine. Check segmentation engine service connectivity and logs.
702Error while getting org entities. Confirm org entities and service health.
703Org timezone fetch failed. Verify org timezone configuration and service availability.
707The passed promotion type is not supported. Change the promotion type to one supported by the system.
500Internal server error. Retry the request after a short delay, and contact support if the error persists.

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!