### Magento 2 Setup and Deployment Commands Source: https://docs.glopal.com/getting-started/magento-adobe-commerce/magento-2 These commands are essential for upgrading the Magento 2 instance after installing a new module, deploying static content, and setting the deployment mode. Ensure you are in the correct user context before execution. ```bash magento setup:upgrade magento setup:static-content:deploy magento deploy:mode:set production ``` -------------------------------- ### Install Glopal Magento 2 Package via Composer Source: https://docs.glopal.com/getting-started/magento-adobe-commerce/magento-2 This command installs the Glopal Magento 2 extension using Composer. It requires authentication with a provided token from your Glopal Account Manager. ```bash composer require glopal/glopal-magento2 Authentication required (glopal.repo.packagist.com): Username: token Password: YOUR-GLOPAL-COMPOSER-TOKEN ``` -------------------------------- ### Access Glopal Configuration Data in JavaScript Source: https://docs.glopal.com/localization/integrations/javascript-customizations This example shows how to access the `window.glopal.config.target` object to retrieve localization details like country code, language tag, and currency. This data can be used for dynamic content adjustments based on the localized site's settings. ```javascript if (window.glopal !== undefined) { /* load additional font for greek language */ (function() { a if (!glopal.config.target.languageTag.startsWith('el-')) { return; } const n = document.createElement('style'); n.textContent = "@font-face {font-family:Interstate; src:local(serif);}"; document.head.appendChild(n); })(); } ``` -------------------------------- ### POST /begin_checkout Source: https://docs.glopal.com/checkout/localized-checkout/integration/checkout-analytics Triggered when a user enters the checkout, refreshes the page, applies a discount, or changes localization settings. ```APIDOC ## POST /begin_checkout ### Description Tracks the initiation of the checkout process or updates to the checkout state. ### Method POST ### Endpoint //glopal-checkout/shipping ### Parameters #### Request Body - **gl_store_id** (string) - Required - Your unique store ID - **gl_store_platform** (string) - Required - Your store platform (e.g., "BigCommerce") - **gl_country** (string) - Required - ISO Alpha-2 destination country code - **gl_currency** (string) - Required - ISO three-letter currency code - **gl_language** (string) - Required - BCP47 language tag - **ecommerce** (object) - Required - Checkout information object - **ecommerce.currency** (string) - Required - ISO three-letter currency code - **ecommerce.value** (number) - Required - Cart subtotal after discount - **ecommerce.coupon** (string) - Optional - Last applied discount code - **ecommerce.items** (array) - Required - List of product objects ### Request Example { "gl_store_id": "12345", "gl_country": "FR", "ecommerce": { "currency": "EUR", "value": 99.99, "items": [{"item_name": "Example Product", "quantity": 1}] } } ``` -------------------------------- ### Add Glopal Composer Repository Source: https://docs.glopal.com/getting-started/magento-adobe-commerce/magento-2 This command configures your Composer environment to access Glopal's private repository for Magento 2 extensions. You will need to add this to your composer.json file. ```bash composer config repositories.glopal composer https://glopal.repo.packagist.com/magento/ ``` -------------------------------- ### POST /ops/prealert Source: https://docs.glopal.com/shipping/order-creation Create an order by referencing an existing quote, combining quote data with additional information like the buyer's shipping address. ```APIDOC ## POST /ops/prealert ### Description Creates an order by utilizing an existing quote and supplementing it with additional order details, such as the shipping address. ### Method POST ### Endpoint /ops/prealert ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **quote_id** (string) - Required - The identifier of the existing quote. * **shipping_address** (object) - Required - The address where the order should be shipped. * **street** (string) - Required - Street name and number. * **city** (string) - Required - City name. * **postal_code** (string) - Required - Postal code. * **country_code** (string) - Required - ISO 3166-1 alpha-2 country code. ### Request Example ```json { "quote_id": "QUOTE987654321", "shipping_address": { "street": "456 Oak Ave", "city": "Othertown", "postal_code": "67890", "country_code": "CA" } } ``` ### Response #### Success Response (200) - **order_id** (string) - The unique identifier for the created order. - **status** (string) - The current status of the order. #### Response Example ```json { "order_id": "ORD987654321", "status": "PENDING_SHIPMENT" } ``` ``` -------------------------------- ### Get Glopal Order Details API Specification (OpenAPI) Source: https://docs.glopal.com/checkout/order-processing/order-creation/order-api This snippet defines the OpenAPI 3.0.3 specification for the Glopal Order API, specifically the GET /v2/orders/{store_id}/{order_id} endpoint. It details the request parameters, response structure, security schemes, and data models for order objects. ```json { "openapi": "3.0.3", "info": { "title": "Glopal Order API", "version": "2.4.0" }, "security": [ { "ClientAuth": [] } ], "components": { "securitySchemes": { "ClientAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "token" } }, "schemas": { "Order": { "type": "object", "properties": { "id": { "$ref": "#/components/schemas/OrderId" }, "status": { "$ref": "#/components/schemas/OrderStatus" }, "external": { "$ref": "#/components/schemas/OrderExternalIds" }, "currency": { "description": "Currency buyer used to place this order", "allOf": [ { "$ref": "#/components/schemas/CurrencyCode" } ] }, "language": { "description": "Language buyer used to place this order", "allOf": [ { "$ref": "#/components/schemas/LanguageTag" } ] }, "environment": { "type": "string", "enum": [ "live", "test" ] }, "customer_note": { "description": "Order note passed from the cart", "type": "string" }, "internal_note": { "description": "Order note by Glopal", "type": "string" }, "exchange_rates": { "type": "object", "description": "Currency exchange rate used to convert to order currency.\n\nCan have up to 8 decimals.\n\nDefined as 1 = X where following example defines 1 USD = 0.9102 EUR:\n\n```\n{\n currency: 'EUR',\n exchange_rates: {\n USD: {\n rate: 0.9102\n }\n }\n}\n```\n", "additionalProperties": { "type": "object", "required": [ "rate" ], "properties": { "rate": { "$ref": "#/components/schemas/Amount" } } } }, "created_at": { "description": "Creation time in UTC timezone", "type": "string", "format": "date-time" }, "customer": { "type": "object", "properties": { "first_name": { "type": "string" }, "last_name": { "type": "string" }, "email": { "type": "string" }, "email_alias": { "description": "If Email Proxy feature is enabled, returns Glopal-provided email alias. Email sent to this alias will be processed and localized by Glopal before it is re-mailed to the buyer's original email address.", "type": "string" }, "email_marketing_consent": { "description": "If Glopal Checkout collects marketing consent, value can be 'granted' or 'denied'. Else, returning 'unknown'.", "type": "string", "enum": [ "granted", "denied", "unknown" ] }, "attributes": { "description": "Additional attributes included in the Checkout API cart transfer customer object.", "type": "object" } } }, "billing_address": { "$ref": "#/components/schemas/Address" }, "shipping_address": { "$ref": "#/components/schemas/ShippingAddress" }, "shipping_address_latin1": { "description": "Romanized shipping address in UTF-8 encoding but restricted to Latin1 character set, if feature is enabled", "allOf": [ { "$ref": "#/components/schemas/ShippingAddress" } ] }, "payment": { "$ref": "#/components/schemas/Payment" }, "glopal_summary": { "type": "object", "properties": { "total": { "$ref": "#/components/schemas/Amount" } } }, "merchant_summary": { "type": "object", "properties": { "total": { "$ref": "#/components/schemas/Amount" } } }, "summary": { "$ref": "#/components/schemas/Summary" }, "merchant_actions": { "type": "object", "properties": { "is_cancellable": { "type": "boolean" }, "is_refundable": { "type": "boolean" } } }, "documents": { "type": "array", "items": { "type": "object", "required": [ "name", "url" ], "properties": { "name": { "type": "string", "enum": [ "invoice", "receipt" ] }, "url": { "type": "string", "format": "URL" } } } }, "cart_transfer": { "type": "object", "description": "Stored copy of the Checkout API cart transfer payload", "properties": { "checkout_id": { "type": "string", "description": "Unique checkout id from Checkout API cart transfer response" }, "visitor": { "type": "object" }, "cart": { "type": "object" }, "items": { "type": "array", "items": { "type": "object" } }, "shipping": { "type": "object" }, "referrer": { "type": "string" }, "tracking": { "type": "object" }, "discounts": { "type": "array", "items": { "type": "object" } } } }, "total_cost": { "type": "object", "additionalProperties": false, "required": [ "transaction_id" ], "properties": { "transaction_id": { "type": "string" }, "transactions": { "description": "Duty & Tax calculation response", "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "transaction_id", "from_country", "summary" ], "properties": { "transaction_id": { "type": "string" }, "from_country": { "$ref": "#/components/schemas/CountryCode" }, "hub_code": { "type": "string" }, "duty_calculation_rule": { "type": "string", "description": "The duty calculation rule of the import country" }, "tax_calculation_rule": { "type": "string", "description": "The tax calculation rule of the import country" }, "incoterms": { "type": "string", "enum": [ "DDU", "DDP" ], "description": "DDU or DDP (Delivery Duty Unpaid or Delivery Duty Paid)" }, "is_duty_deminimis_applied": { "type": "boolean", "description": "A flag describing if the order was below or above duty threshold for country" }, "is_tax_deminimis_applied": { "type": "boolean", "description": "A flag describing if the order was below or above tax threshold for country" }, "summary": { "$ref": "#/components/schemas/SummaryWithDutyAndTaxes" }, "tax_charges": { "type": "array", "description": "The list of applied taxes in this transaction", "items": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "co" } } } } } } } } } } } } } ``` -------------------------------- ### Create Return Request Source: https://docs.glopal.com/shipping/returns Initiates a return request for a customer's order. This endpoint requires detailed information about the order, the items being returned, and the customer's contact details. ```APIDOC ## POST /websites/glopal/returns ### Description Initiates a return request for a customer's order. This endpoint requires detailed information about the order, the items being returned, and the customer's contact details. ### Method POST ### Endpoint /websites/glopal/returns ### Parameters #### Request Body - **order_reference** (string) - Required - The reference number of the order to be returned. - **full_return** (boolean) - Required - Indicates if the entire order is being returned. - **email** (string) - Required - The email address of the customer. - **phone** (string) - Required - The phone number of the customer, starting with a plus sign and followed by 9 to 16 digits. - **wms_id** (string) - Optional - Warehouse Management System package identifier. - **item** (array) - Required - A list of products to return. Each item must include: - **qty** (integer) - Required - The number of products per shipment (minimum 1, maximum 100). - **gtin** (string) - Required - The GTIN identifier of the product (2-50 characters). - **merchant_sku** (string) - Required - The product stock keeping unit (SKU) identifier (2-50 characters). - **discounted_price** (string) - Optional - The reduced price of the returning product, formatted as a string with up to 2 decimal places. ### Request Example ```json { "order_reference": "ORDER12345", "full_return": false, "email": "customer@example.com", "phone": "+1234567890", "item": [ { "qty": 1, "gtin": "1234567890123", "merchant_sku": "SKU001", "discounted_price": "99.99" } ] } ``` ### Response #### Success Response (200) - **return_id** (string) - The unique identifier for the return request (40 characters). - **immediate_return** (object) - Details about the immediate return process, including carrier information and labels. - **carrier_name** (string) - Name of the carrier platform (1-16 characters). - **awb** (string) - Airway Bill number (Carrier tracking reference) (0-255 characters). - **tracking_url** (string) - The URL for tracking the shipment. - **carrier_tracking_url** (string) - The URL for carrier-specific tracking. - **is_paperless** (boolean/integer/string) - Indicates if documents were provided electronically to the carrier. - **label_file_zpl** (string) - Path to the ZPL label file. - **label_file_pdf** (string) - Path to the PDF label file. - **advice_file_pdf** (string) - Path to the PDF advice file. - **combined_doc_file_pdf** (string) - Path to the combined PDF document. - **label_url_zpl** (string) - URL for the ZPL label file. - **label_url_pdf** (string) - URL for the PDF label file. - **advice_url_pdf** (string) - URL for the PDF advice file. - **combined_doc_url_pdf** (string) - URL for the combined PDF document. - **label_dpi_density** (string) - Density of label print (e.g., "300", "203"). - **label_type** (string) - Type (size) of label (e.g., "BL4x6"). #### Error Response (400/500) - **error** (integer) - Indicates if the operation was successful (0 for success, 1 for failure). - **errors** (array) - A list of errors encountered during the request. - **code** (string) - Error code. - **details** (string) - Detailed description of the error. - **field** (string) - The request field associated with the error. - **warnings** (array) - A list of warnings generated during the request. - **code** (string) - Warning code. - **details** (string) - Detailed description of the warning. - **field** (string) - The request field associated with the warning. ### Response Example (Success) ```json { "return_id": "a1b2c3d4e5f678901234567890abcdef12345678", "immediate_return": { "carrier_name": "FedEx", "awb": "789012345678", "tracking_url": "https://www.fedex.com/tracking/789012345678", "carrier_tracking_url": "https://www.fedex.com/tracking/789012345678", "is_paperless": true, "label_file_zpl": "/labels/return_label.zpl", "label_file_pdf": "/labels/return_label.pdf", "advice_file_pdf": "/labels/advice.pdf", "combined_doc_file_pdf": "/labels/combined_doc.pdf", "label_url_zpl": "https://example.com/labels/return_label.zpl", "label_url_pdf": "https://example.com/labels/return_label.pdf", "advice_url_pdf": "https://example.com/labels/advice.pdf", "combined_doc_url_pdf": "https://example.com/labels/combined_doc.pdf", "label_dpi_density": "300", "label_type": "BL4x6" } } ``` ### Response Example (Error) ```json { "error": 1, "errors": [ { "code": "INVALID_ORDER_REFERENCE", "details": "The provided order reference does not exist.", "field": "order_reference" } ], "warnings": [] } ``` ``` -------------------------------- ### POST /ops/create_order Source: https://docs.glopal.com/shipping/order-creation Create a new order from scratch by passing all relevant order information in a single request. ```APIDOC ## POST /ops/create_order ### Description Creates a new order by accepting all necessary order details in a single API request. ### Method POST ### Endpoint /ops/create_order ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **order_details** (object) - Required - All details required to create an order. * **customer_info** (object) - Required - Information about the customer. * **name** (string) - Required - Customer's full name. * **email** (string) - Required - Customer's email address. * **phone** (string) - Optional - Customer's phone number. * **shipping_address** (object) - Required - The address where the order should be shipped. * **street** (string) - Required - Street name and number. * **city** (string) - Required - City name. * **postal_code** (string) - Required - Postal code. * **country_code** (string) - Required - ISO 3166-1 alpha-2 country code. * **items** (array) - Required - List of items in the order. * **sku** (string) - Required - Stock Keeping Unit for the item. * **quantity** (integer) - Required - Number of units for the item. * **price** (number) - Required - Price per unit. * **currency** (string) - Required - Currency of the price (e.g., "USD"). ### Request Example ```json { "order_details": { "customer_info": { "name": "John Doe", "email": "john.doe@example.com", "phone": "+1234567890" }, "shipping_address": { "street": "123 Main St", "city": "Anytown", "postal_code": "12345", "country_code": "US" }, "items": [ { "sku": "ITEM001", "quantity": 2, "price": 25.50, "currency": "USD" } ] } } ``` ### Response #### Success Response (200) - **order_id** (string) - The unique identifier for the created order. - **status** (string) - The current status of the order. #### Response Example ```json { "order_id": "ORD123456789", "status": "CREATED" } ``` ``` -------------------------------- ### Get Stream of Order Events - OpenAPI Specification Source: https://docs.glopal.com/checkout/order-processing/order-creation/order-api This OpenAPI 3.0.3 specification defines the 'Get stream of order events' endpoint for the Glopal Order API. It details the request parameters, including filtering by event type and pagination using event IDs, and the structure of the JSON response containing a list of order events. ```json { "openapi": "3.0.3", "info": { "title": "Glopal Order API", "version": "2.4.0" }, "security": [ { "ClientAuth": [] } ], "components": { "securitySchemes": { "ClientAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "token" } }, "schemas": { "EventList": { "type": "object", "required": [ "events" ], "properties": { "links": { "type": "object", "properties": { "next": { "type": "string" }, "current": { "type": "string" }, "previous": { "type": "string" } } }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/EventListItem" } } } }, "EventListItem": { "type": "object", "required": [ "event_id", "event_name", "event_at", "order_id" ], "properties": { "event_id": { "type": "string" }, "event_name": { "type": "string", "enum": [ "order.received", "order.ready", "order.accepted", "order.cancelled", "order.confirmed", "return.requested", "return.authorized", "return.cancelled", "refund.request_received", "refund.request_sent", "refund.confirmed", "refund.cancelled" ] }, "event_at": { "type": "string", "format": "date-time" }, "order_id": { "$ref": "#/components/schemas/OrderId" }, "external": { "$ref": "#/components/schemas/OrderExternalIds" }, "entity_id": { "type": "string", "description": "For subresource events like returns, includes reference to the id of that resource." } } }, "OrderId": { "type": "string", "pattern": "^\\d+-\\d+$" }, "OrderExternalIds": { "type": "object", "properties": { "order_id": { "type": "string" }, "order_number": { "type": "string" } } } } }, "paths": { "/v2/events/{store_id}": { "get": { "operationId": "v2_get_events", "summary": "Get stream of order events", "description": "Use this endpoint to pull RECEIVED / READY / CANCELLED orders to import into your ecommerce site, OMS or other systems.\n\nFilter for one or multiple events by passing multi-value `event` query parameter (\"?event=order.ready&event=order.cancelled\").\n\nWhen pulling, record the last seen `event_id` in the system pulling orders and use it as `after_event_id` parameter in the next pull.\n", "tags": [ "Order" ], "parameters": [ { "name": "event", "in": "query", "required": true, "style": "form", "explode": true, "schema": { "type": "string" } }, { "name": "before_event_id", "in": "query", "description": "Last seen Event ID for forward pagination. Must be valid Event ID.", "required": false, "schema": { "type": "string" } }, { "name": "after_event_id", "in": "query", "description": "Last seen Event ID for backward pagination. Must be valid Event ID.", "required": false, "schema": { "type": "string" } }, { "name": "count", "description": "Events in response", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventList" } } } }, "401": { "description": "Invalid authentication", "content": {} }, "404": { "description": "Store not found or not authorized", "content": {} } } } } } } ``` -------------------------------- ### GET /shipping/labels Source: https://docs.glopal.com/shipping/returns Retrieves shipping label information, tracking details, and associated document URLs for a specific return ID. ```APIDOC ## GET /shipping/labels ### Description Retrieves the shipping label details, including carrier tracking information, ZPL/PDF file paths, and URLs for a given return request. ### Method GET ### Endpoint /shipping/labels ### Parameters #### Query Parameters - **return_id** (string) - Required - The unique identifier for the return request. ### Request Example GET /shipping/labels?return_id=12345 ### Response #### Success Response (200) - **carrier_name** (string) - Name of the carrier - **awb** (string) - Airway Bill number - **tracking_url** (string) - URL of the tracking document - **is_paperless** (boolean/int) - Indicates if documents are electronically provided - **label_file_zpl** (string) - ZPL document path - **label_url_pdf** (string) - PDF document URL - **label_dpi_density** (string) - Density of label print (300 or 203) #### Response Example { "carrier_name": "DHL", "awb": "123456789", "tracking_url": "https://tracking.example.com/123", "is_paperless": true, "label_file_zpl": "/labels/label.zpl", "label_url_pdf": "https://docs.example.com/label.pdf", "label_dpi_density": "300", "label_type": "BL4x6" } ``` -------------------------------- ### Checkout Configuration Schema Source: https://docs.glopal.com/checkout/localized-checkout/integration Defines the structure for configuring a checkout session, including shipping countries, currencies, and callback URLs. ```APIDOC ## POST /checkout ### Description Configures a new checkout session with specific regional and functional constraints. ### Method POST ### Endpoint /checkout ### Parameters #### Request Body - **countries** (array) - Optional - List of allowed shipping destination country codes. - **currencies** (array) - Optional - List of allowed currency codes. - **expires_at** (string) - Optional - ISO 8601 datetime string for session expiration (default 3 hours). - **callbacks** (object) - Optional - Configuration for inventory and purchase callbacks. ### Request Example { "countries": ["DE", "FR"], "currencies": ["EUR"], "expires_at": "2023-12-31T23:59:59Z" } ### Response #### Success Response (200) - **success_url** (string) - The URL used for the checkout confirmation page. #### Response Example { "success_url": "https://example.com/confirm/${ORDER_ID}" } ``` -------------------------------- ### Verify Nginx Proxy Module Source: https://docs.glopal.com/localization/content-distribution/traffic-splitting/nginx Checks if the ngx_http_proxy_module is installed and active in the current Nginx configuration. ```bash nginx -V 2>&1 | tr ' ' '\n' | grep 'ngx_http_proxy_module' ``` -------------------------------- ### GET /v2/orders/{store_id}/{order_id} Source: https://docs.glopal.com/checkout/order-processing/order-creation/order-api Retrieve detailed information about a specific order using its ID. ```APIDOC ## GET /v2/orders/{store_id}/{order_id} ### Description Fetches the full details of a specific order, including currency and exchange rate information. ### Method GET ### Endpoint https://{server}/v2/orders/{store_id}/{order_id} ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier for the store. - **order_id** (string) - Required - The unique identifier for the order. ### Request Example curl 'https://{server}/v2/orders/{store_id}/{order_id}' -H 'Authorization: Bearer GL.***' ### Response #### Success Response (200) - **order_details** (object) - Detailed order information including exchange_rates. #### Response Example { "order_id": "ORD-999", "exchange_rates": { "USD": { "rate": 1.1 } } } ``` -------------------------------- ### POST /add_shipping_info Source: https://docs.glopal.com/checkout/localized-checkout/integration/checkout-analytics Triggered when a user selects a shipping option before proceeding to payment. ```APIDOC ## POST /add_shipping_info ### Description Tracks the selection of a shipping method and the final grand total. ### Method POST ### Endpoint //glopal-checkout/shipping ### Parameters #### Request Body - **ecommerce.value** (number) - Required - Grand Total - **ecommerce.shipping_tier** (string) - Required - Shipping service grade type and incoterms (e.g., "STANDARD DDU") ### Request Example { "ecommerce": { "value": 110.00, "shipping_tier": "EXPRESS PF DDP" } } ``` -------------------------------- ### Checkout Success Configuration Source: https://docs.glopal.com/checkout/localized-checkout/integration Defines the settings for the checkout confirmation page, including redirection logic and URL placeholders. ```APIDOC ## GET /checkout/success-config ### Description Retrieves or defines the configuration for the checkout success page, supporting dynamic placeholders for order details. ### Method GET ### Endpoint /checkout/success-config ### Parameters #### Query Parameters - **success_url** (string) - Required - The URL for the confirmation page. Supports placeholders: ${COUNTRY}, ${LANGUAGE}, ${CURRENCY}, ${CHECKOUT_ID}, ${ORDER_ID}. - **success_url_autoredirect** (boolean) - Optional - Whether to redirect to the localized site automatically. ### Response #### Success Response (200) - **success_url** (string) - Configured confirmation URL. - **success_url_autoredirect** (boolean) - Redirection status. #### Response Example { "success_url": "https://shop.com/de/success", "success_url_autoredirect": true } ``` -------------------------------- ### Add Custom Item Attributes Source: https://docs.glopal.com/checkout/localized-checkout/integration Example of including additional metadata such as HS codes within the item object for the Cart Transfer API. ```json { "short_name": "mystore", "cart": { "currency": "USD" }, "visitor": { "destination": "FR" }, "items": [ { "id": "5VBHU31KX1S0", "name": "Women Chevron Printed Trumpet Hem Dress", "quantity": 1, "regular_price": 25, "attributes": { "hs_code": "620444" } } ] } ``` -------------------------------- ### GET /v2/events/{store_id} Source: https://docs.glopal.com/checkout/order-processing/order-creation/order-api Retrieves a stream of order events to synchronize order status between Glopal and external systems. ```APIDOC ## GET /v2/events/{store_id} ### Description Use this endpoint to pull RECEIVED, READY, or CANCELLED orders to import into your ecommerce site, OMS, or other systems. Filter for one or multiple events by passing the multi-value `event` query parameter. ### Method GET ### Endpoint /v2/events/{store_id} ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier for the store. #### Query Parameters - **event** (string) - Required - The event type to filter by (e.g., order.ready, order.cancelled). - **before_event_id** (string) - Optional - Last seen Event ID for forward pagination. - **after_event_id** (string) - Optional - Last seen Event ID for backward pagination. - **count** (integer) - Optional - Number of events to return (1-100, default: 20). ### Request Example GET /v2/events/12345?event=order.ready&event=order.cancelled&count=20 ### Response #### Success Response (200) - **events** (array) - A list of event objects containing event_id, event_name, event_at, and order_id. - **links** (object) - Pagination links (next, current, previous). #### Response Example { "events": [ { "event_id": "evt_001", "event_name": "order.ready", "event_at": "2023-10-27T10:00:00Z", "order_id": "123-456" } ], "links": { "next": "/v2/events/12345?after_event_id=evt_001" } } ``` -------------------------------- ### Return Order API Source: https://docs.glopal.com/shipping/returns This API allows merchants to submit return requests for orders, specifying product details, return reasons, and address information. It supports both full and immediate returns. ```APIDOC ## POST /websites/glopal/return ### Description Submits a return request for an order, including item details, return flags, and address information. ### Method POST ### Endpoint /websites/glopal/return ### Parameters #### Query Parameters - **format** (string) - Required - Specifies the response format (e.g., `application/json`, `application/xml`). #### Request Body - **order_reference** (string) - Required - Merchant/Seller order reference. - **hub_code** (string) - Optional - Hub identifier. - **email** (string) - Required - Email address for notifications. - **phone** (string) - Required - Phone number for contact. - **payment** (object) - Required - Payment details for the return. - **payer** (string) - Required - Payer liable for the return costs (`customer` or `merchant`). - **full_payment** (boolean or integer) - Required - Flag indicating if a full payment is associated with the return (1/0 or true/false). - **flat_fee** (string) - Optional - Flat fee amount for the return. - **rma_number** (string) - Optional - Merchant RMA (return) reference. - **notes** (string) - Optional - Free-form notes for the return. - **full_return** (boolean or integer) - Required - Flag indicating if this is a complete order return (1/0 or true/false). - **immediate_return** (boolean or integer) - Optional - Flag indicating if the return should be processed immediately (1/0 or true/false). - **fulfillment_id** (string) - Optional - OMS order fulfillment identifier. - **outbound_awb** (string) - Optional - Airway Bill number (Carrier tracking reference). - **pickup_address** (object) - Optional - Address details for the return pickup. - **name** (string) - Required - Full name of the private person. - **user_reference** (string) - Optional - Merchant address customer reference. - **address1** (string) - Required - Address string (part 1). - **address2** (string) - Optional - Address string (part 2). - **address3** (string) - Optional - Address string (part 3). - **postcode** (string) - Required - Post code. - **state** (string) - Required - State (province) identification. - **city** (string) - Required - City name. - **country** (string) - Required - Country name. - **service_point_reference** (string) - Optional - Destination address receive point reference (used if pickup_address is not provided). - **company** (string) - Optional - Public company name (used if pickup_address is not provided). - **vat_number** (string) - Optional - Company fiscal identification (used if pickup_address is not provided). - **email** (string) - Optional - Email address (used if pickup_address is not provided). - **phone** (string) - Optional - Phone number (used if pickup_address is not provided). - **item** (array) - Required - List of products to return. - **qty** (integer) - Required - Number of products per shipment. - **gtin** (string) - Required - GTIN identifier. - **merchant_sku** (string) - Optional - Product stock keeping unit (SKU) identifier. - **discounted_price** (string) - Optional - Reduced price of the returning product. ### Request Example (JSON) ```json { "order_reference": "ORD123456", "email": "customer@example.com", "phone": "+1234567890", "payment": { "payer": "customer", "full_payment": true }, "full_return": true, "item": [ { "qty": 2, "gtin": "1234567890123", "merchant_sku": "SKU789" } ], "pickup_address": { "name": "John Doe", "address1": "123 Main St", "city": "Anytown", "country": "USA", "postcode": "12345", "state": "CA" } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success status of the request. - **message** (string) - A message confirming the return request submission. #### Response Example (JSON) ```json { "status": "success", "message": "Return request submitted successfully." } ``` ``` -------------------------------- ### POST /checkout Source: https://docs.glopal.com/checkout/localized-checkout/integration Accepts cart content and returns a checkout ID and a cart URL where the buyer should be redirected to complete the checkout process. ```APIDOC ## POST /checkout ### Description Accepts cart content, returning checkout 'id' and 'cart_url' where buyer should be redirected to complete the checkout. ### Method POST ### Endpoint /checkout ### Parameters #### Request Body - **store_id** (string) - Required - The ID of the store. - **visitor** (object) - Required - Information about the visitor, including destination. - **destination** (string) - Required - The ISO 3166-1 Alpha2 country code for the checkout destination. - **language** (string) - Optional - The desired language tag for the checkout (e.g., 'fr', 'fr-FR'). - **currency** (string) - Optional - The desired ISO 4217 currency code for the checkout. - **customer** (object) - Optional - Customer details for non-guest checkout. - **billing_address** (object) - Optional - The billing address of the customer. - **shipping_address** (object) - Optional - The shipping address of the customer. - **cart** (object) - Required - The content of the shopping cart. - **items** (object) - Required - The items included in the cart. ### Request Example ```json { "store_id": "your_store_id", "visitor": { "destination": "US", "language": "en-US", "currency": "USD", "customer": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, "shipping_address": { "first_name": "John", "last_name": "Doe", "address1": "123 Main St", "postcode": "10001", "city": "New York", "state": "NY", "country_code": "US", "telephone": "123-456-7890" } }, "cart": { "currency": "USD", "total_price": "100.00" }, "items": [ { "sku": "ITEM001", "name": "Example Product", "quantity": 1, "price": "100.00", "currency": "USD" } ] } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the created checkout. - **cart_url** (string) - The URL where the buyer can complete the checkout. #### Response Example ```json { "id": "chk_abcdef123456", "cart_url": "https://checkout.glopal.com/cart/chk_abcdef123456" } ``` ``` -------------------------------- ### Exclude prices from conversion Source: https://docs.glopal.com/localization/integrations/exclude-from-localization Example of using the 'data-gp-noloc' attribute to prevent the Glopal engine from converting specific currency values. ```html

Limited time promotion! Subscribe to our newsletter and receive 5$ bonus for next purchase!

``` -------------------------------- ### GET /v2/orders/{store_id}/{order_id} Source: https://docs.glopal.com/checkout/order-processing/order-creation/order-api Retrieves the full details of a specific order by providing the store identifier and the unique order identifier. ```APIDOC ## GET /v2/orders/{store_id}/{order_id} ### Description Retrieves a specific Glopal order's details, including customer information, billing/shipping addresses, payment status, and financial summaries. ### Method GET ### Endpoint /v2/orders/{store_id}/{order_id} ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier for the store. - **order_id** (string) - Required - The unique identifier for the order. ### Request Example GET /v2/orders/my-store-123/order-abc-789 ### Response #### Success Response (200) - **id** (string) - Order identifier - **status** (string) - Current status of the order - **currency** (string) - Currency used by the buyer - **customer** (object) - Customer details including name and email - **billing_address** (object) - Billing address details - **shipping_address** (object) - Shipping address details - **glopal_summary** (object) - Financial summary in Glopal terms #### Response Example { "id": "order-abc-789", "status": "paid", "currency": "EUR", "customer": { "first_name": "John", "last_name": "Doe", "email": "john.doe@example.com" }, "glopal_summary": { "total": { "amount": 150.00, "currency": "EUR" } } } ```