> For the complete documentation index, see [llms.txt](https://docs-staging.billeasy.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-staging.billeasy.in/customer-mobile-app/user-cards.md).

# User Cards

API Endpoints related to User's Loyalty Cards

## Fetch User Cards

<mark style="color:blue;">`GET`</mark> `https://node-staging.billeasy.in/api/v1/Customers/cards`

This endpoint gets User's Loyalty Cards.

#### Query Parameters

| Name         | Type    | Description                                                           |
| ------------ | ------- | --------------------------------------------------------------------- |
| customer\_id | integer | The API will do its best to find a cake matching the provided recipe. |
| limit        | integer | Whether the cake should be gluten-free or not.                        |

#### Headers

| Name              | Type   | Description                                                  |
| ----------------- | ------ | ------------------------------------------------------------ |
| Content-Type      | string | application/json                                             |
| x-customer-token  | string | (Will be receiving a token on successful user login/Sign-in) |
| x-customer-number | string | (User/Customer Mobile Number)                                |
| x-api-secret      | string | (Needs to be requested from Billeasy)                        |
| x-api-access      | string | (Needs to be requested from Billeasy)                        |

{% tabs %}
{% tab title="200 Cards successfully retrieved." %}

```javascript
{
  "success": true,
  "msg": "All cards.",
  "data": [
    {
      "id": "585",
      "attributes": {
        "accent": "",
        "card_type": "gold",
        "category": "utility",
        "client_logo": "https://billeasy-demo.s3.ap-south-1.amazonaws.com/uploads/client/company_logo/306/white_logo_file.png",
        "client_name": "Billeasy Lifestyle Store ",
        "client_type": 1,
        "valid_thru": "9/20",
        "current_mints": 248,
        "client_exec_threshold": 500,
        "client_gold_threshold": 1000,
        "client_exec_mints": 50,
        "client_gold_mints": 100,
        "client_avg_per_customer": 100,
        "total_mints_to_next": null,
        "twitter_handle": null,
        "gradient_dark": "#0a9a8d",
        "gradient_light": "#0ee8d3"
      }
    },
    {
      "id": "570",
      "attributes": {
        "accent": "0cc1b0",
        "card_type": "gold",
        "category": "Shopping",
        "client_logo": "https://billeasy-demo.s3.ap-south-1.amazonaws.com/uploads/client/company_logo/303/white_logo_file.png",
        "client_name": "Billeasy Store",
        "client_type": 1,
        "valid_thru": "9/20",
        "current_mints": 2352,
        "client_exec_threshold": 5000,
        "client_gold_threshold": 10000,
        "client_exec_mints": 500,
        "client_gold_mints": 1000,
        "client_avg_per_customer": 100,
        "total_mints_to_next": null,
        "twitter_handle": null,
        "gradient_dark": "#0a9a8d",
        "gradient_light": "#0ee8d3"
      }
    },
    {
      "id": "518",
      "attributes": {
        "accent": "fcb827",
        "card_type": "gold",
        "category": "F&B",
        "client_logo": "https://billeasy-demo.s3.ap-south-1.amazonaws.com/uploads/client/company_logo/8/white_logo_file.png",
        "client_name": "Mc Donalds",
        "client_type": 1,
        "valid_thru": "4/20",
        "current_mints": 642,
        "client_exec_threshold": 500,
        "client_gold_threshold": 1000,
        "client_exec_mints": 25,
        "client_gold_mints": 50,
        "client_avg_per_customer": 200,
        "total_mints_to_next": null,
        "twitter_handle": null,
        "gradient_dark": "#ca931f",
        "gradient_light": "#ffdd2f"
      }
    }
  ],
  "meta": {
    "categories": [
      {
        "id": "1",
        "name": "Shopping"
      },
      {
        "id": "2",
        "name": "Travel"
      },
      {
        "id": "5",
        "name": "F&B"
      },
      {
        "id": "7",
        "name": "utility"
      },
      {
        "id": "8",
        "name": "Entertainment"
      },
      {
        "id": "11",
        "name": "Uncategorized"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="500 Error fetching Cards." %}

```javascript
{
  "success": false,
  "msg": "Error while fetching cards",
  "data": []
}
```

{% endtab %}
{% endtabs %}
