TGC Order API
The TGOrder endpoint enables the merchant to place international orders within TradeGlobal Commerce without going through the merchant's website. This allows merchant's to leverage TGC's functionality and ship orders internationally without going through the integration process. This functionality is typically used when the merchant is shipping internationally using TradeGlobal's ShipOrder API, or when shipping with TradeGlobal's freight accounts.
Request
TGCOrder requests are support by the HTTP POST method. Create a POST request by adding the parameters in the HTTP request entity body using the application/json
media type. The request URL must conform to the following specifications:
Protocol | Host | Path | Format |
---|---|---|---|
https:// | services.tradeglobal.com | /TGCInternalServices/MerchantServices/api/TGCOrder | Json |
Input Elements (Y=Yes, N=No, C=Conditional, N/A=Not Applicable)
POST /TGCInternalServices/MerchantServices/api/TGCOrder
HOST: services.tradeglobal.com
Content-Type: application/json
{ "MerchantCode" : "TGCSANDBOX", "MerchantOrderID" : "TG0000015", "ServiceCode" : "GMDDP", "PassingFreightCost" : false, "Cart" : { "Products" : [{ "SKU" : "TGSAND_TestSKU123", "Quantity" : 1, "UnitPrice" : 26.99, "Name" : null, "Description" : "Test SKU", "HarmonizedTariffCode" : "620441", "CountryOfOrigin" : "CN", "Length" : 3, "Width" : 6, "Height" : 9, "SizeUOM" : "IN", "Weight" : 0.75, "WeightUOM" : "LBS", "CommercialInvoiceDescription" : "A Test Description" }], "ShipToAddress" : { "FirstName" : "Bryan", "LastName" : "Testcase", "Address1" : "123 Main Street", "City" : "Toronto", "StateProvince" : "ON", "Postal" : "M5S 2A2", "Country" : "CA", "Phone" : "555555555", "Email" : "test@tgc.com" } } }
Response
If the request is valid and authorized, the server will process the request and return a response. Each box passed in the request will be returned with a Status
element indicating if the box was inserted, not processed, or failed. If a order reference does not validate or fails to process, the process will continue to process the rest of the order references in the request.
Output Elements (Y=Yes, N=No, C=Conditional, N/A=Not Applicable)
200 OK
Content-Type: application/json
{ "Status": "SUCCESS", "TimeStamp": "2019-02-26T14:30:45.7055122-05:00", "MerchantCode": "TGCSANDBOX", "MerchantOrderID": "TG0000015", "ServiceCode": "GMDDP", "PassingFreightCost": false, "Quote": { "QuoteID": "5e6732c2-cc55-4035-95df-a307b48be7aa", "CustomsField": { "Discount": [], "Fee": [ { "Amount": 0, "Classification": "Custom", "Type": "Brokerage" }, { "Amount": 0, "Classification": "Custom", "Type": "Disbursement" } ], "Total": 0 }, "ImportField": { "Discount": [], "Fee": [ { "Amount": 4.86, "Classification": "Import", "Type": "Duty" }, { "Amount": 1.59, "Classification": "Import", "Type": "VAT" }, { "Amount": 2.55, "Classification": "Import", "Type": "PST" } ], "Total": 9 }, "ServiceField": { "Discount": [], "Fee": [ { "Amount": 5, "Classification": "Service", "Type": "TransactionFee" } ], "Total": 5 }, "ShippingField": { "Discount": [ { "DiscountAmount": -12.4, "Classification": "Shipping", "Type": "Fixed" } ], "Fee": [ { "Amount": 12.4, "Classification": "Shipping", "Type": "Freight" }, { "Amount": 0, "Classification": "Shipping", "Type": "FuelSurcharge" }, { "Amount": 0, "Classification": "Shipping", "Type": "Insurance" } ], "Total": 0 }, "TotalCost": 53.39 }, "Cart": { "CartID": null, "CartTotal": 26.99, "Products": [ { "SKU": "TGSAND_TestSKU123", "Quantity": 1, "UnitPrice": 26.99, "Name": null, "Description": "Test SKU", "HarmonizedTariffCode": "620441", "CountryOfOrigin": "CN", "Length": 3, "Width": 6, "Height": 9, "SizeUOM": "IN", "Weight": 0.75, "WeightUOM": "LBS", "CommercialInvoiceDescription": "A Test Description", "MerchantStyle": null } ], "ShipToAddress": { "FirstName": "Bryan", "MiddleName": null, "LastName": "Testcase", "Address1": "123 Main Street", "Address2": null, "City": "Toronto", "StateProvince": "ON", "Country": "CA", "Postal": "M5S 2A2", "Phone": "555555555", "Email": "test@tgc.com" } } }