Get return orders
const url = 'https://order.shopgate.io/v1/merchants/example/returnOrders?sort=&limit=100&offset=0&getOriginalImageUrls=false';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://order.shopgate.io/v1/merchants/example/returnOrders?sort=&limit=100&offset=0&getOriginalImageUrls=false'Get return orders
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Unique merchant code which represents the unique “merchant account”.
Query Parameters
Section titled “Query Parameters”Filters as JSON string to be applied. Available filters are orderNumber, externalCode, salesOrderNumber,
name, status, fulfillmentMethod, locationCode, createDate, submitDate, completeDate, customerId.
Available fields: lineItems, salesOrder
Sorting of orders
Items per page, for pagination, default is 10, max is 100
Offset for pagination, default is 0
Request original image URLs for LineItem product images.
Responses
Section titled “Responses”object
object
External order id
Customer identifier
A customer number / reference to an external system.
Customer notes where the shopper can provide special instructions. The notes are shown in the In-Store App & Admin.
Special instructions of the order. It can contain special shipping or fulfillment instructions
object
object
ISO 3166 ALPHA-2 / ISO 3166-2 Country Code
Validated according to country code
Validated according to country code
Validated according to country code
The subtotal of the order (Formula: Sum of all lineItem.extendedPrice)
Total amount of all applied promotions with coupons on order level. Without line item level promotions, since these are already included in the order subtotal.
Total amount of all applied promotions on order level. Without line item level promotions, since these are already included in the order subtotal.
Tax amount of the first tax group (e.g. for german taxes this is an absolut number based on either 7% or 19% of the order total; the order total is 10.00 EUR so the taxAmount is 10.00 EUR * 0.19 = 1.9 EUR)
Tax amount of the second tax group (can be used for additional taxes like for example US state taxes)
object
The final price of the return order, including all promotions, discounts, shipping costs etc.
Date of the order when it was created in the Shopgate system
Date when the order was submitted by the customer
Date when the order status was changed to completed
Location where the order is returned
Operation system of the source device
Indicates if the order has been imported from an external system. Enabling this flag means that there will be no further processes triggered by this order like emitting events, calculating properties like prices, or starting payment transactions.
object
External identifier for this transaction
object
Originally authorized amount
Charged amount of this transaction
Different from payment method to payment method
object
object
External error code of the provider
object
object
Is set if the type is cc
object
Identifier for the line item. Needs to be unique within the return order.
Reference to the sales order line item being returned.
object
object
object
Product code
Product name
Main image url of the product
Main price of the product
Sale price of the product
object
object
object
Amount of all applied promotions for a single unit (single quantity).
Amount of all applied discounts (promotions with coupons) for a single unit (single quantity).
Total amount of all applied promotions with coupons for the line item. (Formula: lineItem.unitDiscountAmount * lineItem.quantity)
Total amount of all applied promotions for the line item. (Formula: lineItem.unitPromoAmount * lineItem.quantity)
The extended Price is the final price of the line item, including all discounts & promotions that apply to this line item, and also already multiplied with the quantity. Formula: (product.price or product.salePrice if not empty) * quantity + promoAmount + discountAmount. Example: A product original price is 60€ (product.price), but it is on sale for 40€ (product.salePrice). Ordered quantity is 2, there is no discount but there is a promotion that applies to this product and gives 10% additional discount (unitPromoAmount = 4€, promoAmount = 8€). The extended price of this line item should be (40€ * 2) + (-8€) = 72€.
object
Example
{ "returnOrders": [ { "orderNumber": "R1256", "externalCode": "000000274", "salesOrderNumber": "1256", "type": "return", "customerId": "55c98b8e-1100-497c-8df6-4b4f0353ab2a", "externalCustomerNumber": "C1756793", "status": "new", "expedited": true, "localeCode": "de-de", "currencyCode": "EUR", "notes": "Some note", "specialInstructions": "House behind the dumpster", "data": {}, "primaryBillToAddressSequenceIndex": 0, "primaryShipToAddressSequenceIndex": 0, "addressSequences": [ { "type": "shipping", "orderIndex": 0, "customerContactId": "0b475af4-7ed9-4065-b4bb-7d76c537d820", "firstName": "Max", "middleName": "René", "lastName": "Muster", "company": "Shopgate GmbH", "address1": "Schloßstr. 10", "address2": "Haus B", "address3": "erste Etage", "address4": null, "city": "Butzbach", "region": "HE", "postalCode": 35510, "country": "DE", "phone": "+49 12345 6789 001", "fax": "+49 12345 6789 002", "mobile": "+49 12345 6789 003", "emailAddress": "max.muster@shopgate.com" } ], "subTotal": -65.99, "discountAmount": 0, "promoAmount": 6.6, "taxAmount": 0, "tax2Amount": 0, "shippingSubTotal": -4.99, "shippingDiscountAmount": 0, "shippingPromoAmount": 0, "shippingTotal": 0, "taxExempt": false, "taxSummary": [ { "code": "default_19", "name": "19%", "amount": 12.54 } ], "total": -65.99, "date": "2019-10-05T09:02:57.733Z", "submitDate": "2019-09-02T09:02:57.733Z", "completeDate": "2019-09-03T15:02:57.733Z", "dropOffType": "inPerson", "dropOffLocationCode": "DERetail001", "os": "android", "imported": false, "paymentTransactions": [ { "id": "27cd64e8-02b0-4959-aada-57d384e5142e", "externalCode": "re_2KqaVM7uuRMaCx6G1XGapN8F", "sourcePaymentTransaction": "edadf6a6-f536-489f-92b8-c15fc1edc19b", "status": "success", "type": "refund", "paymentMethod": { "code": "stripe", "type": "cc", "provider": "stripe" }, "refundAmount": 64.38, "paymentError": { "message": "Your card has insufficient funds", "code": "card_declined" }, "paymentInfo": { "type": "cc", "card": { "type": "visa", "last4": 4242 } } } ], "lineItems": [ { "code": "R386", "salesOrderLineItemCode": "386", "status": "open", "quantity": 1, "returnReasonCode": "itemDamaged", "conditionCode": "good", "product": { "code": "24-MB02", "name": "Fusion backpack", "image": "https://myawesomeshop.com/images/img1.jpg", "price": 79.99, "salePrice": 65.99, "currencyCode": "EUR", "identifiers": { "mfgPartNum": "100-440-0.750-3434-A", "upc": "72527273070", "ean": "401234567890", "isbn": "978-3-16-148410-0", "sku": "UGG-BB-PUR-06", "distiPartNum": "235454356363" }, "options": [ { "code": "color", "name": "Color", "value": { "code": "red", "name": "Red" } } ] }, "currencyCode": "EUR", "price": -79.99, "shippingAmount": 0, "taxAmount": 0, "tax2Amount": 0, "taxExempt": false, "unitPromoAmount": 0, "unitDiscountAmount": 0, "discountAmount": 0, "promoAmount": 0, "overrideAmount": 0, "extendedPrice": -65.99, "note": "Some note" } ] } ], "meta": { "limit": 100, "offset": 0, "totalItemCount": 1 }}Merchant not found
default
Section titled “default”Unexpected error
object
Machine readable error code
Human readable error code
Example
{ "code": "internal.database", "message": "Internal Database Error"}
