Skip to main content
POST
Validate and apply loyalty vouchers to the current user's cart
Part of the Loyalty Vouchers (from Global-e) integration guide — see it for when and how to use this endpoint.
This API is part of Global-e’s extensions and plug-ins. Merchants do not need to implement this API unless a custom integration is required.
Use this method to validate the Loyalty Vouchers selected by the user from the list that has been provided in the loyaltyVouchersList argument of the SendCart API call for the current user’s checkout page. This method can only be executed from within the context of the current user’s client session. Validates Loyalty Vouchers and applies them to the current user’s cart if all the vouchers in the list are valid and applicable.
  • If at least one Loyalty Voucher in the list is invalid, Merchant.ResponseInfo.Success is set to FALSE.
  • If all Loyalty Vouchers are valid, the Merchant’s server should re-calculate the cart pricing and execute before returning a response, the SendCart API call with the CartToken argument value returned from the previous call to SendCart for the current user.

Body

application/json
cartAction
Merchant.CartAction · object
required

Delineates what action to perform with the cart data.

Response

200 - application/json

Describes the response to the API call. In case of an error, indicates the error.

Describes the response to the API call. In case of an error, indicates the error.

Description
string

Optional response description. In case of an error, this property indicates the error message description.

ErrorCode
string

Error code to be returned when an error occurs.

InternalOrderId
string

Order unique identifier on the Merchant's site

Message
string

Optional response message. In case of an error, this property indicates the error message text.

OrderId
string

Order identifier on the Merchant's site used for display and reporting purposes only. Unlike the InternalOrderId, this identifier is not necessarily unique over time, as the Merchant's site may potentially reuse it (for example after deleting the old order having the same OrderId).

PaymentAmount
string

The total payment amount in PaymentCurrency charged for the order (if payment was processed in the respective API method call).

PaymentCurrencyCode
string

3-char ISO currency code for the order (if payment was processed in the respective API method call).

StatusCode
string

Code denoting the order status on the Merchant's site (to be mapped on the Global-e side).

Success
boolean

Indicates if the call has succeeded. TRUE - Call succeeded. FALSE - Denotes an error or failure.