---
title: "checkout"
description: "查询结账"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/checkouts/queries/checkout'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/checkouts/queries/checkout.md'
---
# checkout

查询结账

- **Required Scopes:** `unauthenticated_read_checkouts_info`
- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Query

## Type Signature

`Checkout`

## Required Permissions

* `unauthenticated_read_checkouts_info`

接口访问需要令牌，具体如何获取令牌请参考：[身份认证](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md)

## Arguments

* `id`

  [ID!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/id.md)

  结账ID

## Returns

* `appliedGiftCards`

  [[AppliedGiftCard]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/member-system/objects/applied-gift-card.md)

  应用于结账的礼品卡

* `availableShippingRates`

  [AvailableShippingRates](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/available-shipping-rates.md)

  可选的运费方案

* `buyerIdentity`

  [CheckoutBuyerIdentity](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/checkouts/objects/checkout-buyer-identity.md)

  与结帐关联的客户的身份。

* `completedAt`

  [[Date]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  结帐完成的日期和时间。

* `createdAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  结帐创建的日期和时间。

* `currencyCode`

  [CurrencyCode](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/enums/currency-code.md)

  结账的币种码

* `customAttributes`

  [[Attribute]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/attribute.md)

  添加到结账的额外信息列表。

* `discountApplications`

  [[DiscountApplication]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/discount-application.md)

  已在结账时应用的折扣。

* `email`

  [String](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  结账的邮箱

* `id`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  全局唯一ID

* `lineItems`

  [[CheckoutLineItem]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/checkouts/objects/checkout-line-item.md)

  商品行列表，每个对象都包含有关结帐中的商品的信息。

* `lineItemsSubtotalPrice`

  [Money](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/money.md)

  结帐时所有商品的所有价格总和。不包括关税、税款、运费和折扣。

* `note`

  [String](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  与结帐关联的注释。

* `paymentDue`

  [Money](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/money.md)

  剩余要支付的金额。这等于商品行、关税、税金和运费减去折扣和礼品卡的成本。

* `requiresShipping`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/boolean.md)

  是否需要运输。

* `shippingAddress`

  [ShippingAddress](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/shipping-address.md)

  将运送到的收货地址。

* `shippingDiscountAllocations`

  [[DiscountAllocation]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/discount-allocation.md)

  应用的运费折扣

* `shippingLine`

  [ShippingRate](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/shipping-rate.md)

  一旦客户选择了运费，它就会转换为 shipping_line 对象。

* `subtotalPrice`

  [Money](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/money.md)

  关税、运费和税款前结账时的价格。

* `taxesIncluded`

  [Boolean](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/boolean.md)

  订单项目和运输线路价格中是否包含税费。

* `totalPrice`

  [Money](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/money.md)

  结账时所有商品的所有价格总和，包括关税、税款和折扣。

* `totalTax`

  [Money](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/money.md)

  结帐时应用于商品行和运输的所有税费总和。

* `updatedAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/date.md)

  上次更新结帐的日期和时间。

* `webUrl`

  [URL!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/url.md)

  访问结账页的链接

## Code Example

```graphql
 {
	checkout(id ) 
		 {
			# Checkout fields
		}
}
```

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes)。

