The Admin API is in beta today. Please contact us for access.
Similar to the Storefront API, you will need to generate a Shop Identifier and Access Token before using the Admin API.
In Givy, go to Settings > API Access, enable the Admin API, then save the page. This will generate a Shop Identifier if one doesn't already exist, and an Access Token for the Admin API.
Create Gift Card
The create gift endpoint makes it possible to create a new gift card in Givy, which will automatically generate a gift card in your Shopify admin.
The create endpoint uses the following format:
Type: POST
URL: https://api.givy.ai/admin/v1/shops/<shop-id>/gifts
<shop-id> = the Shop Identifier from Givy
The body of this request should be in the following format:
{
"gift_card": {
"initial_amount": "123.00",
"expiry_date": "yyyy-mm-dd",
"code": "sdfa78sd"
}
}
Definitions
Key name | Description | Format |
initial_amount
REQUIRED | The amount of the gift card being created | 123.45 |
expiry_date | The date when this card will expire. Not required to create a gift card. |
e.g. 2025-12-31 |
code
OPTIONAL | The code to use when creating the gift card. Must not already exist, and be between 8 and 16 alphanumeric characters | 123456abcdef |
Gift Card Create Response
{
"data": {
"id": 20671,
"public_identifier": "ollr4ywzxjy3lmw",
"type": "GIFT_CARD",
"status": "CREATING",
"redeemed": false,
"recipient_name": null,
"purchaser_name": null,
"gif_url": null,
"video_message_url": null,
"message": null,
"gift_card": {
"code": "123456abcded",
"gift_card_image_url": "https://app.givy.ai/static/media/card.jpg",
"start_shopping_url": "https://jp-givy-staging.myshopify.com",
"balance": {
"amount": 12300,
"amount_formatted": "CA$123.00"
}
}
}
}
List All Gifts
The list gifts endpoint will return a list of the gifts on the store. This endpoint has a number of filters to limit results, and pagination.β
The list endpoint uses the following format:
Type: GET
URL: https://api.givy.ai/admin/v1/shops/<shop-id>/gifts
<shop-id> = the Shop Identifier from Givy
Filters
Filter name | Description | Example & Default |
giftCardCode | The gift card code if available |
|
status | The status of the gift |
Options: Default: all |
sort | The order in which gifts are returned |
Options: Default: id |
pageSize | The number of results per page |
Default: 20 |
page | The page number to retrieve |
Default: 1 |
Filters can be added like URL parameters, and can include multiple filters in one request.
https://api.givy.ai/admin/v1/shops/123/gifts?status=ACTIVE&page=5
To retrieve information on a specific gift card, use the filter giftCardCode
Update Gift Card Balance
The update endpoint uses the following format:
Type: PATCH
URL: https://api.givy.ai/admin/v1/shops/<shop-id>/gifts/<gift-id>
<shop-id> = the Shop Identifier from Givy
<gift-id> = the
id
field returned from the list of gifts
The body of this request should be in the following format:
{
"gift_card": {
"balance": "123.00"
}
}
Gift Card Update Response
{
"data": {
"id": 123,
"public_identifier": j4kl33jl23dds88,
"type": "GIFT_CARD",
"status": "ACTIVE",
"redeemed": false,
"recipient_name": "Jane",
"purchaser_name": "Frederick",
"gif_url": null,
"video_message_url": null,
"message": "Happy birthday!",
"gift_card": {
"code": "8d78a42cdf756aag",
"gift_card_image_url": "https://app.givy.ai/static/media/gift.jpg",
"start_shopping_url": "https://store.myshopify.com",
"balance": {
"amount": 12300,
"amount_formatted": "CA$123.00"
}
}
}
}
Delete Gift Card
This endpoint will delete a gift card from Givy as well as from Shopify.
The delete endpoint uses the following format:
Type: DELETE
URL: https://api.givy.ai/admin/v1/shops/<shop-id>/gifts/<gift-id>
<shop-id> = the Shop Identifier from Givy
<gift-id> = the
id
field returned from the list of gifts
Gift Delete Response
{
"data": {
"deleted_gift_id": 123
}
}