This guide provides a comprehensive explanation of the endpoints and webhooks to help developers manage and track returns for merchants. It covers the return process, best practices for using webhooks and API calls, includes examples for all webhooks, and provides detailed references for each API endpoint. By following this guide, developers can seamlessly integrate these APIs, improving operational efficiency and the customer experience.
The return process within follows a typical lifecycle, from the customer initiating a return to final completion, which may involve refunds, exchanges, or restocking of items. Below is an outline of the return lifecycle:
.1:
- : The customer initiates a return via the merchant's platform.
- : Ingrid Returns creates a new return record, assigning it a unique
returnId
, and the return enters the AWAITING_RETURN
state.
.2:
- : The customer ships the items using a return label or carrier.
- : The return status updates to
IN_TRANSIT
, tracking the item’s journey back to the warehouse.
.3:
- : Upon arrival at the warehouse, the items are inspected.
- : After inspection, items may be approved or rejected, and their status is updated.
.4:
- : If approved, the return moves into
AWAITING_REFUND
or depending on the exchange policyAWAITING_EXCHANGE
. Rejected items will create a warehouse remark in Ingrid Returns Backoffice that needs to be handled.
.5:
- : After processing, the return enters the
COMPLETED
state, and refunds or exchanges are finalized.
.1Customer initiates return
.2Item is shipped
.3Warehouse inspects item
.4Approval/Rejection
.5Refund/Exchange processing
.6Return completed
All API requests require an in the x-api-key
header for authentication. Ensure that the API key is valid and included in every request to the endpoints.
: GET https://api.turnr.se/merchant/return
Fetch a paginated list of returns, with filtering options based on date and ID.
Request Parameters
- :
x-api-key
(string, required): Your API key.- :
afterId
(integer, optional): Include returns created after the specified return ID.afterDate
(string, optional, date-time format): Include returns created after the specified date.page
(integer, required): Page number to retrieve.size
(integer, required): Number of results per page.sort
(array of strings, optional): Sorting criteria for the results.
Example Request
GET https://api.turnr.se/merchant/return?page=1&size=10 HTTP/1.1
:
:
Response Properties
totalPages
(integer): Total number of pages.totalElements
(integer): Total number of return records.size
(integer): Number of records per page.content
(array): List of return records.- Each item in
content
includes: id
(integer): Return ID.createdAt
(string, date-time): Return creation timestamp.status
(string): Current status of the returnstatusUrl
(string): URL for tracking the return status.order
(object):id
(integer): Ingrid Returns order ID.foreignId
(string): External order ID.foreignName
(string): Name or description of the order.foreignNumber
(integer): External order number.createdAt
(string, date-time): Order creation timestamp.
Example Response
{
"totalPages": 5,
"totalElements": 50,
"size": 10,
"content": [
{
"id": 261868,
"createdAt": "2024-09-18T12:00:00Z",
"status": "AWAITING_RETURN",
"statusUrl": "https://tracking.turnr.se/return/261868",
"order": {
"id": 12345,
"foreignId": "23965dbb5e9592ba1c19be0651ee9c5a",
"foreignName": "Order #1001",
"foreignNumber": 1001,
"createdAt": "2024-09-15T09:30:00Z"
}
}
]
}
: GET https://api.turnr.se/merchant/return/{returnId}
Get detailed information about a specific return, including costs, refund transactions, and items involved.
Request Parameters
- :
x-api-key
(string, required): Your API key.- :
returnId
(integer, required): Return ID to retrieve.
Example Request
GET https://api.turnr.se/merchant/return/261868 HTTP/1.1
:
:
Response Properties
id
(integer): Return ID.createdAt
(string, date-time): Return creation timestamp.status
(string): Current status of the returnstatusUrl
(string): URL for tracking the return.order
(object):id
(integer): Ingrid Returns order ID.foreignId
(string): External order ID.foreignName
(string): Name associated with the order.foreignNumber
(integer): External order number.createdAt
(string, date-time): Order creation timestamp.returnCosts
(object):currencyCode
(string): Currency code (e.g., SEK).returnShipmentCost
(number): Shipping cost for the return.returnHandlingCost
(number): Handling cost for the return.totalCost
(number): Total cost of the return.refundTransactions
(array):- Each transaction includes:
foreignId
(string): External refund transaction ID.refundType
(string): Type of refund (e.g., GIFT_CARD, BASIC).currencyCode
(string): Currency used.totalAmount
(number): Total refunded amount.items
(array):- Each item includes:
id
(integer): Item ID.foreignLineItemId
(string): External line item ID.status
(string): Item statuspurchasePriceAmount
(object):currencyCode
(string): Currency used.amount
(number): Price of the item.productVariant
(object):sku
(string): Stock Keeping Unit.productTitle
(string): Product title.variantTitle
(string): Variant title.
Example Response
{
"id": 261868,
"createdAt": "2024-09-26T19:47:01.273523Z",
"status": "AWAITING_RETURN",
"statusUrl": "https://returns.turnr.se/merchant/status/124",
"order": {
"id": 254843,
"foreignId": "980ab3e70810976cfd544fa785ebcba3",
"foreignNumber": 1520547,
"createdAt": "2024-09-23T15:41:29.346454Z"
},
"returnCosts": {
"currencyCode": "EUR",
"returnShipmentCost": 10.00,
"returnHandlingCost": 0,
"exchangeCost": 0,
"failedDeliveryCost": 0,
"totalCost": 10.00
},
"refundTransactions": [],
"items": [
{
"id": 448715,
"foreignLineItemId": "3393728",
"status": "AWAITING_RETURN",
"purchasePriceAmount": {
"currencyCode": "EUR",
"amount": 85.00,
"itemTax": 13.57
},
"productVariant": {
"id": 28580,
"foreignProductId": "33",
"foreignVariantId": "1498-231",
"productNumber": "10005",
"properties": [
{
"type": "Variant",
"code": "1001",
"value": "Black"
},
{
"type": "Size",
"code": "M",
"value": "M"
}
],
"sku": "51009M",
"productTitle": "Black Skirt",
"variantTitle": "Black M"
},
"returnReasons": [
{
"id": 363,
"subReasonId": 496
}
]
}
],
"shipments": [
{
"id": 227022,
"type": "C2B",
"carrier": "DHL_EXPRESS",
"trackingUrl": "https://express.api.dhl.com/mydhlapi/shipments/2521800172/tracking",
"trackingReference": "2521800172",
"customsType": "NO_CUSTOMS"
}
],
"exchanges": []
}
: POST https://api.turnr.se/merchant/items/returned
Update the return status of items after they have been checked at the warehouse. Specify approval status and provide additional comments.
Request Parameters
- :
x-api-key
(string, required): Your API key.- :
foreignOrderId
(string, required): External order ID.returnId
(integer, required): Return ID.trackingReference
(string, optional): Tracking number associated with the return.items
(array, required): List of items being reported.- Each item includes:
sku
(string, required): Stock Keeping Unit.quantity
(integer, required): Quantity being returned.approved
(boolean, required): Approval status after inspection.comment
(string, optional): Additional comments.
Example Request
POST https://api.turnr.se/merchant/items/returned HTTP/1.1
:
:
:
{
"foreignOrderId": "23965dbb5e9592ba1c19be0651ee9c5a",
"returnId": 261868,
"items": [
{ "sku": "100011001M",
"quantity": 1,
"approved": true,
"comment": "Item in perfect condition." }
]
}
Response Properties
status
(string): Operation result, typically "OK"
if successful.
Example Response
json
Copy code
To accurately manage exchange orders for bookkeeping purposes in your store’s ERP system, you can retrieve exchange order details associated with completed returns. This section explains how to fetch exchange order information via the API and integrate it into your accounting processes.
: GET https://api.turnr.se/merchant/return/{returnId}
Retrieve detailed information about a specific return, including any associated exchange orders. It’s recommended to perform this action COMPLETED to ensure all return updates are finalized.
Request Parameters
- :
x-api-key
(string, required): Your API key.- :
returnId
(integer, required): Return ID to retrieve.
Example Request
GET https://api.turnr.se/merchant/return/261868 HTTP/1.1
:
:
• (integer): Return ID.
• (string, date-time): Return creation timestamp.
• (string): Current status of the return. Ensure it is COMPLETED before processing.
• (string): URL for tracking the return.
• (object):
• (integer): Ingrid Returns order ID.
• (string): External order ID.
• (integer): External order number.
• (string, date-time): Order creation timestamp.
• (array): List of exchange orders associated with the return.
• (integer): Exchange ID.
• (string): External draft order ID.
• (string): External order ID for the new exchange order.
• (string): External order number.
• (array): List of exchange items.
items
• (integer): Exchange item ID.
• (integer): Associated original order item ID.
• (object): Original product variant being exchanged.
• (string): SKU of the original item.
• (string): Product title of the original item.
• (string): Variant title of the original item.
• (object): New product variant the customer wants.
• (string): SKU of the new item.
• (string): Product title of the new item.
• (string): Variant title of the new item.
fromProductVarianttoProductVariant
• (integer): Product variant ID.
• (string): External product ID.
• (string): External variant ID.
• (string): Product number.
• (array): List of product properties.
• (string): Stock Keeping Unit.
• (string): Product title.
• (string): Variant title.
Example Response
{
"id": 261868,
"createdAt": "2024-09-26T19:47:01.273523Z",
"status": "COMPLETED",
"statusUrl": "https://returns.turnr.se/merchant/status/124",
"order": {
"id": 254843,
"foreignId": "980ab3e70810976cfd544fa785ebcba3",
"foreignNumber": 1520547,
"createdAt": "2024-09-23T15:41:29.346454Z"
},
"exchanges": [
{
"id": 12345,
"foreignDraftOrderId": "DRAFT12345",
"foreignOrderId": "NEWORDER12345",
"foreignOrderNumber": "1002",
"items": [
{
"id": 67890,
"orderItemId": 448715,
"fromProductVariant": {
"id": 28580,
"foreignProductId": "33",
"foreignVariantId": "1498-231",
"productNumber": "10005",
"properties": [
{
"type": "Color",
"code": "BLK",
"value": "Black",
"imageSrc": "https://example.com/images/black.png",
"hexColor": "#000000",
"translations": {
"en": "Black",
"sv": "Svart"
},
"displayPriority": 1
}
],
"sku": "51009M",
"productTitle": "Black Skirt",
"variantTitle": "Black M"
},
"toProductVariant": {
"id": 28581,
"foreignProductId": "33",
"foreignVariantId": "1498-232",
"productNumber": "10006",
"properties": [
{
"type": "Color",
"code": "BLK",
"value": "Black",
"imageSrc": "https://example.com/images/black.png",
"hexColor": "#000000",
"translations": {
"en": "Black",
"sv": "Svart"
},
"displayPriority": 1
}
],
"sku": "51009L",
"productTitle": "Black Skirt",
"variantTitle": "Black L"
}
}
]
}
]
}
To handle exchange orders in your ERP system for accurate bookkeeping, follow these steps:
1. : Verify that the return’s status is COMPLETED before processing exchange orders.
2. : Use the provided endpoint to get detailed information about the return and associated exchanges.
3. : Access the exchanges array from the response to obtain exchange order details.
4. :
• : Use foreignOrderId and foreignOrderNumber to create or update orders in your ERP system.
• : Log details of both the original items (fromProductVariant) and the new items (toProductVariant) in your accounting records.
• :
• : Adjust stock levels for the new items being sent out to the customer.
• : If applicable, adjust stock levels for the returned items after they have been inspected and restocked.
• :
• : Account for any differences in price between the original and new items.
• : Include any additional handling or shipping costs associated with the exchange.
• : Ensure that tax calculations are accurate based on the exchanged items.
• : Record the exchange transaction in your financial system, ensuring compliance with accounting standards.
5. : Mark the exchange order as processed in your ERP to maintain accurate records.
• : Processing exchanges after return completion ensures that all data is final and accurate.
• : Ensure that all bookkeeping entries comply with local accounting regulations and standards.
• : Properly adjust inventory levels to reflect both the returned items and the new items sent to the customer.
• : Update customer accounts with the exchange details for transparency and future reference.
1. : Optionally, set up webhooks to be notified when a return reaches the COMPLETED status.
2. : Use the returnId to retrieve return details, including exchanges.
3. : Follow the steps outlined above to handle the exchange orders in your ERP system.
4. : Update your records to reflect that the exchange has been processed and accounted for.
By integrating this process into your bookkeeping practices, you can ensure that exchange orders resulting from returns are accurately reflected in your financial and inventory records.
Webhooks allow you to receive real-time notifications when key events occur during the return process. Below are the available webhooks, along with example payloads.
1.
Triggered when a return is created by the customer.
:
{
"type": "RETURN_CREATED",
"triggeredAt": "2024-09-18T12:00:00Z",
"returnId": "261868",
"foreignOrderId": "23965dbb5e9592ba1c19be0651ee9c5a",
"lineItems": [{ "sku": "100011001M", "quantity": 1 }]
}
3. (Post-Inspection)
Triggered after the return has been inspected at the warehouse.
:
{
"type": "RETURN_ARRIVED",
"triggeredAt": "2024-09-18T16:05:17.034470979Z",
"returnId": "261868",
"foreignOrderId": "23965dbb5e9592ba1c19be0651ee9c5a",
"lineItems": [
{
"sku": "100011001M",
"quantity": 1,
"returnedToWarehouseAt": "2024-09-18T16:05:16.964408537Z",
"restockStatus": "NO_RESTOCK",
"approvedForRestock": true
}
]
}
4.
Triggered when the return process is fully completed.
:
{
"type": "RETURN_COMPLETED",
"triggeredAt": "2024-09-18T16:10:42.888799023Z",
"returnId": "261868",
"foreignOrderId": "23965dbb5e9592ba1c19be0651ee9c5a",
"lineItems": [
{
"sku": "100011001M",
"quantity": 1,
"returnedToWarehouseAt": "2024-09-18T16:05:16.964408537Z",
"refundStatus": "REFUNDED",
"approvedForRestock": true
}
]
}
.1: When a webhook is received (e.g., RETURN_CREATED
), extract the returnId
from the payload.
.2: Use the returnId
to call GET https://api.turnr.se/merchant/return/{returnId}
for comprehensive details.
.3: Update your system with the latest return information.
:
- : Immediate notification of return events.
- : Reduces unnecessary API calls.
:
- : Ensure webhook authenticity by validating signatures.
- : Always secure your webhook endpoints.
If webhooks cannot be used, implement a polling mechanism:
.1: Regularly call GET https://api.turnr.se/merchant/return
to check for new or updated returns.
.2: Apply afterId
or afterDate
parameters to retrieve only recent data.
:
- : Updates are not real-time.
- : More frequent API calls.
- : Return created, awaiting processing.
- Return created, awaiting handling.
- : Return approved, refund is pending.
- : Return process is finalized.
- : Return was cancelled.
- : Items are undergoing quality inspection.
- : Additional check due to a complaint.
- : Item returned, awaiting processing.
- Return created, awaiting consumer to hand in the package to carrier.
- : Items are in transit back to the warehouse.
- : Awaiting manual inspection.
- : Item have arrived and are awaiting inspection.
- : Undergoing quality inspection.
- : Successfully returned and processed.
- : Item lost during shipment. If all items are marked in this state, the refund process will proceed as normal.
- : Return request cancelled.
- : The customer keeps the item, no return shipment is booked. If all items are marked in this state, the refund process will proceed as normal.
- : Item exchanged, no refund issued.
- : Refund is pending.
- : Refund has been issued.
- : Processed outside of Ingrid Returns.
- : Refund issued as store credit.
- : Standard refund to original payment method.