Skip to main content

Gift Cards v1

REST API
Retailing Solutions

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_client

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
clientThe array to hold the client information.arrayRequired
nameName of TS client.stringRequired
addressAddress of TS client.stringRequired
contactContact Information of TS client.stringRequired
originRequest originating from.stringRequired
users_attributesThe array to hold the client's user attributes.arrayRequired
emailThe client's email address.stringRequired
passwordThe client's password.stringRequired
password_confirmationThe confirmation of the client's password.stringRequired

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."
}

▲ Back to top

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_record

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
store_nameSpecify the name of the store.stringRequired
ts_client_user_emailSpecify the TS client email.stringRequired
ts_api_user_emailSpecify the TS API user email.stringRequired

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
  }
}

▲ Back to top

GET a dashboard report #

Use this endpoint to get the dashboard report.

[GET] /api/v1/clients/dashboard_report

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
start_dateSpecify the report's start date.numberRequired
end_dateSpecify the report's end date.numberRequired

Response in JSON

{
  "labels": [
    "05 Jun",
    "04 Jun"
  ],
  "gift_card_values": [
    72
  ],
  "transactions_values": [
    -1355,
    60
  ]
}

▲ Back to top

GET a gift card report #

Use this endpoint to retrieve a report of gift card details (in JSON format).

[GET] /api/v1/clients/download_report

Note: 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:

ElementDescriptionTypeRequired?
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

stringOptional
number_or_product_name_contUse this to filter by card number or product name.stringOptional
order_number_contUse this to filter by order number.stringOptional
gift_card_skus_scopeUse this to filter by gift card SKUs.stringOptional
store_name_contUse this to filter by store name.stringOptional
campaign_stores_name_contUse this to filter by campaign store name.stringOptional
status_eqUse this to filter by the status of the gift cards.stringOptional
created_at_gt_scopeUse this to filter by the created date greater than the specified value.stringOptional
created_at_lt_scopeUse this to filter by the created date less than the specified value.stringOptional
campaign_code_scopeUse this to filter by campaign code.stringOptional
expiry_date_gt_scopeUse this to filter by expiry date greater than the specified value.stringOptional
expiry_date_lt_scopeUse this to filter by expiry date less than the specified value.stringOptional
pageThe page number to retrieve. Default is 1.stringOptional
per_pageThe number of results per page. Default is 25.stringOptional

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": ""
  }
]

▲ Back to top

GET a gift card transaction report #

Use this endpoint to get the gift card transaction report.

[GET] /api/v1/clients/transactions_report

Response 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
}

▲ Back to top

GET a gift card liability report #

Use this endpoint to get the gift card liability report.

[GET] /api/v1/clients/liabilities_report

Response 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
}

▲ Back to top

POST a new gift card #

Use this endpoint to create a new gift card.

[POST] /api/v1/gift_cards

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
card_typeSpecify the type of card you want to update. Available options are: monetary or experiences.stringRequired
valueSet the amount value of the card.stringRequired
currencySpecify the card currency.stringRequired
delivery_modeSpecify the delivery mode of the card. Available options are: digital or physical.stringRequired
campaign_codeSet the campaign code for the gift card.stringRequired
from_addressSpecify the email address of the person who is sending this card.stringRequired
invoice_idSet the invoice ID generated for the gift card.stringOptional
notesSpecify notes or comments for the gift card.stringOptional
product_nameSpecify the name of the product for which the card is redeemable.stringRequired
receipient_phone_numberSpecify the phone number of the recipient who will receive the gift card. The format is country code followed by phone number: +442012341234.stringRequired
recipient_emailSpecify the email address of the recipient who will receive the gift card.stringRequired
recipient_first_nameSpecify the recipient's first name.stringRequired
recipient_last_nameSpecify the recipient's last name.stringRequired
send_gift_card_viaSpecify 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.stringRequired
skusSet the SKUs of gift cards. You can specify one or more SKUs in an array format.arrayOptional
messageSpecify the gift card message.stringOptional
store_idSpecify the store for the gift cards.stringRequired
creator_attributesSpecify the email and role of the user who is performing this action.stringRequired
request_idSet the unique request ID so that you can track each request.stringRequired

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
}

▲ Back to top

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_cards

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
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

stringOptional
status_inStatus of the gift cards to include in the resultsstringOptional
card_type_nullSet this to true to include cards with a null card_type. Set this to false to exclude cards with a null card_type.booleanOptional
pageThe page number to retrieve. Default is 1.numberOptional
per_pageThe number of results per page. Default is 25.numberOptional

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
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
gift_card_idSpecify the ID of the gift card that you want to retrieve.numberRequired

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"
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
gift_card_idSpecify the ID of the gift card that you want to update.numberRequired

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
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.

arrayRequired
statusIf you want to update the gift card's status (such as from active to blocked), specify the updated status in the status string.stringRequired
expiry_dateIf you want to update the gift card's expiration date, specify the updated date in the expiry_date string.stringRequired
delivery_statusIf 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.stringRequired
transitions_attributesThe array to hold details about the change you are performing.arrayRequired
transition_state_nameSpecify again which attribute of the gift card you want to update. Available options are: status, expiry_date, or delivery_status.stringRequired
notesAdd reasons or notes for the change.stringOptional
pervious_stateSpecify the previous value of the attribute that you are updating. Example: active.stringOptional
current_stateSpecify the new value of the attribute that you are updating. Example: blocked.stringRequired
creator_attributesThe array to hold details about the person who is making this change.arrayRequired
creator_emailSpecify the email of the person who is making this change.stringRequired
creator_roleSpecify the role of the person who is making this change.stringRequired

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"
}

▲ Back to top

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/redeem

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
creator_attributesThe array to hold details about the person who is creating this redemption.arrayRequired
creator_emailSpecify the email of the person who is creating this redemption.stringRequired
creator_roleSpecify the role of the person who is creating this redemption.stringRequired
numberSpecify the gift card number for the gift card that is being redeemed.stringRequired
pinSpecify the security pin of the gift card.stringRequired
skuSpecify the SKU of the product for which you want to redeem the gift card.stringRequired
store_idSpecify the store ID of the store for which you want to redeem this gift card.stringRequired

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
}

▲ Back to top

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/credit

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
amountSpecify the amount that you want to load to the gift card.numberRequired
notesAdd notes to explain this transaction.stringRequired
currencySpecify the card currency.stringRequired
external_invoice_idSpecify the invoice ID of the reload transaction.stringRequired
numberSpecify the card number for the gift card that is being reloaded.stringRequired

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": {}
}

▲ Back to top

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_balance

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
numberSpecify the card number for the gift card for which you are checking the balance.stringRequired
pinSpecify the security PIN number for the gift card for which you are checking the balance.stringRequired

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"
}

▲ Back to top

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_customer

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
numberSpecify the card number for the gift card that you are assigning to a customer.stringRequired
pinSpecify the security PIN number for the gift card that you are assigning to a customer.stringRequired

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"
}

▲ Back to top

PUT to unassign a gift card #

Use this endpoint to unassign gift cards to customers.

[PUT] /api/v1/gift_cards/remove_card

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
numberSpecify the card number for the gift card that you are unassigning to a customer.stringRequired
pinSpecify the security PIN number for the gift card that you are unassigning to a customer.stringRequired
statusSpecify the action to perform on the gift card. You must set this to remove.stringRequired

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"
}

▲ Back to top

PUT to update a gift card's status #

Use this endpoint to update a gift card's status.

[PUT] /api/v1/gift_cards/update_status

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
numberSpecify the card number for the gift card for which you are updating the status.stringRequired
pinSpecify the security PIN number for the gift card for which you are updating the status.stringRequired
statusSpecify the new status of the gift card. Available options are: active, blocked, canceled, or lost.stringRequired

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": ""
}

▲ Back to top

GET a user's campaigns #

Use this endpoint to get all campaigns associated with the currently signed in user.

[GET] /api/v1/campaigns

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
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

stringOptional
name_contUse this to filter for campaigns with names that match this string.stringOptional
code_contUse this to filter for campaigns with codes that match this string.stringOptional
pageThe page number to retrieve. Default is 1.numberOptional
per_pageThe number of results per page. Default is 25.numberOptional

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
}

▲ Back to top

POST to create a campaign #

Use this endpoint to create a new campaign.

[POST] /api/v1/campaigns

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
campaignThe array to hold the campaign's details.arrayRequired
nameSpecify the name of campaign.stringRequired
codeSpecify the code that uniquely identifies the campaign.stringRequired
start_dateSpecify the start date of the campaign.stringRequired
end_dateSpecify the end date of the campaign.stringRequired
max_expiry_daysSpecify the maximum days before expiration of the campaign.integerOptional
store_idsThe array to hold the IDs of stores where the campaign is applicable.arrayRequired
date_specific_expiryIf this is true, a date-specific expiry is enabled. If this is false, a date-specific expiry is disabled.booleanOptional
is_campaign_remained_activeIf this is true, the campaign is active. If this is false, the campaign is not active.booleanOptional
is_gift_card_remained_activeIf this is true, the campaign's gift cards are active. If this is false, the campaign's gift cards are not active.booleanOptional
email_subjectSpecify the subject for the campaign email template.stringOptional
email_htmlSpecify the html for the campaign email template.stringOptional
bodySpecify the body for the campaign email template.stringOptional
specific_dateSpecific the date of expiry of gift cards.stringOptional
sms_htmlSpecify the content for the campaign's SMS messages.stringOptional
allow_passwordIf this is true, a security PIN is required for transactions. If this is false, a security PIN is not required for transactions.booleanOptional
transaction_email_subjectSpecify the subject for the transaction emails.stringOptional
transaction_email_htmlSpecify the email body for the transaction emails.stringOptional
ses_from_emailSpecify the email address from which to be send emails.stringOptional
cc_transaction_emailSpecify the email address to be added in CC for transaction emails.stringOptional
test_modeIf this is true, the campaign is a test campaign. If this is false, the campaign is not a test campaign.booleanOptional

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
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
campaign_idSpecify the ID of the campaign that you want to retrieve.numberRequired

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": ""
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
campaign_idSpecify the ID of the campaign that you want to update.numberRequired

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
campaignThe array to hold the campaign's details.arrayRequired
nameSpecify the name of campaign.stringRequired
codeSpecify the code that uniquely identifies the campaign.stringRequired
start_dateSpecify the start date of the campaign.stringRequired
end_dateSpecify the end date of the campaign.stringRequired
max_expiry_daysSpecify the maximum days before expiration of the campaign.integerOptional
store_idsThe array to hold the IDs of stores where the campaign is applicable.arrayRequired
date_specific_expiryIf this is true, a date-specific expiry is enabled. If this is false, a date-specific expiry is disabled.booleanOptional
is_campaign_remained_activeIf this is true, the campaign is active. If this is false, the campaign is not active.booleanOptional
is_gift_card_remained_activeIf this is true, the campaign's gift cards are active. If this is false, the campaign's gift cards are not active.booleanOptional
email_subjectSpecify the subject for the campaign email template.stringOptional
email_htmlSpecify the html for the campaign email template.stringOptional
bodySpecify the body for the campaign email template.stringOptional
specific_dateSpecific the date of expiry of gift cards.stringOptional
sms_htmlSpecify the content for the campaign's SMS messages.stringOptional
allow_passwordIf this is true, a security PIN is required for transactions. If this is false, a security PIN is not required for transactions.booleanOptional
transaction_email_subjectSpecify the subject for the transaction emails.stringOptional
transaction_email_htmlSpecify the email body for the transaction emails.stringOptional
ses_from_emailSpecify the email address from which to be send emails.stringOptional
cc_transaction_emailSpecify the email address to be added in CC for transaction emails.stringOptional
test_modeIf this is true, the campaign is a test campaign. If this is false, the campaign is not a test campaign.booleanOptional

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": ""
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
campaign_idSpecify the ID of the campaign that you want to delete.numberRequired

Response in JSON

{message: "Campaign deleted"
}

▲ Back to top

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_stores

Path Parameters

The following table describes the elements that you must include for this operation:

ElementDescriptionTypeRequired?
campaign_idSpecify the ID of the campaign for which you want to retrieve stores.numberRequired

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": ""
  }
]

▲ Back to top

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_attachment

Path Parameters

The following table describes the elements that you must include for this operation:

ElementDescriptionTypeRequired?
campaignIdThe unique identifier of the campaign as a path parameter. This should match the id query parameter.numberRequired

Query Parameters

The following table describes the elements that you must include when you query this endpoint:

ElementDescriptionTypeRequired?
idThe unique identifier of the campaign as a query parameter. This should match the campaignId.numberRequired

Form Data Parameters

The following table describes a form data parameter that you must include when you query this endpoint:

ElementDescriptionTypeRequired?
fileSpecify the image file to upload as the campaign attachment.formDataRequired

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"
}

▲ Back to top

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/stores

Response 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": ""
  }
]

▲ Back to top

POST a new store #

Use this endpoint to create a new store.

[POST] /api/v1/stores

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
nameSpecify the name for the new store.stringRequired
codeSpecify the unique store code for the new store.stringRequired
fx_enableIf 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.stringRequired
fx_labelSpecify a label for the additional fee.stringRequired
fx_feesSpecify the amount of the additional fee that will be charged.numberRequired
monetary_campaign_idSpecify the monetary campaign ID against which monetary cards will be activated.stringOptional
top_up_payment_linkSpecify the top up payment link. Card top ups (reloads) can be made using this link.stringRequired
activation_payment_linkSpecify the activation payment link. Cards can be activated via this link.stringRequired
min_valueSpecify the minimum value that a gift card can have for this store.integerRequired
max_valueSpecify the maximum value that a gift card can have for this store.integerRequired
gift_card_valuesSpecify 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,100000stringRequired
users_attributesThe array to hold details about the API user.arrayRequired
idSpecify the ID of the person who is creating this store.stringOptional
emailSpecify the email of the person who is creating this store.stringRequired
passwordSpecify the password of the person who is creating this store.stringRequired
enable_request_idIf this is true, the request ID will be enforced. If this is false, the request ID will not be enforced.booleanOptional
roles_attributesThe array to hold the name of the person who is creating this store.arrayRequired
nameSpecify the name of the person who is creating this store.stringRequired

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"
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
store_idSpecify the ID of the store for which you want to get the store information.numberRequired

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
    }
  ]
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
store_idSpecify the ID of the store that you want to update.numberRequired

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
nameSpecify the name for the store.stringRequired
codeSpecify the unique store code for the store.stringRequired
fx_enableIf 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.stringRequired
fx_labelSpecify a label for the additional fee.stringRequired
fx_feesSpecify the amount of the additional fee that will be charged.numberRequired
monetary_campaign_idSpecify the monetary campaign ID against which monetary cards will be activated.stringOptional
top_up_payment_linkSpecify the top up payment link. Card top ups (reloads) can be made using this link.stringRequired
activation_payment_linkSpecify the activation payment link. Cards can be activated via this link.stringRequired
min_valueSpecify the minimum value that a gift card can have for this store.integerRequired
max_valueSpecify the maximum value that a gift card can have for this store.integerRequired
gift_card_valuesSpecify 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,100000stringRequired
users_attributesThe array to hold details about the API user.arrayRequired
idSpecify the ID of the person who is updating this store.stringOptional
emailSpecify the email of the person who is updating this store.stringRequired
enable_request_idIf this is true, the request ID will be enforced. If this is false, the request ID will not be enforced.booleanOptional

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
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
store_idSpecify the ID of the store that you want to delete.numberRequired

Response in JSON

{message: "Store deleted"
}

▲ Back to top

GET all front desk users #

Use this endpoint to get information about all Front Desk users.

[GET] /api/v1/users

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
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

stringOptional
name_contUse this to filter for users with names that match this string.stringOptional
code_contUse this to filter for users with codes that match this string.stringOptional
pageThe page number to retrieve. Default is 1.numberOptional
per_pageThe number of results per page. Default is 25.numberOptional

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
  }
]

▲ Back to top

POST a new front desk user #

Use this endpoint to create a Front Desk user.

[POST] /api/v1/users

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
nameSpecify the name of the user.stringRequired
emailSpecify the email of the user.stringRequired
store_idsSpecify one or more IDs of the stores to which the user has access.objectRequired
department_idSpecify the ID of the store department to which the user belongs.stringRequired
is_operator_enabledIf this is true, the user supports multiple operators. If this is false, the user does not support multiple operators.booleanRequired
payment_methodsThe array in which you specify the payment methods available to the user: cash, pos, credit_card.stringRequired
cashIf this is true, the user can use the cash payment method. If this is false, the user cannot use the cash payment method.booleanOptional
posIf 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.booleanOptional
credit_cardIf 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.booleanOptional
operators_attributesThe 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.arrayOptional
idSpecify the ID for the operator.stringOptional
operator_nameSpecify the name for the operator.stringOptional
menu_accessThe array in which you specify the operations available to the user: top_up, activation, other_transaction.stringRequired
top_upIf this is true, the user can perform the top up (reload) operation. If this is false, the user cannot perform the top up operation.booleanOptional
activationIf this is true, the user can perform the activation operation. If this is false, the user cannot perform the activation operation.booleanOptional
other_transactionIf 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.booleanOptional
passwordSpecify the user's password.stringRequired

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
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
user_idSpecify the ID of the user whose information you want to retrieve.numberRequired

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"
    }
  }
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
user_idSpecify the ID of the Front Desk user whose information you want to update.numberRequired

Put Body Parameters

The following table describes the parameters to include in your put request:

ElementDescriptionTypeRequired?
nameSpecify the name of the user.stringRequired
emailSpecify the email of the user.stringRequired
store_idsSpecify one or more IDs of the stores to which the user has access.objectRequired
department_idSpecify the ID of the store department to which the user belongs.stringRequired
is_operator_enabledIf this is true, the user supports multiple operators. If this is false, the user does not support multiple operators.booleanRequired
payment_methodsThe array in which you specify the payment methods available to the user: cash, pos, credit_card.stringRequired
cashIf this is true, the user can use the cash payment method. If this is false, the user cannot use the cash payment method.booleanOptional
posIf 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.booleanOptional
credit_cardIf 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.booleanOptional
operators_attributesThe 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.arrayOptional
idSpecify the ID for the operator.stringOptional
operator_nameSpecify the name for the operator.stringOptional
menu_accessThe array in which you specify the operations available to the user: top_up, activation, other_transaction.stringRequired
top_upIf this is true, the user can perform the top up (reload) operation. If this is false, the user cannot perform the top up operation.booleanOptional
activationIf this is true, the user can perform the activation operation. If this is false, the user cannot perform the activation operation.booleanOptional
other_transactionIf 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.booleanOptional
passwordSpecify the user's password.stringRequired

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
}

▲ Back to top

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:

ElementDescriptionTypeRequired?
user_idSpecify the ID of the Front Desk user that you want to delete.numberRequired

Response in JSON

{
  "message": "User deleted"
}

▲ Back to top

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_desk

Important: To use this endpoint, you must post a CSV file that includes the columns explained in the following table.

Column NameColumn ContainsRequired?
User NameAdd the names of the Front Desk users to create.Required
User EmailAdd the email addresses of the Front Desk users.Required
User PasswordAdd the passwords of the Front Desk users.Required
Store for V1Add the stores for the V1 flow.Required
Store for V2Add the stores for the V2 flow.Required
Select DepartmentAdd the departments for the Front Desk users.Required
Allow OperatorAdd true if the user supports multiple operators. Add false if the user does not support multiple operators.Required
Allow Top UpAdd true if the user can perform the top up (reload) operation. Add false if the user cannot perform the top up operation.Required
Allow ActivationAdd true if the user can perform the activation operation. Add false if the user cannot perform the activation operation.Required
CashAdd true if the user can use the cash payment method. Add false if the user cannot use the cash payment method.Required
Credit CardAdd 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 NamesAdd 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:

ElementDescriptionTypeRequired?
fileSpecify the CSV file with the bulk user information to upload.formDataRequired

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.

▲ Back to top

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_data

Response 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"
    ]
  }
]

▲ Back to top

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/profile

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,
  "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
  }
}

▲ Back to top

POST to sign in a user on TS-Portal #

Use this endpoint to sign in a user on TS-Portal.

[POST] /api/v1/users/signin

Your 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:

ElementDescriptionTypeRequired?
emailSpecify the user's email address.stringRequired
passwordSpecify the user's password.stringRequired

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
}

▲ Back to top

POST to create a customer #

Use this endpoint to create a customer.

[POST] /api/v1/users/create_customer

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
titleSpecify the customer's title, such as Mr, Mrs, Miss.stringRequired
first_nameSpecify the customer's first name.stringRequired
last_nameSpecify the customer's last name.stringRequired
phone_numberSpecify the customer's phone number.stringRequired
cell_numberSpecify the customer's cellular phone number.stringRequired
emailSpecify the customer's email address.stringRequired
passwordSpecify the customer's password.stringRequired
terms_and_conditionsIf 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.booleanRequired
enable_promotionsIf this is true, the customer agrees to receive promotional emails. If this is false, the customer does not agree to receive promotional emails.booleanOptional
shipping_address_attributesThe array to hold the customer's shipping address details.arrayRequired
address1Specify the customer's shipping street address.stringRequired
citySpecify the customer's shipping address city.stringRequired
countrySpecify the customer's shipping address country.stringRequired
stateSpecify the customer's shipping address state.stringRequired
zipcodeSpecify the customer's shipping address zip code.stringRequired

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
}

▲ Back to top

POST an update to a customer #

Use this endpoint to update a customer.

[POST] /api/v1/users/update_customer

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
titleSpecify the customer's title, such as Mr, Mrs, Miss.stringRequired
first_nameSpecify the customer's first name.stringRequired
last_nameSpecify the customer's last name.stringRequired
phone_numberSpecify the customer's phone number.stringRequired
cell_numberSpecify the customer's cellular phone number.stringRequired
emailSpecify the customer's email address.stringRequired
passwordSpecify the customer's password.stringRequired
terms_and_conditionsIf 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.booleanRequired
enable_promotionsIf this is true, the customer agrees to receive promotional emails. If this is false, the customer does not agree to receive promotional emails.booleanOptional
shipping_address_attributesThe array to hold the customer's shipping address details.arrayRequired
address1Specify the customer's shipping street address.stringRequired
citySpecify the customer's shipping address city.stringRequired
countrySpecify the customer's shipping address country.stringRequired
stateSpecify the customer's shipping address state.stringRequired
zipcodeSpecify the customer's shipping address zip code.stringRequired

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
}

▲ Back to top

POST to change a customer password #

Use this endpoint to change the password for a customer.

[POST] /api/v1/users/change_password

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
current_passwordSpecify the current password of the customer.stringRequired
new_passwordSpecify the new password of the customer.stringRequired
confirm_passwordSpecify again the new password for the customer. This is the confirmation and must match new_password in order for the update to be successful.stringRequired

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"
}

▲ Back to top

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_token

After 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:

ElementDescriptionTypeRequired?
store_urlSpecify the URL of the customer's store.stringRequired
emailSpecify the customer's email address.stringRequired

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
}

▲ Back to top

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/passwords

Before 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:

ElementDescriptionTypeRequired?
passwordSpecify the customer's new password.stringRequired
password_confirmationSpecify again the new password for the customer. This is the confirmation and must match password in order for the update to be successful.stringRequired
reset_password_tokenSpecify a valid token to reset the password.stringRequired

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"
}

▲ Back to top

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_report

Note: 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:

ElementDescriptionTypeRequired?
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.

objectRequired
reporting_dataThe object to hold the exchange rates and reporting currency.objectRequired
exchange_ratesThe array to hold one or more objects that represent exchange rates.arrayRequired
to_currencySpecify the target currency code (such as USD).stringRequired
from_currencySpecify the source currency code (such as RMB).stringRequired
valueSpecify the exchange rate value between the from_currency and the to_currency.numberRequired
reporting_currencySpecify the currency in which the report will be generated (such as USD).stringRequired

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%7D

3. 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
  }
]

▲ Back to top

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_report

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
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.

stringRequired
gift_card_number_scopeFilter for a gift card numberstringRequired
created_at_gt_scopeCreated at greater thanstringRequired
created_at_lt_scopeCreated at less thanstringRequired
campaign_code_scopeCampaign codestringRequired
gift_card_campaign_stores_name_contGift card campaign store namesstringRequired
transaction_type_eqTransaction typestringRequired
gift_card_status_scopeGift card statusstringRequired
timezoneSpecify the time zone in which to generate the report. Example: Europe/London.stringRequired
exchange_valuesThe object to hold the exchange rate information used in the report.stringRequired
exchange_ratesThe array to hold one or more objects that represent exchange rates.stringRequired
to_currencySpecify the target currency code (such as USD).stringRequired
from_currencySpecify the source currency code (such as RMB).stringRequired
valueSpecify the exchange rate value between the from_currency and the to_currency.numberRequired
reporting_currencySpecify the currency in which the report will be generated (such as USD).stringRequired

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%7D

3. 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
}

▲ Back to top

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_report

Query Parameters

The following table describes the elements that you can include when you query this endpoint:

ElementDescriptionTypeRequired?
timezoneTimezone.stringRequired
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.

stringRequired
liabilities_date_scopeThe date for filtering liabilities.stringRequired
number_or_product_name_contCard number or product name.stringRequired
order_number_contOrder number.stringRequired
gift_card_skus_scopeGift card SKUs.stringRequired
store_name_contStore name.stringRequired
campaign_stores_name_contCampaign store name.stringRequired
status_eqStatus of the gift cards.stringRequired
created_at_gt_scopeFilters by the created date greater than the specified value.stringRequired
created_at_lt_scopeFilters by the created date less than the specified value.stringRequired
campaign_code_scopeFilters by campaign code.stringRequired
expiry_date_gt_scopeExpiry date greater than the specified value.stringRequired
expiry_date_lt_scopeExpiry date less than the specified value.stringRequired
pageThe page number to retrieve. Default is 1.stringRequired
per_pageThe number of results per page. Default is 25.stringRequired

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%7D

3. 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
}

▲ Back to top

POST to create a scheduled report #

Use this endpoint to create a scheduled report.

[POST] /api/v1/scheduled_reports

Post Body Parameters

The following table describes the parameters to include in your post request:

ElementDescriptionTypeRequired?
idSpecify a unique ID number for the report.integerRequired
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

stringRequired
fetch_fromSpecify the time from which to start the report, such as 2026-08-01T00:00:00+05:00.stringRequired
passwordSpecify the report password.stringRequired
ts_store_idsSpecify one or more stores to include in the report.stringRequired
timezoneSpecify the time zone in which to generate the report. Example: Europe/London.stringRequired
report_currency_codeSpecify the currency for the report (such as SGD).stringRequired
report_currency_ex_ratesThe object to hold one or more exchange rates.objectRequired
to_currencySpecify the target currency code (such as SGD).stringRequired
from_currencySpecify the source currency code (such as RMB).stringRequired
valueSpecify the exchange rate value between the from_currency and the to_currency.numberRequired

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).

▲ Back to top