Question & Answer
Question
How can payment processing be enabled on return orders?
Cause
The business requirement is to have payment processing occur directly on return orders and not be tied to sales orders.
Answer
The following APIs can be used to meet the requirement.
1. Create a Sales Order and make sure that the Payment status is "Paid"
2. Create a return order and pass ProcessPaymentOnReturnOrder="Y"
For example - Use the following input to createOrder
<Order ProcessPaymentOnReturnOrder="Y" SellerOrganizationCode="DEFAULT" Override="N" OrderType="" OrderNo="" EnterpriseCode="DEFAULT" DraftOrderFlag="N" DocumentType="0003" CreatedAtNode="N" BillToKey="2017040617043449758 ">
<OrderLines>
<OrderLine ShipToKey="2017040617043449758" ShipNode="Node1" OrderedQty="1.0">
<DerivedFrom OrderHeaderKey="2017070612430098439" OrderLineKey="2017070612430098440 "/>
</OrderLine>
</OrderLines>
3. Run processReturnOrder using the input :
<Order DocumentType="0003" EnterpriseCode="DEFAULT"
OrderHeaderKey="2017070612512398713" OrderNo="Y100001218"/>
This copies the payment method from sales order to return order and also computes the refund needed. A new payment method is created against the return order
4. Run processOrderPayments against the return order. Charges are opened against the new payment method for return order
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg22006934