> ## Documentation Index
> Fetch the complete documentation index at: https://globale-enterprise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ValidateVoucher (Global-e to Merchant)

> This API returns new CartToken in the CartToken attribute. The API call is used to help validate vouchers/coupons used on the Checkout page.

<Info>
  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.
</Info>

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.


## OpenAPI

````yaml api-reference/specs/validatevoucher.yaml POST /checkout-validate-cart-voucher-url
openapi: 3.0.3
info:
  title: ValidateVoucher (Global-e to Merchant)
  version: 1.0.0
  description: >-
    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.
  x-scaled-review: true
servers:
  - url: https://{merchant_site_domain}
    variables:
      merchant_site_domain:
        default: www.merchant-site-domain.com
        description: >-
          The merchant's site domain hosting the checkout-validate-cart-voucher
          endpoint. The merchant supplies the actual URL to Global-e; the
          documentation shows it as a placeholder.
security: []
tags:
  - name: ValidateVoucher (Global-e to Merchant)
    x-page-title: ValidateVoucher (Global-e to Merchant)
  - name: 'Direction: Global-e → Merchant'
  - name: 'Domain: Checkout & Cart'
paths:
  /checkout-validate-cart-voucher-url:
    post:
      tags:
        - ValidateVoucher (Global-e to Merchant)
      summary: ValidateVoucher (Global-e to Merchant)
      description: >-
        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.
      operationId: validateVoucher
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MerchantCartVoucherValidation'
            example:
              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
      responses:
        '200':
          description: Provides information related to the voucher validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantVoucherValidationResponse'
              example:
                IsVoucherValid: true
                VoucherType: 1
                CartToken: f8a78edd-7cea-4cb7-835c-57c7f0b13c56
                VoucherValidationRestriction: []
                ValidationFaliureMessage: ''
components:
  schemas:
    MerchantCartVoucherValidation:
      type: object
      title: Merchant.CartVoucherValidation
      description: Provides information related to validating a voucher in a cart.
      properties:
        CartHash:
          type: string
          description: >-
            Cart hash originally specified in merchantCartHash argument for
            SendCart method for the cart converted to this order on Global‑e.
        CartId:
          type: string
          description: >-
            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:
          type: string
          description: >-
            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:
          type: string
          description: 2-char ISO country code
        CurrencyCode:
          type: string
          description: 3-char ISO currency code.
        Discounts:
          type: array
          description: Cart discounts for voucher validation.
          items:
            $ref: '#/components/schemas/MerchantDiscountVoucherValidation'
        FreeShippingCouponCode:
          type: string
          description: The Merchant free shipping coupon code applied by the end customer.
        IsFreeShipping:
          type: boolean
          description: >-
            Indicates if the Merchant offers free international shipping to the
            end customer.
        MerchantGUID:
          type: string
          description: Unique identifier of the Merchant on Global-e.
        Products:
          type: array
          description: Cart products for voucher validation.
          items:
            $ref: '#/components/schemas/MerchantProductVoucherValidation'
        UserId:
          type: string
          nullable: true
          description: >-
            Internal User identifier on the Merchant’s site in case it was
            specified in the SendCart call.
        VoucherCode:
          type: string
          description: The voucher code specified on the Merchant site.
        VoucherType:
          type: number
          description: 'Enumeration of VoucherTypes: 1 - DiscountVoucher'
        WebStoreCode:
          type: string
          nullable: true
          description: >-
            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:
          type: string
          description: >-
            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.
    MerchantVoucherValidationResponse:
      type: object
      title: Merchant.VoucherValidationResponse
      description: Provides information related to the voucher validation.
      properties:
        CartToken:
          type: string
          description: >-
            CartToken returned from the new SendCart / SendCartV2 API call,
            executed after the voucher has been applied to the respective user’s
            basket
        IsVoucherValid:
          type: boolean
          description: >-
            Indicates if the voucher is valid. TRUE - Voucher is valid. FALSE -
            Voucher is not valid.
        ValidationFaliureMessage:
          type: string
          description: Error message in case voucher is not valid
        VoucherRestrictions:
          type: array
          description: List of validation restrictions applied to vouchers
          items:
            $ref: '#/components/schemas/MerchantVoucherValidationRestriction'
        VoucherType:
          type: number
          description: 'Enumeration of VoucherTypes: 1 - DiscountVoucher'
    MerchantDiscountVoucherValidation:
      type: object
      title: Merchant.DiscountVoucherValidation
      required:
        - DiscountSource
      properties:
        CouponCode:
          type: string
          description: >-
            Merchant CouponCode used for this discount (applicable to
            coupon-based discounts only)
        Description:
          type: string
          description: Discount textual description
        DiscountCode:
          type: string
          description: >-
            Discount code originally specified in the Discount.DiscountCode
            property of the respective discount in SendCart method for the cart
            converted to this order on Global‑e.
        DiscountSource:
          type: integer
          description: >-
            The enum DiscountSource has the following possible values: 1 =
            Merchant; 2 = FixedShippingPrice; 3 = PercentageCartPrice; 4 =
            HiddenForceDDP; 5 = Amend; 6 = RemoteAreaSurchargeSubsidy; 7 =
            LoyaltyPoints; 8 = PaymentCharge; 9 = ReplacementOrder
        DiscountType:
          type: number
          description: >-
            Discount type (“Cart”, “Shipping”, etc.), as defined in the
            DiscountTypeOptions enumeration described in the Discount class in
            this document.
        InternationalPrice:
          type: number
          description: >-
            Discount value in end customer’s currency (specified in
            InternationalDetails.CurrencyCode property for the respective
            Merchant.Order), after applying country coefficient, FX conversion,
            and IncludeVAT handling.
        LocalVATRate:
          type: number
          description: >-
            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
            UseCountryVAT for the current Country is TRUE and therefore the
            VATRate property denotes the VAT for the target country.
        LoyaltyVoucherCode:
          type: string
          description: >-
            Loyalty Voucher code originally specified in
            Discount.LoyaltyVoucherCode property of the respective discount in
            SendCart method for the cart converted to this order on Global‑e.
        c:
          type: string
          description: Discount name
        Price:
          type: number
          description: >-
            Discount value in the currency defined in the CurrencyCode property
            of the respective Merchant.Order object for the order being
            submitted to the Merchant.
        ProductCartItemId:
          type: string
          description: >-
            Identifier of the product cart item related to this discount on the
            Merchant’s site originally specified in the
            Discount.ProductCartItemId property of the respective discount in
            the SendCart method for the cart converted to this order on
            Global‑e.
        VATRate:
          type: number
          description: The VAT rate applied to this discount
    MerchantProductVoucherValidation:
      type: object
      title: Merchant.ProductVoucherValidation
      properties:
        CartItemId:
          type: string
          description: >-
            Identifier of the cart item on the Merchant’s site originally
            specified in the Product.CartItemId property of the respective
            product in the SendCart method for the cart converted to this order
            on Global‑e.
        CartItemOptionId:
          type: string
          description: >-
            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 SendCart method for the cart converted to
            this order on Global‑e.
        Categories:
          type: array
          deprecated: true
          items:
            type: string
          description: List of categories mapped for current cart product.
        HandlingCode:
          type: string
          description: >-
            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 SendOrderToMerchant method.
        ParentCartItemId:
          type: string
          description: >-
            Identifier of the current item’s parent cart item on the Merchant’s
            site originally specified in the Product.ParentCartItemId property
            of the respective product in the SendCart method for the cart
            converted to this order on Global‑e.
        Price:
          type: number
          description: Product price.
        Quantity:
          type: number
          description: Product ordered quantity.
        Sku:
          type: string
          description: >-
            SKU code used to identify the product on the Merchant’s site (to be
            mapped on the Global‑e side).
        VATRate:
          type: number
          description: The VAT rate applied to this product.
    MerchantVoucherValidationRestriction:
      type: object
      title: Merchant.VoucherValidationRestriction
      properties:
        RestrictionEntityCode:
          type: string
          description: Country code value.
        VoucherValidationRestrictionType:
          type: number
          description: 'Enumeration of the voucher value restriction type: 0 - Country'

````