mutation {
productUpdate(input: {
id: "gid://shopify/Product/7812042391803",
productCategory: {
productTaxonomyNodeId: "gid://shopify/ProductTaxonomyNode/5260"
product {
handle
productCategory {
productTaxonomyNode {
fullName
将产品加入 Collection
将产品加入手工维护的 Collection
mutation {
productUpdate(input: {
id: "gid://shopify/Product/7812042391803",
collectionsToJoin: "gid://shopify/Collection/405028700411",
product {
collections(first: 3) {
edges {
node {
handle
通过添加标签加入 Smart Collection
mutation {
productUpdate(input: {
id: "gid://shopify/Product/7812042391803",
tags: "auto-test",
product {
collections(first: 3) {
edges {
node {
handle
gid://shopify/InventoryItem/19848949301270
gid://shopify/InventoryItem/19848949334038
gid://shopify/InventoryItem/19848949366806
以及如下 Location ID
:
gid://shopify/Location/17285971990
通过 InventoryItem ID 和 Location ID 的组合,即可查询到具体仓库的目标产品数量,如:
inventoryItem(id: "gid://shopify/InventoryItem/19848949301270") {
variant {
inventoryQuantity
inventoryLevel(locationId: "gid://shopify/Location/17285971990") {
available
注意,variant - inventoryQuantity
表示产品变体的库存值,它的值是通过所有 Location
的 available
求和计算而来。
Order
LineItem
LineItem
当一个订单生成后,包含在一个具体订单里的变体数据。
order(id: "gid://shopify/Order/5003857068283") {
lineItems(first: 3) {
edges {
node {
title
quantity
variant {
selectedOptions {
value
以上获取到的数据:
LineItem
- gid://shopify/LineItem/12714633101563
FulfillmentOrder
FulfillmentOrder
当一个订单生成后,就会自动生成一个对应的 FulfillmentOrder 履约订单。在实际操作中,一个订单会可能会对应多个 FulfillmentOrder,例如:
一个订单拆分为多个包裹发送,每个包裹对应一个 FulfillmentOrder
订单状态发生变化时可能生成新的 FulfillmentOrder,例如订单从 Archive 状态回退到 Active 状态
查询目标订单的 FulfillmentOrder 数据:
order(id: "gid://shopify/Order/5003857068283") {
displayFulfillmentStatus
fulfillmentOrders(first: 10) {
edges {
node {
fulfillments(first: 10) {
edges {
node {
location {
service {
serviceName
trackingInfo {
number
company
lineItems(first: 10) {
edges {
node {
totalQuantity
lineItem {
title
quantity
variant {
title
selectedOptions {
value
以上获取到的数据:
FulfillmentOrder
- gid://shopify/FulfillmentOrder/6068263977211
fulfillments
- gid://shopify/Fulfillment/4476508373243
location
- gid://shopify/Location/66597421307
service - serviceName
- Manual
trackingInfo - number
- EV007047131CN
Ecommerce fulfillment is the entire process of picking, packing, and shipping products to customers. It includes maintaining inventory, locating products within storage, packaging products, and managing the logistics of delivery.
Fulfillment methods 发货方式
手动发货 Manual fulfillment
自动发货 Automatic fulfillment
使用第三方发货服务 Fulfillment services
与 Shopify 集成的发货服务 Fulfillment services that integrate with Shopify
Dropshipping apps
Print-on-demand apps
自定义发货服务 Custom fulfillment services
综合使用以上两种方式
自定义发货服务 Custom fulfillment services 实际上比较少见,卖家在 Settings - Shipping and delivery - Custom order fulfillment 中添加一个履约服务商的邮箱账户。当你将订单状态修改为「已发货」时,Shopify 会给履约服务商发送一封邮件,对方在收到邮件后完成发货服务。
Fulfillment API 发布说明
自 2022-07 起,早期的 Order
和 Fulfillment
的发货方式将不再支持,你应该用新的 FulfillmentOrder API。
Shipping
FulfillmentService API
创建发货应用
Shopify 创建发货应用的一个示例
Shopify 有几组 API 提供运输服务:
Fulfillment API - 履约服务,例如客户下单后 Shopify 通过 Fulfillment API 通知 APP
Carrier API - 承运人服务,例如各个运输方式的运费等,可能由 EMS, FedDex, UPS, USPS, Royal Mail 等运输服务商提供
DeliveryParticipant
A participant defines carrier-calculated rates for shipping services with a possible merchant-defined fixed fee or a percentage-of-rate fee.
查看店铺可以运输到的国家:
shop {
shipsToCountries
countriesInShippingZones {
countryCodes
查看店铺支持的运输服务 — 店铺的仓库:
shop {
fulfillmentServices {
handle
serviceName
location {
gid://shopify/Fulfillment/4204182405371
gid://shopify/Fulfillment/4203943035131
gid://shopify/Fulfillment/4203418452219
gid://shopify/Fulfillment/4203386044667
gid://shopify/Fulfillment/4200556003579
gid://shopify/Fulfillment/4200555446523
FulfillmentService
- gid://shopify/FulfillmentService/manual
trackingInfo - number
- EV006047541CN
查询指定运单:
fulfillment(id: "gid://shopify/Fulfillment/4204182405371") {
status
order {
trackingInfo {
number
company
更新运单号:
mutation {
fulfillmentTrackingInfoUpdateV2(
fulfillmentId: "gid://shopify/Fulfillment/4204182405371"
trackingInfoInput: {
number: "EV006047542CN"
fulfillment {
trackingInfo {
number