Exchange order object
- Returns Experience
- Customer Endpoints
- Exchange Orders
Exchange Orders (2.0.0)
The Exchange Orders API is used to place an order in your e-commerce platform when the shopper has chosen to exchange for a replacement item or receive their refund via a gift card. Your endpoint should handle all tax and shipping calculations. The endpoint should be idempotent, using original_order_id as the key. Only one exchange order can be placed against an original_order_id.
When it is used:
- Optoro POSTS an Exchange Orders message to you when the shopper has confirmed an exchange, selected a gift card refund, or both.
This is an exchange of one or more items for a variant of the product (ex: different size, different color). This will be represented in the items array by an object like the following:
{
"sku": "888812345678",
"quantity": 2,
"title": "Fuzzy red t-shirt",
"unit_price_amount_cents": 100,
"product_amount_cents": 200,
"discount_amount_cents": 20,
"tax_amount_cents": 100,
"product_identifier": "1234-5678",
"variant_identifier": "1234-5678",
"original_sku": "888812345678",
"original_item_identifier": "1234",
"concept": "acme"
}This is an exchange of one or more items for a gift card. This will be represented in the items array by an object like the following:
{
"sku": "OPTOROGIFTCARD",
"quantity": 1,
"unit_price_amount_cents": 800,
"bonus_credit_amount_cents": 200,
"return_items": [
{
"title": "Pink Shirt",
"original_sku": "888812349672",
"original_item_identifier": "4567",
"quantity": 1,
"concept": "acme"
}
]
}sku will be the agreed upon value for an Instant Gift Card exchange and return_items will be the list of items being exchanged for the gift card.
The original secondary order id of item(s) to be exchanged
Treat as a gift order, don’t show price or allow refund to original form of payment.
An array of order line items.
An identifier which matches the catalog and represents the product for this order item.
The number of units within the order for each SKU (or UPC). Must be less than or equal to 1000.
Unit price amount in cents of a single unit of a product.
Product amount in cents, before discounts, taxes or shipping costs.
Gift card bonus credit amount in cents. This field is only present for an Instant Gift Card exchange.
Id unique to that product (ex. same SKU from different vendors).
Variant can help disambiguate specific variant of a product class (e.g. blue color of a sweater product) -- product_identifier can be the same as variant_identifier in some systems.
SKU of the item from original order that is being exchanged.
Order line item identifier of the item from original order that is being exchanged.
Customer
Address to receive goods
An optional second line for the street address, for suite or other similar additions.
The zip or postal code for this address.
Payment billing address
An optional second line for the street address, for suite or other similar additions.
- Mock serverhttps://developer.optoro.com/_mock/openapi/exchange_orders/openapi/exchange_orders
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.optoro.com/_mock/openapi/exchange_orders/openapi/exchange_orders \
-H 'Content-Type: application/json' \
-H 'X-Optiturn-Api-Version: 1' \
-H 'X-Optiturn-Id: Modrno' \
-d '{
"currency": "USD",
"rma_identifier": "RMA12345",
"original_order_id": "OR123456",
"original_secondary_order_id": "OR987654",
"is_gift": false,
"items": [
{
"sku": "888812345678",
"quantity": 2,
"title": "Fuzzy red t-shirt",
"unit_price_amount_cents": 100,
"product_amount_cents": 200,
"discount_amount_cents": 20,
"tax_amount_cents": 100,
"product_identifier": "1234-5678",
"variant_identifier": "1234-5678",
"original_sku": "888812345678",
"original_item_identifier": "1234",
"concept": "acme"
},
{
"sku": "OPTOROGIFTCARD",
"quantity": 1,
"unit_price_amount_cents": 800,
"bonus_credit_amount_cents": 200,
"return_items": [
{
"title": "Pink Shirt",
"original_sku": "888812349672",
"original_item_identifier": "4567",
"quantity": 1,
"concept": "acme"
}
]
}
],
"customer": {
"identifier": "123",
"first_name": "Carmine",
"last_name": "Customer",
"email": "customer@example.com",
"phone": "202-555-1212"
},
"shipping_address": {
"name": "Carmine Customer",
"street1": "123 Fake St.",
"street2": "STE 1200",
"city": "Utiopiannapolis",
"province": "WA",
"postal_code": "99877",
"country_code": "US",
"phone": "202-555-1212"
},
"billing_address": {
"name": "Carmine Customer",
"street1": "123 Fake St.",
"street2": "STE 1200",
"city": "Utiopiannapolis",
"province": "WA",
"postal_code": "99877",
"country_code": "US",
"phone": "202-555-1212"
},
"payment": {
"transaction_id": "8ef05fb8-283e-4edd-a3d7-47f9fe520cfe"
}
}'Order creation success message
Identifier of created order, should be the same order id given to shoppers
Total amount of order in cents, including any gift card bonus credit (if applicable)
Product amount of order in cents, before discounts, taxes or shipping costs
{ "order_identifier": "OR124567", "total_amount_cents": 100, "product_amount_cents": 100, "tax_amount_cents": 110 }