Overview The ReturnGroupSerializer provides a structured representation of a return group in the v2 API, encompassing associated returns, shipments, orders, customers, exchange items, and refund transactions.
Main Schema: ReturnGroupSerializer Description A serializer for the ReturnGroup model that delivers a complete representation of a return group, including related sub-entities.
Fields Field Type Required? Description idintegerYes Unique identifier for the return group return_methodstringYes Return method (e.g., "shipping" , "in_store" ) credit_methodstringNo Refund/credit method (e.g., "refund" , "store_credit" ) created_atstringYes ISO 8601 timestamp of creation updated_atstringYes ISO 8601 timestamp of last update orderOrderSerializerYes Associated order details customerCustomerSerializerYes Customer details shipmentsarray[ShipmentSerializer]Yes Associated shipments returnsarray[ReturnSerializer]Yes List of returns exchange_line_itemsarray[ExchangeLineItemSerializer]Yes Exchange line items refund_transactionsarray[RefundTransactionSerializer]Yes Refund transactions
Example Response
{
"id": 12345,
"return_method": "shipping",
"credit_method": "refund",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T14:45:00Z",
"order": {
"id": 67890,
"platform_id": "gid://shopify/Order/123456789",
"name": "#1001",
"created_at": "2024-01-10T09:00:00Z",
"source_name": "web",
"fulfilled_at": "2024-01-12T15:30:00Z",
"taxes_included": true
},
"customer": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"shipments": [
{
"id": 111,
"status": "DELIVERED",
"carrier": "FedEx",
"tracking_number": "123456789012",
"created_at": "2024-01-13T08:00:00Z"
}
],
"returns": [
{
"id": 222,
"platform_id": "gid://shopify/Return/987654321",
"created_at": "2024-01-15T10:30:00Z",
"status": "OPEN",
"shipment_id": 111,
"product_platform_id": "gid://shopify/Product/456789",
"product_name": "Cotton T-Shirt",
"variant_platform_id": "gid://shopify/ProductVariant/789012",
"variant_name": "Medium / Blue",
"sku": "TSHIRT-M-BLUE",
"quantity": 1,
"return_reason": "Wrong size",
"return_note": "Ordered medium but need large",
"subtotal": {
"shop_money": {
"amount": 25.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 25.0,
"currency_code": "USD"
}
},
"discounted_subtotal": {
"shop_money": {
"amount": 20.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 20.0,
"currency_code": "USD"
}
},
"tax_total": {
"shop_money": {
"amount": 1.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 1.6,
"currency_code": "USD"
}
},
"total": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
}
}
],
"exchange_line_items": [
{
"id": "exch_001",
"product_platform_id": "gid://shopify/Product/456789",
"product_name": "Cotton T-Shirt",
"variant_platform_id": "gid://shopify/ProductVariant/789013",
"variant_name": "Large / Blue",
"sku": "TSHIRT-L-BLUE",
"quantity": 1,
"subtotal": {
"shop_money": {
"amount": 25.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 25.0,
"currency_code": "USD"
}
},
"discounted_subtotal": {
"shop_money": {
"amount": 20.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 20.0,
"currency_code": "USD"
}
},
"tax_total": {
"shop_money": {
"amount": 1.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 1.6,
"currency_code": "USD"
}
},
"total": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
}
}
],
"refund_transactions": [
{
"platform_id": "gid://shopify/Refund/555666777",
"amount": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
},
"gateway": "shopify_payments"
}
]
}
๐งฉ Subtypes๐ค CustomerSerializerField Type Required Description namestringYes Full name of the customer emailstringYes Customer's email address
Example {
"name": "John Doe",
"email": "john.doe@example.com"
}๐ฆ OrderSerializerField Type Required Description idintegerYes Unique order ID platform_idstringYes Platform-specific ID namestringYes Order number (e.g. #1001 ) created_atstringYes ISO 8601 creation timestamp source_namestringNo Order source (web , pos , etc.) fulfilled_atstringNo Fulfillment timestamp taxes_includedbooleanYes If taxes are included in pricing
Example {
"id": 67890,
"platform_id": "gid://shopify/Order/123456789",
"name": "#1001",
"created_at": "2024-01-10T09:00:00Z",
"source_name": "web",
"fulfilled_at": "2024-01-12T15:30:00Z",
"taxes_included": true
}๐ ShipmentSerializerField Type Required Description idintegerYes Shipment ID statusstringYes Shipment status. Possible Values:
DRAFT CREATED IN_TRANSIT DELIVERED FAILED CANCELED carrierstringNo Carrier name tracking_numberstringNo Tracking number created_atstringYes Creation timestamp
Example {
"id": 111,
"status": "DELIVERED",
"carrier": "FedEx",
"tracking_number": "123456789012",
"created_at": "2024-01-13T08:00:00Z"
}๐ ReturnSerializerField Type Required Description idintegerYes Return ID platform_idstringNo Platform return ID created_atstringYes Return creation timestamp statusstringYes Return status. Possible values:
IN_REVIEW OPEN COMPLETED CANCELED shipment_idintegerNo Linked shipment ID product_platform_idstringYes Platform product ID product_namestringYes Name of the product variant_platform_idstringYes Platform variant ID variant_namestringYes Name of the product variant skustringNo SKU quantityintegerYes Quantity returned return_reasonstringYes Reason provided return_notestringNo Optional customer note subtotalMoneyBagYes Pre-discount price discounted_subtotalMoneyBagYes Post-discount price tax_totalMoneyBagYes Tax total totalMoneyBagYes Final total
Example {
"id": 222,
"platform_id": "gid://shopify/Return/987654321",
"created_at": "2024-01-15T10:30:00Z",
"status": "OPEN",
"shipment_id": 111,
"product_platform_id": "gid://shopify/Product/456789",
"product_name": "Cotton T-Shirt",
"variant_platform_id": "gid://shopify/ProductVariant/789012",
"variant_name": "Medium / Blue",
"sku": "TSHIRT-M-BLUE",
"quantity": 1,
"return_reason": "Wrong size",
"return_note": "Ordered medium but need large",
"subtotal": {
"shop_money": {
"amount": 25.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 25.0,
"currency_code": "USD"
}
},
"discounted_subtotal": {
"shop_money": {
"amount": 20.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 20.0,
"currency_code": "USD"
}
},
"tax_total": {
"shop_money": {
"amount": 1.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 1.6,
"currency_code": "USD"
}
},
"total": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
}
}๐ ExchangeLineItemSerializerField Type Required Description idstringYes Exchange item ID product_platform_idstringYes Product ID product_namestringYes Name of the product variant_platform_idstringYes Variant ID variant_namestringYes Variant name skustringNo SKU quantityintegerYes Quantity exchanged subtotalMoneyBagYes Pre-discount subtotal discounted_subtotalMoneyBagYes Post-discount subtotal tax_totalMoneyBagYes Tax total totalMoneyBagYes Total
Example {
"id": "exch_001",
"product_platform_id": "gid://shopify/Product/456789",
"product_name": "Cotton T-Shirt",
"variant_platform_id": "gid://shopify/ProductVariant/789013",
"variant_name": "Large / Blue",
"sku": "TSHIRT-L-BLUE",
"quantity": 1,
"subtotal": {
"shop_money": {
"amount": 25.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 25.0,
"currency_code": "USD"
}
},
"discounted_subtotal": {
"shop_money": {
"amount": 20.0,
"currency_code": "USD"
},
"presentment_money": {
"amount": 20.0,
"currency_code": "USD"
}
},
"tax_total": {
"shop_money": {
"amount": 1.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 1.6,
"currency_code": "USD"
}
},
"total": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
}
}๐ธ RefundTransactionSerializerField Type Required Description platform_idstringNo Platform-specific refund ID amountMoneyBagYes Refund amount gatewaystringNo Payment gateway used
Example {
"platform_id": "gid://shopify/Refund/555666777",
"amount": {
"shop_money": {
"amount": 21.6,
"currency_code": "USD"
},
"presentment_money": {
"amount": 21.6,
"currency_code": "USD"
}
},
"gateway": "shopify_payments"
}MoneyBag Field Type Required Description shop_moneyMoneySerializerYes Amount in shop's base currency presentment_moneyMoneySerializerYes Amount in customerโs local currency
MoneySerializer Field Type Required Description amountfloatYes Amount currency_codestringYes Currency code (ISO 4217)