post https://api.zenoti.com/v1/invoices/gift_cards
This API helps you to create an invoice for the sale of a gift card without having to first create or select a gift card template.
If you have your own Webstore, e-commerce store, or Consumer Mobile App (CMA), this API helps you to record the sale of a physical or online gift card (with a custom gift code or gift card number) in your Zenoti application.
gift_cards Object
Name | Type | Description |
---|---|---|
type | enum | Mandatory Indicates the type of the gift card: 0 - CustomAmount, 1 - Service, and 2 - PreDefined. If you do not provide any value for this parameter, the API takes the default value of 0. |
code | string | Mandatory Unique code of the gift card. |
custom_amount | object | Mandatory Object that contains the custom price and amount details of the gift card: price (purchase price of the gift card) and value (value of the gift card). |
notes | string | Optional Any helpful notes related to the gift card sale invoice. |
is_onetime_use | boolean | Optional Indicates whether the gift card can be used or redeemed only once. If you do not provide any value for this parameter, the API takes the default value of false. |
expiry | object | Mandatory Object that contains the gift card's expiry-related details: days (number of days from the purchase date after which the gift card will expire) and date (date on which the gift card will expire). |
Response Details
Name | Type | Description |
---|---|---|
invoice_id | guid | Unique 32-character identifier of the generated gift card sale invoice. |
error | object | Object that contains error code and error message details. For more information, refer to the error Object table. |
error Object
code | message |
---|---|
448 | GiftCard with same Number already sold. |
503 | Invalid input. |
502 | center_id was not passed. |
502 | guest_id was not passed. |
502 | center_id is not valid. |
502 | giftcard code was not passed. |
502 | gift cards value is required. |
1201 | employee is Compulsory, as saleBy is enforced for gift cards. |
1202 | non expiry gift card is not allowed. |
1200 | gift cards with different price and value not allowed. |
438 | User is Not Authorized for gift card sale with difference in price and value. |
1207 | Only one of gift card validity days or expiry date is allowed. |