curl --location --request POST 'https://api.stateset.com/v1/gift-cards' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"type": "digital",
"initial_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday"
},
"validity": {
"expires_at": "2025-02-14T23:59:59Z"
},
"order_id": "order_789012"
}'
{
"id": "gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "gift_card",
"code": "GIFT-XMAS-A3B7C9D2",
"type": "digital",
"status": "active",
"initial_balance": 5000,
"current_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z",
"delivery_status": "scheduled"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday",
"preview_url": "https://gift-cards.stateset.com/preview/gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
},
"validity": {
"activated_at": "2024-01-20T12:00:00Z",
"expires_at": "2025-02-14T23:59:59Z",
"is_expired": false,
"days_until_expiry": 390
},
"restrictions": {
"product_ids": [],
"category_ids": [],
"exclude_sale_items": false,
"minimum_purchase": null
},
"redemption_url": "https://shop.example.com/gift-card/GIFT-XMAS-A3B7C9D2",
"order_id": "order_789012",
"created_at": "2024-01-20T12:00:00Z",
"updated_at": "2024-01-20T12:00:00Z",
"transactions": [],
"metadata": {
"campaign": "birthday_promo_2024"
}
}
Create a new gift card with a specified balance
curl --location --request POST 'https://api.stateset.com/v1/gift-cards' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"type": "digital",
"initial_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday"
},
"validity": {
"expires_at": "2025-02-14T23:59:59Z"
},
"order_id": "order_789012"
}'
{
"id": "gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "gift_card",
"code": "GIFT-XMAS-A3B7C9D2",
"type": "digital",
"status": "active",
"initial_balance": 5000,
"current_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z",
"delivery_status": "scheduled"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday",
"preview_url": "https://gift-cards.stateset.com/preview/gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
},
"validity": {
"activated_at": "2024-01-20T12:00:00Z",
"expires_at": "2025-02-14T23:59:59Z",
"is_expired": false,
"days_until_expiry": 390
},
"restrictions": {
"product_ids": [],
"category_ids": [],
"exclude_sale_items": false,
"minimum_purchase": null
},
"redemption_url": "https://shop.example.com/gift-card/GIFT-XMAS-A3B7C9D2",
"order_id": "order_789012",
"created_at": "2024-01-20T12:00:00Z",
"updated_at": "2024-01-20T12:00:00Z",
"transactions": [],
"metadata": {
"campaign": "birthday_promo_2024"
}
}
gift_cards:write
permissions.
Authorization: Bearer YOUR_API_KEY
curl --location --request POST 'https://api.stateset.com/v1/gift-cards' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"type": "digital",
"initial_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday"
},
"validity": {
"expires_at": "2025-02-14T23:59:59Z"
},
"order_id": "order_789012"
}'
{
"id": "gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "gift_card",
"code": "GIFT-XMAS-A3B7C9D2",
"type": "digital",
"status": "active",
"initial_balance": 5000,
"current_balance": 5000,
"currency": "USD",
"recipient": {
"email": "recipient@example.com",
"name": "Jane Smith",
"message": "Happy Birthday! Enjoy your shopping.",
"delivery_date": "2024-02-14T09:00:00Z",
"delivery_status": "scheduled"
},
"purchaser": {
"customer_id": "cust_abc123",
"email": "purchaser@example.com",
"name": "John Doe"
},
"design": {
"template_id": "tmpl_birthday_001",
"theme": "birthday",
"preview_url": "https://gift-cards.stateset.com/preview/gc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30"
},
"validity": {
"activated_at": "2024-01-20T12:00:00Z",
"expires_at": "2025-02-14T23:59:59Z",
"is_expired": false,
"days_until_expiry": 390
},
"restrictions": {
"product_ids": [],
"category_ids": [],
"exclude_sale_items": false,
"minimum_purchase": null
},
"redemption_url": "https://shop.example.com/gift-card/GIFT-XMAS-A3B7C9D2",
"order_id": "order_789012",
"created_at": "2024-01-20T12:00:00Z",
"updated_at": "2024-01-20T12:00:00Z",
"transactions": [],
"metadata": {
"campaign": "birthday_promo_2024"
}
}