Returns via API
As part of Global-e's comprehensive solution, Global-e delivers a Returns Portal branded with the merchant logo and theme as well as a unique URL to access your Returns Portal.
Merchants who have their own returns portal and third party return shipment providers can use Global-e Return APIs to integrate functionality for Global-e return shipping options, as well as to obtain required return documents and manage tracking information.
For a new third-party integration please contact your representative at Global-e.
Functional documentation
Global-e Return API’s are designed to provide a comprehensive solution for the return flow.
Global-e Return APIs
GetReturnShippingOptions API - used to receive essential return information, including a list of return shipping methods available for a specific order and associated costs.
GetReturnDocuments API - used to receive return documents and related information, including the label, the tracking number, the tracking URL, the shipper’s name, the commercial invoice (if relevant), the RMA number, and the return note.
GetTrackingEvents API - used to receive status events on the delivery status of an order.
High-level flow
Following is the recommended high-level workflow for the product(s) return process.
Shopper initiates a return, usually using an Order ID and an Email.
Shopper selects the return product(s) and the reason(s) for his return.
Returns Portal calls GetReturnShippingOptions API to receive a list of available return shipping methods and their associated price configured on Global-e.
Return Portal displays the available return shipping methods, the associated shipping cost and the amount that would be refunded to the shopper after the shipping cost deduction.
The return shipping price received from Global-e via the API can be overridden by the Returns Portal.
Additional refund\credit methos, such as store credit, can be offered to the shopper.
Once the shopper selects the desired return shipping method, the Returns Portal calls GetReturnDocuments API to generate a Global-e RMA and receive all the required return documents.
Global-e returns all the required documents as a single PDF file including tracking information, if relevant.
Returns Portal shows a confirmation page indicating the return was issued with the documents available for download.
Global-e sends an RMA email (a return request confirmation email) to the shopper with the relevant documents attached.
The RMA email can be disabled on the Global-e side and managed by the Returns Portal. To disable it please refer to your Global-e representative.
Shopper ships the return package using the return documents.
Optional: the Returns Portal calls the Tracking Events API to get all the tracking events for a given tracking number. (Not all returns are trackable)
Based on the merchant policy, the shopper should be refunded for the returned items (after shipping cost deduction). The merchant\returns portal can use standard Global-e functionality with Refund APIs.
For more information, see:
GetReturnShippingOptions
The Return Shipping Options API provides essential return information, including a list of return shipping methods and costs.
Important
Global-e must enable and configure this API on the Global-e side.
Method/URL
POST https://{globale_api_domain}/Return/GetReturnShippingOptions
Parameters
Request Parameters
Name | Type | Description | Mandatory |
---|---|---|---|
| String | 10-character code. Default is EN Maximum: 10 characters. | No |
| String | The currency of the return prepaid shipping cost. 3-char ISO currency code. The default should be as the origin order currency If the submitted order currency is not the same as the (outbound) order, apply the currency exchange. | No |
| String | No | |
| String | Unique Global-e Order ID or Merchant Order ID Maximum: 100 characters. | Yes |
| String | Provider name that identifies the source of the request. | Yes |
| Array of<Products> | Each product object has the following fields:
| Yes |
| Long | Provides the ID of the return shipping method. | No |
Response Parameters
Name | Type | Description | Mandatory |
---|---|---|---|
| Double | The cost of the shipment | Yes |
| String | 3-letter currency ISO code | Yes |
| Boolean | Whether this is a label-free return (QR code only). Only applicable to the | No |
| Boolean | True for carriers that Global-ehas Tracking events integrations with. False for carriers for which Global-e does not support Tracking capabilities. | Yes |
| String | Merchant Order Id Maximum: 100 characters | Yes |
| String | Global-e Order Id Maximum: 100 characters | Yes |
| The Contains the following values:
| ||
| Array of <ReturnShippingMethods> | | |
| String | Yes | |
| Int | The shipping method identifier. Can be used when calling GetReturnDocuments to receive the return document for the selected shipping method. | Yes |
| String | Yes | |
| String | The name of the shipping service of the return provider | Yes |
Examples
Request Example
{ "ProviderCode": "ExampleProvider", "OrderId": "EUQA6215359", "Email": [email protected], "ReturnedProducts": [ { "ProductCode": "433117270672", "ReturnQuantity": 1 } ] }
Response Example
{ "IsSuccess": true, "Data": { "OrderId": "GE10470948238NL", "MerchantOrderId": "EUQA6215359", "ReturnShippingMethods": [ { "ShippingMethodId": 40044878, "ShippingMethodDescription": "DHL-GlobalE", "ShippingMethodType": "Express Courier (Air)", "ShipperName": "DHL", "IsQrLabel": false, "IsTrackable": true, "Cost": 0.0, "Currency": "EUR" } ], "ReturnShippingDestinationDetails": { "Country": "Netherlands", "City": "Amsterdam", "Address": "Ood 5", "Zip": "4751XK", "StateOrProvince": "", "Email": [email protected], "Phone": "310610887191" } }
Error Codes
Code | Message | Description |
---|---|---|
E01 | Could not find an available shipping method | No shipping method was found for the submitted products and quantities |
E02 | Return is not allowed due to order status %Order Status% | Allowed Return Statuses |
E03 | Order ID not found | Returned if the provided OrderId cannot be found for the merchant |
E04 | Currency is invalid |
|
E05 | There are multiple orders with this orderID %orderID% | |
E06 | The ReturnShippingMethodId %ReturnShippingMethodId% is invalid | |
ME01 | Input value for ProductCode is invalid | |
ME02 | Input value for CartItemId is invalid | |
ME03 | Input value for ReturnQuantity is invalid | |
ME06 | Input value for OrderId is Invalid | |
ME07 | Input value for Email is invalid | |
ME09 | Input value for ReturnedProducts is invalid | |
ME10 | Input value for CultureCode is invalid | |
ME12 | Input value for CurrencyCode is invalid | |
ME13 | Input value for ProviderCode is invalid | |
SME15 | Input value for ReturnShippingMethodId is invalid | |
PE01 | Unable to process this request as the returns period has expired for product %Product% | Can enable this error code through configuration. |
PE02 | Return product %Product% was not found for order | |
PE03 | Product %Product% is not Returnable | |
PE04 | Requested return product quantity was not delivered to customer %Customer% | |
PE05 | Requested return product is virtual ({0}) | |
PE06 | Requested return product contains dangerous goods ({0}) | |
PE07 | Requested return product quantity is zero ({0}) | |
PE08 | OrderProduct was not found for requested return product ({0}) | |
PE09 | Child return product was requested without parent product ({0}) | |
PE10 | Order product delivery quantity is zero ({0}) | |
PE11 | Order product unit sale price is zero ({0}) | |
PE13 | Return products collection has duplication | |
PE14 | Return products collection is empty |
Classes
GetReturnDocuments
Use the GetReturnDocuments API to integrate the return documents capability into your Returns Portal or through a third party returns provider.
Important
Global-e enables and configures this API on the Global-e side.
The API provides return documents and related information, including the label, the tracking number, the tracking URL, the shipper name, the commercial invoice (if relevant), the RMA number, and the return note. In addition, as part of the process, Global-e produces a Global-e RMA. If so requested by a merchant, Global-e can disable sending RMA information to the merchant through configuration on the Global-e side.
Note
Electronic invoices are not returned.
Method/URL
POST https://{globale_api_domain}/Return/GetReturnDocuments
Parameters
Request Parameters
Field | Type | Description | Mandatory |
---|---|---|---|
| String | The currency of the returned prepaid shipping cost. 3-character ISO code. |
|
| String | The language for the Return Note document. 3-character ISO code. Currently, English is the only supported language. | No |
| String | The customer's email address. Maximum 100 characters. | No |
| Bool | Indicates if return is created for service | No |
| String | The Merchant's internal RMA Number. Maximum 200 characters. | No |
| String | The order unique ID. Maximum 100 characters. | Yes |
| String | The Provider's name identifies the source of the request. | Yes |
| Merchant hub delivery address with return details. | No | |
| Array | An array of returned products' details. Contains array of ReturnedProducts.:
| Yes |
| Integer | Based on the end customer's selected shipping method, as returned in the Get Return Shipping Options response. If empty, Globale uses the cheapest method based on the return shipping type id (or self-postage if configured) | No |
| Integer | Possible values:
| No |
| Decimal | The prepaid shipping cost associated with the return. If not provided, then the ShippingCost will be the configured prepaid/flat return rate. | No |
Response
Upon successful returns the required documents for the return.
Response Parameters
Name | Type | Description |
---|---|---|
| Boolean | True: If the API call is successful. False: If the API call fails. |
| Class Data | Data regarding the return, including:
|
Examples
Request Example
curl --location 'https://[globale domain]/Return/GetReturnDocuments' \ --header 'MerchantGUID: D2ED2A7F-F6ED-4CCB-B611-B44AC8D02250' \ --header 'Content-Type: application/json' \ --data-raw '{ "ProviderCode": "Loop", "OrderId": "GE314856569TS", "Email": "[email protected]", "MerchantRMANumber": "RM132", "ShippingCost": 10.0, "CurrencyCode": "USD", "ReturnShippingTypeId": 2, "ReturnShippingMethodId": null, "ReturnedProducts": [ { "ProductCode": "DKB500680.M8", "CartItemId": null, "ReturnQuantity": 1, "MerchantReturnReasonCode": "", "MerchantReturnReasonDescription": "Return Reason from GRD request for product 1" }, { "ProductCode": "B7ECS.C8", "CartItemId": 1, "ReturnQuantity": 1, "MerchantReturnReasonCode": "TTT", "MerchantReturnReasonDescription": "Return Reason from GRD request for product 2" } ] }'
Response Example
Success
{ "IsSuccess": true, "Data": { "OrderId": "GE314856569TS", "MerchantOrderId": "314856569", "GlobaleRmaNumber": "371104", "ReturnTrackingDetails": { "TrackingNumber": "1ZXXXXXXXXXXXXXXXX", "TrackingURL": "https://wwwapps.ups.com/tracking/tracking.cgi?tracknum=1ZX&requester=ST/", "IsQrLabel": "false", "IsTrackable": true }, "ReturnDocuments": [ { "DocumentTypeCode": "ShippingLabel", "DocumentTypeName": "Shipping Label", "DocumentData": "AQCkosNhECNeAACYzH/NIA5NgtHU2QAAAABJRU5ErkJggg==", "URL": "https://[MerchantDomain]/url" } ] }, }
Failure
{ "Code": "error code", "Error": "error message", "Description: "error description" }
Example 1
"IsSuccess": false, "Errors": [ { "Code": "E500", "Error": "We encountered an unexpected error and are working to resolve the issue”, "Description": null, "Success": false } ] }
Example 2
{ "IsSuccess": false, "Errors": [ { "Code": "PE27", "Error": "Return products collection has duplication", "Description": null, "Success": false }, { "Code": "PE07", "Error": "Return product (DKB500680.M8) was not found for order", "Description": null, "Success": false }, { "Code": "PE07", "Error": "Return product (B7ECS.C8) was not found for order", "Description": null, "Success": false } ] }
Error Codes
Code | Message | More Information |
---|---|---|
E01 | Could not create the shipping label. | Note: Not applicable to the self-postage option. |
E02 | The return is not allowed due to the order status ({0}) | Note: for more information, see Allowed Return Statuses Global-e can configure if to enable the E02 error code and validate the order status. |
E03 | The Order ID was not found | |
E04 | There is already an RMA request for this order ({0}) | |
E07 | The return is not allowed due to the parcel status ({0}). | Note: for more information, see Allowed Return Statuses. |
E08 | Unable to find the shipping method for the provided return shipping method Id ({0}) | Note: for more information, see Return Shipping Service Types. |
E09 | The provided ReturnShippingTypeId is not valid ({0}) | Note: for more information, see Return Shipping Service Types. |
E10 | There are multiple orders with this Order ID ({0}) | |
E11 | No shipping options were found for the order return ({0}) | |
E12 | The return shipping address was not found for order ({0}) | |
E13 | Invalid currency code for the provided shipping cost for order ({0}) | |
E14 | The return shipping cost cannot be a negative number | |
E15 | The return shipping cost is greater than the return product price | |
E16 | Return address country code is not valid | |
E17 | Return address state code is not valid or does not belong to the country")] ReturnAddressStateIsNotValid | |
E18 | Return address country is not allowed for given order")] ReturnAddressCountryIsNotAllowed | |
E19 | MerchantRMANumber is required | |
E20 | ReturnShippingMethodId is required for provider ({0}) |
Product Errors
Code | Message | More information |
---|---|---|
PE01 | Unable to process this request as the returns period has expired for the product ({0}) | Global-e can enable the PE01 error, and whether to enable validation for expired return periods, through configuration. |
PE02 | The return product ({0}) was not found for the order | |
PE03 | Product ({0}) is not returnable | |
PE04 | The requested return product quantity was not delivered to customer ({0}) | |
PE05 | The requested return product is virtual ({0}) | |
PE06 | The requested return product contains dangerous goods ({0}) | |
PE07 | The requested return product quantity is zero ({0}) | |
PE08 | The OrderProduct was not found for the requested return product ({0}) | |
PE09 | The child return product was requested without the parent product ({0}) | |
PE10 | The order product delivery quantity is zero ({0}) | |
PE11 | The order product unit sale price is zero ({0}) | |
PE12 | The return reason code was not found for the requested product ({0}) | |
PE13 | The return product collection has duplications | |
PE14 | The return product collection is empty |
Model Validation Errors
Code | Message |
---|---|
ME01 | The input value for ProductCode is Invalid |
ME02 | The input value for CartItemId is Invalid |
ME03 | The input value for ReturnQuantity is Invalid |
ME04 | The input value for MerchantReturnReasonCode is Invalid |
ME05 | The input value for MerchantReturnReasonDescription is Invalid |
ME06 | The input value for OrderId is Invalid |
ME07 | The input value for Email is Invalid |
ME08 | The input value for ReturnShippingTypeId is Invalid |
ME09 | The input value for ReturnedProducts is Invalid |
ME10 | The input value for CultureCode is Invalid |
ME11 | The input value for MerchantRMANumber is Invalid |
ME12 | The input value for CurrencyCode is Invalid |
ME13 | The input value for ProviderCode is Invalid |
ME14 | The input value for ShippingCost is Invalid |
ME15 | The input value for ReturnShippingMethodId is Invalid |
ME16 | "Input value for ReturnAddress.CompanyName is required")] |
ME17 | Input value for ReturnAddress.FirstName is required |
ME19 | Input value for ReturnAddress.City is required |
ME20 | Input value for ReturnAddress.PostalCode is required |
ME21 | Input value for ReturnAddress.CountryCode is required |
ME22 | Input value for ReturnAddress.CompanyName exceeds the 100-character limit |
ME23 | Input value for ReturnAddress.FirstName exceeds the 500-character limit |
ME24 | Input value for ReturnAddress.LastName exceeds the 500-character limit |
ME25 | Input value for ReturnAddress.Email exceeds the 500-character limit |
ME26 | Input value for ReturnAddress.Phone1 exceeds the 50-character limit |
ME27 | Input value for ReturnAddress.Phone2 exceeds the 50-character limit |
ME28 | Input value for ReturnAddress.Fax exceeds the 50-character limit |
ME29 | Input value for ReturnAddress.City exceeds the 100-character limit |
ME30 | Input value for ReturnAddress.StateOrProvince exceeds the 100-character limit |
ME31 | Input value for ReturnAddress.StateCode exceeds the 10-character limit |
ME32 | Input value for ReturnAddress.PostalCode exceeds the 50-character limit |
ME33 | Input value for ReturnAddress.CountryCode exceeds the 2-character limit |
Classes
Allowed Return Statuses
To initiate a return, the order or package must bear one of the specified permissible statuses below.
Return Statuses for Regular Orders (Non-split Orders)
Delivered to customer
Delivered to store
Dispatched to customer
Returned to store
Allowed Return Statuses for Spilt Orders
Delivered to customer
Delivered to store
Dispatched to customer
Returned to Store
Part dispatched (the rest to follow) and payment received.
Part dispatched and part refunded
Tracking Events API
Prerequisites
The request can include a list of global-e order IDs, a list of tracking events, or both, but all the same type: Inbound or Outbound. Each request can report on either inbound orders or outbound, but not both. For requesting inbound and outbound tracking events, two different requests should be issued.
GetTrackingEvents
The Get Tracking Events API lets you receive status events on the delivery status of an order. Reporting of tracking events allows both our customers and 3rd parties to stay informed about the exact location and status of returned items throughout the entire external return journey.
With that, having tracking events for return shipments allows to trigger refunds automatically upon confirmation of returned item receipt (or any other tracking event).
The API accepts one or more order ID numbers, up to 100, on a single call, a list of either orders moved to forward shipments, after checkout completion (outbound), or returns (inbound) and returns their status.
Method/URL:
POST https://{globale_api_domain}/Shipment/GetTrackingEvents
Request Parameters
Parameter | Type | Description | Mandatory |
---|---|---|---|
| DateTime | Date and time for the earliest time of the order shipment status, UTC, in RFC 2822 format (for example, Fri, 8 Aug 2014 17:13:07 +0000). | No |
| List of strings | List of Global‑e Order IDs. Up to 100 in each request. Note: each Max length:100 chars. | One of either |
| List of strings | List of Global‑e tracking numbers. Up to 100 in each request, with prefix | Conditional |
| String | The shipment direction. One of the following:
| Yes |
Response Parameters
Parameter | Type | Description | Mandatory |
---|---|---|---|
| List<FailedTrackingNumbers> | List of objects containing detailed error information. The object includes:
| |
| Class SuccessfulTrackingNumbers | The events for each
|
Examples
Request
Request for only for GE orders:
{ "EventSinceInUTC": "2023-01-01 00:04:23", "Type": "outbound", "OrderIds": [ "GE381652418TS" ], "TrackingNumbers":[ ]}
Response
{ "Data": { "SuccessfulTrackingNumbers": [ { "GlobaleOrderID": "GE381652418TS", "MerchantOrderID": "381652418", "GlobaleParcelCode": "240324091851129-P1", "GlobaleRMANumber": "2832849023948", "MerchantRMANumber": "832849932893", "IsTrackingNumberActive": true, "TrackingNumber": "GE381652418TS2864637A0", "Type": "outbound", "TrackingUrl": "https://mailingtechnology.com/tracking/?tn=GE381652418TS2864637A0", "ShipperName": "Spring XBS Packet Registered-GlobalE", "TrackingEvents": [ { "ShipperEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "TrackingEventDateTimeInUTC": "2024-03-24T09:19:08", "GlobaleEventCode": "1", "GlobaleEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "ShipperEventCode": "0", "TrackingEventStatus": [], "Location": { "FullAddress": null } } ] }, { "GlobaleOrderID": "GE381652418TS", "MerchantOrderID": "381652418", "GlobaleParcelCode": "240324091851211-P2", "GlobaleRMANumber": "0239283284948", "MerchantRMANumber": "8884994993293", "IsTrackingNumberActive": true, "TrackingNumber": "GE381652418TS2864637A0", "Type": "outbound", "TrackingUrl": "https://mailingtechnology.com/tracking/?tn=GE381652418TS2864637A0", "ShipperName": "Spring XBS Packet Registered-GlobalE", "TrackingEvents": [ { "ShipperEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "TrackingEventDateTimeInUTC": "2024-03-24T09:19:16", "GlobaleEventCode": "1", "GlobaleEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "ShipperEventCode": "0", "TrackingEventStatus": [], "Location": { "FullAddress": null } } ] }, { "GlobaleOrderID": "GE381652418TS", "MerchantOrderID": "381652418", "GlobaleParcelCode": "24032409185195-P3", "GlobaleRMANumber": "2418039843948", "MerchantRMANumber": "4993983832893", "GlobaleParcelCode": "24032409185195-P3", "IsTrackingNumberActive": true, "TrackingNumber": "GE381652418TS2864637A0", "Type": "outbound", "TrackingUrl": "https://mailingtechnology.com/tracking/?tn=GE381652418TS2864637A0", "ShipperName": "Spring XBS Packet Registered-GlobalE", "TrackingEvents": [ { "ShipperEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "TrackingEventDateTimeInUTC": "2024-03-24T09:19:17", "GlobaleEventCode": "1", "GlobaleEventDescription": "The parcel has been created but is waiting to be manifested (i.e. despatched)", "ShipperEventCode": "0", "TrackingEventStatus": [], "Location": { "FullAddress": null } } ] } ], "FailedTrackingNumbers": [ { "OrderId": "ABC123", "TrackingNumber": "123", "ErrorInfo": { "Code": "E06", "Error": "The tracking number (123) is not associated with the merchant", "Description": null }, "Success": false } ] }, "Errors": null }