Skip to content

Commit 589ebb8

Browse files
committed
added usage to the GiftCardAdjustment class
1 parent 7a52f6a commit 589ebb8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/GiftCardAdjustment.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66
*
77
* @see https://shopify.dev/docs/api/admin-rest/2023-01/resources/gift-card-adjustment Shopify API Reference for Gift Card Adjustment
88
* @note - requires gift_card_adjustments access scope enabled by Shopify Support
9+
*
10+
* @usage:
11+
*
12+
$shopify = \PHPShopify\ShopifySDK::config($config);
13+
14+
$gift_card_id = 88888888888;
15+
16+
$gift_card_adjustment_id = 999999999999;
17+
18+
// Get all gift card adjustments
19+
$shopify->GiftCard($gift_card_id)->Adjustment()->get();
20+
21+
// Get a single gift card adjustment
22+
$shopify->GiftCard($gift_card_id)->Adjustment($gift_card_adjustment_id)->get();
23+
24+
// Create a gift card adjustment
25+
$shopify->GiftCard($gift_card_id)->Adjustment()->post([
26+
'amount' => 5,
27+
'note' => 'Add $5 to gift card'
28+
]);
929
*/
1030

1131
namespace PHPShopify;

0 commit comments

Comments
 (0)