Notice
The fields
refund_status
,all_refunded
,refund_total
,refund_discount_total
, andrefund_tax_total
in the interface response are deprecated. To ensure compatibility with the old versions, we will not delete it, only return default values。
Domain Object
RefundListResponse
Field | Type | Desc |
---|---|---|
order_status | string | the status of order |
order_financial_status | string | the payment status of order |
bool | @Deprecated. | |
string | @Deprecated. | |
string | @Deprecated. | |
string | @Deprecated. | |
string | @Deprecated. | |
refunds | 【】Refunds |
Example
Tax-inclusive scenario(order.config.product_tax_included=true)
A customer placed an order for 2 iPhones, with the product's original price (product.price) being $50 (the $50 already includes tax).
The total tax for the order (total_tax) is $20 (this is independent of order.config.product_tax_included and is calculated by the tax service), so the total amount of the order excluding tax is $80.
The total discount (total_discount) is $40.
So, the order's subtotal (order.sub_total) is $100, which is the sum of the total price of each line item (sum(line_item.total_price) = sum(line_item.price * line_item.quantity)).
The actual payment (total_price) is $60 (2 iPhones at $50 each minus the $40 discount).
Now, for this order, a refund is being processed:
The refund amount (refund_price) is $40 (this is because the refund amount is something the buyer can input).
The total amount of the refund line item (RefundLineItem.total) is $40 (since there is only one product, there is no need to further apportion the refund).
The subtotal of the refund line item (RefundLineItem.SubTotal) is calculated as follows: ($50 * 2) - ($40 / $60).
The tax of the refund line item (RefundLineItem.tax) is calculated as: ($20 * $40) / $60.
Non tax-inclusive scenario(order.config.product_tax_included=false)
A customer placed an order for 2 iPhones, with the product's original price being $50 (the $50 is the price before tax).
The total tax for the order (total_tax) is $20 (this is independent of order.config.product_tax_included and is calculated by the tax service).
The total discount (total_discount) is $40.
So, the order's subtotal (order.sub_total) is $100 (calculated as the sum of the total price of each line item: sum(line_item.total_price) = sum(line_item.price * line_item.quantity)).
The actual payment (total_price) is $80 (calculated as 2 iPhones at $50 each, plus tax of $20, minus the $40 discount: 50*2 + 20 - 40 = 80).
Now, for this order, a refund is being processed:
The refund amount (refund_price) is $40 (the reason it's $40 is because the refund amount is something the buyer can input).
The total amount of the refund line item (RefundLineItem.total) is $40 (since there is only one type of product, there is no need to further apportion the refund).
The subtotal of the refund line item (RefundLineItem.SubTotal) should be calculated as follows: (50 * 2 - 40) / 80 = 50.
The tax of the refund line item (RefundLineItem.tax) should be calculated as: (20 * 40) / 80 = 10.