# Gift Card Product
The Gift Cards are prepaid stored-value money cards that customers can use to pay for their orders. The gift card is sold as a product and the amount of selling will not be reflected in the sales reports. When a gift card is sold the customers can use the gift card as a payment method when making orders.
# The Gift Card Product Object
# Sample
{
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
# Attributes
| Field | Type | Rule | Description |
|---|---|---|---|
id | string | Unique identifier for the gift card product. | |
name* | string | updatable | Name of the gift card product |
name_localized | string | nullable updatable | Localized gift card product name if business uses localization |
image | string | nullable updatable | Gift Card Image |
sku* | string | updatable | Sku of the gift card product |
barcode | string | updatable | Barcode of the gift card product |
pricing_method* | integer | updatable | The Pricing Method of the gift card product |
price* | double | updatable | The price of the gift card product |
is_active | boolean | updatable | True if the gift card product is available for usage |
category* | object | updatable includable | The Category attached to the gift card product. |
branches | array | updatable includable | List of Branches attached to the gift card product. |
tags | array | updatable includable | List of Tags attached to the gift card product. |
groups | array | updatable includable | List of Groups attached to the gift card product. |
created_at | string | sortable | Time at which the object was created in UTC. YYYY-MM-DD HH-MM-SS |
updated_at | string | sortable | Time at which the object was updated in UTC. YYYY-MM-DD HH-MM-SS |
deleted_at | string | nullable | Time at which the object was deleted in UTC. YYYY-MM-DD HH-MM-SS |
# Pricing Methods
| Type | Description |
|---|---|
1 | Fixed Price. |
2 | Open Price. |
# List Gift Card Products
GET /gift_card_products
# Scope
general.read
# Filters
idnamepricing_methodname_localizedcategory_idgroups.idtags.idis_activeskusku_partialbarcodeupdated_afteris_deletedcreated_onupdated_ondeleted_on
# Response
{
"data": [
{
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
]
}
# Get Gift Card
GET /gift_card_products/{giftCardProductId}
# Scope
general.read
# Response
{
"data": {
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
}
# Create Gift Card Product
POST /gift_card_products
# Scope
admin.write
# Request
{
"tags": [
{
"id": "9cd1956d"
}
],
"category_id": "8cd1956b",
"groups": [
{
"id": "8f26e6c7"
}
],
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image":null,
"pricing_method": 1,
"price": 745,
"is_active": true
}
# Response
{
"data": {
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
}
# Update Gift Card Product
PUT /gift_card_products/{giftCardProductId}
# Scope
admin.write
# Request
{
"tags": [
{
"id": "9cd1956d"
}
],
"category_id": "8cd1956b",
"groups": [
{
"id": "8f26e6c7"
}
],
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image":"https://s3.image.example.com",
"pricing_method": 1,
"price": 745,
"is_active": true
}
# Response
{
"data": {
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
}
# Delete Gift Card Product
DELETE /gift_card_products/{giftCardProductId}
# Scope
admin.write
The API will respond with 200 indicating that the Gift Card has been deleted.
# Restore Gift Card Product
PUT /gift_card_products/{giftCardProductId}/restore
# Scope
admin.restore
The API will respond with 200 indicating that the Gift Card has been restored.
# Attach Branch Attributes to Gift Card Product
POST /gift_card_products/{giftCardProductId}/branches/{branchId}
# Scope
admin.write
Some attributes could have special values in a specific branch or set of branches, you can define these attachments with the following request.
# Request
{
"is_active": false
}
# Response
{
"data": {
"tags": [
{
"id": "8ed25961",
"pivot": {
"gift_card_product_id": "8d969736",
"tag_id": "8ed25961"
}
}
],
"category": {
"id": "8d90b7a1"
},
"id": "8d969736",
"name": "$1000 Gift Card",
"name_localized": null,
"sku": "P001231",
"barcode": "54198471984721",
"image": null,
"pricing_method": 1,
"price": 745,
"is_active": true,
"branches": [
{
"id": "8d82ff0c",
"pivot": {
"gift_card_product_id": "8d969736",
"branch_id": "8d82ff0c",
"is_active": false
}
}
],
"groups": [
{
"id": "8f26e6c7",
"pivot": {
"gift_card_product_id": "8d969736",
"group_id": "8f26e6c7"
}
}
],
"created_at": "2019-05-02 06:40:15",
"updated_at": "2019-05-02 06:40:15",
"deleted_at": null
}
}
# Remove Branch Attributes from Gift Card Product
DELETE /gift_card_products/{giftCardProductId}/branches/{branchId}
# Scope
admin.write
Some attributes could have special values in a specific branch or set of branches, you can remove these attachments with the following request.