What is it?
The Gift Cards v1 and v3 API versions are both active and available to use. The v3 API enhances and extends the API options. You can use the v1 and v3 endpoints to manage gift cards in the following ways:
- Create, update, and delete gift cards.
- Perform transactions (credit, debit, top up) on gift cards.
- Create, update, and delete Transaction reasons.
- Create, update, and delete Campaigns.
- Create, update, and delete Clients.
- Create, update, and delete Stores.
- Create, update, and delete Departments.
- Create, update, and delete Operators.
- Generate reports.
Before You Begin
- You must authenticate before you can use this API. For full instructions, see Get a Token for REST APIs.
- At any time, you can go to this API's Reference Documentation tab, where you can make test calls with the following endpoints.
How to use
This section covers the endpoints for this API and examples of how to use them.
Gift Card Terminology
For the Gift Card v1 and v3 APIs, here are definitions for some common terms:
- client: This is the business entity (and its administrator user) that manages the gift cards.
- operator: This is a sub-entity under a client. It represents a named individual (such as front-desk) who performs transactions.
- user: This generally refers to a user record, which has an assigned role, such as :front_desk or :client.
- customer: This is the consumer who receives and redeems gift cards.
POST a new or updated client #
Use this endpoint to create or update a TS client.
[POST] /api/v1/clients/create_or_update_clientPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| client | The array to hold the client information. | array | Required |
| name | Name of TS client. | string | Required |
| address | Address of TS client. | string | Required |
| contact | Contact Information of TS client. | string | Required |
| origin | Request originating from. | string | Required |
| users_attributes | The array to hold the client's user attributes. | array | Required |
| The client's email address. | string | Required | |
| password | The client's password. | string | Required |
| password_confirmation | The confirmation of the client's password. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"client": {
"name": "new client",
"address": "PK",
"contact": "123456",
"origin": "ts_curate",
"users_attributes": [
{
"email": "ts_client_2@secbuf.com",
"password": "ts_client_@secbuf.coml",
"password_confirmation": "ts_client_@secbuf.coml"
}
]
}
}Response in JSON
{
"message": "Client has been created successfully."
}GET a fast track record #
Use this endpoint to make a fast track record. When you use this get operation to send a request to the fast_track_record API, the following records will be created:
- A new TS client.
- A new store for the TS client.
- A new user with the client role.
- A new user with the API role.
[GET] /api/v1/clients/fast_track_recordQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| store_name | Specify the name of the store. | string | Required |
| ts_client_user_email | Specify the TS client email. | string | Required |
| ts_api_user_email | Specify the TS API user email. | string | Required |
Response in JSON
{
"success": true,
"store": {
"id": 329,
"name": "T1",
"code": "T1",
"url": "",
"client_id": 192,
"created_at": "2025-12-15T17:34:19.907Z",
"updated_at": "2025-12-15T17:34:19.907Z",
"fx_fees": null,
"fx_label": null,
"fx_enable": false,
"monetary_campaign_id": null,
"store_front_link": null,
"soft_delete": false,
"activation_payment_link": null,
"top_up_payment_link": null,
"max_value": null,
"min_value": null,
"gift_card_values": null
}
}GET a dashboard report #
Use this endpoint to get the dashboard report.
[GET] /api/v1/clients/dashboard_reportQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| start_date | Specify the report's start date. | number | Required |
| end_date | Specify the report's end date. | number | Required |
Response in JSON
{
"labels": [
"05 Jun",
"04 Jun"
],
"gift_card_values": [
72
],
"transactions_values": [
-1355,
60
]
}GET a gift card report #
Use this endpoint to retrieve a report of gift card details (in JSON format).
[GET] /api/v1/clients/download_reportNote: You can use the GET api/v1/reports/download_report endpoint to retrieve the same data but with PII included.
Query Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | This q element is a filter that is logically an object, but technically a string. For this endpoint, your request must format the q filters as standard query-string notation (q[field]=value), not as a URL-encoded JSON object. The following is an example of a request: GET https://<ts_server_url>/api/v1/clients/download_report ?q[number_or_product_name_cont]=Gift%20Card &q[order_number_cont]=897703402801023370 &q[gift_card_skus_scope]=SKU-123 &q[store_name_cont]=Ahsan &q[campaign_stores_name_cont]=dev-store-1 &q[status_eq]=active &q[created_at_gt_scope]=2026-08-01 &q[created_at_lt_scope]=2026-08-31 &q[campaign_code_scope]=dev-1 &q[expiry_date_gt_scope]=2027-01-01 &q[expiry_date_lt_scope]=2027-12-31 &page=1 &per_page=25 | string | Optional |
| number_or_product_name_cont | Use this to filter by card number or product name. | string | Optional |
| order_number_cont | Use this to filter by order number. | string | Optional |
| gift_card_skus_scope | Use this to filter by gift card SKUs. | string | Optional |
| store_name_cont | Use this to filter by store name. | string | Optional |
| campaign_stores_name_cont | Use this to filter by campaign store name. | string | Optional |
| status_eq | Use this to filter by the status of the gift cards. | string | Optional |
| created_at_gt_scope | Use this to filter by the created date greater than the specified value. | string | Optional |
| created_at_lt_scope | Use this to filter by the created date less than the specified value. | string | Optional |
| campaign_code_scope | Use this to filter by campaign code. | string | Optional |
| expiry_date_gt_scope | Use this to filter by expiry date greater than the specified value. | string | Optional |
| expiry_date_lt_scope | Use this to filter by expiry date less than the specified value. | string | Optional |
| page | The page number to retrieve. Default is 1. | string | Optional |
| per_page | The number of results per page. Default is 25. | string | Optional |
Response in JSON
[
{
"number": "420646903701023412",
"serial_number": "01023412",
"created_at": "13 Aug 24",
"type": "monetary",
"delivery_type": "physical",
"updated_at": "07:10:34 AM - 13 Aug 24",
"valid": "14 Oct 25",
"status": "active",
"recipient_first_name": "mehran",
"recipient_last_name": "javid",
"recipient_email": "",
"recipient_phone_number": null,
"order_number": "897703402801023370",
"original_balance": "10.0",
"current_balance": 10,
"pending_liability": 10,
"campaign_code": "dev-1",
"stores": null,
"campaign_stores": "store1, store2, store3",
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin",
"message": ""
}
]GET a gift card transaction report #
Use this endpoint to get the gift card transaction report.
[GET] /api/v1/clients/transactions_reportResponse in JSON
{
"transactions": [
{
"id": 30321,
"amount": "10.0",
"currency": "AED",
"transaction_type": "credit",
"ip": "::1",
"note": "",
"refund_id": null,
"gift_card_id": 28070,
"user_id": 24,
"sku": "[]",
"created_at": "2024-08-13T07:10:35.868Z",
"updated_at": "2024-08-13T07:10:35.868Z",
"refunded": false,
"external_invoice_id": "897703402801023400",
"notes": "897703402801023370",
"card_balance": "10.0",
"store_id": 227,
"meta": null,
"transaction_reason_id": 1328,
"select_payment_methods": null,
"operator_id": null,
"gift_card_status": "active",
"recipient_emails": "",
"service_fee_id": null,
"gift_card_balance_status": null,
"gift_card": {
"id": 28070,
"number": "420646903701023412",
"pin": "17123",
"currency": "AED",
"card_type": "monetary",
"expiry_date": "2025-10-14T00:00:00.000Z",
"value": "10.0",
"skus": [],
"status": "active",
"user_id": 24,
"campaign_id": 61,
"created_at": "2024-08-13T07:10:33.979Z",
"updated_at": "2024-08-13T07:10:34.047Z",
"client_id": 3,
"product_name": "Gift Card",
"delivery_mode": "physical",
"delivery_status": "pickUp",
"is_redeemed": false,
"is_expired": false,
"recipient_first_name": "mehran",
"recipient_last_name": "javid",
"recipient_email": "",
"order_number": "897703402801023370",
"send_email": false,
"order_pay_load": "",
"notes": "897703402801023370",
"invoice_id": "897703402801023400",
"from_address": "",
"store_name": null,
"customer_email": null,
"barcode_key": "tFy383IBzMdLsgA6",
"qrcode_key": "YGnTWj5Gh6h4XkEf",
"spree_ts_giftcard_id": null,
"slug": "ee96012c-5f0d-4951-a37b-499d2a3ee407",
"receipient_phone_number": null,
"send_gift_card_via": "email",
"bonus": false,
"serial_number": "01023412",
"operator_id": null,
"customer_id": null,
"recipient_emails": "ayesha@plerosys.com",
"store_id": 227,
"generated_at": null,
"import_by": "ts_giftcards",
"transition_activation_date": "2024-08-13T07:10:33.979Z",
"message": "",
"order_placed_date": null,
"line_item_id": null,
"start_date": null,
"test_mode": false,
"request_id": null,
"balance": "10.0"
},
"transaction_amount": "10.0",
"campaign": {
"id": 61,
"name": "dev-1",
"start_date": "2023-01-27T00:00:00.000Z",
"end_date": "2026-12-27T00:00:00.000Z",
"client_id": 3,
"code": "dev-1",
"max_expiry_days": null,
"created_at": "2023-01-27T09:20:56.836Z",
"updated_at": "2024-08-13T11:32:17.940Z",
"date_specific_expiry": true,
"email_subject": "dev testing email template merhan",
"email_html": "dev testing email template merhan",
"specific_date": "2025-10-14T00:00:00.000Z",
"body": "dev testing message body",
"sms_html": "dev testing sms template",
"allow_password": false,
"ses_from_email": "zeeshan@techsembly.com",
"transaction_email_subject": "dev testing transaction email bisma",
"transaction_email_html": " {{#if trasaction.show_local_amount}}\n {
{trasaction.local_currency
}
} {
{trasaction.local_amount
}
}\n {
{/if
}
}","soft_delete": false,
"cc_transaction_email": "ahsan.chughtai@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": false
},
"stores": "store1, store2, store3",
"redemption_store": "Ahsan",
"transaction_reason": {
"id": 1328,
"transaction_reason": "Active",
"transaction_type": "credit",
"client_id": 3,
"created_at": "2024-05-12T06:13:52.890Z",
"updated_at": "2024-05-12T06:13:52.890Z",
"soft_delete": false,
"store_id": null
},
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin"
}
],
"count": 1
}GET a gift card liability report #
Use this endpoint to get the gift card liability report.
[GET] /api/v1/clients/liabilities_reportResponse in JSON
{
"gift_cards": [
{
"id": 28070,
"number": "420646903701023412",
"pin": "17123",
"currency": "AED",
"card_type": "monetary",
"expiry_date": "2025-10-14T00:00:00.000Z",
"value": "10.0",
"skus": [],
"status": "active",
"user_id": 24,
"campaign_id": 61,
"created_at": "2024-08-13T07:10:33.979Z",
"updated_at": "2024-08-13T07:10:34.047Z",
"client_id": 3,
"product_name": "Gift Card",
"delivery_mode": "physical",
"delivery_status": "pickUp",
"is_redeemed": false,
"is_expired": false,
"recipient_first_name": "mehran",
"recipient_last_name": "javid",
"recipient_email": "",
"order_number": "897703402801023370",
"send_email": false,
"order_pay_load": "",
"notes": "897703402801023370",
"invoice_id": "897703402801023400",
"from_address": "",
"store_name": null,
"customer_email": null,
"barcode_key": "tFy383IBzMdLsgA6",
"qrcode_key": "YGnTWj5Gh6h4XkEf",
"spree_ts_giftcard_id": null,
"slug": "ee96012c-5f0d-4951-a37b-499d2a3ee407",
"receipient_phone_number": null,
"send_gift_card_via": "email",
"bonus": false,
"serial_number": "01023412",
"operator_id": null,
"customer_id": null,
"recipient_emails": "ayesha@plerosys.com",
"store_id": 227,
"generated_at": null,
"import_by": "ts_giftcards",
"transition_activation_date": "2024-08-13T07:10:33.979Z",
"message": "",
"order_placed_date": null,
"line_item_id": null,
"start_date": null,
"test_mode": false,
"request_id": null,
"campaign_code": "dev-1",
"campaign_stores": "store1, store2, store3",
"stores": null,
"liability_date": "2024-08-15T11:14:48.986+05:00",
"liability": "10.0",
"current_balance": 10,
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin"
}
],
"total_count": 1
}POST a new gift card #
Use this endpoint to create a new gift card.
[POST] /api/v1/gift_cardsPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| card_type | Specify the type of card you want to update. Available options are: monetary or experiences. | string | Required |
| value | Set the amount value of the card. | string | Required |
| currency | Specify the card currency. | string | Required |
| delivery_mode | Specify the delivery mode of the card. Available options are: digital or physical. | string | Required |
| campaign_code | Set the campaign code for the gift card. | string | Required |
| from_address | Specify the email address of the person who is sending this card. | string | Required |
| invoice_id | Set the invoice ID generated for the gift card. | string | Optional |
| notes | Specify notes or comments for the gift card. | string | Optional |
| product_name | Specify the name of the product for which the card is redeemable. | string | Required |
| receipient_phone_number | Specify the phone number of the recipient who will receive the gift card. The format is country code followed by phone number: +442012341234. | string | Required |
| recipient_email | Specify the email address of the recipient who will receive the gift card. | string | Required |
| recipient_first_name | Specify the recipient's first name. | string | Required |
| recipient_last_name | Specify the recipient's last name. | string | Required |
| send_gift_card_via | Specify how the card will be sent to the recipient. Available options are: email, sms, both, or do_not_send. Use do_not_send to disable email sending for the gift card. | string | Required |
| skus | Set the SKUs of gift cards. You can specify one or more SKUs in an array format. | array | Optional |
| message | Specify the gift card message. | string | Optional |
| store_id | Specify the store for the gift cards. | string | Required |
| creator_attributes | Specify the email and role of the user who is performing this action. | string | Required |
| request_id | Set the unique request ID so that you can track each request. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"card_type": "monetary",
"value": "1000",
"currency": "USD",
"delivery_mode": "digital",
"campaign_code": "dev-1",
"from_address": "wyfosykyp@mailinator.com",
"invoice_id": "sk-123",
"notes": "werwe",
"product_name": "tesitng",
"receipient_phone_number": "",
"recipient_email": "wyfosykyp@mailinator.com",
"recipient_first_name": "Darrel",
"recipient_last_name": "Wiggins",
"send_gift_card_via": "email",
"skus": [],
"message": "",
"store_id": "11",
"creator_attributes": {
"creator_email": "dev@tsclient.com",
"creator_role": "1234"
},
"request_id": "1234"
}Response in JSON
{
"id": 28071,
"number": "935896188801023413",
"pin": "24429",
"currency": "USD",
"card_type": "monetary",
"expiry_date": "2025-10-14T00:00:00.000Z",
"value": "1000.0",
"skus": [],
"status": "active",
"user_id": 24,
"campaign_id": 61,
"created_at": "2024-08-18T06:38:49.603Z",
"updated_at": "2024-08-18T06:38:49.603Z",
"client_id": 3,
"product_name": "tesitng",
"delivery_mode": "digital",
"delivery_status": "delivered",
"is_redeemed": false,
"is_expired": false,
"recipient_first_name": "Darrel",
"recipient_last_name": "Wiggins",
"recipient_email": "wyfosykyp@mailinator.com",
"order_number": "",
"send_email": false,
"order_pay_load": "",
"notes": "werwe",
"invoice_id": "sk-123",
"from_address": "wyfosykyp@mailinator.com",
"store_name": null,
"customer_email": null,
"barcode_key": "UT764xIqPatTsAl0",
"qrcode_key": "ZemSYyRv6OAfQ9H1",
"spree_ts_giftcard_id": null,
"slug": "d4b46bb5-3666-4e54-954b-cae5bad470f0",
"receipient_phone_number": "",
"send_gift_card_via": "email",
"bonus": false,
"serial_number": "01023413",
"operator_id": null,
"customer_id": null,
"recipient_emails": "",
"store_id": null,
"generated_at": null,
"import_by": "ts_giftcards",
"transition_activation_date": "2024-08-18T06:38:50.960Z",
"message": "",
"order_placed_date": null,
"line_item_id": null,
"start_date": null,
"test_mode": false,
"request_id": "1234",
"campaign_body": "dev testing message body",
"image_url": "http://[YourUrl]/eyJfcmFpbH.jpg",
"campaign_response": {
"id": 61,
"name": "dev-1",
"start_date": "2023-01-27T00:00:00.000Z",
"end_date": "2026-12-27T00:00:00.000Z",
"client_id": 3,
"code": "dev-1",
"max_expiry_days": null,
"created_at": "2023-01-27T09:20:56.836Z",
"updated_at": "2024-08-13T11:32:17.940Z",
"date_specific_expiry": true,
"email_subject": "dev testing email template merhan",
"email_html": "dev testing email template merhan",
"specific_date": "2025-10-14T00:00:00.000Z",
"body": "dev testing message body",
"sms_html": "dev testing sms template",
"allow_password": false,
"ses_from_email": "zeeshan@techsembly.com",
"transaction_email_subject": "dev testing transaction email bisma",
"transaction_email_html": " {{#if trasaction.show_local_amount}}\n {
{trasaction.local_currency
}
} {
{trasaction.local_amount
}
}\n {
{/if
}
}","soft_delete": false,
"cc_transaction_email": "ahsan.chughtai@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": false
},
"initial_store_id": 11
}GET gift cards by using filters #
This endpoint retrieves gift cards based on filters for the gift card status and gift card type.
[GET] /api/v1/gift_cardsQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | This q element is a filter that is logically an object, but technically a string. For this endpoint, your request must format the q filters as standard query-string notation (q[field]=value), not as a URL-encoded JSON object. The following is an example of a request: GET https://<ts_server_url>/api/v1/gift_cards ?q[status_in]=active &q[card_type_null]=false &page=1 &per_page=25 | string | Optional |
| status_in | Status of the gift cards to include in the results | string | Optional |
| card_type_null | Set this to true to include cards with a null card_type. Set this to false to exclude cards with a null card_type. | boolean | Optional |
| page | The page number to retrieve. Default is 1. | number | Optional |
| per_page | The number of results per page. Default is 25. | number | Optional |
Response in JSON
{
"gift_cards": [
{
"id": 27985,
"number": "789782926501023327",
"serial_number": "01023327",
"created_at": "2024-05-22T09:16:08.590Z",
"status": "active",
"expiry_date": "2026-11-27T00:00:00.000Z",
"product_name": "1323123",
"card_type": "monetary",
"currency": "AED",
"value": "23.0",
"campaign_id": 61,
"order_number": "",
"bonus": false,
"skus": [],
"store_name": null,
"campaign_code": "dev-1",
"stores": null,
"campaign_store": "store1, store2, store3"
}
],
"total_count": 1
}GET a gift card's details #
Use this endpoint to retrieve the details of a gift card (by specifying the gift card ID).
[GET] /api/v1/gift_cards/{gift_card_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| gift_card_id | Specify the ID of the gift card that you want to retrieve. | number | Required |
Response in JSON
{
"gift_card": {
"id": 28071,
"number": "935896188801023413",
"serial_number": "01023413",
"created_at": "2024-08-18T06:38:49.603Z",
"status": "active",
"expiry_date": "2025-10-14T00:00:00.000Z",
"product_name": "tesitng",
"card_type": "monetary",
"currency": "USD",
"value": "1000.0",
"campaign_id": 61,
"order_number": "",
"bonus": false,
"skus": [],
"delivery_mode": "digital",
"delivery_status": "delivered",
"store_name": null,
"message": ""
},
"transactions": [
{
"transaction_type": "credit",
"transaction_reason": "Active",
"id": 30322,
"amount": "1000.0",
"currency": "USD",
"created_at": "2024-08-18T06:38:51.072Z",
"refunded": false,
"transaction_notes": "werwe",
"transaction_creator_email": "dev@tsclient.com",
"transaction_creator_role": "1234"
}
],
"current_balance": "1000.00"
}PUT an update to a gift card's details #
Use this endpoint to update the details of a specific gift card (by gift card ID). You can update status, expiration date, and delivery status.
[PUT] /api/v1/gift_cards/{gift_card_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| gift_card_id | Specify the ID of the gift card that you want to update. | number | Required |
Put Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| gift_card | The array to hold the details of the updates you are making to the gift card. Important: You specify which details you are updating for this array by selecting whether the next string is status, expiry_date, or delivery_status. You must include one of these. The body example below shows a status update. | array | Required |
| status | If you want to update the gift card's status (such as from active to blocked), specify the updated status in the status string. | string | Required |
| expiry_date | If you want to update the gift card's expiration date, specify the updated date in the expiry_date string. | string | Required |
| delivery_status | If you want to update the gift card's delivery status (such as from pickup to delivered), specify the updated status in the delivery_status string. | string | Required |
| transitions_attributes | The array to hold details about the change you are performing. | array | Required |
| transition_state_name | Specify again which attribute of the gift card you want to update. Available options are: status, expiry_date, or delivery_status. | string | Required |
| notes | Add reasons or notes for the change. | string | Optional |
| pervious_state | Specify the previous value of the attribute that you are updating. Example: active. | string | Optional |
| current_state | Specify the new value of the attribute that you are updating. Example: blocked. | string | Required |
| creator_attributes | The array to hold details about the person who is making this change. | array | Required |
| creator_email | Specify the email of the person who is making this change. | string | Required |
| creator_role | Specify the role of the person who is making this change. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"gift_card": {
"status": "blocked",
"transitions_attributes": [
{
"transition_state_name": "status",
"notes": "dsa",
"pervious_state": "active",
"current_state": "blocked",
"creator_attributes": {
"creator_email": "dev@client.com",
"creator_role": "client"
}
}
]
}
}Response in JSON
{
"status": "blocked",
"value": "1000.0",
"id": 28071,
"number": "935896188801023413",
"currency": "USD",
"card_type": "monetary",
"expiry_date": null,
"skus": [],
"user_id": 24,
"campaign_id": 61,
"created_at": "2024-08-18T06:38:49.603Z",
"updated_at": "2024-08-18T12:41:48.628Z",
"client_id": 3,
"product_name": "tesitng",
"delivery_mode": "digital",
"delivery_status": "delivered",
"is_redeemed": false,
"is_expired": false,
"recipient_first_name": "Darrel",
"recipient_last_name": "Wiggins",
"recipient_email": "wyfosykyp@mailinator.com",
"order_number": "",
"send_email": false,
"order_pay_load": "",
"notes": "werwe",
"invoice_id": "sk-123",
"from_address": "wyfosykyp@mailinator.com",
"store_name": null,
"customer_email": null,
"barcode_key": "UT764xIqPatTsAl0",
"qrcode_key": "ZemSYyRv6OAfQ9H1",
"spree_ts_giftcard_id": null,
"slug": "d4b46bb5-3666-4e54-954b-cae5bad470f0",
"receipient_phone_number": "",
"send_gift_card_via": "email",
"bonus": false,
"serial_number": "01023413",
"operator_id": null,
"customer_id": null,
"recipient_emails": "",
"store_id": null,
"generated_at": null,
"import_by": "ts_giftcards",
"transition_activation_date": "2024-08-18T06:38:50.960Z",
"message": "",
"order_placed_date": null,
"line_item_id": null,
"start_date": null,
"test_mode": false,
"request_id": "1234"
}POST to redeem an experience gift card #
Use this endpoint to redeem a gift card whose card_type is experiences.
[POST] /api/v1/gift_cards/redeemPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| creator_attributes | The array to hold details about the person who is creating this redemption. | array | Required |
| creator_email | Specify the email of the person who is creating this redemption. | string | Required |
| creator_role | Specify the role of the person who is creating this redemption. | string | Required |
| number | Specify the gift card number for the gift card that is being redeemed. | string | Required |
| pin | Specify the security pin of the gift card. | string | Required |
| sku | Specify the SKU of the product for which you want to redeem the gift card. | string | Required |
| store_id | Specify the store ID of the store for which you want to redeem this gift card. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"creator_attributes": {
"creator_email": "mehran@techsembly.com",
"creator_role": "front_desk"
},
"number": "791400114701023414",
"pin": "69337",
"sku": "swim",
"store_id": "11"
}Response in JSON
{
"card_number": "791400114701023414",
"amount": "Card is redeemed",
"balance": "",
"currency": "",
"id": 30327
}POST to top up (reload) a gift card #
Use this endpoint to top up a gift card with a specified amount and currency.
[POST] /api/v1/gift_cards/creditPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| amount | Specify the amount that you want to load to the gift card. | number | Required |
| notes | Add notes to explain this transaction. | string | Required |
| currency | Specify the card currency. | string | Required |
| external_invoice_id | Specify the invoice ID of the reload transaction. | string | Required |
| number | Specify the card number for the gift card that is being reloaded. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"amount": 123123,
"notes": "1231231231",
"currency": "USD",
"external_invoice_id": 234234,
"number": "8108449962"
}Response in JSON
{
"card_number": "8108449962",
"amount": "123123.00",
"balance": "13076531.56",
"currency": "USD",
"meta": {}
}PUT to check the balance for an experience gift card #
Use this endpoint to check the balance of a gift card with card_type experiences.
[PUT] /api/v1/gift_cards/check_balancePut Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| number | Specify the card number for the gift card for which you are checking the balance. | string | Required |
| pin | Specify the security PIN number for the gift card for which you are checking the balance. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"number": "791400114701023414",
"pin": "69337"
}Response in JSON
{
"product_name": "Gift Card",
"card_type": "experiences",
"skus": "sad",
"card_status": "Valid",
"card_number": "791400114701023414",
"balance": "Card is redeemable.",
"expiry_date": "2025-10-14T00:00:00.000Z"
}PUT to assign a gift card to a customer #
Use this endpoint to assign gift cards to customers.
[PUT] /api/v1/gift_cards/assign_to_customerPut Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| number | Specify the card number for the gift card that you are assigning to a customer. | string | Required |
| pin | Specify the security PIN number for the gift card that you are assigning to a customer. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"number": "935896188801023413",
"pin": "24429"
}Response in JSON
{
"message": "Card Added Successfully"
}PUT to unassign a gift card #
Use this endpoint to unassign gift cards to customers.
[PUT] /api/v1/gift_cards/remove_cardPut Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| number | Specify the card number for the gift card that you are unassigning to a customer. | string | Required |
| pin | Specify the security PIN number for the gift card that you are unassigning to a customer. | string | Required |
| status | Specify the action to perform on the gift card. You must set this to remove. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"number": "456038848301023363",
"pin": "52169",
"status": "remove"
}Response in JSON
{
"message": "Card Removed Successfully"
}PUT to update a gift card's status #
Use this endpoint to update a gift card's status.
[PUT] /api/v1/gift_cards/update_statusPut Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| number | Specify the card number for the gift card for which you are updating the status. | string | Required |
| pin | Specify the security PIN number for the gift card for which you are updating the status. | string | Required |
| status | Specify the new status of the gift card. Available options are: active, blocked, canceled, or lost. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"number": "791400114701023414",
"pin": "",
"status": "lost"
}Response in JSON
{
"status": "lost",
"value": "123.0",
"id": 28072,
"number": "791400114701023414",
"pin": "69337",
"currency": "AED",
"card_type": "experiences",
"expiry_date": "2025-10-14T00:00:00.000Z",
"skus": [
"sad"
],
"user_id": 24,
"campaign_id": 61,
"created_at": "2024-08-18T15:25:19.074Z",
"updated_at": "2024-08-18T15:44:07.695Z",
"client_id": 3,
"product_name": "Gift Card",
"delivery_mode": "digital",
"delivery_status": "delivered",
"is_redeemed": false,
"is_expired": false,
"recipient_first_name": "Monetary",
"recipient_last_name": "(Ifrah)",
"recipient_email": "mehran@techsembly.com",
"order_number": "",
"send_email": false,
"order_pay_load": "",
"notes": "ad",
"invoice_id": "dsa",
"from_address": "mehran@techsembly.com",
"store_name": null,
"customer_email": null,
"barcode_key": "3W9WxznsbsiXpkzo",
"qrcode_key": "KOjnl79OQ8dy1jKW",
"spree_ts_giftcard_id": null,
"slug": "b807ce33-cfe1-4c55-95b5-ff675b5b63d5",
"receipient_phone_number": "",
"send_gift_card_via": "email",
"bonus": false,
"serial_number": "01023414",
"operator_id": null,
"customer_id": 752,
"recipient_emails": "",
"store_id": null,
"generated_at": null,
"import_by": "ts_giftcards",
"transition_activation_date": "2024-08-18T15:25:20.266Z",
"message": "dsa",
"order_placed_date": null,
"line_item_id": null,
"start_date": null,
"test_mode": false,
"request_id": ""
}GET a user's campaigns #
Use this endpoint to get all campaigns associated with the currently signed in user.
[GET] /api/v1/campaignsQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | This q element is a filter that is logically an object, but technically a string. For this endpoint, your request must format the q filters as standard query-string notation (q[field]=value), not as a URL-encoded JSON object. The following is an example of a request: GET https://<ts_server_url>/api/v1/campaigns ?q[name_cont]=Gift%20Card &q[code_cont]=1234 &page=1 &per_page=25 | string | Optional |
| name_cont | Use this to filter for campaigns with names that match this string. | string | Optional |
| code_cont | Use this to filter for campaigns with codes that match this string. | string | Optional |
| page | The page number to retrieve. Default is 1. | number | Optional |
| per_page | The number of results per page. Default is 25. | number | Optional |
Response in JSON
{
"campaigns": [
{
"id": 370,
"name": "dsa",
"start_date": "2025-04-23T00:00:00.000Z",
"end_date": "2026-05-15T00:00:00.000Z",
"client_id": 3,
"code": "dsa-1",
"max_expiry_days": 1,
"created_at": "2025-04-23T07:12:20.258Z",
"updated_at": "2025-06-20T14:25:39.226Z",
"date_specific_expiry": false,
"email_subject": "abcs@tecsdfdhsembly.com",
"email_html": " hello world ",
"specific_date": null,
"body": "",
"sms_html": "",
"allow_password": false,
"ses_from_email": "abcs@techsembly.com",
"transaction_email_subject": "abcs@techsembly.com",
"transaction_email_html": "asd",
"soft_delete": false,
"cc_transaction_email": "abcs@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": false
}
],
"total_count": 1
}POST to create a campaign #
Use this endpoint to create a new campaign.
[POST] /api/v1/campaignsPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign | The array to hold the campaign's details. | array | Required |
| name | Specify the name of campaign. | string | Required |
| code | Specify the code that uniquely identifies the campaign. | string | Required |
| start_date | Specify the start date of the campaign. | string | Required |
| end_date | Specify the end date of the campaign. | string | Required |
| max_expiry_days | Specify the maximum days before expiration of the campaign. | integer | Optional |
| store_ids | The array to hold the IDs of stores where the campaign is applicable. | array | Required |
| date_specific_expiry | If this is true, a date-specific expiry is enabled. If this is false, a date-specific expiry is disabled. | boolean | Optional |
| is_campaign_remained_active | If this is true, the campaign is active. If this is false, the campaign is not active. | boolean | Optional |
| is_gift_card_remained_active | If this is true, the campaign's gift cards are active. If this is false, the campaign's gift cards are not active. | boolean | Optional |
| email_subject | Specify the subject for the campaign email template. | string | Optional |
| email_html | Specify the html for the campaign email template. | string | Optional |
| body | Specify the body for the campaign email template. | string | Optional |
| specific_date | Specific the date of expiry of gift cards. | string | Optional |
| sms_html | Specify the content for the campaign's SMS messages. | string | Optional |
| allow_password | If this is true, a security PIN is required for transactions. If this is false, a security PIN is not required for transactions. | boolean | Optional |
| transaction_email_subject | Specify the subject for the transaction emails. | string | Optional |
| transaction_email_html | Specify the email body for the transaction emails. | string | Optional |
| ses_from_email | Specify the email address from which to be send emails. | string | Optional |
| cc_transaction_email | Specify the email address to be added in CC for transaction emails. | string | Optional |
| test_mode | If this is true, the campaign is a test campaign. If this is false, the campaign is not a test campaign. | boolean | Optional |
Post Body Example
The following is an example of the body for this post request:
{
"campaign": {
"name": "new campaign",
"code": "new_camp1",
"start_date": "2024-08-18",
"end_date": "2024-08-31",
"max_expiry_days": null,
"store_ids": [
"14",
"11"
],
"date_specific_expiry": true,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"email_subject": "campaign email subject",
"email_html": "campaign email template",
"body": "",
"specific_date": "2024-08-31",
"sms_html": "",
"allow_password": true,
"transaction_email_subject": "mehran@techsembly.com",
"transaction_email_html": "Transaction Email Template",
"ses_from_email": "mehran@techsembly.com",
"cc_transaction_email": "mehran@techsembly.com",
"test_mode": true
}
}Response in JSON
{
"id": 371,
"name": "new campaign",
"start_date": "2024-08-18T00:00:00.000Z",
"end_date": "2024-08-31T00:00:00.000Z",
"client_id": 3,
"code": "new_camp1",
"max_expiry_days": null,
"created_at": "2024-08-18T17:04:19.919Z",
"updated_at": "2024-08-18T17:04:19.919Z",
"date_specific_expiry": true,
"email_subject": "campaign email subject",
"email_html": "campaign email template",
"specific_date": "2024-08-31T00:00:00.000Z",
"body": "",
"sms_html": "",
"allow_password": true,
"ses_from_email": "mehran@techsembly.com",
"transaction_email_subject": "mehran@techsembly.com",
"transaction_email_html": "Transaction Email Template",
"soft_delete": false,
"cc_transaction_email": "mehran@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": true
}GET a campaign by ID #
Use this endpoint to get a specific campaign by its campaign ID.
[GET] /api/v1/campaigns/{campaign_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign_id | Specify the ID of the campaign that you want to retrieve. | number | Required |
Response in JSON
{
"id": 371,
"name": "new campaign",
"start_date": "2024-08-18T00:00:00.000Z",
"end_date": "2024-08-31T00:00:00.000Z",
"client_id": 3,
"code": "new_camp1",
"max_expiry_days": null,
"created_at": "2024-08-18T17:04:19.919Z",
"updated_at": "2024-08-18T17:04:19.919Z",
"date_specific_expiry": true,
"email_subject": "campaign email subject",
"email_html": "campaign email template",
"specific_date": "2024-08-31T00:00:00.000Z",
"body": "",
"sms_html": "",
"allow_password": true,
"ses_from_email": "mehran@techsembly.com",
"transaction_email_subject": "mehran@techsembly.com",
"transaction_email_html": "Transaction Email Template",
"soft_delete": false,
"cc_transaction_email": "mehran@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": true,
"store_ids": [
"14",
"11"
],
"attachment_url": ""
}PUT an update to a campaign #
Use this endpoint to update a specific campaign by its campaign ID.
[PUT] /api/v1/campaigns/{campaign_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign_id | Specify the ID of the campaign that you want to update. | number | Required |
Put Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign | The array to hold the campaign's details. | array | Required |
| name | Specify the name of campaign. | string | Required |
| code | Specify the code that uniquely identifies the campaign. | string | Required |
| start_date | Specify the start date of the campaign. | string | Required |
| end_date | Specify the end date of the campaign. | string | Required |
| max_expiry_days | Specify the maximum days before expiration of the campaign. | integer | Optional |
| store_ids | The array to hold the IDs of stores where the campaign is applicable. | array | Required |
| date_specific_expiry | If this is true, a date-specific expiry is enabled. If this is false, a date-specific expiry is disabled. | boolean | Optional |
| is_campaign_remained_active | If this is true, the campaign is active. If this is false, the campaign is not active. | boolean | Optional |
| is_gift_card_remained_active | If this is true, the campaign's gift cards are active. If this is false, the campaign's gift cards are not active. | boolean | Optional |
| email_subject | Specify the subject for the campaign email template. | string | Optional |
| email_html | Specify the html for the campaign email template. | string | Optional |
| body | Specify the body for the campaign email template. | string | Optional |
| specific_date | Specific the date of expiry of gift cards. | string | Optional |
| sms_html | Specify the content for the campaign's SMS messages. | string | Optional |
| allow_password | If this is true, a security PIN is required for transactions. If this is false, a security PIN is not required for transactions. | boolean | Optional |
| transaction_email_subject | Specify the subject for the transaction emails. | string | Optional |
| transaction_email_html | Specify the email body for the transaction emails. | string | Optional |
| ses_from_email | Specify the email address from which to be send emails. | string | Optional |
| cc_transaction_email | Specify the email address to be added in CC for transaction emails. | string | Optional |
| test_mode | If this is true, the campaign is a test campaign. If this is false, the campaign is not a test campaign. | boolean | Optional |
Put Body Example
The following is an example of the body for this put request:
{
"campaign": {
"name": "new campaign updated",
"code": "new_camp1",
"start_date": "2024-08-18",
"end_date": "2024-08-31",
"max_expiry_days": null,
"store_ids": [
"14",
"11"
],
"date_specific_expiry": true,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"email_subject": "campaign email subject",
"email_html": "campaign email template",
"body": "",
"specific_date": "2024-08-31",
"sms_html": "",
"allow_password": true,
"transaction_email_subject": "mehran@techsembly.com",
"transaction_email_html": "Transaction Email Template",
"ses_from_email": "mehran@techsembly.com",
"cc_transaction_email": "mehran@techsembly.com",
"test_mode": true
}
}Response in JSON
{
"name": "new campaign updated",
"start_date": "2024-08-18T00:00:00.000Z",
"end_date": "2024-08-31T00:00:00.000Z",
"code": "new_camp1",
"max_expiry_days": null,
"date_specific_expiry": true,
"is_gift_card_remained_active": false,
"is_campaign_remained_active": false,
"email_subject": "campaign email subject",
"email_html": "campaign email template",
"specific_date": "2024-08-31T00:00:00.000Z",
"body": "",
"sms_html": "",
"allow_password": true,
"ses_from_email": "mehran@techsembly.com",
"transaction_email_subject": "mehran@techsembly.com",
"transaction_email_html": "Transaction Email Template",
"cc_transaction_email": "mehran@techsembly.com",
"test_mode": true,
"id": 371,
"client_id": 3,
"created_at": "2024-08-18T17:04:19.919Z",
"updated_at": "2024-08-18T20:23:23.812Z",
"soft_delete": false,
"remain_active": false,
"transaction_email_receivers": "",
"attachment_url": ""
}DELETE a campaign #
Use this endpoint to delete a specific campaign by its campaign ID.
[DELETE] /api/v1/campaigns/{campaign_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign_id | Specify the ID of the campaign that you want to delete. | number | Required |
Response in JSON
{message: "Campaign deleted"
}GET a campaign's stores #
Use this endpoint to get all the stores of a specific campaign by its campaign ID.
[GET] /api/v1/campaigns/{campaign_id}/get_storesPath Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaign_id | Specify the ID of the campaign for which you want to retrieve stores. | number | Required |
Response in JSON
[
{
"id": 227,
"name": "Ahsan",
"code": "ali",
"url": "",
"client_id": 3,
"created_at": "2024-01-16T09:37:22.940Z",
"updated_at": "2024-02-14T10:47:52.262Z",
"fx_fees": null,
"fx_label": "",
"fx_enable": null,
"monetary_campaign_id": 347,
"store_front_link": null,
"soft_delete": false,
"activation_payment_link": "https://[YourURL]/single-client-single-vendor/card_activation?sku=002271",
"top_up_payment_link": "https://[YourURL]/single-client-single-vendor/card_activation?sku=002271",
"max_value": null,
"min_value": null,
"gift_card_values": ""
}
]PUT an update to a campaign's attachments #
Use this endpoint to update attachments of a specific campaign by its campaign ID.
[PUT] /api/v1/campaigns/{campaignId}/upload_attachmentPath Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| campaignId | The unique identifier of the campaign as a path parameter. This should match the id query parameter. | number | Required |
Query Parameters
The following table describes the elements that you must include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| id | The unique identifier of the campaign as a query parameter. This should match the campaignId. | number | Required |
Form Data Parameters
The following table describes a form data parameter that you must include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| file | Specify the image file to upload as the campaign attachment. | formData | Required |
Here is an example of a full GET request in curl:
curl -X 'PUT' \
'https://tsgifts-staging.techsembly.com/api/v1/campaigns/3/upload_attachment?id=4' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@FileName.png;type=image/png'Response in JSON
{
"updated_at": "2024-08-13T11:32:17.940Z",
"id": 61,
"name": "dev-1",
"start_date": "2023-01-27T00:00:00.000Z",
"end_date": "2026-12-27T00:00:00.000Z",
"client_id": 3,
"code": "dev-1",
"max_expiry_days": null,
"created_at": "2023-01-27T09:20:56.836Z",
"date_specific_expiry": true,
"email_subject": "dev testing email template merhan",
"email_html": "dev testing email template merhan",
"specific_date": "2025-10-14T00:00:00.000Z",
"body": "dev testing message body",
"sms_html": "dev testing sms template",
"allow_password": false,
"ses_from_email": "zeeshan@techsembly.com",
"transaction_email_subject": "dev testing transaction email bisma",
"transaction_email_html": " {{#if trasaction.show_local_amount}}\n {
{trasaction.local_currency
}
} {
{trasaction.local_amount
}
}\n {
{/if
}
}","soft_delete": false,
"cc_transaction_email": "ahsan.chughtai@techsembly.com",
"remain_active": false,
"is_campaign_remained_active": false,
"is_gift_card_remained_active": false,
"transaction_email_receivers": "",
"test_mode": false,
"attachment_url": "http://[YourURL]/eyJfcmF.jpg"
}GET a signed in user's stores #
Use this endpoint to get all stores for the signed in user. This endpoint has no parameters or configurable elements.
[GET] /api/v1/storesResponse in JSON
[
{
"id": 326,
"name": "Monetary (Ifrah)",
"code": "ali03",
"url": "",
"client_id": 3,
"created_at": "2024-06-05T12:22:37.998Z",
"updated_at": "2024-06-05T12:22:37.998Z",
"fx_fees": null,
"fx_label": "",
"fx_enable": null,
"monetary_campaign_id": null,
"store_front_link": null,
"soft_delete": false,
"activation_payment_link": "",
"top_up_payment_link": "",
"max_value": null,
"min_value": null,
"gift_card_values": ""
}
]POST a new store #
Use this endpoint to create a new store.
[POST] /api/v1/storesPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| name | Specify the name for the new store. | string | Required |
| code | Specify the unique store code for the new store. | string | Required |
| fx_enable | If this is true, additional fees can be charged by the store during transactions. If this is false, additional fees cannot be charged by the store during transactions. | string | Required |
| fx_label | Specify a label for the additional fee. | string | Required |
| fx_fees | Specify the amount of the additional fee that will be charged. | number | Required |
| monetary_campaign_id | Specify the monetary campaign ID against which monetary cards will be activated. | string | Optional |
| top_up_payment_link | Specify the top up payment link. Card top ups (reloads) can be made using this link. | string | Required |
| activation_payment_link | Specify the activation payment link. Cards can be activated via this link. | string | Required |
| min_value | Specify the minimum value that a gift card can have for this store. | integer | Required |
| max_value | Specify the maximum value that a gift card can have for this store. | integer | Required |
| gift_card_values | Specify the possible values that will be displayed as a comma-separated list of options to users when activating this gift card. For example: 100,500,1000,10000,100000 | string | Required |
| users_attributes | The array to hold details about the API user. | array | Required |
| id | Specify the ID of the person who is creating this store. | string | Optional |
| Specify the email of the person who is creating this store. | string | Required | |
| password | Specify the password of the person who is creating this store. | string | Required |
| enable_request_id | If this is true, the request ID will be enforced. If this is false, the request ID will not be enforced. | boolean | Optional |
| roles_attributes | The array to hold the name of the person who is creating this store. | array | Required |
| name | Specify the name of the person who is creating this store. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"store": {
"name": "new store",
"code": "new-store-01",
"fx_enable": true,
"fx_label": "exchange fee",
"fx_fees": 10,
"monetary_campaign_id": "",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"min_value": 1,
"max_value": 100000,
"gift_card_values": "100,500,1000,10000,100000",
"users_attributes": [
{
"id": "",
"email": "new-api-email@gmail.com",
"password": "1234567",
"roles_attributes": [
{
"name": "api"
}
],
"enable_request_id": true
}
]
}
}Response in JSON
{
"id": 330,
"name": "new store",
"code": "new-store-01",
"url": "",
"client_id": 3,
"created_at": "2024-08-19T06:38:01.356Z",
"updated_at": "2024-08-19T06:38:01.356Z",
"fx_fees": 10,
"fx_label": "exchange fee",
"fx_enable": true,
"monetary_campaign_id": null,
"store_front_link": null,
"soft_delete": false,
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"max_value": 100000,
"min_value": 1,
"gift_card_values": "100,500,1000,10000,100000"
}GET a store's information #
Use this endpoint to get the store information for a store that you specify by store ID.
[GET] /api/v1/stores/{store_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| store_id | Specify the ID of the store for which you want to get the store information. | number | Required |
Response in JSON
{
"id": 330,
"name": "new store",
"code": "new-store-01",
"url": "",
"client_id": 3,
"created_at": "2024-08-19T06:38:01.356Z",
"updated_at": "2024-08-19T06:38:01.356Z",
"fx_fees": 10,
"fx_label": "exchange fee",
"fx_enable": true,
"monetary_campaign_id": null,
"store_front_link": null,
"soft_delete": false,
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"max_value": 100000,
"min_value": 1,
"gift_card_values": "100,500,1000,10000,100000",
"campaigns": [],
"users": [
{
"id": 773,
"email": "new-api-email@gmail.com",
"name": "",
"store_id": null,
"client_id": null,
"created_at": "2024-08-19T06:38:01.653Z",
"updated_at": "2024-08-19T06:38:01.653Z",
"payment_methods": {
"pos": false,
"cash": false,
"credit_card": false
},
"department_id": null,
"is_operator_enabled": false,
"is_top_up_show": false,
"menu_access": {
"top_up": false,
"activation": false,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": null,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": true
}
]
}PUT an update to a store #
Use this endpoint to update the store information for a store that you specify by store ID.
[PUT] /api/v1/stores/{store_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| store_id | Specify the ID of the store that you want to update. | number | Required |
Put Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| name | Specify the name for the store. | string | Required |
| code | Specify the unique store code for the store. | string | Required |
| fx_enable | If this is true, additional fees can be charged by the store during transactions. If this is false, additional fees cannot be charged by the store during transactions. | string | Required |
| fx_label | Specify a label for the additional fee. | string | Required |
| fx_fees | Specify the amount of the additional fee that will be charged. | number | Required |
| monetary_campaign_id | Specify the monetary campaign ID against which monetary cards will be activated. | string | Optional |
| top_up_payment_link | Specify the top up payment link. Card top ups (reloads) can be made using this link. | string | Required |
| activation_payment_link | Specify the activation payment link. Cards can be activated via this link. | string | Required |
| min_value | Specify the minimum value that a gift card can have for this store. | integer | Required |
| max_value | Specify the maximum value that a gift card can have for this store. | integer | Required |
| gift_card_values | Specify the possible values that will be displayed as a comma-separated list of options to users when activating this gift card. For example: 100,500,1000,10000,100000 | string | Required |
| users_attributes | The array to hold details about the API user. | array | Required |
| id | Specify the ID of the person who is updating this store. | string | Optional |
| Specify the email of the person who is updating this store. | string | Required | |
| enable_request_id | If this is true, the request ID will be enforced. If this is false, the request ID will not be enforced. | boolean | Optional |
Put Body Example
The following is an example of the body for this put request:
{
"store": {
"name": "new store updated",
"code": "new-store-01",
"fx_enable": true,
"fx_label": "exchange fee",
"fx_fees": 10,
"monetary_campaign_id": "",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"min_value": 1,
"max_value": 100000,
"gift_card_values": "100,500,1000,10000,100000",
"users_attributes": [
{
"email": "new-api-email@gmail.com",
"enable_request_id": true
}
]
}
}Response in JSON
{
"client_id": 3,
"name": "new store updated",
"code": "new-store-01",
"max_value": 100000,
"min_value": 1,
"gift_card_values": "100,500,1000,10000,100000",
"fx_fees": 10,
"fx_label": "exchange fee",
"fx_enable": true,
"monetary_campaign_id": null,
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"id": 330,
"url": "",
"created_at": "2024-08-19T06:38:01.356Z",
"updated_at": "2024-08-19T07:15:59.233Z",
"store_front_link": null,
"soft_delete": false
}DELETE a store #
Use this endpoint to delete a store that you specify by store ID.
[DELETE] /api/v1/stores/{store_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| store_id | Specify the ID of the store that you want to delete. | number | Required |
Response in JSON
{message: "Store deleted"
}GET all front desk users #
Use this endpoint to get information about all Front Desk users.
[GET] /api/v1/usersQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | This q element is a filter that is logically an object, but technically a string. For this endpoint, your request must format the q filters as standard query-string notation (q[field]=value), not as a URL-encoded JSON object. The following is an example of a request: GET https://<ts_server_url>/api/v1/users ?q[name_cont]=Jane &q[code_cont]=1234 &page=1 &per_page=25 | string | Optional |
| name_cont | Use this to filter for users with names that match this string. | string | Optional |
| code_cont | Use this to filter for users with codes that match this string. | string | Optional |
| page | The page number to retrieve. Default is 1. | number | Optional |
| per_page | The number of results per page. Default is 25. | number | Optional |
Response in JSON
[
{
"id": 766,
"email": "testing3@mailinator.com",
"name": "testing3",
"store_id": null,
"client_id": 3,
"created_at": "2024-08-14T18:43:47.905Z",
"updated_at": "2024-08-14T18:43:47.905Z",
"payment_methods": {
"pos": false,
"cash": true,
"credit_card": true
},
"department_id": 192,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 227,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
},
{
"id": 442,
"email": "testing@mailinator.com",
"name": "testing",
"store_id": null,
"client_id": 3,
"created_at": "2024-01-15T09:49:15.305Z",
"updated_at": "2024-06-26T06:56:04.195Z",
"payment_methods": {
"pos": false,
"cash": true,
"credit_card": true
},
"department_id": 192,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 227,
"provider": "email",
"uid": "4421eb39cdc8f04c84e8703896ad0c6",
"tokens": null,
"enable_request_id": false
},
{
"id": 151,
"email": "imranfd@test.com",
"name": "imranFd",
"store_id": null,
"client_id": 3,
"created_at": "2023-04-13T10:15:42.017Z",
"updated_at": "2023-04-13T11:04:08.499Z",
"payment_methods": {
"pos": false,
"cash": true,
"credit_card": true
},
"department_id": 132,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 13,
"provider": "email",
"uid": "1512362efbc9adfe9799cc5dbe17d15",
"tokens": null,
"enable_request_id": false
},
{
"id": 63,
"email": "dev123@gmail.com",
"name": "dev123",
"store_id": null,
"client_id": 3,
"created_at": "2023-02-28T07:49:04.800Z",
"updated_at": "2024-08-14T19:13:50.316Z",
"payment_methods": {
"pos": false,
"cash": true,
"credit_card": false
},
"department_id": 52,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": true
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 11,
"provider": "email",
"uid": "63cb51aeb01e00aad1f46383ab9772",
"tokens": null,
"enable_request_id": false
},
{
"id": 60,
"email": "mehrufd2.0@gmail.com",
"name": "mehruFD",
"store_id": null,
"client_id": 3,
"created_at": "2023-02-27T08:28:44.272Z",
"updated_at": "2024-08-14T19:13:40.652Z",
"payment_methods": {
"pos": true,
"cash": true,
"credit_card": true
},
"department_id": 52,
"is_operator_enabled": true,
"is_top_up_show": true,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 11,
"provider": "email",
"uid": "60440f4d516a2d74a538e79289c335",
"tokens": null,
"enable_request_id": false
}
]POST a new front desk user #
Use this endpoint to create a Front Desk user.
[POST] /api/v1/usersPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| name | Specify the name of the user. | string | Required |
| Specify the email of the user. | string | Required | |
| store_ids | Specify one or more IDs of the stores to which the user has access. | object | Required |
| department_id | Specify the ID of the store department to which the user belongs. | string | Required |
| is_operator_enabled | If this is true, the user supports multiple operators. If this is false, the user does not support multiple operators. | boolean | Required |
| payment_methods | The array in which you specify the payment methods available to the user: cash, pos, credit_card. | string | Required |
| cash | If this is true, the user can use the cash payment method. If this is false, the user cannot use the cash payment method. | boolean | Optional |
| pos | If this is true, the user can use the POS (Point of Sale) payment method. If this is false, the user cannot use the POS (Point of Sale) payment method. | boolean | Optional |
| credit_card | If this is true, the user can use the credit card payment method. If this is false, the user cannot use the credit card payment method. | boolean | Optional |
| operators_attributes | The array to hold details about the operator. If the user you are creating supports multiple operators (is_operator_enabled is set to true), add the ID and name in this array. | array | Optional |
| id | Specify the ID for the operator. | string | Optional |
| operator_name | Specify the name for the operator. | string | Optional |
| menu_access | The array in which you specify the operations available to the user: top_up, activation, other_transaction. | string | Required |
| top_up | If this is true, the user can perform the top up (reload) operation. If this is false, the user cannot perform the top up operation. | boolean | Optional |
| activation | If this is true, the user can perform the activation operation. If this is false, the user cannot perform the activation operation. | boolean | Optional |
| other_transaction | If this is true, the user can perform "other transaction" operations that were created for the client. If this is false, the user cannot perform "other transaction" operations. | boolean | Optional |
| password | Specify the user's password. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"user": {
"name": "new-fd-user",
"email": "new-fd-user@sabre.com",
"store_ids": [
"11"
],
"department_id": "200",
"is_operator_enabled": true,
"payment_methods": {
"cash": true,
"pos": false,
"credit_card": true
},
"operators_attributes": [
{
"id": "",
"operator_name": "operator 1"
}
],
"store_filter_id": "11",
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"password": "123456"
}
}Response in JSON
{
"id": 772,
"email": "new-fd-user@sabre.com",
"name": "new-fd-user",
"store_id": null,
"client_id": 3,
"created_at": "2024-08-19T05:14:59.010Z",
"updated_at": "2024-08-19T05:14:59.010Z",
"payment_methods": {
"cash": true,
"pos": false,
"credit_card": true
},
"department_id": 200,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 11,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
}GET a user's information #
Use this endpoint to get information about a user that you specify by user ID.
[GET] /api/v1/users/{user_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| user_id | Specify the ID of the user whose information you want to retrieve. | number | Required |
Response in JSON
{
"id": 772,
"email": "new-fd-user@sabre.com",
"name": "new-fd-user",
"store_id": null,
"client_id": 3,
"created_at": "2024-08-19T05:14:59.010Z",
"updated_at": "2024-08-19T05:14:59.010Z",
"payment_methods": {
"pos": false,
"cash": true,
"credit_card": true
},
"department_id": 200,
"is_operator_enabled": true,
"is_top_up_show": false,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"store_filter_id": 11,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false,
"operators": [
{
"id": 237,
"operator_name": "operator 1",
"pin": "16651",
"user_id": 772,
"created_at": "2024-08-19T05:14:59.035Z",
"updated_at": "2024-08-19T05:14:59.035Z",
"soft_delete": false
}
],
"stores": [
{
"id": 11,
"name": "dev-store-1",
"code": "dev-1",
"url": "",
"client_id": 3,
"created_at": "2023-01-27T09:19:35.641Z",
"updated_at": "2024-06-21T07:22:08.578Z",
"fx_fees": 4,
"fx_label": "mehru",
"fx_enable": true,
"monetary_campaign_id": 61,
"store_front_link": "https://[YourURL]",
"soft_delete": false,
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"max_value": 100,
"min_value": 10,
"gift_card_values": "5,10,15,20, 19.11111"
}
],
"department": {
"id": 200,
"department_name": "new department name",
"department_description": "new department description",
"client_id": null,
"created_at": "2024-08-13T13:59:50.386Z",
"updated_at": "2024-08-13T14:00:00.962Z",
"soft_delete": false,
"store_id": 11,
"store": {
"id": 11,
"name": "dev-store-1",
"code": "dev-1",
"url": "",
"client_id": 3,
"created_at": "2023-01-27T09:19:35.641Z",
"updated_at": "2024-06-21T07:22:08.578Z",
"fx_fees": 4,
"fx_label": "mehru",
"fx_enable": true,
"monetary_campaign_id": 61,
"store_front_link": "https://[YourURL]",
"soft_delete": false,
"activation_payment_link": "http://[YourURL]/card_activation?sku=005672",
"top_up_payment_link": "http://[YourURL]/card_topup?sku=005672",
"max_value": 100,
"min_value": 10,
"gift_card_values": "5,10,15,20, 19.11111"
}
}
}PUT an update to a front desk user #
Use this endpoint to update the information for a Front Desk user that you specify by user ID.
[PUT] /api/v1/users/{user_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| user_id | Specify the ID of the Front Desk user whose information you want to update. | number | Required |
Put Body Parameters
The following table describes the parameters to include in your put request:
| Element | Description | Type | Required? |
|---|---|---|---|
| name | Specify the name of the user. | string | Required |
| Specify the email of the user. | string | Required | |
| store_ids | Specify one or more IDs of the stores to which the user has access. | object | Required |
| department_id | Specify the ID of the store department to which the user belongs. | string | Required |
| is_operator_enabled | If this is true, the user supports multiple operators. If this is false, the user does not support multiple operators. | boolean | Required |
| payment_methods | The array in which you specify the payment methods available to the user: cash, pos, credit_card. | string | Required |
| cash | If this is true, the user can use the cash payment method. If this is false, the user cannot use the cash payment method. | boolean | Optional |
| pos | If this is true, the user can use the POS (Point of Sale) payment method. If this is false, the user cannot use the POS (Point of Sale) payment method. | boolean | Optional |
| credit_card | If this is true, the user can use the credit card payment method. If this is false, the user cannot use the credit card payment method. | boolean | Optional |
| operators_attributes | The array to hold details about the operator. If the user you are creating supports multiple operators (is_operator_enabled is set to true), add the ID and name in this array. | array | Optional |
| id | Specify the ID for the operator. | string | Optional |
| operator_name | Specify the name for the operator. | string | Optional |
| menu_access | The array in which you specify the operations available to the user: top_up, activation, other_transaction. | string | Required |
| top_up | If this is true, the user can perform the top up (reload) operation. If this is false, the user cannot perform the top up operation. | boolean | Optional |
| activation | If this is true, the user can perform the activation operation. If this is false, the user cannot perform the activation operation. | boolean | Optional |
| other_transaction | If this is true, the user can perform "other transaction" operations that were created for the client. If this is false, the user cannot perform "other transaction" operations. | boolean | Optional |
| password | Specify the user's password. | string | Required |
Put Body Example
The following is an example of the body for this put request:
{
"user": {
"name": "new-fd-user name updated",
"email": "new-fd-user@sabre.com",
"store_ids": [
"11"
],
"department_id": "200",
"is_operator_enabled": true,
"payment_methods": {
"cash": true,
"pos": false,
"credit_card": true
},
"operators_attributes": [
{
"id": 237,
"operator_name": "operator 1"
}
],
"store_filter_id": "11",
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"password": "navisi9055@secbuf.com"
}
}Response in JSON
{
"client_id": 3,
"store_filter_id": 11,
"email": "new-fd-user@sabre.com",
"name": "new-fd-user name updated",
"department_id": 200,
"is_operator_enabled": true,
"menu_access": {
"top_up": true,
"activation": true,
"other_transaction": false
},
"payment_methods": {
"cash": true,
"pos": false,
"credit_card": true
},
"id": 772,
"store_id": null,
"created_at": "2024-08-19T05:14:59.010Z",
"updated_at": "2024-08-19T05:36:15.035Z",
"is_top_up_show": false,
"first_name": null,
"last_name": null,
"phone_number": null,
"cell_number": null,
"terms_and_conditions": false,
"enable_promotions": false,
"title": null,
"soft_delete": false,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
}DELETE a front desk user #
Use this endpoint to delete a Front Desk user that you specify by user ID.
[DELETE] /api/v1/users/{user_id}Path Parameters
The following table describes the elements that you must include for this operation:
| Element | Description | Type | Required? |
|---|---|---|---|
| user_id | Specify the ID of the Front Desk user that you want to delete. | number | Required |
Response in JSON
{
"message": "User deleted"
}POST to create front desk users in bulk #
Use this endpoint to perform a bulk create of Front Desk users.
[POST] /api/v1/users/create_bulk_front_deskImportant: To use this endpoint, you must post a CSV file that includes the columns explained in the following table.
| Column Name | Column Contains | Required? |
|---|---|---|
| User Name | Add the names of the Front Desk users to create. | Required |
| User Email | Add the email addresses of the Front Desk users. | Required |
| User Password | Add the passwords of the Front Desk users. | Required |
| Store for V1 | Add the stores for the V1 flow. | Required |
| Store for V2 | Add the stores for the V2 flow. | Required |
| Select Department | Add the departments for the Front Desk users. | Required |
| Allow Operator | Add true if the user supports multiple operators. Add false if the user does not support multiple operators. | Required |
| Allow Top Up | Add true if the user can perform the top up (reload) operation. Add false if the user cannot perform the top up operation. | Required |
| Allow Activation | Add true if the user can perform the activation operation. Add false if the user cannot perform the activation operation. | Required |
| Cash | Add true if the user can use the cash payment method. Add false if the user cannot use the cash payment method. | Required |
| Credit Card | Add true if the user can use the credit card payment method. Add false if the user cannot use the credit card payment method. | Required |
| Operator Names | Add the name for the operator. | Required |
Form Data Parameters
The following table describes the form data parameter that you must include to post your CSV file for this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| file | Specify the CSV file with the bulk user information to upload. | formData | Required |
Here is an example of a full POST request in curl:
curl -X 'POST' \
'https://tsgifts-staging.techsembly.com/api/v1/users/create_bulk_front_desk' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@BulkFrontDeskUsers.csv;type=text/csv'Response in JSON
The response to a successful update will be Code 204 No Content.
GET data for all users #
Use this endpoint to export the data for all users. The response contains each user's data in an array.
[GET] /api/v1/users/export_dataResponse in JSON
[
{
"name": "testing3",
"email": "testing3@mailinator.com",
"department_name": "Ahsan",
"stores_v1": "dev-store-1, Ahsan",
"store_v2": "Ahsan",
"cash": true,
"credit_card": true,
"activation": true,
"top_up": true,
"is_operator_enabled": true,
"operators": [
"testing op, 49910"
]
}
]GET the user profile for the signed in user #
Use this endpoint to get the user profile of the signed in user. The user profile you receive in the response includes user details, payment methods (POS, cash, credit card), menu access (top up, activation, other transactions), and more.
[GET] /api/v1/users/profileResponse in JSON
{
"id": 767,
"email": "tscustomer@gmail.com",
"name": "",
"store_id": null,
"client_id": null,
"created_at": "2024-08-14T20:03:37.761Z",
"updated_at": "2024-08-15T16:49:16.429Z",
"payment_methods": {
"pos": false,
"cash": false,
"credit_card": false
},
"department_id": null,
"is_operator_enabled": false,
"is_top_up_show": false,
"menu_access": {
"top_up": false,
"activation": false,
"other_transaction": false
},
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234phone",
"cell_number": "5678cell",
"terms_and_conditions": true,
"enable_promotions": true,
"title": "Miss",
"soft_delete": false,
"store_filter_id": null,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false,
"shipping_address": {
"id": 1199,
"gift_card_id": null,
"created_at": "2024-08-14T20:20:23.788Z",
"updated_at": "2024-08-14T20:20:23.788Z",
"firstname": "",
"lastname": "",
"address1": "arfa tower",
"address2": "",
"city": "Lahore",
"zipcode": "54500",
"phone": "",
"state_name": "",
"state": "Punjab",
"country": "Pakistan",
"user_id": 767
}
}POST to sign in a user on TS-Portal #
Use this endpoint to sign in a user on TS-Portal.
[POST] /api/v1/users/signinYour URL to the portal generally looks like this: https://www.MyStore.com/ts-portal/ts-login
Post Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| Specify the user's email address. | string | Required | |
| password | Specify the user's password. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"email": "tscustomer@gmail.com",
"password": "tscustomer@gmail.com"
}Response in JSON
{
"id": 767,
"email": "tscustomer@gmail.com",
"name": "",
"store_id": null,
"client_id": null,
"created_at": "2024-08-14T20:03:37.761Z",
"updated_at": "2024-08-15T16:49:16.429Z",
"payment_methods": {
"pos": false,
"cash": false,
"credit_card": false
},
"department_id": null,
"is_operator_enabled": false,
"is_top_up_show": false,
"menu_access": {
"top_up": false,
"activation": false,
"other_transaction": false
},
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234phone",
"cell_number": "5678cell",
"terms_and_conditions": true,
"enable_promotions": true,
"title": "Miss",
"soft_delete": false,
"store_filter_id": null,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
}POST to create a customer #
Use this endpoint to create a customer.
[POST] /api/v1/users/create_customerPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| title | Specify the customer's title, such as Mr, Mrs, Miss. | string | Required |
| first_name | Specify the customer's first name. | string | Required |
| last_name | Specify the customer's last name. | string | Required |
| phone_number | Specify the customer's phone number. | string | Required |
| cell_number | Specify the customer's cellular phone number. | string | Required |
| Specify the customer's email address. | string | Required | |
| password | Specify the customer's password. | string | Required |
| terms_and_conditions | If this is true, the customer accepts the terms and conditions. If this is false, the customer does not accept the terms and conditions. This must be true in order to successfully create the customer. | boolean | Required |
| enable_promotions | If this is true, the customer agrees to receive promotional emails. If this is false, the customer does not agree to receive promotional emails. | boolean | Optional |
| shipping_address_attributes | The array to hold the customer's shipping address details. | array | Required |
| address1 | Specify the customer's shipping street address. | string | Required |
| city | Specify the customer's shipping address city. | string | Required |
| country | Specify the customer's shipping address country. | string | Required |
| state | Specify the customer's shipping address state. | string | Required |
| zipcode | Specify the customer's shipping address zip code. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"user": {
"title": "Miss",
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234",
"cell_number": "5678",
"email": "tscustomer@gmail.com",
"email_confirmation": "tscustomer@gmail.com",
"password": "tscustomer@gmail.com",
"password_confirmation": "tscustomer@gmail.com",
"terms_and_conditions": true,
"enable_promotions": true,
"shipping_address_attributes": {
"address1": "arfa tower",
"city": "Lahore",
"country": "Pakistan",
"state": "Punjab",
"zipcode": "54500"
}
}
}Response in JSON
{
"id": 767,
"email": "tscustomer@gmail.com",
"name": "",
"store_id": null,
"client_id": null,
"created_at": "2024-08-14T20:03:37.761Z",
"updated_at": "2024-08-14T20:03:37.761Z",
"payment_methods": {
"pos": false,
"cash": false,
"credit_card": false
},
"department_id": null,
"is_operator_enabled": false,
"is_top_up_show": false,
"menu_access": {
"top_up": false,
"activation": false,
"other_transaction": false
},
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234",
"cell_number": "5678",
"terms_and_conditions": true,
"enable_promotions": true,
"title": "Miss",
"soft_delete": false,
"store_filter_id": null,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
}POST an update to a customer #
Use this endpoint to update a customer.
[POST] /api/v1/users/update_customerPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| title | Specify the customer's title, such as Mr, Mrs, Miss. | string | Required |
| first_name | Specify the customer's first name. | string | Required |
| last_name | Specify the customer's last name. | string | Required |
| phone_number | Specify the customer's phone number. | string | Required |
| cell_number | Specify the customer's cellular phone number. | string | Required |
| Specify the customer's email address. | string | Required | |
| password | Specify the customer's password. | string | Required |
| terms_and_conditions | If this is true, the customer accepts the terms and conditions. If this is false, the customer does not accept the terms and conditions. This must be true in order to successfully update the customer. | boolean | Required |
| enable_promotions | If this is true, the customer agrees to receive promotional emails. If this is false, the customer does not agree to receive promotional emails. | boolean | Optional |
| shipping_address_attributes | The array to hold the customer's shipping address details. | array | Required |
| address1 | Specify the customer's shipping street address. | string | Required |
| city | Specify the customer's shipping address city. | string | Required |
| country | Specify the customer's shipping address country. | string | Required |
| state | Specify the customer's shipping address state. | string | Required |
| zipcode | Specify the customer's shipping address zip code. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"user": {
"title": "Miss",
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234phone",
"cell_number": "5678cell",
"email": "tscustomer@gmail.com",
"email_confirmation": "tscustomer@gmail.com",
"terms_and_conditions": true,
"enable_promotions": true,
"shipping_address_attributes": {
"address1": "arfa tower",
"city": "Lahore",
"country": "Pakistan",
"state": "Punjab",
"zipcode": "54500"
}
}
}Response in JSON
{
"title": "Miss",
"email": "tscustomer@gmail.com",
"first_name": "ts",
"last_name": "customer",
"phone_number": "1234phone",
"cell_number": "5678cell",
"terms_and_conditions": true,
"enable_promotions": true,
"id": 767,
"name": "",
"store_id": null,
"client_id": null,
"created_at": "2024-08-14T20:03:37.761Z",
"updated_at": "2024-08-14T20:09:49.088Z",
"payment_methods": {
"pos": false,
"cash": false,
"credit_card": false
},
"department_id": null,
"is_operator_enabled": false,
"is_top_up_show": false,
"menu_access": {
"top_up": false,
"activation": false,
"other_transaction": false
},
"soft_delete": false,
"store_filter_id": null,
"provider": "email",
"uid": "",
"tokens": null,
"enable_request_id": false
}POST to change a customer password #
Use this endpoint to change the password for a customer.
[POST] /api/v1/users/change_passwordPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| current_password | Specify the current password of the customer. | string | Required |
| new_password | Specify the new password of the customer. | string | Required |
| confirm_password | Specify again the new password for the customer. This is the confirmation and must match new_password in order for the update to be successful. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"current_password": "tscustomer@gmail.com",
"new_password": "tscustomer456@gmail.com",
"confirm_password": "tscustomer456@gmail.com"
}Response in JSON
{
"message": "Password updated successfully"
}POST to generate a reset password token for a customer #
Use this endpoint to generate a reset password token for a customer.
[POST] /api/v1/passwords/generate_reset_password_tokenAfter you use this endpoint to generate the token, you can then use the token in the [POST] /api/v1/passwords endpoint to reset the customer password.
Post Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| store_url | Specify the URL of the customer's store. | string | Required |
| Specify the customer's email address. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"store_url": "http://localhost:3000/ts-portal",
"email": "mehran@techsembly.com"
}Response in JSON
{
"success": true
}POST to reset a customer password #
Use this endpoint to reset a customer's password. You must provide a valid reset password token.
[POST] /api/v1/passwordsBefore you use this endpoint to reset the customer password, you generate the needed token with the [POST] /api/v1/passwords/generate_reset_password_token endpoint.
Post Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| password | Specify the customer's new password. | string | Required |
| password_confirmation | Specify again the new password for the customer. This is the confirmation and must match password in order for the update to be successful. | string | Required |
| reset_password_token | Specify a valid token to reset the password. | string | Required |
Post Body Example
The following is an example of the body for this post request:
{
"password": "tscustomer@gmail.com",
"password_confirmation": "tscustomer@gmail.com",
"reset_password_token": "z6Fy2saZEMt7T1PLe8Kg"
}Response in JSON
{
"message": "Password updated successfully"
}GET a gift card report that includes PII #
Use this endpoint to retrieve a report of gift card details (in JSON format) that includes Personally Identifiable Information (PII).
[GET] /api/v1/reports/download_reportNote: You can use the [GET] /api/v1/clients/download_report endpoint to retrieve the same data but without PII included.
Query Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | For this endpoint, your request must format the q filters as a URL-encoded JSON object. To understand how to format your full GET request, see How to Format. | object | Required |
| reporting_data | The object to hold the exchange rates and reporting currency. | object | Required |
| exchange_rates | The array to hold one or more objects that represent exchange rates. | array | Required |
| to_currency | Specify the target currency code (such as USD). | string | Required |
| from_currency | Specify the source currency code (such as RMB). | string | Required |
| value | Specify the exchange rate value between the from_currency and the to_currency. | number | Required |
| reporting_currency | Specify the currency in which the report will be generated (such as USD). | string | Required |
How to Format This GET Request
This endpoint requires you to add the q filter to your request. The q filter is logically an object, but technically a string. Therefore, you must follow these steps:
1. Construct your q filter as a JSON object.
The following is an example of a JSON object for this request. (This example shows q as the outer object to illustrate the full structure of the filter. Steps 2 and 3 explain why you can't use this exact format in your HTTP request.)
{
"q": {
"reporting_data": {
"reporting_currency": "USD",
"exchange_rates": [
{
"from_currency": "AED",
"to_currency": "USD",
"value": 0.27226
}
]
}
}
}2. Serialize and URL-encode your q JSON object.
You will typically do this programmatically (for example, using curl). Conceptually, this involves two steps:
- Serialize the q JSON object into a JSON string.
- URL-encode that JSON string so that it can be safely sent as a query parameter.
The following generic example illustrates what serialization looks like:
{"object1":{"object2":{"array1":[{"string1":"value1"}]}}}And here is that same generic example in URL-encoded form:
%7B%22object1%22%3A%7B%22object2%22%3A%7B%22array1%22%3A%5B%7B%22string1%22%3A%22value1%22%7D%5D%7D%7D%7D3. Send your GET request that includes the q parameter as a pre-encoded query string, or as raw JSON that your HTTP client (such as curl) will URL-encode for you.
Here is an example of a full GET request that uses curl to URL-encode the q parameter:
curl -X GET \
"https://<ts_server_url>/api/v1/reports/download_report" \
-u email@example.com:password \
--data-urlencode 'q={
"reporting_data": {
"reporting_currency": "USD",
"exchange_rates": [
{
"from_currency": "AED",
"to_currency": "USD",
"value": 0.27226
}
]
}
}'Response in JSON
[
{
"id": 28070,
"number": "420646903701023412",
"product_name": "Gift Card",
"serial_number": "01023412",
"currency": "AED",
"created_at": "August 13, 2024 07:10 AM",
"type": "monetary",
"delivery_type": "physical",
"updated_at": "August 13, 2024 07:10 AM",
"valid": "October 14, 2025 12:00 AM",
"status": "active",
"recipient_first_name": "mehran",
"recipient_last_name": "javid",
"recipient_email": "",
"recipient_phone_number": null,
"order_number": "897703402801023370",
"original_balance": "10.0",
"current_balance": "10.0",
"pending_liability": 10,
"campaign_code": "dev-1",
"stores": null,
"campaign_stores": "store1, store2, store3",
"reporting_currency": "USD",
"reporting_amount": 2.72,
"reporting_exchange_rate": 0.27226,
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin",
"message": "",
"bonus": false
}
]GET a transaction report that includes PII #
Use this endpoint to get a gift card transactions report that includes Personally Identifiable Information (PII).
[GET] /api/v1/reports/transactions_reportQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| q | For this endpoint, your request must format the q filters as a URL-encoded JSON object. To understand how to format your full GET request, see How to Format. | string | Required |
| gift_card_number_scope | Filter for a gift card number | string | Required |
| created_at_gt_scope | Created at greater than | string | Required |
| created_at_lt_scope | Created at less than | string | Required |
| campaign_code_scope | Campaign code | string | Required |
| gift_card_campaign_stores_name_cont | Gift card campaign store names | string | Required |
| transaction_type_eq | Transaction type | string | Required |
| gift_card_status_scope | Gift card status | string | Required |
| timezone | Specify the time zone in which to generate the report. Example: Europe/London. | string | Required |
| exchange_values | The object to hold the exchange rate information used in the report. | string | Required |
| exchange_rates | The array to hold one or more objects that represent exchange rates. | string | Required |
| to_currency | Specify the target currency code (such as USD). | string | Required |
| from_currency | Specify the source currency code (such as RMB). | string | Required |
| value | Specify the exchange rate value between the from_currency and the to_currency. | number | Required |
| reporting_currency | Specify the currency in which the report will be generated (such as USD). | string | Required |
How to Format This GET Request
This endpoint requires you to add the q filter and exchange_values object to your request. Both q and exchange_values are logically objects but technically strings. You must also add a timezone string. Therefore, you must follow these steps:
1. Construct q and exchange_values as JSON objects.
The following is an example of the JSON object for q. (This example shows q as the outer object to illustrate the full structure of the filter. Steps 2 and 3 explain why you can't use this exact format in your HTTP request.)
{
"q": {
"gift_card_number_scope": "1234567890",
"created_at_gt_scope": "2024-08-01",
"created_at_lt_scope": "2024-08-31",
"campaign_code_scope": "dev-1",
"gift_card_campaign_stores_name_cont": "example-store",
"transaction_type_eq": "credit",
"gift_card_status_scope": "active"
}
}The following is an example of the JSON object for exchange_values. (This example shows exchange_values as the outer object to illustrate the full structure of the filter. Steps 2 and 3 explain why you can't use this exact format in your HTTP request.)
{
"exchange_values": {
"reporting_currency": "USD",
"exchange_rates": [
{
"from_currency": "AED",
"to_currency": "USD",
"value": 0.27226
}
]
}
}2. Serialize and URL-encode your q and exchange_values JSON objects.
You will typically do this programmatically (for example, using curl). Conceptually, this involves two steps:
- Serialize the JSON objects into JSON strings.
- URL-encode the JSON strings so that they can be safely sent as query parameters.
The following generic example illustrates what serialization looks like:
{"object1":{"object2":{"array1":[{"string1":"value1"}]}}}And here is that same generic example in URL-encoded form:
%7B%22object1%22%3A%7B%22object2%22%3A%7B%22array1%22%3A%5B%7B%22string1%22%3A%22value1%22%7D%5D%7D%7D%7D3. Send your GET request that includes the q parameter as a pre-encoded query string, or as raw JSON that your HTTP client (such as curl) will URL-encode for you.
Here is an example of a full GET request that uses curl to URL-encode q and exchange_values:
curl -X GET \
"https://<ts_server_url>/api/v1/reports/transactions_report" \
-u email@example.com:password \
--data-urlencode 'timezone=Europe/London' \
--data-urlencode 'q={
"gift_card_number_scope": "1234567890",
"created_at_gt_scope": "2024-08-01",
"created_at_lt_scope": "2024-08-31",
"campaign_code_scope": "dev-1",
"gift_card_campaign_stores_name_cont": "example-store",
"transaction_type_eq": "credit",
"gift_card_status_scope": "active"
}' \
--data-urlencode 'exchange_values={
"reporting_currency": "USD",
"exchange_rates": [
{
"from_currency": "AED",
"to_currency": "USD",
"value": 0.27226
}
]
}'Response in JSON
{
"transactions": [
{
"gift_card_number": "420646903701023412",
"recipient_email": "",
"order_number": "897703402801023370",
"serial_number": "01023412",
"store_code": "ali",
"store_name": [
"Ahsan",
"Winifred Hickman",
"qwer",
"devtransaction store",
"testing",
"testing",
"dev Front Desk",
"Muhammad Mehran Javid",
"Monetary (Ifrah)",
"Monetary (Ifrah)",
"Monetary (Ifrah)",
"Monetary (Ifrah)",
"wyfosy243234234kyp test",
"wyfosy243234234kyp test",
"wyfosy243234234kyp test",
"dev-store-1"
],
"currency": "AED",
"amount": "10.0",
"transaction_type": "Active",
"store_currency": "AED",
"trans_amount": "10.0",
"service_fee": "",
"exchange_rate": "",
"card_balance": "10.0",
"gift_card_status": "active",
"operator_id": null,
"operator_name": null,
"department": null,
"delivery_mode": "physical",
"gift_card_type": "monetary",
"action_date": "2024-08-13",
"action_time": "08:10 am",
"notes": "897703402801023370",
"gift_card_store_name": "Ahsan",
"campaign_code": "dev-1",
"campaign_stores": "store1, store2, store3",
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin",
"message": ""
}
],
"count": 1
}GET a liabilities report that includes PII #
Use this endpoint to get a liabilities report that includes Personally Identifiable Information (PII).
[GET] /api/v1/reports/liabilities_reportQuery Parameters
The following table describes the elements that you can include when you query this endpoint:
| Element | Description | Type | Required? |
|---|---|---|---|
| timezone | Timezone. | string | Required |
| q | For this endpoint, your request must format the q filters as a URL-encoded JSON object. To understand how to format your full GET request, see How to Format. | string | Required |
| liabilities_date_scope | The date for filtering liabilities. | string | Required |
| number_or_product_name_cont | Card number or product name. | string | Required |
| order_number_cont | Order number. | string | Required |
| gift_card_skus_scope | Gift card SKUs. | string | Required |
| store_name_cont | Store name. | string | Required |
| campaign_stores_name_cont | Campaign store name. | string | Required |
| status_eq | Status of the gift cards. | string | Required |
| created_at_gt_scope | Filters by the created date greater than the specified value. | string | Required |
| created_at_lt_scope | Filters by the created date less than the specified value. | string | Required |
| campaign_code_scope | Filters by campaign code. | string | Required |
| expiry_date_gt_scope | Expiry date greater than the specified value. | string | Required |
| expiry_date_lt_scope | Expiry date less than the specified value. | string | Required |
| page | The page number to retrieve. Default is 1. | string | Required |
| per_page | The number of results per page. Default is 25. | string | Required |
How to Format This GET Request
This endpoint requires you to add the q filter to your request. The q filter is logically an object, but technically a string. Therefore, you must follow these steps:
1. Construct your q filter as a JSON object.
The following is an example of a JSON object for this request. (This example shows q as the outer object to illustrate the full structure of the filter. Steps 2 and 3 explain why you can't use this exact format in your HTTP request.)
{
"q": {
"liabilities_date_scope": "2024-08-15",
"number_or_product_name_cont": "Gift Card",
"order_number_cont": "897703402801023370",
"gift_card_skus_scope": "SKU-123",
"store_name_cont": "Ahsan",
"campaign_stores_name_cont": "dev-store-1",
"status_eq": "active",
"created_at_gt_scope": "2024-08-01",
"created_at_lt_scope": "2024-08-31",
"campaign_code_scope": "dev-1",
"expiry_date_gt_scope": "2025-01-01",
"expiry_date_lt_scope": "2025-12-31"
}
}2. Serialize and URL-encode your q JSON object.
You will typically do this programmatically (for example, using curl). Conceptually, this involves two steps:
- Serialize the q JSON object into a JSON string.
- URL-encode that JSON string so that it can be safely sent as a query parameter.
The following generic example illustrates what serialization looks like:
{"object1":{"object2":{"array1":[{"string1":"value1"}]}}}And here is that same generic example in URL-encoded form:
%7B%22object1%22%3A%7B%22object2%22%3A%7B%22array1%22%3A%5B%7B%22string1%22%3A%22value1%22%7D%5D%7D%7D%7D3. Send your GET request that includes the q parameter as a pre-encoded query string, or as raw JSON that your HTTP client (such as curl) will URL-encode for you.
Here is an example of a full GET request that uses curl to URL-encode the q parameter:
curl -X GET \
"https://<ts_server_url>/api/v1/reports/liabilities_report" \
-u email@example.com:password \
--data-urlencode 'timezone=Europe/London' \
--data-urlencode 'page=1' \
--data-urlencode 'per_page=25' \
--data-urlencode 'q={
"liabilities_date_scope": "2024-08-15",
"number_or_product_name_cont": "Gift Card",
"order_number_cont": "897703402801023370",
"gift_card_skus_scope": "SKU-123",
"store_name_cont": "Ahsan",
"campaign_stores_name_cont": "dev-store-1",
"status_eq": "active",
"created_at_gt_scope": "2024-08-01",
"created_at_lt_scope": "2024-08-31",
"campaign_code_scope": "dev-1",
"expiry_date_gt_scope": "2025-01-01",
"expiry_date_lt_scope": "2025-12-31"
}'Response in JSON
{
"gift_cards": [
{
"id": 28070,
"product_name": "Gift Card",
"number": "420646903701023412",
"delivery_mode": "physical",
"card_type": "monetary",
"created_at_date": "August 13, 2024 08:10 AM",
"liability_date": "August 15, 2024 09:03 AM",
"expiry_date": "October 14, 2025 01:00 AM",
"status": "active",
"recipient_first_name": "mehran",
"recipient_last_name": "javid",
"recipient_email": "",
"receipient_phone_number": null,
"serial_number": "01023412",
"order_number": "897703402801023370",
"value": "10.0",
"currency": "AED",
"current_balance": "10.0",
"liability": "10.0",
"campaign_code": "dev-1",
"stores": null,
"campaign_stores": "store1, store2, store3",
"creator_email": "navisi9055@secbuf.com",
"creator_role": "admin",
"balance": "10.0",
"message": ""
}
],
"total_count": 1
}POST to create a scheduled report #
Use this endpoint to create a scheduled report.
[POST] /api/v1/scheduled_reportsPost Body Parameters
The following table describes the parameters to include in your post request:
| Element | Description | Type | Required? |
|---|---|---|---|
| id | Specify a unique ID number for the report. | integer | Required |
| report_type | Specify the type of the report. Available options are: • gift_cards_including_ppi • gift_cards_excluding_ppi • gift_cards_liability_including_ppi • gift_cards_liability_excluding_pp • gift_cards_transactions | string | Required |
| fetch_from | Specify the time from which to start the report, such as 2026-08-01T00:00:00+05:00. | string | Required |
| password | Specify the report password. | string | Required |
| ts_store_ids | Specify one or more stores to include in the report. | string | Required |
| timezone | Specify the time zone in which to generate the report. Example: Europe/London. | string | Required |
| report_currency_code | Specify the currency for the report (such as SGD). | string | Required |
| report_currency_ex_rates | The object to hold one or more exchange rates. | object | Required |
| to_currency | Specify the target currency code (such as SGD). | string | Required |
| from_currency | Specify the source currency code (such as RMB). | string | Required |
| value | Specify the exchange rate value between the from_currency and the to_currency. | number | Required |
Post Body Example
The following is an example of the body for this post request:
{
"id": 113,
"report_type": "gift_cards_transactions",
"fetch_from": "2024-08-01T00:00:00+05:00",
"password": "mehran@techsembly.com",
"ts_store_ids": [
"11"
],
"timezone": "Europe/London",
"report_currency_code": "SGD",
"report_currency_ex_rates": [
{
"to_currency": "SGD",
"from_currency": "AED",
"value": 0.3714
},
{
"to_currency": "SGD",
"from_currency": "AUD",
"value": 0.9289
},
{
"to_currency": "SGD",
"from_currency": "GBP",
"value": 1.82
},
{
"to_currency": "SGD",
"from_currency": "HKD",
"value": 0.174
}
]
}Response in JSON
The response you will receive is the URL location of your report (in the s3_file_url attribute).