Get Customer Coupons

Retrieves the details of coupons (issued, redeemed, expired) of a specific customer.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This API retrieves coupon details for a specific customer, including issued, redeemed, and expired coupons. You can filter results by coupon status, date range, coupon series, or store, and sort by validity or creation date.

Pass at least one customer identifier (mobile, email, external_id, or id) to identify the customer.

Example request

curl --location 'https://eu.api.capillarytech.com/v1.1/customer/coupons?mobile=1234512345&limit=200' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Z2VvcmdlLmRvY2RlbW86NjVhMDgzYjk1MNTY5NDk1YmNkNzUxYmJiY2U=' \
--header 'Cookie: _cfuvid=CMee7qv34XA7aUyzJ_SpIlU06R3Fngfu6LI-1771396256754-0.0.1.1-604800000'

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Access group: Default access group

Resource information

Pagination supportYes
Batch supportNo

Query parameters

FieldTypeRequiredDescription
mobileStringConditionalSpecify the mobile number of the customer.
emailStringConditionalSpecify the email ID of the customer.
external_idStringConditionalSpecify the external ID of the customer.
idNumberOptionalSpecify the unique ID of the customer.
start_dateDateOptionalSpecify the starting date (YYYY-MM-DD) to get coupons issued or redeemed on or after. To get the coupon history for a specific duration, pass both start_date and end_date.
end_dateDateOptionalSpecify the ending date (YYYY-MM-DD) to get coupons issued or redeemed before. To get the coupon history for a specific duration, pass both start_date and end_date.
statusEnumOptionalSpecify the status to filter coupons by. Values: unredeemed, redeemed, expired, active. Note: active returns coupons whose valid_till is a future date and does not validate redemptions.
series_idNumberOptionalSpecify the series ID to retrieve coupons from a specific coupon series.
store_idStringOptionalSpecify the store ID to retrieve active coupons that can be redeemed at a specific store.
order_byEnumOptionalSpecify the field to sort results by. Values: created_date, created_by, valid_till.
sort_orderEnumOptionalSpecify the sort order. Values: asc (ascending), desc (descending).
limitNumberOptionalSpecify the maximum number of results to return. Default limit: 100

Example response

{
  "response": {
    "pagination": {
      "limit": "100",
      "offset": "0",
      "total": 1
    },
    "status": {
      "success": "true",
      "code": 200,
      "message": "Success"
    },
    "customers": {
      "customer": [
        {
          "firstname": "Tom",
          "lastname": "Sawyer",
          "email": "[email protected]",
          "external_id": null,
          "mobile": "9988776655",
          "id": "98662653",
          "coupons": {
            "coupon": [
              {
                "id": "163267982",
                "series_id": "12360",
                "series_name": "Spin_The_Wheel",
                "redemption_count": 0,
                "created_date": "2019-07-29T16:13:14.000Z",
                "valid_till": "2019-12-31 23:59:59",
                "code": "6WRNA5UM",
                "transaction_number": null,
                "issued_at": {
                  "code": "store_001",
                  "name": "Main Store"
                },
                "purpose": "",
                "custom_properties": {
                  "custom_property": [
                    {
                      "name": "standard_description",
                      "value": "10% off on next purchase"
                    }
                  ]
                },
                "redemptions": {
                  "redemption": [
                    {
                      "id": "4359526",
                      "date": "2021-05-17T19:07:54.000Z",
                      "transaction_number": "TXN12345",
                      "redeemed_at": {
                        "code": "store_002",
                        "name": "Downtown Store"
                      }
                    }
                  ]
                }
              }
            ]
          },
          "item_status": {
            "success": "true",
            "code": 1000,
            "message": "Coupons retrieved successfully"
          }
        }
      ]
    }
  }
}

Response parameters

FieldTypeDescription
paginationObjectDefine the pagination details for the response.
.limitStringSpecify the maximum number of results per page.
.offsetStringSpecify the number of results to skip from the beginning.
.totalNumberSpecify the total number of coupons matching the query.
statusObjectDefine the overall API response status.
.successStringIndicate if the request was successful (true or false).
.codeNumberSpecify the HTTP status code.
.messageStringProvide the status message.
customersObjectContain the container for customer data.
.customerArrayDefine an array of customer objects.
..firstnameStringSpecify the customer's first name.
..lastnameStringSpecify the customer's last name.
..emailStringSpecify the customer's email address.
..external_idStringSpecify the customer's external ID.
..mobileStringSpecify the customer's mobile number.
..idStringSpecify the customer's unique ID.
..couponsObjectContain the container for the customer's coupons.
...couponArrayDefine an array of coupon objects.
....idStringSpecify the unique coupon ID.
....series_idStringSpecify the ID of the coupon series this coupon belongs to.
....series_nameStringSpecify the name of the coupon series.
....redemption_countNumberSpecify the number of times this coupon has been redeemed.
....created_dateStringSpecify the date and time when the coupon was issued (ISO 8601 format).
....valid_tillStringSpecify the coupon expiry date and time.
....codeStringSpecify the coupon code.
....transaction_numberStringSpecify the transaction number associated with coupon issuance, if any.
....issued_atObjectDefine the store where the coupon was issued.
.....codeStringSpecify the store code.
.....nameStringSpecify the store name.
....purposeStringSpecify the purpose or description of the coupon issuance.
....custom_propertiesObjectContain the container for custom properties.
.....custom_propertyArrayDefine an array of custom property objects with name and value fields.
....redemptionsObjectContain the container for redemption history.
.....redemptionArrayDefine an array of redemption objects.
......idStringSpecify the redemption ID.
......dateStringSpecify the date and time of redemption (ISO 8601 format).
......transaction_numberStringSpecify the transaction number associated with the redemption.
......redeemed_atObjectDefine the store where the coupon was redeemed.
.......codeStringSpecify the store code.
.......nameStringSpecify the store name.
..item_statusObjectDefine the status for this specific customer's coupon retrieval.
...successStringIndicate if the retrieval was successful (true or false).
...codeNumberSpecify the item-level status code (1000 for success).
...messageStringProvide the item-level status message.

Error and warning codes

CodeTypeDescription
701ErrorCustomer could not be found. Check the mobile, email, or external ID passed.
702ErrorCoupon code is invalid.
707ErrorCoupon series ID is invalid.
1000InfoCoupons retrieved successfully.
Query Params
string

Mobile number of the customer.

string

Email ID of the customer.

string

External ID of the customer.

int64

Unique ID of the customer.

date

Get coupons issued or redeemed on or after a specific date (YYYY-MM-DD). To get coupon history of a specific duration, pass the date range in start_date and end_date.

date

Get coupons issued or redeemed before a specific date (YYYY-MM-DD). To get coupon history of a specific duration, pass the date range in start_date and end_date.

string
enum

Retrieve coupons by coupon status. active is based on the coupon expiry date and does not validate redemptions. Hence you will see all coupons whose expiry (valid_till) is a future date.

Allowed:
int32

Retrieve details of a specific coupon series by series id.

string

Retrieves the details of active coupons of the customer that can be redeemed at a specific store.

string
enum

"valid_till" is used to filter coupons by their validity. Use "sort_order" alongside this to sort the results in ascending or descending order of coupon validity.

Allowed:
string
enum

Sort the results in ascending (asc) or descending (desc) order of order_by.

Allowed:
int32

Limit the number of results to be retrieved. For example: limit=10 to retrieve the history of ten recent coupons of the customer.

Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json