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.

API Specific Error Code

Error CodeDescriptionReason
404Not FoundThe provided customerId or evaluationId does not exist or is invalid.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!