Requireswrite_orderaccess scope. More access scope
The Get Order's Refund Record initiates a refund for a specific order with detailed refund allocation options.
This API is especially useful for:
- Processing full or partial order refunds
- Managing refunds across multiple payment methods
- Handling complex refund scenarios with item-level control
Request Parameters
Public Request Parameters
Path Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
order_id | string | Yes | Unique identifier of the order | "ord_123456789" |
Body Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| string | Yes | Total refund amount |
|
| string | No | Shipping cost to refund |
|
| string | No | Tip amount to refund |
|
| string | No | Additional charges to refund |
|
| string | No | Product subtotal to refund |
|
| string | No | Refund reason or notes |
|
| object | No | array of refund_line_items object | |
| string | Yes | ID of the order line item |
|
| int32 | No | Quantity to refund |
|
| int32 | No | Default |
|
| boolean | No | Restock inventory. |
|
| object | No | array of objects | |
| string | Yes | Original payment method ID |
|
| string | Yes | Amount to refund via this method |
|
| object | No | array of objects | |
| string | Yes | Name of additional charge |
|
| string | Yes | Amount to refund |
|
refund_item_type Field
Value | Type | Description |
|---|---|---|
| Automatic refund | Automatically calculates refund quantities based on fulfillment status.
|
| Refund Shipped items | Refunds only items that have been shipped. |
| Refund unfulfilled items | Refunds only items that are waiting to ship |
Usage Rules
- Automatic Mode: Use only
0(automatic refund) for automatic handling for the same line item. System will first deduct from unfulfilled quantities. - Manual Mode: Can combine
1(shipped) and2(waiting ship) within a single line item. - Invalid Combinations: Cannot mix
0(automatic refund) with other types for the same line item.
Response Explanation
Public Response Parameters
Successful Response
| Parameter | Type | Example | Description |
|---|---|---|---|
code | string | "success" | API response status code |
message | string | "Refund processed successfully" | Operation result message |
data.refund_record_id | string | "ref_123456789" | Unique refund transaction ID |
data.post_sale_id | string | "ps_123456789" | After-sales service case ID |
Error Response
| Field | Type | Example | Description |
|---|---|---|---|
code | string | InvalidParameter | Error http message |
message | string | Error message |
