gift_cards
Create a gift card
Changed onCreate a gift card
post/gift_cards
Request
- Base URLhttps://{your_organization_slug}.commercelayer.io/api
- URLhttps://{your_organization_slug}.commercelayer.io/api/gift_cards
- AuthHTTP bearer
Request body
Example request
{
"data": {
"attributes": {
"code": "32db311a-75d9-4c17-9e34-2be220137ad6",
"currency_code": "EUR",
"balance_cents": 15000,
"balance_max_cents": 100000,
"rechargeable": true,
"distribute_discount": true,
"image_url": "https://img.yourdomain.com/gift_cards/32db311a.png",
"expires_at": "2018-01-01T12:00:00.000Z",
"recipient_email": "john@example.com",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"market": {
"data": {
"id": "XAyRWNUzyN"
}
},
"gift_card_recipient": {
"data": {
"id": "XAyRWNUzyN"
}
},
"tags": {
"data": {
"id": "XAyRWNUzyN"
}
}
}
}
}Response
The created gift card object
Changes
- breaking
added the new required request property
/// - breaking
added the new required request property
/// - breaking
request property
/was restricted to a list of enum values - breaking
the
//request property type changed fromstringtointeger - warning
removed the request property
/// - warning
removed the request property
/// - warning
removed the request property
/// - warning
removed the request property
/// - info
added the new optional request property
// - info
added the new optional request property
// - info
the
request property default valuegift_cardswas removed - info
added the new
gift_cardsenum value to the request property/ - info
added the media type
application/vnd.api+jsonfor the response with the status
- breaking