shopify回传订单

已解决
ljl
新成员
29 0 0

通过该接口获取到shopify平台订单,如果我再次获取还会获取到相同的单子,如何回传订单状态,让已经获取到的单子无法获取到

38 条回复38
ljl
新成员
29 0 0

不好意思,周末还来打然您,不过看了一些博客,问题得到了解决

Snipaste_2021-10-24_10-52-17.png

ljl
新成员
29 0 0

1、目前接口已经调通了,应该不需要操作获取授权这一步吧

https://shopify.dev/apps/auth/oauth

2、在调获取订单接口时,shopify官方可以按照时间段来获取订单,API中提供的日期格式是这样的2005-07-31T15:57:11-04:00,我也转化成这样吗?重点是-04:00,你有转成这种时间格式的Java代码吗?

ljl_0-1635067220174.png

 

ljl
新成员
29 0 0

1、目前接口已经调通了,应该不需要操作获取授权这一步吧

https://shopify.dev/apps/auth/oauth

2、在调获取订单接口时,shopify官方可以按照时间段来获取订单,API中提供的日期格式是这样的2005-07-31T15:57:11-04:00,我也转化成这样吗?重点是-04:00,你有转成这种时间格式的Java代码吗?

ljl_0-1635067220174.png

 

ljl
新成员
29 0 0

您好,有个问题想问您一下,在创建正式订单的时候,可以指定渠道吗?

有们这边有一个需求,需要通过shopify平台店铺中订单的渠道,去匹配我们系统中指定的渠道,如果匹配上了,我就可以用这个渠道发货,请求shopifyf在建单时可以指定渠道吗?如果可以,方便告诉我在哪一步指定吗?

还有个问题2021-10-25T17:18:27+08:00,这是获取的中国时间,我用这个时间减掉8个小时才能获取到当下创建的订单,也就是说我如果在拉取shopify平台的订单,我在中国根据指定时间日期去拉取,拉的是8个小时以前的订单

 

ljl_0-1635152914162.png

 

https://8578cc2007111d6dff8ea7b92e6fd69f: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@redliuiot.myshopify....

{
    "orders": [
        {
            "id"3901351919716,
            "admin_graphql_api_id""gid://shopify/Order/3901351919716",
            "app_id"1354745,
            "browser_ip"null,
            "buyer_accepts_marketing"false,
            "cancel_reason"null,
            "cancelled_at"null,
            "cart_token"null,
            "checkout_id"23170614100068,
            "checkout_token""215f7af4c24162d06a55a631d712424b",
            "client_details": {
                "accept_language"null,
                "browser_height"null,
                "browser_ip"null,
                "browser_width"null,
                "session_hash"null,
                "user_agent"null
            },
            "closed_at"null,
            "confirmed"true,
            "contact_email""111111@qq.com",
            "created_at""2021-10-25T14:36:20+08:00",
            "currency""USD",
            "current_subtotal_price""100.00",
            "current_subtotal_price_set": {
                "shop_money": {
                    "amount""100.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""100.00",
                    "currency_code""USD"
                }
            },
            "current_total_discounts""0.00",
            "current_total_discounts_set": {
                "shop_money": {
                    "amount""0.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""0.00",
                    "currency_code""USD"
                }
            },
            "current_total_duties_set"null,
            "current_total_price""100.00",
            "current_total_price_set": {
                "shop_money": {
                    "amount""100.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""100.00",
                    "currency_code""USD"
                }
            },
            "current_total_tax""0.00",
            "current_total_tax_set": {
                "shop_money": {
                    "amount""0.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""0.00",
                    "currency_code""USD"
                }
            },
            "customer_locale""zh-CN",
            "device_id"null,
            "discount_codes": [],
            "email""111111@qq.com",
            "estimated_taxes"false,
            "financial_status""paid",
            "fulfillment_status"null,
            "gateway""manual",
            "landing_site"null,
            "landing_site_ref"null,
            "location_id"null,
            "name""#1018",
            "note""测试面单",
            "note_attributes": [],
            "number"18,
            "order_number"1018,
            "original_total_duties_set"null,
            "payment_gateway_names": [
                "manual"
            ],
            "phone"null,
            "presentment_currency""USD",
            "processed_at""2021-10-25T14:36:20+08:00",
            "processing_method""manual",
            "reference"null,
            "referring_site"null,
            "source_identifier"null,
            "source_name""shopify_draft_order",
            "source_url"null,
            "subtotal_price""100.00",
            "subtotal_price_set": {
                "shop_money": {
                    "amount""100.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""100.00",
                    "currency_code""USD"
                }
            },
            "tags""",
            "tax_lines": [],
            "taxes_included"false,
            "test"false,
            "token""3aa74d1e15221a7b6890377c4a7267c8",
            "total_discounts""0.00",
            "total_discounts_set": {
                "shop_money": {
                    "amount""0.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""0.00",
                    "currency_code""USD"
                }
            },
            "total_line_items_price""100.00",
            "total_line_items_price_set": {
                "shop_money": {
                    "amount""100.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""100.00",
                    "currency_code""USD"
                }
            },
            "total_outstanding""0.00",
            "total_price""100.00",
            "total_price_set": {
                "shop_money": {
                    "amount""100.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""100.00",
                    "currency_code""USD"
                }
            },
            "total_price_usd""100.00",
            "total_shipping_price_set": {
                "shop_money": {
                    "amount""0.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""0.00",
                    "currency_code""USD"
                }
            },
            "total_tax""0.00",
            "total_tax_set": {
                "shop_money": {
                    "amount""0.00",
                    "currency_code""USD"
                },
                "presentment_money": {
                    "amount""0.00",
                    "currency_code""USD"
                }
            },
            "total_tip_received""0.00",
            "total_weight"45359,
            "updated_at""2021-10-25T14:36:21+08:00",
            "user_id"71512817764,
            "billing_address": {
                "first_name""test",
                "address1""1200  Westport Rd",
                "phone""+11234567890",
                "city""Imperial",
                "zip""15126-1002",
                "province""Pennsylvania",
                "country""United States",
                "last_name""test",
                "address2""",
                "company""test",
                "latitude"40.4502542,
                "longitude"-80.3158926,
                "name""test test",
                "country_code""US",
                "province_code""PA"
            },
            "customer": {
                "id"5257612558436,
                "email""111111@qq.com",
                "accepts_marketing"false,
                "created_at""2021-10-22T09:27:57+08:00",
                "updated_at""2021-10-25T14:36:21+08:00",
                "first_name""test",
                "last_name""test",
                "orders_count"15,
                "state""disabled",
                "total_spent""1500.00",
                "last_order_id"3901351919716,
                "note"null,
                "verified_email"true,
                "multipass_identifier"null,
                "tax_exempt"false,
                "phone"null,
                "tags""",
                "last_order_name""#1018",
                "currency""USD",
                "accepts_marketing_updated_at""2021-10-22T09:27:57+08:00",
                "marketing_opt_in_level"null,
                "tax_exemptions": [],
                "sms_marketing_consent"null,
                "admin_graphql_api_id""gid://shopify/Customer/5257612558436",
                "default_address": {
                    "id"6454376005732,
                    "customer_id"5257612558436,
                    "first_name""test",
                    "last_name""test",
                    "company""test",
                    "address1""1200  Westport Rd",
                    "address2""",
                    "city""Imperial",
                    "province""Pennsylvania",
                    "country""United States",
                    "zip""15126-1002",
                    "phone""+11234567890",
                    "name""test test",
                    "province_code""PA",
                    "country_code""US",
                    "country_name""United States",
                    "default"true
                }
            },
            "discount_applications": [],
            "fulfillments": [],
            "line_items": [
                {
                    "id"10184054964324,
                    "admin_graphql_api_id""gid://shopify/LineItem/10184054964324",
                    "destination_location": {
                        "id"2975341346916,
                        "country_code""US",
                        "province_code""PA",
                        "name""testtest",
                        "address1""1200  Westport Rd",
                        "address2""",
                        "city""Imperial",
                        "zip""15126-1002"
                    },
                    "fulfillable_quantity"1,
                    "fulfillment_service""manual",
                    "fulfillment_status"null,
                    "gift_card"false,
                    "grams"45359,
                    "name""HAT - RED",
                    "origin_location": {
                        "id"2974544560228,
                        "country_code""US",
                        "province_code""NJ",
                        "name""redliuiot",
                        "address1""601 RANDOLPH RD",
                        "address2""",
                        "city""SOMERSET",
                        "zip""08873"
                    },
                    "price""100.00",
                    "price_set": {
                        "shop_money": {
                            "amount""100.00",
                            "currency_code""USD"
                        },
                        "presentment_money": {
                            "amount""100.00",
                            "currency_code""USD"
                        }
                    },
                    "product_exists"true,
                    "product_id"6608633462884,
                    "properties": [],
                    "quantity"1,
                    "requires_shipping"true,
                    "sku""HAT",
                    "taxable"true,
                    "title""HAT",
                    "total_discount""0.00",
                    "total_discount_set": {
                        "shop_money": {
                            "amount""0.00",
                            "currency_code""USD"
                        },
                        "presentment_money": {
                            "amount""0.00",
                            "currency_code""USD"
                        }
                    },
                    "variant_id"39453535535204,
                    "variant_inventory_management""shopify",
                    "variant_title""RED",
                    "vendor""redliuiot",
                    "tax_lines": [],
                    "duties": [],
                    "discount_allocations": []
                }
            ],
            "payment_terms"null,
            "refunds": [],
            "shipping_address": {
                "first_name""test",
                "address1""1200  Westport Rd",
                "phone""+11234567890",
                "city""Imperial",
                "zip""15126-1002",
                "province""Pennsylvania",
                "country""United States",
                "last_name""test",
                "address2""",
                "company""test",
                "latitude"40.4502542,
                "longitude"-80.3158926,
                "name""test test",
                "country_code""US",
                "province_code""PA"
            },
            "shipping_lines": []
        }
    ]
}
Tim_Mak
探索者
89 10 12

1. 可以,如果店铺有设置物流选项,他们会在订单的shipping_lines这一条显示

2. 你们指定时间是什么目的?有好几个不同的用法,created_at_max是指定时间以前的订单,created_at_min是指定时间以后的订单

ljl
新成员
29 0 0

我不是很清楚店铺物流选项在哪里设置,方便截图告诉我吗?

这是shopify平台告诉我的,他不建议我这样做

了解,Shopify的后台设计中,发货和选择物流商是同一个动作(因为一般来说要发货的话才会选择物流商)

因此建议您可以在确认物流商后,再选择发货并选择该物流商

请问以上说明是否有不清楚,或是其他能帮助您的部分呢?

这次对话给您的体验如何?期待您的反馈
/

Tim_Mak
探索者
89 10 12

我想了下,更好的方案应该是按location_id去区分

shopify店铺可以有多个发货地点,每个都有单独的location_id

这个location_id是可以获取订单的时候得知

ljl
新成员
29 0 0

我看了一下,此方案不可行,因为订单状态为未发货状态时,当调取获取订单接口时,是获取不到订单location_id,当调fulfillments回传运单号和面单信息才传location_id,还有别的可行方案吗?当我获取到未发货状态的订单时,就能使用使用某参数用于我来做一个渠道映射

ljl
新成员
29 0 0

此问题已得到解决,我们系统如果同步过来的订单如果没有指定渠道,是可以在我们系统选择的,谢谢