The ReturnLogic API uses bearer tokens to authenticate requests. You must pass
the token in the Authorization
HTTP request header.
Authorization: Bearer {{your token here}}
Your public app must have a redirect url that is set up to accept the following query string parameters:
code
- The authorization code generated after a successful installationteamId
- The unique identifier of the retailer that installed your appWhenever a retailer installs your app, we will redirect the retailer to your URL with the auth code and the teamId appended in the query string.
https://www.your-public-app.com/app/authorize_redirect?code=a22bcde12345&teamId=36bd1371-1eac-40d3-92f4-065982ff9d3f
Use the code provided and make an HTTP POST request to https://api.returnlogic.com/v1/oauth with the following body:
{
"grant_type": "authorization_code",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"code": "a22bcde12345"
}
You'll receive a Bearer token and a Refresh token:
{
"bearer_token": "uebjkefgh84372",
"refresh_token": "buelfxkdezxc10392"
}
The bearer token can be used to make API requests. The refresh token can be used to generate new bearer tokens when they expire.
It is your responsibility to keep track of bearer tokens for each retailer that installs your application.
Any API call could return an error:
401
- Unauthorized400
- Bad Request429
- Rate Limit Exceeded503
- Down For MaintenanceThe default rate limit for a ReturnLogic API key is 2 requests per second and
120 requests per minute. If an API request exceeds the rate limit, the API
will return a 429 Rate Limit Exceeded
response. The following HTTP headers
will be present on all API responses to help you stay within the limit.
X-RateLimit-Limit-Second
: maximum number of calls client can make in 1 secondX-RateLimit-Limit-Minute
: maximum number of calls client can make in 1 minuteX-RateLimit-Remaining-Second
: remaining number of calls client can make in 1 secondX-RateLimit-Remaining-Minute
: remaining number of calls client can make in 1 minuteGet a list of Orders
skip | integer <int32> >= 0 Default: 0 Number of items to skip over |
limit | integer <int32> [ 1 .. 250 ] Default: 20 Limit on number of items to return |
orderNumber | string Find Orders by order number |
orderName | string Find Orders by order name |
string Find Orders by email address. Case insensitive, exact match only. | |
minCreateDate | string <date-time> Find Orders created on or after this date |
maxCreateDate | string <date-time> Find Orders created on or before this date |
financialStatus | string (OrderFinancialStatus) Enum: "authorized" "paid" "partially_paid" "pending" "refunded" "voided" "ThirdParty" Find Orders by their financial status |
[- {
- "rlOrderId": 87654,
- "externalOrderId": "1456032",
- "externalSource": "Shopify",
- "createDate": "2022-05-23T16:57:54.684Z",
- "updateDate": "2022-05-25T16:57:54.684Z",
- "externalCreateDate": "2022-05-23T16:57:54.684Z",
- "externalUpdateDate": "2022-05-25T16:57:54.684Z",
- "billingAddress": {
- "address1": "395 St Johns Church Rd",
- "address2": "",
- "city": "Camp Hill",
- "region": "Pennsylvania",
- "regionCode": "PA",
- "postcode": "17011",
- "country": "United States Of America",
- "countryCode": "US"
}, - "shippingAddress": {
- "address1": "395 St Johns Church Rd",
- "address2": "",
- "city": "Camp Hill",
- "region": "Pennsylvania",
- "regionCode": "PA",
- "postcode": "17011",
- "country": "United States Of America",
- "countryCode": "US"
}, - "customerEmail": "admin@returnlogic.com",
- "customerPhone": "111-111-1111",
- "orderName": "RL1234",
- "orderNumber": "1234",
- "gateway": "Paypal",
- "subtotalPrice": 30.5,
- "totalPrice": 40,
- "shippingPrice": 5.95,
- "fees": 0,
- "orderLevelDiscount": 0,
- "taxPrice": 3.55,
- "taxesIncluded": false,
- "refundAmount": 0,
- "shippedAt": "2022-05-24T16:57:54.684Z",
- "shopCurrencyCode": "USD",
- "tags": [ ],
- "fulfillmentStatus": "fulfilled",
- "isPseudo": false,
- "discounts": [
- {
- "rlOrderDiscountId": 60294,
- "rlOrderId": 87654,
- "externalOrderId": "1456032",
- "amount": 5,
- "code": "SUMMERFUN",
- "isShippingDiscount": false
}
], - "orderItems": [
- {
- "rlOrderItemId": 913743,
- "rlOrderId": 87654,
- "externalOrderItemId": "3049177",
- "externalProductId": "4922",
- "createDate": "2022-05-23T16:57:54.684Z",
- "updateDate": "2022-05-25T16:57:54.684Z",
- "sku": "10015204",
- "displayName": "Bike",
- "productExists": true,
- "quantity": 2,
- "pricePerItem": 18,
- "discountPerItem": 2.75,
- "actualPricePerItem": 15.25,
- "taxPerItem": 1.52,
- "totalPrice": 36,
- "totalDiscount": 5.5,
- "totalTax": 3.04,
- "isTaxable": true,
- "fulfillableQuantity": 0,
- "fulfillmentStatus": "fulfilled",
- "isGiftCard": false,
- "properties": [ ],
- "refundQuantity": 0,
- "grams": 2000,
- "discounts": [ ]
}
]
}
]
Create a new order
externalOrderId required | string The ID of the order on the ecommerce platform (i.e. Shopify) |
externalCustomerId | number <double> The ID of the customer who placed the order on the ecommerce platform (i.e. Shopify) |
customerEmail | string The email provided when creating this order. |
customerPhone | string The customer phone provided when creating this order. |
orderNumber required | string Order number provided to the customer to identify the order. Used to initiate RMAs. |
orderName required | string Order name provided to the customer to identify the order. Can be used to initiate RMAs. |
object (Address) | |
object (Address) | |
fulfillmentStatus | string (OrderFulfillmentStatus) Enum: "fulfilled" "partial" "restocked" |
financialStatus | string (OrderFinancialStatus) Enum: "authorized" "paid" "partially_paid" "pending" "refunded" "voided" "ThirdParty" |
externalSource | string Name of ecommerce platform where order was originally created |
sourceType | string How the order was collected, i.e. web, pos, in-store |
shippedAt | string <date-time> Date the order was shipped. |
tags required | Array of strings A list of tags on the order. |
taxesIncluded required | boolean Are taxes included in the price of the order items. |
shopCurrencyCode required | string <= 3 characters 3 letter code of the currency used by the store. // TODO currency code ISO standard? |
totalPrice required | number <double> Amount billed to customer after applying discounts, taxes, shipping, and other fees |
fees required | number <double> Additional fees added to order not reported on order items |
taxPrice required | number <double> Amount of tax applied to order |
shippingPrice required | number <double> Cost of shipping |
refundAmount required | number <double> Total value refunded to order |
externalCreateDate | string <date-time> Date order was created on ecommerce platform |
externalUpdateDate | string <date-time> Date order was updated on ecommerce platform |
gateway | string Payment gateway used to process the order |
Array of AddProductToOrderRequest (object) or AddCustomItemToOrderRequest (object) (AddOrderItemToOrderRequest) Array of order items to create | |
Array of objects (OrderDiscountAttributes) Array of order discounts to create |