Order Reference API



If the merchant is going to be using TradeGlobal's Shipping portal or ShipOrder API to generate shipping labels, and the package will not be manifested using the TG/Web order number, the merchant will need to be able to provide the order level reference that is generated from the merchant's warehouse or order management systems. Order references can be passed at the order level or sku level. If the reference is an order reference (All SKUS will be shipping under the same reference), the SKU field can be left null. If the reference is a SKU level reference (multiple shipments for the given order), populate the SKU field with SKU associated for the given reference.

Request

OrderReference requests are supported 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/OrderReference Json

Input Elements (Y=Yes, N=No, C=Conditional, N/A=Not Applicable)

Node Required Description Data Type Length Values
OrderReferenceRequest Y Container array for one or more order references.
OrderReferences Y Order Reference Object Array
MerchantCode Y Unique identifier for merchant String 20
OrderNum Y TradeGlobal/Web order number String 50
RefNumber Y Order reference number String 50
SKU C SKU associated with the given order reference number String 100

Example Request - JSON Format
POST /TGCInternalServices/Merchant/api/WarehouseBox
HOST: services.tradeglobal.com
Content-Type: application/json
{
	"OrderReferences" : [
		{
			"MerchantCode" : "TGCSANDBOX",
			"OrderNumber" : "5013355",
			"OrderReferenceNumber" : "ReferenceTest001111",
			"SKU" : null
		},
		{
			"MerchantCode" : "TGCSANDBOX",
			"OrderNumber" : "5013355",
			"OrderReferenceNumber" : "ReferenceTest002111",
			"SKU" : "846733012138"
		}
		]
}

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)

Node Required Description Data Type Length Values
OrderReferenceResponse Y Container array for one or more order references.
CreateDate Y Time Stamp of when the response was generated DateTime
OrderReferences Y Container array that holds one or more order references
Status Y Indicates if the request was successful String SUCCESS, FAILED
ErrorMessage C Message describing the error that was thrown for the given box String
MerchantCode Y Unique identifier for merchant String 20
OrderNum Y TradeGloabl/Web Order number String
RefNumber Y Reference number assigned in the request String 50
SKU C SKU associated with the given order reference String 100
Example Respone - JSON Format
200 OK
Content-Type: application/json
{
    "CreateDate": "2019-02-26T11:49:32.7483132-05:00",
    "OrderReferences": [
        {
            "Status": "SUCCESS",
            "ErrorMessage": null,
            "MerchantCode": "TARTECOSMETICS",
            "OrderNum": "5013355",
            "RefNumber": "ReferenceTest001111",
            "SKU": null
        },
        {
            "Status": "SUCCESS",
            "ErrorMessage": null,
            "MerchantCode": "TARTECOSMETICS",
            "OrderNum": "5013355",
            "RefNumber": "ReferenceTest002111",
            "SKU": "846733012138"
        }
    ]
}