riverty logo

Docs

Refund Payment

Sequence Diagram

Refund Sequence Diagram (1).png

Why Refund Payment is Important

Occasionally customers may choose to return a product or a merchant may decide to issue a refund, for example due to minor damage or delayed delivery. The Refund Payment call manages these situations. The merchant may also choose to trigger the Refund call through the Merchant Portal.

An Example

Astrid has received her hat and jacket via two deliveries (the socks were voided by the merchant), but has decided that the woolen hat she ordered is a different color than she expected. She uses the original packaging to send just the woolen hat back to the merchant. Then, she goes to my.riverty.com and uses the “Report a Return” feature, triggering a notification to the merchant to expect a return of the woolen hat.

The merchant receives the woolen hat, sees that it is in good condition and still has the tags attached. The refund is accepted, and the merchant issues a REFUND call from their webshop to the Riverty eComm API. Astrid’s invoice is updated and the cost of the woolen hat is deducted from the total. She now only has to pay for the sock and the jacket she decided to keep.

This is a POST call to the REFUND endpoint of the Riverty eCommerce API. Embedded in the URL is the Order.Number from the AUTHORIZE and CAPTURES calls.

API Call Blocks:

Capture Number

This is the unique ID that was provided in the response to the CAPTURES call. This tells Riverty where to debit the money (from the merchant’s settlement account, and the specific transaction) that will be credited to the customer.

Order Items

This contains the same information as the AUTHORIZE (and/or CAPTURES) call, for the product(s) being refunded.

In this example, we are doing a Partial Refund – refunding only one order item out of many.

If we send the POST call to the REFUND endpoint with nothing in the body, we will be making a Full Refund – refunding all order items.

You can do multiple Partial Refunds within the same order. You can also do a Full Refund after a Partial Refund – refunding all items that were not refunded before.

See the detailed API documentation for more information.

    
        {
 "captureNumber": "800001138",
 "orderItems": [
  {
   "productId": "3323-BRN-M",
   "description": "Woolen hat, brown, Size M",
   "grossUnitPrice": 30,
   "netUnitPrice": 25.21,
   "quantity": 1,
   "vatPercent": 19,
   "vatAmount": 4.79,
   "imageUrl": "https://developer-sandbox.riverty.com/images/brown_wool_hat.jpg"
  }
 ]
}
    
    
        {
 "totalCapturedAmount": 135,
 "totalAuthorizedAmount": 185,
 "refundNumbers": [
  "800001139"
 ]
}