- 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
Completes a checkout
POST
/admin/api/{api_version}/checkouts/{token}/complete.json
请求参数
Path 参数
api_version
string
必需
token
string
必需
示例代码
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//checkouts//complete.json'
返回响应
🟢202Completes a checkout
application/json
Body
checkout
object (Checkout)
可选
applied_discount
string
可选
A cart-level discount applied to the checkout. Apply a discount by
specifying values for amount
, title
, description
, value
,
and value_type
.
- amount: The amount that is deducted from
payment_due
in presentment currency. - title: The title to categorize the applied discount.
- description: The description of the applied discount.
- value: The value that was used to calculate the final applied discount amount.
- value_type: The type of value that was used to calculate the final applied discount amount. Valid values:
fixed_amount
andpercentage
. - non_applicable_reason: The reason why the discount is not applicable, if the discount cannot be applied to the checkout.
- applicable: Whether this discount code can be applied to the checkout.
- application_type: Describes how the discount was applied to the checkout. Possible values:
- automatic: The discount was applied automatically.
- discount_code: The merchant or customer entered a discount code.
- manual: The discount was applied manually by the merchant or an app.
- script: The discount was applied by a Shopify Script.
billing_address
string
必需
- address1: The street address of the billing address.
- address2: An optional additional field for the street address of the billing address.
- city: The city, town, or village 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 format) 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.
- phone: The phone number at the billing address.
- province: The name of the region (province, state, prefecture, …) of the billing address.
- province_code: The two-letter abbreviation of the region of the billing address.
- zip: The postal code (zip, postcode, Eircode, …) of the billing address.
buyer_accepts_marketing
string
可选
created_at
string
只读可选
currency
string
只读可选
presentment_currency
.customer_id
string
可选
discount_code
string
可选
applied_discount
withthe appropriate metadata for that discount code. To remove a discount code, send an empty string or
null
.email
string
可选
email
or phone
before it can be completed.gift_cards
string
可选
Gift cards can be applied to a checkout by passing
{ "checkout": { "gift_cards": [{ "code": "a gift card code" }, { "code": "another gift card code" }] } }
.Each gift card object has the following properties:
- amount_used: The amount of the gift card used by this checkout in presentment currency.
- code: The gift card code.
- balance: The amount left on the gift card after being applied to this checkout in presentment currency.
- id: The ID for the applied gift card.
- last_characters: The last four characters of the applied gift card for display back to the user.
gift_cards
array without that gift card.示例值:
{"amount_used":"30.00","balance":"70.00","id":1014759463,"last_characters":"abdr"}
line_items
string
必需
- applied_discounts: A list of the discounts applied to the line item.
- compare_at_price: The original selling price of the product, if applicable.
- discount_allocations: A list all discounts on the checkout that target this line item, including both "across" and "each" applications. A superset of
applied_discounts
. - fulfillment_service: If the variant is a gift card, allows to override the fulfillment service so the gift card can be activated with a custom code. Valid values:
manual
. - grams: The weight of the item in grams.
- id: The checkout-specific ID of the line item.
- line_price: The line price of the item, based on
price
multiplied byquantity
. - price: The price of the item in presentment currency.
- product_id: The product of the line item.
- properties: The customization information for a line item (optional).
- quantity: The number of products that were purchased.
- requires_shipping: Whether the fulfillment requires shipping.
- sku: The unique identifier of the item in the fulfillment.
- taxable: Whether this product is taxable.
- title: The title of the product.
- variant_id: The variant ID of the line item.
- variant_title: The title of the product variant.
- vendor: The name of the item's supplier.
order
string
只读可选
null
.payment_due
string
只读可选
payment_url
string
只读可选
https://elb.deposit.shopifycs.com/sessions
.phone
string
可选
email
or phone
before it can be completed.presentment_currency
string
可选
currency
.requires_shipping
string
只读可选
true
, then shipping_line
must be set before creating a payment.reservation_time
string
已废弃
null
. This property is not writable.reservation_time_left
string
已废弃
0
. This property is not writable.shipping_address
string
可选
- address1: The street address of the shipping address.
- address2: An optional additional field for the street address of the shipping address.
- city: The city, town, or village 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 (ISO 3166-1 alpha-2 format) for the country of the shipping address.
- first_name: The first name of the person associated with the shipping address.
- last_name: The last name of the person associated with the shipping address.
- phone: The phone number at the shipping address.
- province: The name of the region (province, state, prefecture, …) of the shipping address.
- province_code: The two-letter abbreviation of the region of the shipping address.
- zip: The postal code (zip, postcode, Eircode, …) of the shipping address.
shipping_line
string
可选
handle
.A shipping line is required when
requires_shipping
is true
. Learn more aboutselecting shipping rates.
shipping_rate
string
只读可选
source_name
string
可选
source_name
value in your request.source_identifier
string
可选
This value doesn't correspond to the Shopify ID that's generated from a completed draft.
source_url
string
可选
This URL is displayed to merchants on the Order Details page.
If the URL is invalid, then it won't be displayed.
subtotal_price
string
只读可选
tax_lines
string
只读可选
tax_line
objects, each of which represents a tax rate applicable to the checkout. Each tax line object has the following properties:- price: The amount of tax to be charged in presentment currency.
- rate: The rate of tax to be applied.
- title: The name of the tax.
示例值:
{"price":"11.94","rate":"0.06","title":"State Tax"}
taxes_included
string
只读可选
token
string
只读可选
total_price
string
只读可选
total_tax
string
只读可选
updated_at
string
只读可选
user_id
string
可选
null
.web_url
string
只读可选
示例
{
"checkout": {
"completed_at": null,
"created_at": "2012-10-12T07:05:27-04:00",
"currency": "USD",
"presentment_currency": "USD",
"customer_id": 207119551,
"customer_locale": "en",
"device_id": null,
"discount_code": null,
"discount_codes": [],
"email": "bob.norman@mail.example.com",
"legal_notice_url": null,
"location_id": null,
"name": "#86568385",
"note": "",
"note_attributes": {
"custom engraving": "Happy Birthday",
"colour": "green"
},
"order_id": null,
"order_status_url": null,
"order": null,
"payment_due": "0.00",
"payment_url": "https://app.local/cardserver/sessions",
"payments": [],
"phone": null,
"shopify_payments_account_id": null,
"privacy_policy_url": null,
"refund_policy_url": null,
"requires_shipping": false,
"reservation_time_left": 0,
"reservation_time": null,
"source_identifier": null,
"source_name": "web",
"source_url": null,
"subscription_policy_url": null,
"subtotal_price": "0.00",
"shipping_policy_url": null,
"tax_exempt": false,
"taxes_included": false,
"terms_of_sale_url": null,
"terms_of_service_url": null,
"token": "b490a9220cd14d7344024f4874f640a6",
"total_price": "0.00",
"total_tax": "0.00",
"total_tip_received": "0.00",
"total_line_items_price": "0.00",
"updated_at": "2023-01-03T12:41:10-05:00",
"user_id": null,
"web_url": "https://checkout.local/548380009/checkouts/b490a9220cd14d7344024f4874f640a6",
"total_duties": null,
"total_additional_fees": null,
"line_items": [
{
"id": 49148385,
"key": 49148385,
"product_id": 632910392,
"variant_id": 49148385,
"sku": "IPOD2008RED",
"vendor": "Apple",
"title": "IPod Nano - 8GB",
"variant_title": "Red",
"image_url": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672766496",
"taxable": true,
"requires_shipping": false,
"gift_card": false,
"price": "0.00",
"compare_at_price": null,
"line_price": "0.00",
"properties": {},
"quantity": 1,
"grams": 200,
"fulfillment_service": "manual",
"applied_discounts": [],
"discount_allocations": [],
"tax_lines": []
}
],
"gift_cards": [],
"tax_lines": [],
"tax_manipulations": [],
"shipping_line": null,
"shipping_rate": null,
"shipping_address": {
"id": 550558813,
"first_name": "Bob",
"last_name": "Norman",
"phone": "+1(502)-459-2181",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
},
"credit_card": null,
"billing_address": {
"id": 550558813,
"first_name": "Bob",
"last_name": "Norman",
"phone": "+1(502)-459-2181",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
},
"applied_discount": null,
"applied_discounts": [],
"discount_violations": []
}
}
修改于 2023-01-29 12:00:33