- Documentation Portal
- SDK and API
- General API Reference
- Webhooks
- ValidateVoucher (Global-e to Merchant)
ValidateVoucher (Global-e to Merchant)
Note
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.
Method/URL
https://www.merchant-site-domain.com/checkout-validate-cart-voucher-url
Parameters
Request
Name | Type | Description | Mandatory |
|---|---|---|---|
Merchant.CartVoucherValidation | Object Merchant.CartVoucherValidation | Provides information related to validating a voucher in a cart. |
Merchant.CartVoucherValidation
Parameter Name | Type | Description | Mandatory |
|---|---|---|---|
| String | Cart hash originally specified in | |
| String | Identifier of the cart on the Merchant’s site originally specified in | |
| String | The value returned from the previous call to | |
| String | 2-char ISO country code | |
| String | 3-char ISO currency code. | |
| List of | Cart discounts for voucher validation. | |
| String | The Merchant free shipping coupon code applied by the end customer. | |
| Bool | Indicates if the Merchant offers free international shipping to the end customer. | |
| String | Unique identifier of the Merchant on Global-e. | |
| List of | Cart products for voucher validation. | |
| String | Internal User identifier on the Merchant’s site in case it was specified in the | No |
| String | The voucher code specified on the Merchant site. | |
| Decimal | Enumeration of 1 - | |
| String | 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. | |
| 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. |
Merchant.DiscountVoucherValidation
Parameter Name | Type | Description | Mandatory |
|---|---|---|---|
| String | Merchant | No |
| String | Discount textual description | No |
| String | Discount code originally specified in the | No |
| Enum | The enum
| Yes |
| Decimal | Discount type (“Cart”, “Shipping”, etc.), as defined in the | |
| Decimal | Discount value in end customer’s currency (specified in | No |
| Decimal | The VAT rate that would be applied to this discount if the order was placed by the local customer. This value must be specified if | No |
| String | Loyalty Voucher code originally specified in | No |
c | String | Discount name | |
| Decimal | Discount value in the currency defined in the | |
| String | Identifier of the product cart item related to this discount on the Merchant’s site originally specified in the | No |
| Decimal | The VAT rate applied to this discount |
Merchant.ProductVoucherValidation
Parameter Name | Type | Description | Mandatory |
|---|---|---|---|
| String | Identifier of the cart item on the Merchant’s site originally specified in the | |
| String | Identifier of the child cart item “option” on the Merchant’s site originally specified in the Product.CartItemOptionId property of the respective product in the | |
| List of String | List of categories mapped for current cart product. | |
| String | Code applicable to the product on the Merchant’s site. This code may be optionally used by the Merchant to trigger a certain business logic when this product is included in the order posted back to the Merchant’s site with the | |
| String | Identifier of the current item’s parent cart item on the Merchant’s site originally specified in the | |
| Decimal | Product price. | |
| Decimal | Product ordered quantity. | |
| String | SKU code used to identify the product on the Merchant’s site (to be mapped on the Global‑e side). | |
| Decimal | The VAT rate applied to this product. |
Response
Name | Type | Description | Mandatory |
|---|---|---|---|
Merchant.VoucherValidationResponse | Object Merchant.VoucherValidationResponse | Provides information related to the voucher validation. |
Merchant.VoucherValidationResponse
Parameter Name | Type | Description | Mandatory |
|---|---|---|---|
| String |
| |
| Boolean | Indicates if the voucher is valid. TRUE - Voucher is valid. FALSE - Voucher is not valid. | |
| String | Error message in case voucher is not valid | |
| List of | List of validation restrictions applied to vouchers | |
| Decimal | Enumeration of 1 - DiscountVoucher |
Merchant.VoucherValidationRestriction
Parameter Name | Type | Description | Mandatory |
|---|---|---|---|
| String | Country code value. | |
| Decimal | Enumeration of the voucher value restriction type: 0 - Country |
Examples
{
"CartHash": "",
"CartId": "36048",
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"CountryCode": "IL",
"CurrencyCode": "ILS",
"Discounts": [],
"FreeShippingCouponCode": "",
"IsFreeShipping": false,
"MerchantGUID": "e967e65e-f69e-479c-949d-91289a7f6875",
"Products": [],
"UserId": null,
"VoucherCode": "10Perc",
"VoucherType": 1,
"WebStoreCode": null,
"WebStoreInstanceCode": "GlobalEDefaultStoreInstance"
}
{
"IsVoucherValid": true,
"VoucherType": 1,
"CartToken": "f8a78edd-7cea-4cb7-835c-57c7f0b13c56",
"VoucherValidationRestriction": [],
"ValidationFaliureMessage": ""
}