- 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
Receive a single DraftOrder
GET
/admin/api/{api_version}/draft_orders/{draft_order_id}.json
请求参数
Path 参数
api_version
string
必需
draft_order_id
string
必需
Query 参数
fields
string
可选
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://demo.myshopify.com//admin/api//draft_orders/.json'
返回响应
🟢200Receive a single DraftOrder
application/json
Body
draft_order
object (DraftOrder)
可选
id
string
可选
order_id
string
可选
name
string
可选
customer
string
可选
and removing customers. For more information about the
customer
resource, seethe Customer documentation.
shipping_address
string
可选
shipping_address
is optional and will not be available on orders that don't require shipping. The shipping_address
resource has the following properties:- address1: The street address of the shipping address.
- address2: An optional additional field for the street address of the shipping address.
- city: The city of the shipping address.
- company: The company of the person associated with the shipping address.
- country: The name of the country of the shipping address.
- country_code: The two-letter code for the country of the shipping address.
- first_name: The first name of the person associated with the payment method.
- last_name: The last name of the person associated with the payment method.
- latitude: The latitude of the shipping address.
- longitude: The longitude of the shipping address.
- name: The full name of the person associated with the payment method.
- phone: The phone number at the shipping address.
- province: The name of the state or province of the shipping address.
- province_code: The two-letter abbreviation of the state or province of the shipping address.
- zip: The zip or postal code of the shipping address.
billing_address
string
可选
billing_address
resource has the following properties:- address1: The street address of the billing address.
- address2: An optional additional field for the street address of the billing address.
- city: The city of the billing address.
- company: The company of the person associated with the billing address.
- country: The name of the country of the billing address.
- country_code: The two-letter code (ISO 3166-1 alpha-2 two-letter country code) for the country of the billing address.
- first_name: The first name of the person associated with the payment method.
- last_name: The last name of the person associated with the payment method.
- latitude: The latitude of the billing address.
- longitude: The longitude of the billing address.
- name: The full name of the person associated with the payment method.
- phone: The phone number at the billing address.
- province: The name of the billing address region, such as province, state, or prefecture.
- province_code: The two-letter abbreviation of the region for the billing address.
- zip: The postal code of the billing address, such as zip, postcode, or Eircode.
note
string
可选
note_attributes
string
可选
name
and value
keys.示例值:
{"name":"custom name","value":"custom value"}
email
string
可选
currency
string
可选
invoice_sent_at
string
可选
invoice_url
string
可选
line_items
string
可选
Each draft order must include at least one
line_item
.Each
line_item
resource has the following properties:- custom: Read only field Whether this is a custom line item or a product variant line item.
If set totrue
indicates a custom line item.
If set tofalse
indicates a product variant line item. - id: The ID of the line item.
- variant_id: The ID of the product variant corresponding to the line item. Required for a product variant line item. Set to
null
for a custom line item. - product_id: The ID of the product corresponding to the line item’s product variant.
- name: The name of the product.
- variant_title: The title of the product variant. Defaults to
Custom
for custom line items created via the API. - vendor: The vendor.
- quantity: The number of products that were purchased.
- gift_card: Indicates if the product is a gift card. Valid values:
true
orfalse
. - fulfillment_service: The service provider responsible for fulfillment. Valid values are either
manual
or the name of the provider, for example amazon, shipwire. Defaults tomanual
for custom line items. - properties: An array of custom information for an item that has been added to the draft order,
often used to provide product customization options.
Copied to created order when draft order is completed. - applied_discount: The discount applied to the line item. For more information, see the
applied_discount
property. - tax_lines: Read only field The calculated rate and amount of taxes for the line item.
- price: The amount of tax to be charged.
- rate: The rate of tax to be applied.
- title: The name of the tax.
- title: The title of the product or variant. Applicable only to custom line items. Required field.
- price: The price of the item before discounts have been applied. Applicable only to custom line items. Required field.
- grams: The weight of the item in grams. Applicable only to custom line items. If not specified, defaults to 0.
- requires_shipping: Whether the fulfillment requires shipping. Applicable only to custom line items. Valid values:
true
orfalse.
- sku: A unique identifier for the item in the fulfillment. Applicable only to custom line items.
- taxable: Whether the product is taxable. Applicable only to custom line items.
payment_terms
string
只读可选
- amount: The amount that is owed according to the payment terms.
- currency: The presentment currency for the payment.
- payment_terms_name: The name of the selected payment terms template for the draft order.
- payment_terms_type: The type of selected payment terms template for the draft order.
- due_in_days: The number of days between the invoice date and due date that is defined in the selected payment terms template.
- payment_schedules: An array of schedules associated to the payment terms.
- amount: The amount that is owed according to the payment terms.
- currency: The presentment currency for the payment.
- issued_at: The date and time when the payment terms were initiated.
- due_at: The date and time when the payment is due. Calculated based on
issued_at
anddue_in_days
or a customized fixed date if the type is fixed. - completed_at: The date and time when the purchase is completed. Returns null initially and updates when the payment is captured.
- expected_payment_method: The name of the payment method gateway.
shipping_line
string
可选
shipping_line
resource has the following properties:- custom: Whether this is a regular shipping line or custom shipping line.
- handle: The handle of the shipping rate which was selected and applied. Required for regular shipping lines.
- title: The title of the shipping method. Required for custom shipping lines. (maximum: 255 characters)
- price: The price of the shipping method. Required for custom shipping lines.
source_name
string
可选
You can register the channels that your app is managing by completing the Order Attribution Access Form.
After you've submited the form, you'll need to wait for your request to be processed by Shopify. You can find a list of your channels in the Partner Dashboard, in your app's Marketplace extension.
You can specify a handle as the
source_name
value in your request.tags
string
可选
Each individual tag is limited to 40 characters in length. For example,
tags: "tag1","tag2","tag3"
.tax_exempt
string
可选
false
,then Shopify refers to the
taxable
field for each line_item
.If a customer is applied to the draft order, then Shopify uses the customer's
tax_exempt
field instead.tax_exemptions
enum<string>
可选
枚举值:
EXEMPT_ALLCA_STATUS_CARD_EXEMPTIONCA_DIPLOMAT_EXEMPTIONCA_BC_RESELLER_EXEMPTIONCA_MB_RESELLER_EXEMPTIONCA_SK_RESELLER_EXEMPTIONCA_BC_COMMERCIAL_FISHERY_EXEMPTIONCA_MB_COMMERCIAL_FISHERY_EXEMPTIONCA_NS_COMMERCIAL_FISHERY_EXEMPTIONCA_PE_COMMERCIAL_FISHERY_EXEMPTIONCA_SK_COMMERCIAL_FISHERY_EXEMPTIONCA_BC_PRODUCTION_AND_MACHINERY_EXEMPTIONCA_SK_PRODUCTION_AND_MACHINERY_EXEMPTIONCA_BC_SUB_CONTRACTOR_EXEMPTIONCA_SK_SUB_CONTRACTOR_EXEMPTIONCA_BC_CONTRACTOR_EXEMPTIONCA_SK_CONTRACTOR_EXEMPTIONCA_ON_PURCHASE_EXEMPTIONCA_MB_FARMER_EXEMPTIONCA_NS_FARMER_EXEMPTIONCA_SK_FARMER_EXEMPTION
示例值:
CA_STATUS_CARD_EXEMPTIONCA_BC_RESELLER_EXEMPTION
tax_lines
string
只读可选
tax_lines
resource has the following properties:- price: The amount of tax to be charged.
- rate: The rate of tax to be applied.
- title: The name of the tax.
示例值:
{"price":11.94,"rate":0.06,"title":"State Tax"}
applied_discount
string
可选
applied_discount
resource and each draft order line item can have its own applied_discount
.The
applied_discount
resource has the following properties:- title: Title of the discount.
- description: Reason for the discount.
- value: The value of the discount. If the type of discount is
fixed_amount
, then it corresponds to a fixed dollar amount. If the type ispercentage
, then it corresponds to percentage. - value_type: The type of discount. Valid values:
percentage
,fixed_amount
. - amount: The applied amount of the discount, based on the setting of
value_type
. For more information, see Applying discounts.
taxes_included
string
可选
Valid values:
true
or false
.total_tax
string
可选
subtotal_price
string
可选
total_price
string
可选
including taxes and discounts.
completed_at
string
可选
created_at
string
可选
updated_at
string
可选
status
enum<string>
可选
The status of a draft order as it transitions into an order. When a draft order is created it is set to open
status.
The invoice can then be sent to the customer, and status
changes to invoice_sent
.
The draft order can then be paid, set to pending, or paid by credit card. In each case, the draft order is set to completed
and an order is created.
After a draft order is set to completed
the only further modifications that can be made are adding tags or metafields.
Valid values:
枚举值:
openinvoice_sentcompleted
示例
{
"draft_order": {
"id": 994118539,
"note": "rush order",
"email": "bob.norman@mail.example.com",
"taxes_included": false,
"currency": "USD",
"invoice_sent_at": null,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"tax_exempt": false,
"completed_at": null,
"name": "#D2",
"status": "open",
"line_items": [
{
"id": 994118539,
"variant_id": 39072856,
"product_id": 632910392,
"title": "IPod Nano - 8gb",
"variant_title": "green",
"sku": "IPOD2008GREEN",
"vendor": null,
"quantity": 1,
"requires_shipping": false,
"taxable": true,
"gift_card": false,
"fulfillment_service": "manual",
"grams": 567,
"tax_lines": [],
"applied_discount": null,
"name": "IPod Nano - 8gb - green",
"properties": [],
"custom": false,
"price": "199.00",
"admin_graphql_api_id": "gid://shopify/DraftOrderLineItem/994118539"
}
],
"shipping_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "+1(502)-459-2181",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"billing_address": {
"first_name": "Bob",
"address1": "Chestnut Street 92",
"phone": "+1(502)-459-2181",
"city": "Louisville",
"zip": "40202",
"province": "Kentucky",
"country": "United States",
"last_name": "Norman",
"address2": "",
"company": null,
"latitude": 45.41634,
"longitude": -75.6868,
"name": "Bob Norman",
"country_code": "US",
"province_code": "KY"
},
"invoice_url": "https://jsmith.myshopify.com/548380009/invoices/ba8dcf6c022ccad3d47e3909e378e33f",
"applied_discount": {
"description": "$5promo",
"value": "5.0",
"title": null,
"amount": "5.00",
"value_type": "fixed_amount"
},
"order_id": null,
"shipping_line": {
"title": "UPS Ground",
"custom": false,
"handle": "ups-3-12.25",
"price": "12.25"
},
"tax_lines": [],
"tags": "Wholesale",
"note_attributes": [],
"total_price": "206.25",
"subtotal_price": "194.00",
"total_tax": "0.00",
"payment_terms": null,
"admin_graphql_api_id": "gid://shopify/DraftOrder/994118539",
"customer": {
"id": 207119551,
"email": "bob.norman@mail.example.com",
"accepts_marketing": false,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"first_name": "Bob",
"last_name": "Norman",
"orders_count": 1,
"state": "disabled",
"total_spent": "199.65",
"last_order_id": 450789469,
"note": null,
"verified_email": true,
"multipass_identifier": null,
"tax_exempt": false,
"tags": "",
"last_order_name": "#1001",
"currency": "USD",
"phone": "+16136120707",
"accepts_marketing_updated_at": "2005-06-12T11:57:11-04:00",
"marketing_opt_in_level": null,
"tax_exemptions": [],
"email_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": null,
"consent_updated_at": "2004-06-13T11:57:11-04:00"
},
"sms_marketing_consent": {
"state": "not_subscribed",
"opt_in_level": "single_opt_in",
"consent_updated_at": "2023-01-03T12:56:35-05:00",
"consent_collected_from": "OTHER"
},
"admin_graphql_api_id": "gid://shopify/Customer/207119551",
"default_address": {
"id": 207119551,
"customer_id": 207119551,
"first_name": null,
"last_name": null,
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"country": "United States",
"zip": "40202",
"phone": "555-625-1199",
"name": "",
"province_code": "KY",
"country_code": "US",
"country_name": "United States",
"default": true
}
}
}
}
修改于 2023-01-29 12:00:32