Skip to main content

Documentation Portal

Return Methods

 

GetReturnDocuments

Overview

Use the GetReturnDocuments API to integrate the return documents capability into your returns portal or through a 3rd party returns provider.

The Return Documents API provides all relevant return documents and 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, Global-e creates a Global-e RMA. Note: Most invoices are electronic and are not returned.

Note: Electronic invoices are not returned.

Important

Global‑e enables and configures this API on the Global‑e side.

Request

Endpoint URL

POST {globale domain}/Return/GetReturnDocuments
Request Structure

Field

Type

Mandatory

Description

ProviderCode

String

Yes

The Provider's name used to identify the source of the request.

OrderId

String (100)

Yes

OrderId

Email

String (100)

Yes

The customer's email address

MerchantRMANumber

String (200)

No

The Merchant's internal RMA Number

ShippingCost

Decimal

No

The prepaid shipping cost associated with the return.

If not provided, then the ShippingCost will be the configured prepaid/flat return rate.

CurrencyCode

String (3)

Yes (*) See Description

The currency of the returned prepaid shipping cost

(*) Mandatory: Yes, if the ShippingCost parameter is greater than 0.

ReturnShippingTypeId

Integer

Yes

Possible values:

1 - Returns an appropriate validation error. See Error Code.

2 - Prepaid

3 - Local Prepaid Courier

4 - Local Prepaid

ReturnShippingMethodId

Integer

No

Based on the end customer's selected shipping method, as it appears in the Get Return Shipping Options response.

If empty, Global‑e uses the cheapest method based on the return shipping type id.

CultureCode

String (10)

No

The preferred language for the Return Note document.

Currently, English is the only supported language.

ReturnedProducts

Array

Yes

An array of returned product objects

ReturnedProducts

ReturnedProducts (array <ReturnedProducts>) of ReturnedProduct objects for this return.

Field

Type

Mandatory

Description

ProductCode

String (600)

Yes

The ProductCode used to identify the product

CartItemId

Integer

No

Identifier of the cart item

ReturnQuantity

Integer

Yes

Requested quantity to return of the product

MerchantReturnReasonCode

String (100)

No

The code of the reason for the product return on the Merchant site.

MerchantReturnReasonDescription

String (100)

Yes

The description of the reason for the return on the Merchant site

Response

Upon successful API call, the API returns the required documents for the return.

If the API call fails, the API returns ErrorInfo.

Response Structure

Field

Type

Description

IsSuccess

bool

True: If the API call is successful.

False: If the API call fails.

Data

Field

Type

Description

OrderId

String (100)

The Global‑e Order ID

MerchantOrderId

String (100)

The Merchant Order ID

GlobaleRMANumber

String (100)

The Global‑e RMA Number

MerchantRMANumber

String (100)

The Merchant RMA Number

ReturnTrackingDetails (Object)

The ReturnTrackingDetails Object contains the tracking information of the return.

Field

Type

Description

TrackingNumber

String

Reference number valid for the tracking service used by the shipper for this return.

TrackingURL

String

Full tracking URL of the tracking service site used by the shipper.

ShipperName

String

The Shipping service name of the return provider.

IsQrLabel

bool

Optional: Whether this is a label-free return (QR code only).

This is only applicable to the ShippingLabel object.

IsTrackable

bool

True for carriers for which Global-e supports tracking capabilities and tracking events.

False for carriers for which Global‑e does not support Tracking capabilities

ReturnDocuments (Array)

The ReturnDocuments returns the following documents individually or unified, as a single multi-page document.

  • A Commercial Invoice (if the electronic invoice is not supported)

  • A Shipping Label

  • A Return Note

Field

Type

Description

DocumentData

String

Base64 file type representing the document file content

URL

String

Uri of the document

DocumentTypeCode

String

The code value of the document type. This value can be:

  1. ShippingLabel

  2. ReturnNote

  3. CommercialInvoice

  4. CombinedReturnDocuments (if UnifiedAllDocumentsUnderOneFile = true)

Each document should contain just the relevant content and with relevant copies.

Examples:

The return note PDF should have only the return note in it without additional documents.

The ReturnCommercialInvoice should have the return commercial invoice with the correct number of copies.

DocumentTypeName

String

The name of the document type, e.g. ShippingLabel, ReturnNote or CommercialInvoice (unless the invoice is electronic, no invoice is returned).

General API Error as ErrorInfo

ErrorInfo

{
     "Code": "error code", 
     "Error": "error message", 
     "Description: "error description"
}

Structure

Field

Type

Description

Code

String

Error code

Error

String

Error message

Description

String

Error description

For the list of errors, see Error Code

Samples
Request Sample
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",
			"ProductSecondaryCode": "",
			"CartItemId": null,
			"ReturnQuantity": 1,
			"MerchantReturnReasonCode": "",
			"MerchantReturnReasonDescription": "Return Reason from GRD request for product 1"
		},
		{
			"ProductCode": "B7ECS.C8",
			"ProductSecondaryCode": "",
			"CartItemId": 1,
			"ReturnQuantity": 1,
			"MerchantReturnReasonCode": "TTT",
			"MerchantReturnReasonDescription": "Return Reason from GRD request for product 2"
		}
	]
}'
Success Sample
{
    "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"
            }
        ]
    },
    "Errors": null
}
Failure Sample

Example 1

{
    "IsSuccess": false,
    "Data": null,
    "Errors": [
        {
            "Code": "E500",
            "Error": "We encountered an unexpected error and are working to resolve the issue."
        }
    ]
}

Example 2

{
    "IsSuccess": false,
    "Data": null,
    "Errors": [
        {
            "Code": "PE27",
            "Error": "Return products collection has duplication"
        },
        {
            "Code": "PE07",
            "Error": "Return product (DKB500680.M8) was not found for order"
        },
        {
            "Code": "PE07",
            "Error": "Return product (B7ECS.C8) was not found for order"
        }
    ]
}
Error Code

Error Code

Error Message

For more information, see:

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})

Allowed Return Statuses

E03

The Order ID was not found

E04

There is already an RMA request for this order ({0})

E05

There are multiple orders with these details ({0})

E06

The return is not allowed due to the parcel status ({0})

Allowed Return Statuses

E07

Unable to find the shipping method for the provided return shipping method Id ({0})

Return Shipping Service Types

E08

The provided ReturnShippingTypeId is not valid ({0})

Return Shipping Service Types

E09

There are multiple orders with this Order ID ({0})

E10

No shipping options were found for the order return ({0})

E11

The return shipping address was not found for order ({0})

E12

Invalid currency code for the provided shipping cost for order ({0})

E13

The return shipping request failed 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

UpdateRMA

Call the UpdateRMA API to set or update the MerchantRMANumber and send an email to the customer.

SAMPLE

Body:

{
    “OrderId”: ”12345”, (optional)
    “MerchantOrderId”: ”09876”, (optional)
    ”RMANumber”: ”852147”, 
    ”MerchantRMANumber”: ”265646925”
}

URL:

https://{server_name}/Return/UpdateRMA?merchantGUID= F3BE2R-8546-FC38-90SJ-1C780SG8F90SBS

ACCEPTS

UpdateRMANumber updateRMANumber

RETURNS

HttpResponseMessage class