Order Creation
Create order object in Glopal's shipping solution at order confirmation
Pre-Integrated Platforms
Glopal's cross-border shipping solution is pre-integrated into Glopal’s Checkout solution, and available for the most relevant e-commerce platforms:
Shopify: Partner app for Shopify and Shopify Plus.
Magento 2: Plugin
Salesforce Cloud Commerce: B2C Commerce Cartridge listed on the Salesforce AppExchange, supporting SFRA, OpenCommerce API (OCAPI), and Site Genesis
Native API Integration
Alternatively, create an order object in Glopal's shipping system via API in one of two ways:
Option 1: Create order from scratch
Pass all relevant order information in one single request.
Client username (set by Glopal)
username
Pattern: ^[a-z0-9\-]{3,255}$
Optional system username to enable separation of authentication credentials by integrated client system. (set by Glopal)
alias-username
Pattern: ^[a-z0-9\-]{3,50}$
The authentication signature is created by using the concatenation of the login, the ‘@’ sign and the timestamp, transformed into a HMAC_256 signature using your secret access key.
40b976b35a08bb951439ea7bbfa0a7bd73dab7c813399a31d9d1a157bc08929b
Pattern: ^[0-9a-f]{64}$
The authentication timestamp must be a decimal numeric representing the current POSIX time, extended to microsecond accuracy. If the requesting system does not provide high-resolution time, it is advised to use a 6-digit random number. It is important to have the requesting system synchronised with a reliable time source (f.i. a stratum 2 NTP server) to avoid request rejection.
1680010295.775523
Pattern: ^[12]\d{9}\.\d{6}$
0.68
Pattern: (^0\.\d{2}$|^[1-9]\d*\.\d{2}$)
const timestamp = String(Date.now() / 1000).padEnd(17, '0');
const username = "username";
const signature = CryptoJS.HmacSHA256(
`${username}@${timestamp}`, "sharedsecret"
).toString(CryptoJS.digest)
const response = await fetch('https://ws.xport.glopalservice.com/ops/create_order', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"x-login": username,
"x-timestamp": timestamp,
"x-signature": signature
},
body: JSON.stringify({
"args": {
"from_country_id": "FR",
"to_country_id": "US",
"to_state_id": "CA",
"to_post_code": "90210",
"shipments": [
{
"currency": "USD",
"weight": 12.34,
"height": 23.45,
"width": 34.56,
"length": 13.57,
"products": [
{
"hs_code": "330310",
"quantity": 1,
"unitprice": 234.56,
"merchant_sku": "1234567890",
"description": "Pink summer dress",
}
]
}
],
"reference": "test123",
"addressee": {
"name": "Test Testington",
"user_reference": "testref",
"address1": "Test street 1",
"address2": "Second floor",
"address3": "Room 37",
"postcode": "90210",
"state": "CA",
"city": "Beverly Hills",
"country": "US",
"service_point_reference": "SDF_hub_rr1234",
"company": "Test company",
"vat_number": "T12344434",
"email": "[email protected]",
"phone": "12345678919"
}
},
"wants": {
"currency": "USD",
"transaction_id": 1
}
}),
});
const data = await response.json();
{
"error": 0,
"parcel": [
{
"shipin_id": 123456,
"shipment_number": 1,
"inboundawb": "AWB1234567890_23",
"delivery_address": {
"name": "Test Testington",
"user_reference": "testref",
"address1": "Test street 1",
"address2": "Second floor",
"address3": "Room 37",
"postcode": "90210",
"state": "CA",
"city": "Beverly Hills",
"country": "US",
"service_point_reference": "SDF_hub_rr1234",
"company": "Test company",
"vat_number": "T12344434",
"email": "[email protected]",
"phone": "12345678919"
},
"transport": {
"carrier": "DHL",
"service": "DHL Express"
}
}
],
"result": {
"from_country_id": "FR",
"to_country_id": "US",
"to_state_id": "CA",
"to_post_code": "90210",
"delivery_type_id": "X",
"transaction_id": "642edad40de2f361ba4d1684aaf3c53a0afc687b",
"dutiable_value": 84.75,
"dutiable_value_discount": 10,
"dutiable_value_discount_tax": 1.2,
"dutiable_value_discount_duty": 1.23,
"dutiable_value_discount_net": 8.02,
"dutiable_value_tax_included": 100,
"dutiable_value_tax_charge": 4.23,
"duty_charge": 15.25,
"duty_charge_included": 12.12,
"duty_charge_tax": 2.23,
"currency": "USD",
"dead_weight": 12.34,
"vol_weight": 15.22,
"weight": 15.22,
"weight_unit": "kg",
"duty_calculation_rule": "CIF",
"tax_calculation_rule": "CIF",
"is_duty_deminimis_applied": 0,
"is_tax_deminimis_applied": 0,
"commission_fee": 0.12,
"incoterms": "DDP",
"reference": "test123",
"tax_charge": 15.25,
"tax_charges": [
{
"name": "Charge",
"code": "charge_id",
"rate": 9.975,
"type": "dutiable_value",
"base": 121.5,
"value": 12.12
}
],
"tax_charge_included": 12.12,
"product_tax_charge": 10.03,
"calculus_shipping_charge": 15.33,
"shipping_charge": 13.33,
"shipping_charge_duty": 3.33,
"shipping_charge_tax": 2.33,
"shipping_charge_tax_included": 2.33,
"shipping_charge_duty_tax": 0.33,
"merchant_shipping_charge": {
"currency": "USD",
"value": 5
},
"discount": 10,
"discounts": [
{
"name": "Charge",
"code": "charge_id",
"rate": 9.975,
"type": "dutiable_value",
"base": 121.5,
"value": 12.12
}
],
"extra_charge": 33.23,
"extra_charges": [
{
"name": "Charge",
"code": "charge_id",
"rate": 9.975,
"type": "dutiable_value",
"base": 121.5,
"value": 12.12
}
],
"total_charge": 150.23,
"transport": {
"carrier": "DHL",
"service": "DHL Express"
},
"products": [
{
"calculus_duty_charge": 5.33,
"calculus_tax_charge": 3.49,
"documentation_code": "CITES_2000_a",
"dutiable_value": 84.75,
"dutiable_value_tax_charge": 4.23,
"dutiable_value_tax_included": 100,
"duty_charge": 15.25,
"duty_charges": [
{
"name": "Charge",
"code": "charge_id",
"rate": 9.975,
"type": "dutiable_value",
"base": 121.5,
"value": 12.12
}
],
"duty_charge_included": 12.12,
"duty_charge_tax": 2.23,
"duty_deminimis": 125,
"duty_rate": 8.25,
"gtin": "1234567890",
"hs_code": "330310",
"merchant_sku": "1234567890",
"alt_merchant_sku": "AMS1234567890",
"preference_applied": 0,
"preference_source": "Free trade agreement",
"product_dutiable_value_discount": 10,
"product_dutiable_value_discount_tax": 1.2,
"product_dutiable_value_discount_duty": 1.23,
"product_dutiable_value_discount_net": 8.02,
"product_shipping_charge_duty": 3.33,
"product_shipping_charge_tax": 2.33,
"product_shipping_charge_duty_tax": 0.33,
"prohibition_id": "W12",
"prohibition_note": "Warning for product type importing to destination country",
"quantity": 1,
"shipment_id": 123456,
"tax_charge": 15.25,
"tax_charges": [
{
"name": "Charge",
"code": "charge_id",
"rate": 9.975,
"type": "dutiable_value",
"base": 121.5,
"value": 12.12
}
],
"tax_charge_included": 12.12,
"tax_deminimis": 25,
"tax_rate": 20.25
}
]
}
}
Option 2: Create order from existing quote
If integrated with Glopal's tcc.calculate_order
API service (see Duty & Tax Calculation), reference the earlier quote to join already provided order information with additional data (such as the buyer shipping address).
Client username (set by Glopal)
username
Pattern: ^[a-z0-9\-]{3,255}$
Optional system username to enable separation of authentication credentials by integrated client system. (set by Glopal)
alias-username
Pattern: ^[a-z0-9\-]{3,50}$
The authentication signature is created by using the concatenation of the login, the ‘@’ sign and the timestamp, transformed into a HMAC_256 signature using your secret access key.
40b976b35a08bb951439ea7bbfa0a7bd73dab7c813399a31d9d1a157bc08929b
Pattern: ^[0-9a-f]{64}$
The authentication timestamp must be a decimal numeric representing the current POSIX time, extended to microsecond accuracy. If the requesting system does not provide high-resolution time, it is advised to use a 6-digit random number. It is important to have the requesting system synchronised with a reliable time source (f.i. a stratum 2 NTP server) to avoid request rejection.
1680010295.775523
Pattern: ^[12]\d{9}\.\d{6}$
0.68
Pattern: (^0\.\d{2}$|^[1-9]\d*\.\d{2}$)
const timestamp = String(Date.now() / 1000).padEnd(17, '0');
const username = "username";
const signature = CryptoJS.HmacSHA256(
`${username}@${timestamp}`, "sharedsecret"
).toString(CryptoJS.digest)
const response = await fetch('https://ws.xport.glopalservice.com/ops/prealert', {
method: 'POST',
headers: {
"Content-Type": "application/json",
"x-login": username,
"x-timestamp": timestamp,
"x-signature": signature
},
body: JSON.stringify({
"order": {
"reference": "test123",
"transaction_id": "642edad40de2f361ba4d1684aaf3c53a0afc687b",
"addressee": {
"name": "Test Testington",
"user_reference": "testref",
"address1": "Test street 1",
"postcode": "90210",
"state": "CA",
"city": "Beverly Hills",
"country": "US"
}
}
}),
});
const data = await response.json();
{
"error": 0,
"parcel": [
{
"shipin_id": 123456,
"shipment_number": 1,
"inboundawb": "AWB1234567890_23",
"delivery_address": {
"name": "Test Testington",
"user_reference": "testref",
"address1": "Test street 1",
"address2": "Second floor",
"address3": "Room 37",
"postcode": "90210",
"state": "CA",
"city": "Beverly Hills",
"country": "US",
"service_point_reference": "SDF_hub_rr1234",
"company": "Test company",
"vat_number": "T12344434",
"email": "[email protected]",
"phone": "12345678919"
},
"transport": {
"carrier": "DHL",
"service": "DHL Express"
}
}
]
}
Last updated