phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
570 stars 210 forks source link

so How to create a fulfillment in the latest api version? #272

Closed shadowhenry closed 2 years ago

shadowhenry commented 2 years ago

I'm confused now. could someone give an example?

guerrillacontra commented 2 years ago

I am also stuck, no matter what I put in the body it simply won't work AND permissions are set up correctly on the store.

nVuln commented 2 years ago

see: https://shopify.dev/api/admin-rest/2022-07/resources/fulfillment#post-fulfillments

$client->Fulfillment->post([
    'fulfillment' => [
        'message' => 'The package was shipped this morning.',
        'notify_customer' => false,
        'tracking_info' => [
            'number' => 'tracking number 1'
        ],
        'line_items_by_fulfillment_order' => [
            [
                'fulfillment_order_id' => '1046000811'
            ]
        ]
    ]
]);

need plugin v1.2.2 to work

shadowhenry commented 2 years ago

The latest version couldn't be pulled by composer, so I choose to assign the default api version: "2022-04", then I success to create.