- Customers
- Customer Address
- Retrieves a list of addresses for a customer
- Creates a new address for a customer
- Retrieves details for a single customer address
- Updates an existing customer address
- Removes an address from a customer’s address list
- Performs bulk operations for multiple customer addresses
- Sets the default address for a customer
- CustomerSavedSearch
- Customer
- Retrieves a list of customers
- Creates a customer
- Searches for customers that match a supplied query
- Retrieves a single customer
- Updates a customer
- Deletes a customer
- Creates an account activation URL for a customer
- Sends an account invite to a customer
- Retrieves a count of customers
- Retrieves all orders that belong to a customer
- Sales channels
- Checkout
- CollectionListing
- Retrieve collection listings that are published to your app
- Retrieve product_ids that are published to a collection_id
- Retrieve a specific collection listing that is published to your app
- Create a collection listing to publish a collection to your app
- Delete a collection listing to unpublish a collection from your app
- Product ResourceFeedback
- MobilePlatformApplication
- ProductListing
- Retrieve product listings that are published to your app
- Retrieve product_ids that are published to your app
- Retrieve a count of products that are published to your app
- Retrieve a specific product listing that is published to your app
- Create a product listing to publish a product to your app
- Delete a product listing to unpublish a product from your app
- ResourceFeedback
- Payment
- Products
- Collect
- Collection
- CustomCollection
- Product
- Product Image
- Product Variant
- SmartCollection
- Orders
- Abandoned checkouts
- DraftOrder
- Order Risk
- Transaction
- Order
- Refund
- Access
- Billing
- Online store
- Asset
- Blog
- Article
- Retrieves a list of all articles from a blog
- Creates an article for a blog
- Retrieves a count of all articles from a blog
- Receive a single Article
- Updates an article
- Deletes an article
- Retrieves a list of all article authors
- Retrieves a list of all article tags
- Retrieves a list of all article tags from a specific blog
- Redirect
- Comment
- ScriptTag
- Page
- Theme
- Shipping and fulfillment
- CancellationRequest
- CarrierService
- AssignedFulfillmentOrder
- FulfillmentEvent
- Fulfillment
- Retrieves fulfillments associated with an order
- Retrieves fulfillments associated with a fulfillment order
- Retrieves a count of fulfillments associated with a specific order
- Receive a single Fulfillment
- Creates a fulfillment for one or many fulfillment orders
- Updates the tracking information for a fulfillment
- Cancels a fulfillment
- FulfillmentOrder
- Retrieves a list of fulfillment orders for a specific order
- Retrieves a specific fulfillment order
- Cancel a fulfillment order
- Marks a fulfillment order as incomplete
- Moves a fulfillment order to a new location
- Marks the fulfillment order as open
- Reschedules the fulfill_at time of a scheduled fulfillment order
- Applies a fulfillment hold on an open fulfillment order
- Sets deadline for fulfillment orders
- Releases the fulfillment hold on a fulfillment order
- LocationsForMove
- FulfillmentRequest
- FulfillmentService
- Shopify Payments
- Analytics
- Deprecated API calls
- Discounts
- DiscountCode
- Creates a discount code
- Retrieves a list of discount codes
- Updates an existing discount code
- Retrieves a single discount code
- Deletes a discount code
- Retrieves the location of a discount code
- Retrieves a count of discount codes for a shop
- Creates a discount code creation job
- Retrieves a discount code creation job
- Retrieves a list of discount codes for a discount code creation job
- PriceRule
- DiscountCode
- Inventory
- Events
- MarketingEvent
- Metafield
- Plus
- Store properties
- TenderTransaction
Creates a refund
POST
/admin/api/{api_version}/orders/{order_id}/refunds.json
calculate
endpoint to produce the transactions to submit.请求参数
Path 参数
api_version
string
必需
order_id
string
必需
Query 参数
currency
string
可选
discrepancy_reason
string
可选
reason
property of the resulting order_adjustment
object attached to the refund. Valid values: restock
, damage
, customer
, and other
.note
string
可选
notify
string
可选
refund_line_items
string
可选
示例值:
line_item_id
restock
string
可选
restock_type
for refund line items instead.shipping
string
可选
示例值:
full_refund
transactions
string
可选
to process as refunds. Use the
calculate
endpoint to obtain these transactions.示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://demo.myshopify.com//admin/api//orders//refunds.json'
返回响应
🟢201Creates a refund
application/json
Body
refund
object (Refund)
可选
created_at
string
只读可选
duties
string
只读可选
id
string
只读可选
note
string
可选
order_adjustments
object
只读可选
示例值:
{"id":4221763620,"order_id":171016912932,"refund_id":8244756516,"amount":"-8.00","tax_amount":"0.00","kind":"shipping_refund","reason":"Shipping refund","amount_set":{"shop_money":{"amount":10.99,"currency_code":"USD"},"presentment_money":{"amount":12.95,"currency_code":"CAD"}},"tax_amount_set":{"shop_money":{"amount":1.67,"currency_code":"USD"},"presentment_money":{"amount":2.32,"currency_code":"CAD"}}}
processed_at
string
可选
processed_at
timestamp set to a value earlier the created_at
timestamp. Private apps can't be granted permission by Shopify.refund_duties
string
可选
- duty_id: The unique identifier of the duty.
- refund_type: Specifies how you want the duty refunded. Valid values:
FULL
: Refunds all the duties associated with a duty ID. You do not need to include refund line items if you are using the full refund type.PROPORTIONAL
: Refunds duties in proportion to the line item quantity that you want to refund. If you choose the proportional refund type, then you must also pass the refund line items to calculate the portion of duties to refund.
示例值:
{"duty_id":1,"refund_type":"FULL"}
refund_line_items
string
可选
A list of refunded line items. Each entry has the following properties:
- id: The unique identifier of the line item in the refund.
- line_item: A line item being refunded.
- line_item_id: The ID of the related line item in the order.
- quantity: The refunded quantity of the associated line item.
- restock_type: How this refund line item affects inventory levels. Valid values:
- no_restock: Refunding these items won't affect inventory. The number of fulfillable units for this line item will remain unchanged. For example, a refund payment can be issued but no items will be refunded or made available for sale again.
- cancel: The items have not yet been fulfilled. The canceled quantity will be added back to the available count. The number of fulfillable units for this line item will decrease.
- return: The items were already delivered, and will be returned to the merchant. The refunded quantity will be added back to the available count. The number of fulfillable units for this line item will remain unchanged.
- legacy_restock: The deprecated
restock
property was used for this refund. These items were made available for sale again. This value is not accepted when creating new refunds.
- location_id: The unique identifier of the location where the items will be restocked. Required when
restock_type
has the valuereturn
orcancel
. - subtotal: The subtotal of the refund line item.
- total_tax: The total tax on the refund line item.
- subtotal_set: The subtotal of the refund line item in shop and presentment currencies.
- total_tax_set: The total tax of the line item in shop and presentment currencies.
示例值:
{"id":209341123,"line_item":{},"line_item_id":128323456,"quantity":2,"location_id":40642626,"restock_type":"return","subtotal":10.99,"total_tax":2.67,"subtotal_set":{"shop_money":{"amount":10.99,"currency_code":"CAD"},"presentment_money":{"amount":8.95,"currency_code":"USD"}},"total_tax_set":{"shop_money":{"amount":1.67,"currency_code":"CAD"},"presentment_money":{"amount":1.32,"currency_code":"USD"}}}
restock
string
已废弃
transactions
string
可选
示例值:
{"id":179259969,"order_id":450789469,"amount":"209.00","kind":"refund","gateway":"shopify_payments","status":"success","message":null,"created_at":"2005-08-05T12:59:12-04:00","test":false,"authorization":"authorization-key","currency":"USD","location_id":null,"user_id":null,"parent_id":801038806,"device_id":null,"receipt":{},"error_code":null,"source_name":"web"}
user_id
string
可选
示例
{
"refund": {
"id": 929361465,
"order_id": 450789469,
"created_at": "2023-01-03T13:05:55-05:00",
"note": "wrong size",
"user_id": null,
"processed_at": "2023-01-03T13:05:55-05:00",
"restock": false,
"duties": [],
"total_duties_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"additional_fees": [],
"total_additional_fees_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"return": null,
"admin_graphql_api_id": "gid://shopify/Refund/929361465",
"refund_line_items": [
{
"location_id": null,
"restock_type": "no_restock",
"quantity": 1,
"id": 1058498312,
"line_item_id": 518995019,
"subtotal": 195.67,
"total_tax": 3.98,
"subtotal_set": {
"shop_money": {
"amount": "195.67",
"currency_code": "USD"
},
"presentment_money": {
"amount": "195.67",
"currency_code": "USD"
}
},
"total_tax_set": {
"shop_money": {
"amount": "3.98",
"currency_code": "USD"
},
"presentment_money": {
"amount": "3.98",
"currency_code": "USD"
}
},
"line_item": {
"id": 518995019,
"variant_id": 49148385,
"title": "IPod Nano - 8gb",
"quantity": 1,
"sku": "IPOD2008RED",
"variant_title": "red",
"vendor": null,
"fulfillment_service": "manual",
"product_id": 632910392,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"name": "IPod Nano - 8gb - red",
"variant_inventory_management": "shopify",
"properties": [],
"product_exists": true,
"fulfillable_quantity": 1,
"grams": 200,
"price": "199.00",
"total_discount": "0.00",
"fulfillment_status": null,
"price_set": {
"shop_money": {
"amount": "199.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "199.00",
"currency_code": "USD"
}
},
"total_discount_set": {
"shop_money": {
"amount": "0.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "0.00",
"currency_code": "USD"
}
},
"discount_allocations": [
{
"amount": "3.33",
"discount_application_index": 0,
"amount_set": {
"shop_money": {
"amount": "3.33",
"currency_code": "USD"
},
"presentment_money": {
"amount": "3.33",
"currency_code": "USD"
}
}
}
],
"duties": [],
"admin_graphql_api_id": "gid://shopify/LineItem/518995019",
"tax_lines": [
{
"title": "State Tax",
"price": "3.98",
"rate": 0.06,
"channel_liable": null,
"price_set": {
"shop_money": {
"amount": "3.98",
"currency_code": "USD"
},
"presentment_money": {
"amount": "3.98",
"currency_code": "USD"
}
}
}
]
}
}
],
"transactions": [
{
"id": 1068278491,
"order_id": 450789469,
"kind": "refund",
"gateway": "bogus",
"status": "success",
"message": "Bogus Gateway: Forced success",
"created_at": "2023-01-03T13:05:54-05:00",
"test": true,
"authorization": null,
"location_id": null,
"user_id": null,
"parent_id": 801038806,
"processed_at": "2023-01-03T13:05:54-05:00",
"device_id": null,
"error_code": null,
"source_name": "755357713",
"receipt": {},
"amount": "41.94",
"currency": "USD",
"payment_id": "c901414060.1",
"admin_graphql_api_id": "gid://shopify/OrderTransaction/1068278491"
}
],
"order_adjustments": []
}
}
修改于 2023-01-29 12:00:33