Partial Order Refund

🔒

Requires write_order access scope. More access scope

The Partial Order Refund API processes a refund for specific items or a partial amount of an order, enabling granular control over the refund process.

This API is especially useful for:

  1. Handling refunds for specific products or quantities in an order.
  2. Managing partial refunds based on customer requests or issues.
  3. Maintaining accurate refund and order tracking records.

Request Parameters

Public Request Parameters

📘

Public Request Parameters

Path Parameters

ParameterTypeRequiredDescriptionExample
idstringYesThe unique ID of the order.1232123

Body Parameters

ParameterTypeRequiredDescriptionExample
is_returnbooleanYesIndicates if the refund includes the return of items.true
pricestringYesThe refund amount for the partial refund.81.00
line_itemsarray of objectsYesList of line items(product) included in the refund.See below

line_items Object Fields:

FieldTypeRequiredDescriptionExample
idstringYesThe unique ID of the LineItem.31d95f28-baf0-47c9-ad53-dbf3833f1b85
quantityintYesThe quantity of the product to refund.1

Response Description

Public Response Fields

📘

Public Response Parameters

Success Response

FieldTypeDescriptionExample
IdstringUnique identifier of the refund order."31e27a7a-6899-4709-93e2-b3d6177c7458"
StatusstringCurrent status of the refund (finished, pending, etc.)."finished"
NumberstringRefund order number."SPZ00000020-S1"
CreatedAtstring (ISO8601)Timestamp of when the refund order was created."2024-06-24T08:17:59Z"
NotestringNotes about the refund order (optional).""
RefundFailReasonstringReason for refund failure (if applicable).""
AllRefundedboolIndicates whether the order has been fully refunded (true/false).true
RefundStatusstringStatus of the refund process (pending, failed, finished, etc.)."finished"
Order*OrderAssociated order details (see Order struct).{...}
Refund*RefundRecordRefund record details (see RefundRecord struct).{...}

Order Structure

FieldTypeDescriptionExample
IdstringUnique identifier of the order."633130-SPZ00000020"
Note*stringNotes for the order (optional)."Urgent delivery requested"
NumberstringOrder number."SPZ00000020"
FinancialStatusstringFinancial status of the order."refunded"
StatusstringCurrent status of the order (placed, cancelled, etc.)."placed"
CancelReason*stringReason for cancellation (if applicable)."Out of stock"
PaymentMethodstringPayment method used for the order."bogus_gateway"
FulfillmentStatusstringFulfillment status of the order (waiting, shipped, etc.)."waiting"
DiscountCodestringDiscount code applied to the order."SUMMER2024"
DiscountApplicationsstringDetails of discounts applied."[{...}]"
CustomerNotestringNotes from the customer about the order."Leave package at the front door."
SalesPlatformstringThe platform where the order was placed."shoplazza"
LandingSitestringURL of the landing page where the order originated."https://shop.com/landing"
BuyerAcceptsMarketingboolIndicates if the customer has opted into marketing.true
CurrencystringCurrency of the order."USD"
TotalPricestringTotal price of the order, including taxes and shipping."21.10"
TotalDiscountstringTotal discount applied to the order."5.00"
TotalTaxstringTotal tax applied to the order."1.50"
TotalShippingstringTotal shipping cost for the order."11.00"
SubTotalstringSubtotal of the order (price before tax and shipping)."10.10"
CodeDiscountTotalstringTotal discount from discount codes."2.00"
LineItemDiscountTotalstringTotal discount applied to line items."1.00"
TagsstringCustom tags for the order."high-priority"
CreatedAtstring (ISO8601)Timestamp of when the order was created."2024-06-24T08:16:57Z"
UpdatedAtstring (ISO8601)Timestamp of the last update to the order."2024-06-24T08:18:00Z"
CanceledAt*string (ISO8601)Timestamp of when the order was cancelled (if applicable)."2024-06-24T09:00:00Z"
CustomerDeletedAt*string (ISO8601)Timestamp of when the customer deleted the order (if applicable).null
TotalRefundPricestringTotal refund amount processed for the order."21.10"
RefundStatus*stringStatus of the refund process for the order."customize"
BrowserIPstringIP address of the customer when the order was placed."192.168.0.1"
SourcestringReferrer or source of the order."https://shop.com/checkout"
EmailStatusstringEmail delivery status (waiting, sent, etc.)."waiting"
ShippingLine*ShippingLineDetails of the shipping method used.{...}
Customer*CustomerInformation about the customer who placed the order.{...}
ShippingAddress*ShippingAddressShipping address of the customer.{...}
BillingAddress*BillingAddressBilling address of the customer.{...}
PaymentLine*PaymentLineDetails of the payment method used.{...}
LineItems[]*OrderLineItemList of items included in the order.[{...}]
GiftCardTotalstringTotal value of gift cards applied to the order."0.00"
ProductTaxIncludedboolIndicates whether the product prices include tax.true
AdditionalTotalstringTotal value of additional charges applied to the order."0.00"
AdditionalPrices[]*AdditionalPriceList of additional charges applied to the order.[{...}]
LogisticsCodestringLogistics or shipping code associated with the order."LOG12345"
Config*ConfigConfiguration details for the order, including currency, language, and tax settings.{...}
CheckoutUrlstringURL for the checkout page of the order."https://shop.com/checkout/12345"

ShippingLine

FieldTypeDescriptionExample
IdstringUnique identifier for the shipping line."123456"
NamestringName of the shipping method (required)."Express Delivery"
DescstringDescription of the shipping method."Delivery within 2 days"
SupportCodintIndicates if Cash on Delivery (COD) is supported (1 for yes, 0 for no).1
ShippingPricestringPrice of the shipping service (required)."15.00"

Customer

FieldTypeDescriptionExample
UserIdstringUnique identifier for the customer."user_001"
FirstNamestringFirst name of the customer."John"
LastNamestringLast name of the customer."Doe"
EmailstringEmail address of the customer."[email protected]"
PhonestringPhone number of the customer."+1234567890"
CustomerRolestringRole of the customer (e.g., "buyer", "admin")."buyer"
ExtarrayAdditional custom fields for the customer in a key-value format.

Error Response

Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.

FieldTypeExampleDescription
errorsArray["Order not found"]A list of errors encountered during the request processing.
FieldTypeExampleDescription
errorString "store is not active"Indicates an error encountered during the process

Error Detail

Status CodeMessagePossible ReasonExample Response
400Bad RequestInvalid input format or request structure (e.g., missing required fields or incorrect data types).Bad Request
UnauthorizedThe request is missing valid authentication credentials or the credentials provided are invalid.Unauthorized
404Not FoundThe Id provided is not found"Order not found"
406Not AcceptableCurrent order can not finish after-sale."After-sales is not included in current order."
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!