> For the complete documentation index, see [llms.txt](https://developer.convergegate.com/legacy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.convergegate.com/legacy/token-api/card/store-a-card.md).

# Store a card

Store the card is used to store the card information for a customer.

<mark style="color:yellow;">`POST`</mark> `/v1/customers/:id/sources`

{% tabs %}
{% tab title="CURL" %}

```
curl https://{provided url}/v1/customers/P2ZTA56JQ7-AvwGf0pHd2Q/sources \
  -u sk_test_yFStF-KUmgr-7CoumuY2JA: \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d card[number]=5159084567916624 \
  -d card[exp_month]=12 \
  -d card[exp_year]=2022 \
  -d card[name]=John Doe \
  -d card[address_line1]=Address line 1 \
  -d card[address_state]=mz \
  -d card[address_city]=Cardholder City \
  -d card[address_zip]=24310 \
  -d card[address_country]=pl \
  -d client_ip=127.0.0.1
```

{% endtab %}
{% endtabs %}

The above command returns JSON structured like this:

```json
{
	"id": "TlnNDVS6TteSn2-FEh3ZKg",
	"created_at": 1568904725,
	"name": "John Doe",
	"exp_month": 12,
	"exp_year": 2022,
	"last4": "6624",
	"brand": "mastercard",
	"customer": "P2ZTA56JQ7-AvwGf0pHd2Q",
	"fingerprint": "R1gbK7BauiX3XdnUCQRhzlnvMxxtSKVS7NqScFBeVRE",
	"client_ip": "127.0.0.1",
	"address_line1": "Address line 1",
	"address_city": "Cardholder City",
	"address_state": "mz",
	"address_zip": "24310",
	"address_country": "PL",
	"type": "card"
}
```

## Arguments <a href="#arguments" id="arguments"></a>

Contain the card information to be stored.

| Parameter               | Type    | Required                             | Description                                                            |
| ----------------------- | ------- | ------------------------------------ | ---------------------------------------------------------------------- |
| card\[number]           | numeric | required is source is not present    | Credit card number.                                                    |
| card\[exp\_month]       | numeric | required is source is not present    | Card expiration month.                                                 |
| card\[exp\_year]        | numeric | required is source is not present    | Card expiration year.                                                  |
| card\[name]             | string  | required is source is not present    | Cardholder name.                                                       |
| card\[address\_line1]   | string  | optional                             | Cardholder line 1 address.                                             |
| card\[address\_line2]   | string  | optional                             | Cardholder line 2 address.                                             |
| card\[address\_state]   | string  | optional                             | Cardholder address state using the iso 3166-2 code for country states. |
| card\[address\_city]    | string  | optional                             | Cardholder address city.                                               |
| card\[address\_zip]     | string  | optional                             | Cardholder zip address.                                                |
| card\[address\_country] | string  | optional                             | Cardholder iso 2 country code.                                         |
| source                  | string  | optional if card data is not present | Contain the token ID received from the token creation.                 |
| client\_ip              | string  | optional                             | IP address of the client that generate the token.                      |

## Returns <a href="#returns" id="returns"></a>

Return the card object linked to the card information stored.
