Order API

In addition to the Plug & Play integration, Glopal exposes Order API that can be used to receive and process orders completed in the Glopal Checkout back into your eCommerce platform backend or other related systems, and issue refunds and manage return requests.

For your convenience, you can download the description in the OpenAPI format. Please reach out to your Glopal account manager to receive the endpoint and the API key to start your integration.

The latest API version is 2.3.2

Receiving orders


Integration guide

After the purchase in the Glopal Checkout, Glopal Order API will emit different events as the order goes through order processing. To integrate with Glopal, you have to write code that will take action on specific events. You can setup a webhook to listen on events, or pull events with the /v2/events/{store_id} endpoint. We recommend the pull method for easier integration.

You can choose to import orders on RECEIVED (right after the Glopal Checkout) or READY event when Glopal marks the order as ready to be accepted by merchants. If you are just starting a new integration, we recommend starting with the READY event.

When pulling you can record the last seen event, and use this as a cursor to pull additional events.

curl -G \
  'https://{server}/v2/events/{store_id}' \
  -d 'event=order.ready&after_event_id=' \
  -H 'Authorization: Bearer GL.***'

Parameters event and after_event_id should be passed in the URL query (after ?)

Each event returns order_id that can be used to fetch order details and then accept the order, returning your order id and number (reference) to Glopal. Glopal will use your order number to include in the order confirmation email or in the shipping & logistics part of the Glopal solution.

Note: All order amounts are presented in the transaction currency (buyer’s currency). You can choose to import the order into your system either in this or in your base currency. To import the order in the base currency, divide all amounts by the rate included in the order details response (field exchange_rates.{base}.rate).

curl \
  'https://{server}/v2/orders/{store_id}/{order_id}' \
  -H 'Authorization: Bearer GL.***'

curl -X POST \
  'https://{server}/v2/orders/{store_id}/{order_id}/accept' \
  -d '{"external": {"order_id": "42", "order_number": "ECOM-2022-42"}}' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer GL.***'

Order can only be accepted once, but the call is idempotent if called with the same parameters. On success, Glopal returns HTTP 200 with {"status": "ok"} JSON response. On error, you should receive HTTP 400 with an error description in the JSON response.

If for any reason order can not be accepted, you can cancel the order, with an automatic refund.

Cancelation and refunds

Note: When cancelling the order either via API or Glopal Merchant Account user interface, Glopal will not update the order in your eCommerce backend / OMS. You can either ensure that the order is canceled inside your eCommerce backend, before canceling it through Glopal or listen / pull for the order.cancelled event via Order API.

Last updated