curl --location --request POST 'https://api.stateset.com/v1/returns/:id/exchange' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"exchange_reason": "Wrong size ordered",
"price_difference": 0,
"shipping_method": "standard",
"expedited": false
}'
mutation returnExchangeMutation {
returnExchange(
id: "${returnId}",
exchangeProductId: "${exchangeProductId}",
exchangeVariantId: "${exchangeVariantId}",
exchangeReason: "${exchangeReason}",
priceDifference: ${priceDifference},
shippingMethod: "${shippingMethod}",
expedited: ${expedited}
) {
return {
id,
status,
exchange_order_id,
exchange_status,
tracking_number
}
userErrors {
field
message
}
}
}
`;
const returns = await stateset.returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
});
returns = stateset.returns.exchange({
'id': 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id': 'prod_abc789',
'exchange_variant_id': 'var_size_large',
'exchange_reason': 'Wrong size ordered',
'price_difference': 0,
'shipping_method': 'standard',
'expedited': False
})
returns = Stateset::Return.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
})
returns, err := stateset.Returns.exchange({
ID: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductID: 'prod_abc789',
ExchangeVariantID: 'var_size_large',
ExchangeReason: 'Wrong size ordered',
PriceDifference: 0,
ShippingMethod: 'standard',
Expedited: false
})
Return returns = stateset.Returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchangeProductId: 'prod_abc789',
exchangeVariantId: 'var_size_large',
exchangeReason: 'Wrong size ordered',
priceDifference: 0,
shippingMethod: 'standard',
expedited: false
});
$returns = $stateset->returns->exchange([
'id' => 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id' => 'prod_abc789',
'exchange_variant_id' => 'var_size_large',
'exchange_reason' => 'Wrong size ordered',
'price_difference' => 0,
'shipping_method' => 'standard',
'expedited' => false
]);
var returns = await stateset.Returns.Exchange(new {
Id = 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductId = 'prod_abc789',
ExchangeVariantId = 'var_size_large',
ExchangeReason = 'Wrong size ordered',
PriceDifference = 0,
ShippingMethod = 'standard',
Expedited = false
});
{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"object": "return",
"exchanged": true,
"exchange_order_id": "ord_exch_789xyz",
"exchange_status": "processing",
"original_product_id": "prod_xyz123",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"price_difference": 0,
"payment_status": "no_payment_required",
"tracking_number": "1Z999AA10123456785",
"estimated_delivery": "2024-01-18"
}
Exchange Return
This endpoint processes an exchange for a returned item.
POST
/
v1
/
returns
/
:id
/
exchange
curl --location --request POST 'https://api.stateset.com/v1/returns/:id/exchange' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"exchange_reason": "Wrong size ordered",
"price_difference": 0,
"shipping_method": "standard",
"expedited": false
}'
mutation returnExchangeMutation {
returnExchange(
id: "${returnId}",
exchangeProductId: "${exchangeProductId}",
exchangeVariantId: "${exchangeVariantId}",
exchangeReason: "${exchangeReason}",
priceDifference: ${priceDifference},
shippingMethod: "${shippingMethod}",
expedited: ${expedited}
) {
return {
id,
status,
exchange_order_id,
exchange_status,
tracking_number
}
userErrors {
field
message
}
}
}
`;
const returns = await stateset.returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
});
returns = stateset.returns.exchange({
'id': 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id': 'prod_abc789',
'exchange_variant_id': 'var_size_large',
'exchange_reason': 'Wrong size ordered',
'price_difference': 0,
'shipping_method': 'standard',
'expedited': False
})
returns = Stateset::Return.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
})
returns, err := stateset.Returns.exchange({
ID: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductID: 'prod_abc789',
ExchangeVariantID: 'var_size_large',
ExchangeReason: 'Wrong size ordered',
PriceDifference: 0,
ShippingMethod: 'standard',
Expedited: false
})
Return returns = stateset.Returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchangeProductId: 'prod_abc789',
exchangeVariantId: 'var_size_large',
exchangeReason: 'Wrong size ordered',
priceDifference: 0,
shippingMethod: 'standard',
expedited: false
});
$returns = $stateset->returns->exchange([
'id' => 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id' => 'prod_abc789',
'exchange_variant_id' => 'var_size_large',
'exchange_reason' => 'Wrong size ordered',
'price_difference' => 0,
'shipping_method' => 'standard',
'expedited' => false
]);
var returns = await stateset.Returns.Exchange(new {
Id = 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductId = 'prod_abc789',
ExchangeVariantId = 'var_size_large',
ExchangeReason = 'Wrong size ordered',
PriceDifference = 0,
ShippingMethod = 'standard',
Expedited = false
});
{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"object": "return",
"exchanged": true,
"exchange_order_id": "ord_exch_789xyz",
"exchange_status": "processing",
"original_product_id": "prod_xyz123",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"price_difference": 0,
"payment_status": "no_payment_required",
"tracking_number": "1Z999AA10123456785",
"estimated_delivery": "2024-01-18"
}
Body
The ID provided in the data tab may be used to identify the return
The product ID of the item to exchange for
The variant ID if exchanging for a different variant (size, color, etc.)
The reason for the exchange
The price difference between original and exchange items (positive if customer owes, negative if refund due)
The shipping method for the exchange item
Whether to expedite the exchange shipment
Response
The ID provided in the data tab may be used to identify the return
The object type
The new order ID for the exchange
The status of the exchange (e.g., “pending”, “processing”, “shipped”)
The original product that was returned
The new product being sent as exchange
The price difference between items
Status of any additional payment or refund
Tracking number for the exchange shipment
Indicates whether the call was successful. true if successful, false if not.
curl --location --request POST 'https://api.stateset.com/v1/returns/:id/exchange' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <token>' \
--data-raw '{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"exchange_reason": "Wrong size ordered",
"price_difference": 0,
"shipping_method": "standard",
"expedited": false
}'
mutation returnExchangeMutation {
returnExchange(
id: "${returnId}",
exchangeProductId: "${exchangeProductId}",
exchangeVariantId: "${exchangeVariantId}",
exchangeReason: "${exchangeReason}",
priceDifference: ${priceDifference},
shippingMethod: "${shippingMethod}",
expedited: ${expedited}
) {
return {
id,
status,
exchange_order_id,
exchange_status,
tracking_number
}
userErrors {
field
message
}
}
}
`;
const returns = await stateset.returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
});
returns = stateset.returns.exchange({
'id': 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id': 'prod_abc789',
'exchange_variant_id': 'var_size_large',
'exchange_reason': 'Wrong size ordered',
'price_difference': 0,
'shipping_method': 'standard',
'expedited': False
})
returns = Stateset::Return.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchange_product_id: 'prod_abc789',
exchange_variant_id: 'var_size_large',
exchange_reason: 'Wrong size ordered',
price_difference: 0,
shipping_method: 'standard',
expedited: false
})
returns, err := stateset.Returns.exchange({
ID: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductID: 'prod_abc789',
ExchangeVariantID: 'var_size_large',
ExchangeReason: 'Wrong size ordered',
PriceDifference: 0,
ShippingMethod: 'standard',
Expedited: false
})
Return returns = stateset.Returns.exchange({
id: 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
exchangeProductId: 'prod_abc789',
exchangeVariantId: 'var_size_large',
exchangeReason: 'Wrong size ordered',
priceDifference: 0,
shippingMethod: 'standard',
expedited: false
});
$returns = $stateset->returns->exchange([
'id' => 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
'exchange_product_id' => 'prod_abc789',
'exchange_variant_id' => 'var_size_large',
'exchange_reason' => 'Wrong size ordered',
'price_difference' => 0,
'shipping_method' => 'standard',
'expedited' => false
]);
var returns = await stateset.Returns.Exchange(new {
Id = 'rt_1NXWPnCo6bFb1KQto6C8OWvE',
ExchangeProductId = 'prod_abc789',
ExchangeVariantId = 'var_size_large',
ExchangeReason = 'Wrong size ordered',
PriceDifference = 0,
ShippingMethod = 'standard',
Expedited = false
});
{
"id": "rt_1NXWPnCo6bFb1KQto6C8OWvE",
"object": "return",
"exchanged": true,
"exchange_order_id": "ord_exch_789xyz",
"exchange_status": "processing",
"original_product_id": "prod_xyz123",
"exchange_product_id": "prod_abc789",
"exchange_variant_id": "var_size_large",
"price_difference": 0,
"payment_status": "no_payment_required",
"tracking_number": "1Z999AA10123456785",
"estimated_delivery": "2024-01-18"
}
⌘I