Update a gift card
How to update an existing gift card via API
To update an existing gift card, send a PATCH
request to the /api/gift_cards/:id
endpoint, where id
is the ID of the resource that you want to update.
Here below the list of all the possible arguments that you can pass with the request body.
Request
PATCH https://yourdomain.commercelayer.io/api/gift_cards/:id
Arguments
type
string
Required
id
string
Required
attributes.currency_code
string
Optional
attributes.balance_cents
integer
Optional
attributes.balance_max_cents
integer
Optional
attributes.single_use
boolean
Optional
attributes.rechargeable
boolean
Optional
attributes.distribute_discount
boolean
Optional
attributes.image_url
string
Optional
attributes.expires_at
datetime
Optional
attributes.recipient_email
string
Optional
attributes._purchase
boolean
Optional
attributes._activate
boolean
Optional
attributes._deactivate
boolean
Optional
attributes._balance_change_cents
integer
Optional
attributes._add_tags
string
Optional
attributes._remove_tags
string
Optional
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.market
object
Optional
relationships.gift_card_recipient
object
Optional
relationships.tags
array
Optional
Example
The following request updates the gift card identified by the ID "xYZkjABcde":
Last updated