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

Gift Card Adjustment Resource #299

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

whobutsb
Copy link
Contributor

@whobutsb whobutsb commented Jun 27, 2023

Added the Gift Card Adjustment Resource to list adjustments and increment and decrement amounts on gift cards.

This is a Shopify Plus only feature and requires you to contact Shopify Support to enable the gift_card_adjustments access scope.

API Documentation - https://shopify.dev/docs/api/admin-rest/2023-01/resources/gift-card-adjustment

Usage

$config = array(
    'ShopUrl' => 'my-store.myshopify.com',
    'AccessToken' => 'shpat_999999999999999999999'
);

$shopify = \PHPShopify\ShopifySDK::config($config);

$gift_card_id = 88888888888;

$gift_card_adjustment_id = 999999999999;

// Get all gift card adjustments
$shopify->GiftCard($gift_card_id)->Adjustment()->get();

// Get a single gift card adjustment
$shopify->GiftCard($gift_card_id)->Adjustment($gift_card_adjustment_id)->get();

// Create a gift card adjustment
$shopify->GiftCard($gift_card_id)->Adjustment()->post([
    'amount' => 5,
    'note' => 'Add $5 to gift card'
]);

PS - Could you also please consider - #276 😃

@tareqtms tareqtms merged commit c0103f9 into phpclassic:master Jun 28, 2023
@tareqtms
Copy link
Contributor

@whobutsb
Regarding #276, Pls check my review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants