Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AssignedFulfillmentOrder resource #295

Merged
merged 2 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ Some resources are available directly, some resources are only available through
- [AbandonedCheckout](https://help.shopify.com/api/reference/abandoned_checkouts)
- [ApiDeprecations](https://shopify.dev/api/admin-rest/2022-04/resources/deprecated-api-calls#get-deprecated-api-calls)
- [ApplicationCharge](https://help.shopify.com/api/reference/applicationcharge)
- [AssignedFulfillmentOrder](https://shopify.dev/docs/api/admin-rest/2023-04/resources/assignedfulfillmentorder)
- [Blog](https://help.shopify.com/api/reference/blog/)
- Blog -> [Article](https://help.shopify.com/api/reference/article/)
- Blog -> Article -> [Event](https://help.shopify.com/api/reference/event/)
Expand Down Expand Up @@ -520,10 +521,13 @@ The custom methods are specific to some resources which may not be available for
- Mapped FulfillmentOrder->FulfillmentRequest
- Mapped Order(id)->FulfillmentOrder

```
```php
// Requesting the FulfilmentOrder for a given order
$fo = $client->Order("1234567890")->FulfillmentOrder()->get();

// Requesting assigned fulfillment orders (with status fulfillment_requested)
$shopify->AssignedFulfillmentOrder()->get(["assignment_status" => "fulfillment_requested"]);

// Creating a FulfilmentRequest
// Follow instructions to get partial fulfilments
$fr = $client->FulfillmentOrder('0987654321')->FulfillmentRequest->post([]);
Expand Down
16 changes: 16 additions & 0 deletions lib/AssignedFulfillmentOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
*
* @see https://shopify.dev/docs/api/admin-rest/2023-04/resources/assignedfulfillmentorder Shopify API Reference for Assigned Fulfillment Order
*/

namespace PHPShopify;


class AssignedFulfillmentOrder extends ShopifyResource
{
/**
* @inheritDoc
*/
protected $resourceKey = 'assigned_fulfillment_order';
}
3 changes: 3 additions & 0 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@

/**
* @property-read AbandonedCheckout $AbandonedCheckout
* @property-read AssignedFulfillmentOrder $AssignedFulfillmentOrder
* @property-read AccessScope $AccessScope
* @property-read ApiDeprecations $ApiDeprecations
* @property-read ApplicationCharge $ApplicationCharge
Expand Down Expand Up @@ -116,6 +117,7 @@
* @property-read GraphQL $GraphQL
*
* @method AbandonedCheckout AbandonedCheckout(integer $id = null)
* @method AssignedFulfillmentOrder AssignedFulfillmentOrder(string $assignment_status = null, array $location_ids = null)
* @method AccessScope AccessScope()
* @method ApiDeprecations ApiDeprecations()
* @method ApplicationCharge ApplicationCharge(integer $id = null)
Expand Down Expand Up @@ -173,6 +175,7 @@ class ShopifySDK
*/
protected $resources = array(
'AbandonedCheckout',
'AssignedFulfillmentOrder',
'AccessScope',
'ApiDeprecations',
'ApplicationCharge',
Expand Down