Gift Cards
Developers can create a gift card with the GiftCardService.
Gift Cards require a Shopify Plus subscription.
Listing Gift Cards
Section titled “Listing Gift Cards”var service = new GiftCardService(myShopifyUrl, shopAccessToken);var giftCards = await service.ListAsync();Creating a Gift Card
Section titled “Creating a Gift Card”var service = new GiftCardService(myShopifyUrl, shopAccessToken);var giftCard = await service.CreateAsync(new GiftCard(){ InitialValue = 100, Code = "abc-bcd-efg"});Getting a Gift Card
Section titled “Getting a Gift Card”var service = new GiftCardService(myShopifyUrl, shopAccessToken);var giftCard = await service.GetAsync(giftCardId):Disabling a Gift Card
Section titled “Disabling a Gift Card”Gift Cards can be disabled via that API, which makes them inactive and unusable until reenabled.
var service = new GiftCardService(myShopifyUrl, shopAccessToken);
await service.DisableAsync(discountId);Counting a Gift Cards
Section titled “Counting a Gift Cards”var service = new GiftCardService(myShopifyUrl, shopAccessToken);int giftCardCount = await service.CountAsync();Searching a Gift Cards
Section titled “Searching a Gift Cards”var service = new GiftCardService(myShopifyUrl, shopAccessToken);IEnumerable<GiftCard> giftCards = await Service.SearchAsync("code: abc-bcd-efg");Gift Card Adjustments
Section titled “Gift Card Adjustments”Developers can create adjustments on existing gift cards with the GiftCardAdjustmentService.
Gift Cards require a Shopify Plus subscription and also the Gift Card Adjustment endpoint needs to be enabled on your store, contact Shopify plus support for more info.
Listing Gift Card Adjustments
Section titled “Listing Gift Card Adjustments”var service = new GiftCardAdjustmentService(myShopifyUrl, shopAccessToken);var giftCardAdjustments = await service.ListAsync(giftCardId);Creating a Gift Card Adjustment
Section titled “Creating a Gift Card Adjustment”var service = new GiftCardAdjustmentService(myShopifyUrl, shopAccessToken);var giftCard = await service.CreateAsync(giftCardId, new GiftCardAdjustment(){ Amount = -1.00,});Getting a Gift Card Adjustment
Section titled “Getting a Gift Card Adjustment”var service = new GiftCardAdjustmentService(myShopifyUrl, shopAccessToken);var giftCardAdjustment = await service.GetAsync(giftCardId, adjustmentId):