Skip to main content
POST
ValidateVoucher (Global-e to Merchant)
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.
This API returns new CartToken in the CartToken attribute. The API call is used to help validate vouchers/coupons used on the Checkout page. If the voucher is valid, the merchant’s platform is responsible for applying this voucher to the shopper’s basket and executing a new SendCart / SendCartV2 API call to Global‑e, with an indication of the newly generated discount for this voucher or coupon. The new CartToken returned from this call is returned in the CartToken attribute.

Body

application/json

Provides information related to validating a voucher in a cart.

CartHash
string

Cart hash originally specified in merchantCartHash argument for SendCart method for the cart converted to this order on Global‑e.

CartId
string

Identifier of the cart on the Merchant’s site originally specified in merchantCartToken argument for SendCart method for the cart converted to this order on Global‑e.

CartToken
string

The value returned from the previous call to SendCart for the same client (must be stored in the client session or persistent cookie on the Merchant’s side). This parameter is used to support cart updates.

CountryCode
string

2-char ISO country code

CurrencyCode
string

3-char ISO currency code.

Discounts
Merchant.DiscountVoucherValidation · object[]

Cart discounts for voucher validation.

FreeShippingCouponCode
string

The Merchant free shipping coupon code applied by the end customer.

IsFreeShipping
boolean

Indicates if the Merchant offers free international shipping to the end customer.

MerchantGUID
string

Unique identifier of the Merchant on Global-e.

Products
Merchant.ProductVoucherValidation · object[]

Cart products for voucher validation.

UserId
string | null

Internal User identifier on the Merchant’s site in case it was specified in the SendCart call.

VoucherCode
string

The voucher code specified on the Merchant site.

VoucherType
number

Enumeration of VoucherTypes: 1 - DiscountVoucher

WebStoreCode
string | null

Code used on the Merchant’s side to identify the web store where the current cart is originating from. This code should be used in case of a multi-store setup on the Merchant’s site.

WebStoreInstanceCode
string

Code used on the Merchant’s side to identify the web store instance where the current cart is originating from. This code should be used in case of multi-store domains set up on the Merchant’s site.

Response

200 - application/json

Provides information related to the voucher validation.

Provides information related to the voucher validation.

CartToken
string

CartToken returned from the new SendCart / SendCartV2 API call, executed after the voucher has been applied to the respective user’s basket

IsVoucherValid
boolean

Indicates if the voucher is valid. TRUE - Voucher is valid. FALSE - Voucher is not valid.

ValidationFaliureMessage
string

Error message in case voucher is not valid

VoucherRestrictions
Merchant.VoucherValidationRestriction · object[]

List of validation restrictions applied to vouchers

VoucherType
number

Enumeration of VoucherTypes: 1 - DiscountVoucher