Returns
Here's how returns and exchanges work in NewStore:
Assign Customer, place normal order, pay with credit card.
Look at customer’s Activity screen and open previous order.
Apply return and inspect cart payload. Note the following:
All we must do is to create a return is to add
cart.returnsto the cart.After the cart is synced,
cart.payments.potential_store_creditis added.potential_store_creditis the total credit the customer has from the returned order.
Checkout and select
Refund to Original Payment Method. Refunding to original payment method is the default refunding behavior, nothing needs to be set in the cart for choosing this option.Because this is a return (no exchange), total refunded amount equals
cart.remainingAmountwhich is the same as the amount inpotential_store_creditpayment.Look at
cart.paymentStatuses, note thatstatusofpotential_store_creditisdraftbecause we never used this credit.
To get the refund method (where the money was refunded to), we need to make another API call to
/customer_orders/<returns[0].orderId>.On the response payload, we must correlate a payment
activityinpaymentHistorywithreturnIdfrom cart. In this case the correlation ispaymentHistory[1].activities[0].correlationId === cart.returns[0].returnId
Returns: Questions and more
Why is a payment called
potential_store_credit?Because the store credit hasn't been used yet, it refers to the total amount a customer can potentially use from this credit.
How do
cart.idsfrom the original order and the return order relate to each other?cart.idof the original order correlates withreturns[*].orderIdof the return order.Why do we call
/customer_orders/with<returns[0].orderId>?Because
<returns[0].orderId>contains the original payment methods along with the returns.Why are we getting the
orderIdfromreturns[0]? What if there is more than one?All
returns[*]belong to the same order, returns from different orders is currently not supported.Can we call the
/customer_orders/endpoint withcart.idfrom the return order?We won't find the information we need there, since refund methods are in the payment history of the original order.
Is a new order being created when placing the return?
No, since we are not actually creating a new order, just returning from the original order.
Exchanges
Important
Cross-country exchanges are not supported when the taxes or tax policies in the countries you are trying to exchange the item(s) in are different.
For example, if you buy an item online or in a store in Germany, and then go to a Swedish store to exchange the item, the transaction will be unsuccessful.
Equal exchanges
Create an equal exchange order by returning a product and buying a product with the same price.
Look at
cart.payments:paymentStatuses[...].statusforstore_creditpayment issucceededbecause we successfully processedstore_credit(we used the store credit to buy the new item).We got a new property in the cart:
cart.exchange, with information about this exchange checkout.
Equal Exchanges: Questions and more
Why are we calling
/customer_orders/with<returns[0].orderId>?Because
<returns[0].orderId>contains the original payment methods along with the returns.Note
There are no payments in
paymentHistoryto correlate to this return. Why? Because customer didn’t get refunded.Is a new order being created when placing the return?
Yes, the new order for the new product(s) bought.
Look at exchange and original orders in HQ
What payment information do we get when calling
customer_orders/withcart.idfrom the original order?Original payment and
store_creditissued
What payment information we get when calling
customer_orders/withcart.idfrom the return order?store_creditredeemed (used to pay for exchanged product)
Negative exchanges
Create negative exchange order by returning product and adding product with lower
priceto the cart. Inspect payload:cart.payments.potential_store_credit.amountis equal to the total exchange credit available to the customer.cart.exchange.amountis the total amount of the refund.remainingAmountis equal tocart.totals.grandTotalminus payments amount.
Place cart and inspect cart payload again:
store_creditpayment changed. Now it is equal to the total credit used for this checkout. Therefore,remainingAmountis now 0.For exchanges, always use
cart.exchangefor determining balance amount.
Look at response payload from
/customer_orders/and correlatepaymentHistoryactivity withreturnIdto determine where the money was refunded.
Negative exchanges: Questions and more
Look at exchange and original orders in HQ.
Why does
store_creditpayment changes amounts?It changes because customer didn't use the whole credit amount.
What payment information do we get when calling
customer_orders/withcart.idfrom the original order?Original payment
store_creditissuedAmount refunded to original payment method
What payment information we get when calling
customer_orders/withcart.idfrom the return order?store_creditredeemed (used to pay for exchanged product)
Positive exchanges
Create a positive exchange order by returning a product and adding a product with higher price to the cart. Inspect
cartpayload (payments,paymentStatuses,returnStatus,exchange).Place cart, inspect
cartpayload:Look at
cart.payments: new payment andstore_creditpayments are there.Look at
cart.paymentStatusesto check that allstatusesaresucceeded. Note thatpaymentsids correlate withpaymentStatusesids.Look at
cart.returnStatusto check that returnssucceededLook at
cart.exchangeto get type and balance information on the exchange.
Related topics