# `Stancer.API.Cards`

# `create`

```elixir
@spec create(map()) :: {:ok, map()} | {:error, term()}
```

POST `/v2/cards/`

## Parameters

  * `customer` (string (matches ^cust_[a-zA-Z0-9]{24}$), optional) - Customer to assign the card
    - Example: "cust_yWYfCSzsUUhr9KwMv7vuLZHX"
  * `cvc` (string (3-4 chars), optional) - Card security code used to secure the transaction
  * `exp_month` (integer, optional) - Month expiration in MM format
  * `exp_year` (integer, optional) - Year expiration in YYYY format
  * `external_id` (string (1-36 chars), optional) - Unique id with unicity check
  * `name` (string (3-64 chars), optional) - custome name given to the card, often the card holder name
  * `number` (string (13-19 chars), optional) - Card number
  * `preferred_network` (string, optional) - Card network to use for co-branded card
    - Example: "national"
  * `tokenize` (boolean, optional) - Define if card can be reused for future payments
  * `zip_code` (string (2-16 chars), optional) - zip code in 2 to 8 digit format

# `delete`

```elixir
@spec delete(String.t()) :: {:ok, map()} | {:error, term()}
```

DELETE `/v2/cards/{id}`

# `get`

```elixir
@spec get(String.t()) :: {:ok, map()} | {:error, term()}
```

GET `/v2/cards/{id}`

# `list`

```elixir
@spec list() :: {:ok, map()} | {:error, term()}
```

GET `/v2/cards/`

# `update`

```elixir
@spec update(String.t(), map()) :: {:ok, map()} | {:error, term()}
```

PATCH `/v2/cards/{id}`

## Parameters

  * `exp_month` (integer, optional) - Month in MM format
  * `exp_year` (integer, optional) - Year expiration in YYYY format
  * `external_id` (string (1-36 chars), optional) - Unique id with unicity check
  * `zip_code` (string (2-16 chars), optional) - Zip code in 2 to 8 digit format

---

*Consult [api-reference.md](api-reference.md) for complete listing*
