LogoLogo
MerchantsHelpSign in
  • Overview
    • Countries & Currencies
    • Glopal Solutions Portfolio
  • Getting started
    • Shopify
      • Glopal Duty & Tax for Shopify
      • Shopify Collaborator Access
    • BigCommerce
    • Magento (Adobe Commerce)
      • Magento 1
      • Magento 2
        • Magento Activation
        • Magento Configuration
        • Magento Database Model
    • Visualsoft
    • PrestaShop
  • Marketing Solutions
    • Acquisition channels
      • Integrate Google Ads
      • Integrate Facebook Ads
    • Feed localization
      • Read domestic items
      • Localize the items
      • Upload the localized items
    • Features / Customization
      • Google Shopping countries coverage
      • Filters
      • Free listings
      • Comparison Shopping Services (CSS)
    • Google Ads
      • Conversion tracking
      • Standard accounts structure
      • Launching and monitoring Google Ads campaigns
    • Facebook
      • Facebook & Instagram Shops
      • Catalog Based Campaigns
      • Conversion and Brand awareness campaigns
      • Facebook conversion tracking
    • Email marketing
  • Localization
    • Site localization
      • Content localization
      • Price localization
      • Site search
      • Checkout
      • User account
    • Site discovery
      • Domains and Routing
      • Search engine optimization
      • Geo-localization
      • Country selector
    • Content distribution
      • Site security
      • Domains (DNS)
      • Traffic Splitting
        • Akamai
        • Cloudflare
        • Nginx
        • Microsoft IIS
        • AWS CloudFront
        • Magento Cloud
      • Third-party CDN
        • Cloudflare
      • Site speed
    • Integrations
      • CSS customizations
      • JavaScript customizations
      • Server-side customizations
      • Exclude from localization
      • Integration examples
        • Hiding Products
        • Newsletter Signup
        • Custom Price Logic
  • Checkout
    • Localized checkout
      • Overview
      • Styling
      • Integration
        • Callback Functions
        • Confirmation Page
        • Checkout Analytics
        • Allowlisting Glopal IPs
      • Price localization
    • Order processing
      • Order creation
        • Plug & Play integration
        • Order API
        • Event webhook
        • Custom Integration
      • Cancellation & refund
      • Returns
      • Buyer's communication
      • Customer account
    • Financials
      • EU VAT
  • DUTY & TAXES
    • Product Classification
    • Duty & Tax Calculation
      • Product Pricing
      • Supported Countries
    • Compliance Checks
      • Prohibited Goods
      • Denied Party Screening
  • SHIPPING
    • Order Creation
    • Label Generation
    • Manifest
    • Tracking
  • Translations
    • Translation Editor
  • MERCHANT ACCOUNT
    • Dashboards
      • SEO dashboard
  • What's New
    • Release Notes
Powered by GitBook
On this page
  1. Checkout
  2. Localized checkout
  3. Integration

Callback Functions

PreviousIntegrationNextConfirmation Page

Last updated 2 years ago

Glopal Checkout offers callback support (synchronous webhooks) that enables your system to respond at crucial points during the checkout process. The platform will pause for your backend to supply a response, modifying the related action's behavior accordingly.

On receiving network error, 5xx HTTP response or timeout (no response in 5 seconds), Glopal will retry the callback request up to 3 times. Most callbacks have optional response. In case of a bad or no response, Glopal will resume delivering checkout experience. Because of their synchronous nature, it is critical for a good buyer experience to ensure fast and reliable response.

To activate Checkout Callbacks, please provide the URL(s) of your backend that should receive callbacks to your Glopal account manager. For details on the expected request body and potential responses, consult the related documentation provided below.

Endpoint URL will be your backend endpoint that recieves request from Glopal. Request payload is sent by Glopal, and your endpoint can return specified response. To see full specification you can download Checkout API reference in the .

To authenticate requests from Glopal, you can choose to setup Basic HTTP Authentication for the Endpoint URL or include a shared secret in query parameters.

Inventory Check (Available to Promise)

Callback is triggered at the last stage of the checkout, before starting the payment action. Use this callback to confirm items are available for purchase.

When integrating this callback, keep in mind that buyers may still opt not to complete the payment, effectively canceling the purchase. If you decide to reserve inventory at this stage, rendering it unavailable to other buyers, make sure to establish an appropriate time limit before the reservation is released.

Checkout Purchase

Use this callback to specify custom confirmation page message (eg. your order number) or custom . Other common uses is draft order creation (inventory reservation), clearing cart on the localized store or server-side marketing analytics.

confirmation page url
  • Inventory Check (Available to Promise)
  • POSTValidate requested inventory
  • Checkout Purchase
  • POSTCompleting the checkout with a purchase

Completing the checkout with a purchase

post
Body
all ofOptional
and
Responses
200
Successful response
application/json
post
POST /checkout-purchase HTTP/1.1
Host: api.glopal.com
Content-Type: application/json
Accept: */*
Content-Length: 1395

{
  "store_id": "text",
  "checkout_id": "text",
  "callback": "checkout_purchase",
  "visitor": {
    "destination": "FR",
    "customer": {
      "first_name": "text",
      "last_name": "text",
      "email": "text",
      "attributes": {}
    },
    "billing_address": {
      "first_name": "text",
      "last_name": "text",
      "company": "text",
      "address1": "text",
      "postcode": "text",
      "city": "text",
      "state": "text",
      "country_code": "AE",
      "telephone": "text"
    },
    "shipping_address": {
      "first_name": "text",
      "last_name": "text",
      "company": "text",
      "address1": "text",
      "postcode": "text",
      "city": "text",
      "state": "text",
      "country_code": "AE",
      "telephone": "text"
    }
  },
  "cart": {
    "external_id": "text",
    "attributes": {}
  },
  "items": [
    {
      "line_id": "50a2fabfdd276f573ff97ace8b11c5f4"
    },
    {
      "id": "5VBHU31KX1S0",
      "variant_id": "747535896",
      "sku": "828-12/M",
      "options": [
        [
          {
            "name": "XS",
            "value": 505
          },
          {
            "name": "Actual Color",
            "value": "Black White"
          },
          {
            "name": "Gift",
            "value": true
          },
          {
            "name": "Custom Message",
            "value": null
          },
          {
            "name": 1024,
            "value": "Rose Gold"
          }
        ]
      ],
      "quantity": 1,
      "shipment": {
        "package-a": 1,
        "package-b": 1
      },
      "attributes": {}
    }
  ],
  "discounts": [
    {
      "name": "text",
      "code": "text",
      "attributes": {}
    }
  ],
  "shipping": {
    "shipments": [
      {
        "reference": "text",
        "from_country": "AE",
        "hub_code": "text",
        "attributes": {}
      }
    ]
  },
  "tracking": {
    "tags": {
      "utm_source": "https://fr-mystore.glopalstore.com",
      "utm_medium": "wi_proxy",
      "utm_campaign": "co_o_r",
      "custom": "my-affiliate-id"
    },
    "cookies": {
      "_gcl_au": "1.1.346136889.1644568558"
    },
    "client_ids": {
      "ga": "1709456884.1556804913"
    }
  },
  "order": {
    "id": "text"
  }
}
200

Successful response

{
  "checkout": {
    "success_url": "https://mysite.com/${COUNTRY}/checkout/thankyou?lang=${LANGUAGE}",
    "success_url_autoredirect": true,
    "success_url_enable_hmac": false,
    "terms_of_service_url": "text",
    "terms_of_service_url_autoredirect": true,
    "privacy_policy_url": "text",
    "privacy_policy_url_autoredirect": true,
    "returns_policy_url": "text",
    "returns_policy_url_autoredirect": true,
    "contact_details_url": "text",
    "contact_details_url_autoredirect": true
  }
}

Validate requested inventory

post

Callback for doing ATP (Available to Promise) check or inventory reservation right before buyer's payment attempt.

Body
all ofOptional
and
Responses
200
Successful response
application/json
post
POST /inventory-check HTTP/1.1
Host: api.glopal.com
Content-Type: application/json
Accept: */*
Content-Length: 1371

{
  "store_id": "text",
  "checkout_id": "text",
  "callback": "inventory_check",
  "visitor": {
    "destination": "FR",
    "customer": {
      "first_name": "text",
      "last_name": "text",
      "email": "text",
      "attributes": {}
    },
    "billing_address": {
      "first_name": "text",
      "last_name": "text",
      "company": "text",
      "address1": "text",
      "postcode": "text",
      "city": "text",
      "state": "text",
      "country_code": "AE",
      "telephone": "text"
    },
    "shipping_address": {
      "first_name": "text",
      "last_name": "text",
      "company": "text",
      "address1": "text",
      "postcode": "text",
      "city": "text",
      "state": "text",
      "country_code": "AE",
      "telephone": "text"
    }
  },
  "cart": {
    "external_id": "text",
    "attributes": {}
  },
  "items": [
    {
      "line_id": "50a2fabfdd276f573ff97ace8b11c5f4"
    },
    {
      "id": "5VBHU31KX1S0",
      "variant_id": "747535896",
      "sku": "828-12/M",
      "options": [
        [
          {
            "name": "XS",
            "value": 505
          },
          {
            "name": "Actual Color",
            "value": "Black White"
          },
          {
            "name": "Gift",
            "value": true
          },
          {
            "name": "Custom Message",
            "value": null
          },
          {
            "name": 1024,
            "value": "Rose Gold"
          }
        ]
      ],
      "quantity": 1,
      "shipment": {
        "package-a": 1,
        "package-b": 1
      },
      "attributes": {}
    }
  ],
  "discounts": [
    {
      "name": "text",
      "code": "text",
      "attributes": {}
    }
  ],
  "shipping": {
    "shipments": [
      {
        "reference": "text",
        "from_country": "AE",
        "hub_code": "text",
        "attributes": {}
      }
    ]
  },
  "tracking": {
    "tags": {
      "utm_source": "https://fr-mystore.glopalstore.com",
      "utm_medium": "wi_proxy",
      "utm_campaign": "co_o_r",
      "custom": "my-affiliate-id"
    },
    "cookies": {
      "_gcl_au": "1.1.346136889.1644568558"
    },
    "client_ids": {
      "ga": "1709456884.1556804913"
    }
  }
}
200

Successful response

{
  "items": [
    {
      "line_id": "text",
      "max_quantity": "Infinity"
    }
  ],
  "checkout": {
    "expires_at": "text"
  }
}
OpenAPI format