Skip to content

Commit

Permalink
Merge pull request #295 from Spotnyk/master
Browse files Browse the repository at this point in the history
Add support for AssignedFulfillmentOrder resource
  • Loading branch information
tareqtms committed May 29, 2023
2 parents 1d05bc9 + d8b2c2b commit 9e885b7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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

0 comments on commit 9e885b7

Please sign in to comment.