Creating Gift Cards - with Specific codes via API

matt_clogau
Visitor
1 0 0

Hi. We need to create our own gift card codes using the gift card POST method. Currently, the POST method generates and returns codes to us automatically, but we need to specify our own. Secondly, can the amount remaining on a gift card be adjusted via the API?

Reply 1 (1)

SBD_
Shopify Staff
1828 269 398

Hey @matt_clogau 

 

The code can be set on the initial creation:

 

{
  "gift_card": {
    "initial_value": "100.00",
    "code": "abcdefghijklmnop"
  }
}

 

I was unable to adjust the balance of an existing card via the API.

Scott | Developer Advocate @ Shopify