VeePee Refund
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Date | Version | Name | Applied changes |
---|---|---|---|
15.02.2023 | 1.0 | Bogomil Pavlov | First Publish |
28.02.2023 | 1.1 | Danail Deltchev | General clean up and rewording |
30.03.2023 | 1.2 | Bogomil Pavlov | Additional logic for shipping refunds |
The purpose of this document is to give detailed explanation how to refund an order on VeePee.
The marketplace supports both full and partial refunds in one single flow. We can refund only an order when we have Hemi Order status “Shipped” or “Partially Shipped“on the order to pick it for refund (PostShipment refunds as part of our abstraction). As opposed to the Cancellation flow the refund allows us to send specific value, including partial out of a specific quantity (example: 0,5 of a single quantity). The Refund also allows us to directly refund shipment values too. Standard Post Shipment refund with partial allowances are fully applicable here as per our general Refunds send general logic
Refund Order
API Call: POST {{BaseURL}}/orders/{orderId}/refund
API Docs: https://api-pinkstaging.pink-connect.com/v4/orders/{orderId}/refund
Query Parameters: orderId - The order id returned from VeePee in the Get Orders flow (Orders > Marketplace Order ID)
Sample Request: POST https://api-pinkstaging.pink-connect.com/v4/orders/34935/refund
Body:
{
"linesToRefund": [
{
"identifierType": "OrderLineId",
"identifier": "69762"
},
{
"identifierType": "OrderLineId",
"identifier": "69763"
}
],
"shippingCost": "1",
"amount": 10,
"currency": "EUR"
}
Body (Mapping):
VeePee Field | Required | Hemi Field | Comment | |
---|---|---|---|---|
linesToRefund |
||||
identifierType |
Yes | ”OrderLineId” | ”OrderLineId” hardcoded for identifierType | |
identifier |
Yes | Order Item Line > Marketplace Order Item ID | ||
shippingCost |
Yes | Order Refund Rows > Amount | For Refund Row > Type = Shipping |
If there is no shipping cost to refund we still need to add this in the payload with amount = 0 |
| amount
| | Yes | Order Refund Rows > Amount | For Refund Row > Type
= Item
If there is no item price to refund we still need to add this in the payload with amount = 0 |
| currency
| | No | Order > Order Currency | |
The refunds are per order which means for each separate refund (payment row with type refund) we need to make separate request.
However in each request we can specify more than one product in order. In this case VeePee automatically assign the amount across the products on their end.
For example we have an order with total amount 10$ and two products. Product A - 3$ and Product B - 7$.
If we make partial refund for 5$ we need to specify both Order Item Line > Marketplace Order Item ID and sum the amount
. This way VeePee will spread the amount across the products based on their logic.
Having such structure cannot result in refunds which are partially completed.
Please note when we are refunding shipping cost we still need to specify for which line we are doing a refund in the payload. However our internal validation and logic for Order Item Line status works only for item refunds and we are not tracking the shipping refunds on Order Item Line level thus when we are refunding only shipping cost we always get the first line id.
We should be fine with these approach because we are having internal validations and we are not downloading the refunds from the marketplace.
Sample Response:
If there is empty response it means success. Otherwise we will receive an error that we need to store accordingly. Please note we are still expecting to receive a status code in the 200s most notably 200 or 204 for success
As previously mentioned all validations, triggers and updates are as per the validation based on the type of refund we can do here (link provided above)