Question

Creates a Fulfillment Status in Shopify

  • 2 January 2024
  • 8 replies
  • 137 views

Userlevel 1
Badge

Hello Together I would like to generate a fulfillment status in Shopify. As long as I follow the API documentation of Shopify. I get an error message: Bad Request Status 400. 
I also tried it in the POST-Request instead of Custom-Request. Write here Error Code 500. I'd appreciate any solution. Thank you. 
Here is the Shopify API documentation.

https://shopify.dev/docs/api/admin-rest/2023-10/resources/fulfillment#post-fulfillments


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +14

Hi @VIktor1515 

Have you tried to create a custom action for Shopify with the help of AI?

 

Userlevel 1
Badge

I tried the whole thing in Custom Actions. Still get the Error Code 400. 
I also inserted the JSON code in the JSON validator and it shows me errors.

@Troy Tessalone 

Userlevel 1
Badge

Even with API Request (Shopify) does not try any change Error Code 400 remains. 
Also tried "Order ID", "Order Line Items ID", "Order Line Items Variant ID", Order Linbe Items Product ID".

Userlevel 7
Badge +14

@VIktor1515

This is not valid Body JSON, and looks like JavaScript.

 

From the Shopify API endpoint docs:

 

Userlevel 1
Badge

Thanks @Troy Tessalone, nevertheless I get an error code 404 in all 3 versions "Custom Request by Webhook", "API Request in Shopify" and in "Custom Actions in Shopify"
Below I have attached the API Response from the Zap Custom Actions in Shopify.

{
    "request": {
        "method": "POST",
        "url": "https://******-*.myshopify.com/admin/api/2023-10/fulfillments.json",
        "querystring": null,
        "headers": {
            "content-type": "application/json",
            "x-shopify-access-token": "shpat_******************************************"
        },
        "body": "{\n    \"fulfillment\": {\n        \"line_items_by_fulfillment_order\": [\n            {\n                \"fulfillment_order_id\": 15034248036701\n            }\n        ],\n        \"tracking_info\": {\n            \"number\": \"996014925900000001\",\n            \"url\": \"https://www.post.ch/swisspost-tracking?formattedParcelCodes=996014925900000001\"\n        }\n    }\n}",
        "data": {
            "fulfillment": {
                "line_items_by_fulfillment_order": [
                    {
                        "fulfillment_order_id": 15034248036701
                    }
                ],
                "tracking_info": {
                    "number": "996014925900000001",
                    "url": "https://www.post.ch/swisspost-tracking?formattedParcelCodes=996014925900000001"
                }
            }
        }
    },
    "response": {
        "status": 404,
        "headers": {
            "date": "Tue, 02 Jan 2024 23:08:15 GMT",
            "content-type": "application/json; charset=utf-8",
            "transfer-encoding": "chunked",
            "connection": "keep-alive",
            "x-sorting-hat-podid": "348",
            "x-sorting-hat-shopid": "79273132381",
            "vary": "Accept-Encoding",
            "referrer-policy": "origin-when-cross-origin",
            "x-frame-options": "DENY",
            "x-shopid": "79273132381",
            "x-shardid": "348",
            "x-stats-userid": "",
            "x-stats-apiclientid": "78097416193",
            "x-stats-apipermissionid": "584056570205",
            "x-shopify-api-terms": "By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms",
            "x-shopify-api-version": "2023-10",
            "http_x_shopify_shop_api_call_limit": "1/40",
            "x-shopify-shop-api-call-limit": "1/40",
            "strict-transport-security": "max-age=7889238",
            "server-timing": "processing;dur=40, cfRequestDuration;dur=203.000069",
            "x-shopify-stage": "production",
            "content-security-policy": "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Ffulfillments&source%5Bsection%5D=admin_api&source%5Buuid%5D=8f33a2c0-fee1-4dbc-98e4-22c4bdcb8d61",
            "x-content-type-options": "nosniff",
            "x-download-options": "noopen",
            "x-permitted-cross-domain-policies": "none",
            "x-xss-protection": "1; mode=block; report=/xss-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Ffulfillments&source%5Bsection%5D=admin_api&source%5Buuid%5D=8f33a2c0-fee1-4dbc-98e4-22c4bdcb8d61",
            "x-envoy-upstream-service-time": "89",
            "x-dc": "gcp-us-east4,gcp-europe-west4",
            "content-encoding": "gzip",
            "x-request-id": "8f33a2c0-fee1-4dbc-98e4-22c4bdcb8d61",
            "cf-cache-status": "DYNAMIC",
            "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=roFXHA5SlolMWO%2FIFEayRarSxqxlCRqg2cBNGw1kdqKqkrMii1VaiwDeNVrqQrFoKxWZmh0AR%2FiifRICwaTNERDQGmoOfY6N0Rp7ldVaetE4gkSo5Nw%2BOI37ibMywDGI8gpYtIof%2FQU%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
            "nel": "{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}",
            "server": "cloudflare",
            "cf-ray": "83f6a9b25d6559d9-IAD",
            "alt-svc": "h3=\":443\"; ma=86400"
        },
        "body": "{\"errors\":\"Not Found\"}",
        "data": {
            "errors": "Not Found"
        }
    }
}

Userlevel 7
Badge +14

@VIktor1515 

Have you tried asking ChatGPT for help checking/configuring the JSON and other elements of your HTTP request?

Userlevel 1
Badge

Got it. Thank you again for the comments @Troy Tessalone :). It was the wrong ID...

@VIktor1515  can you share the final code you used and also which ID you pulled?