【问题标题】:Modify an existing Fulfillment unexpectedly returns 404 page修改现有的 Fulfillment 意外返回 404 页面
【发布时间】:2013-03-27 21:11:59
【问题描述】:

我目前在github上使用sandeepshetty的shopify.php插件 https://github.com/sandeepshetty/shopify.php

插件似乎可以工作,逻辑也很简单。我已经使用“Create a new Fulfillment”对其进行了测试,但是在使用“Modify an existing Fulfillment”API 调用时收到错误消息。

我提交以下字符串并收到 404 错误

$orders = $shopify('PUT', "/admin/orders/160387514/fulfillments/791851111396.json", $fulfillment_put, $response_headers);

$fulfillment_put 转换为有效负载的地方

{ "fulfillment": { "tracking_number": "987654321", "id": 255858046 } }

以下是 PUT 命令的详细转储。如上所示,我对路径使用了以下格式。我确实用 hidden 或 alt 替换了一些变量,仅供参考。

/admin/orders/#{order_id}/fulfillments/#{product_id}.json

* About to connect() to alt.myshopify.com port 443 (#0)
*   Trying 204.93.213.40... * connected
* Connected to alt.myshopify.com (204.93.213.40) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /usr/share/curl/curl-ca-bundle.crt
  CApath: none
* SSL connection using RC4-SHA
* Server certificate:
* subject: /serialNumber=Hidden/C=CA/ST=Ontario/L=Ottawa/O=Jaded Pixel Technologies Inc./CN=*.myshopify.com
* start date: 2010-05-10 22:23:08 GMT
* expire date: 2015-08-12 19:17:14 GMT
* subjectAltName: alt.myshopify.com matched
* issuer: /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
* SSL certificate verify ok.
* Server auth using Basic with user 'hidden for privacy'
> PUT /admin/orders/160387514/fulfillments/791851111396.json HTTP/1.1
Authorization: Basic hidden for privacy=
User-Agent: HAC
Host: alt.myshopify.com
Accept: */*
Content-Type: application/json; charset=utf-8
Content-Length: 62

< HTTP/1.1 404 Not Found
< Server: nginx
< Date: Thu, 21 Mar 2013 21:39:06 GMT
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Status: 404 Not Found
< X-Shopify-Shop-Api-Call-Limit: 2/500
< HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 2/500
< X-Request-Id: 7ec529327cd022e973f22be4a9e86916
< X-UA-Compatible: IE=Edge,chrome=1
< Set-Cookie: _secure_session_id=hidden; path=/; secure; HttpOnly
< X-Runtime: 0.042757
< 
* Connection #0 to host alt.myshopify.com left intact
* Closing connection #0

附: 我想指出我使用了以下 API 文档 http://docs.shopify.com/api/fulfillment#create

这表明我使用 PUT /admin/orders/#{id}/fulfillments/#{id}.json

但是,#{id} 在那里被引用了两次,这表明我应该连续两次使用订单 ID,但文档清楚地显示了 /admin/orders/450789469/fulfillments/255858046.json 的示例 我想进一步说明 #{id} 的实际含义以及如何使用它们。

【问题讨论】:

    标签: php api shopify fulfillment


    【解决方案1】:

    我认为您只是在 /admin/orders/#{id}/fulfillments/#{id}.json 中为第二个 ID 使用了错误的 ID。第一个是正确的,它是订单 ID,但第二个是履行 ID。在创建履行响应中返回履行 ID。

    【讨论】:

    • 感谢您的回复,对于延迟接受它感到抱歉。问题很简单,就是使用了错误的 ID。
    猜你喜欢
    • 2019-09-10
    • 2020-05-12
    • 2021-11-29
    • 2013-08-28
    • 2018-09-03
    • 2020-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多