---
agentTools:
  projectIndex: https://docs.bond.tech/llms.txt
---

# Creating a card

How to create a customer card and an associated card account.

<style>
.button {
    background-color: #EF5B25;
    border: none;
    color: white;
    padding: 4px 10px;
    text-align: center;
    text-decoration: none !important;
    display: inline-block;
    font-size: 12px;
    /* margin: 3px 2px; */
    cursor: pointer;
    border-radius: 12px;
    /* width: 150px; */
    height: 25px;
}
.button:hover{
  	opacity: 80%;
    color: #ffffff;
  }
</style>

[block:api-header]
{
  "title": "Introduction"
}
[/block]

After you [create a customer resource](https://docs.bond.tech/docs/creating-a-customer-resource) and they've passed [KYC verification](https://docs.bond.tech/docs/kyc), you need to [create an account](https://docs.bond.tech/docs/opening-a-credit-account) before you can create a card which simultaneously also creates an associated card account.

<a class="button" href="https://www.postman.com/bond-technologies/workspace/bond-api" target="_blank">▶ Run in Postman</a>

A card and its card account are closely coupled but logically distinct, the difference is what is being managed. The card resource contains information about the actual physical or virtual card, while the card account resource stores broader account information, such as what bank accounts are connected to the card. For card type details, see <a href="https://docs.bond.tech/docs/card#card-types" target="_blank">Card types</a>.

The card configuration is determined by the `program_id` which is provided by Bond based on your requirements. There are three card configurations:

* Virtual
* Physical
* Dual

For details, see [Card program ID](https://docs.bond.tech/docs/card-program-id#card-configurations).

Upon creation, a virtual card is usable immediately but a physical card is issued as inactive and must be <a href="https://docs.bond.tech/docs/changing-the-card-status#activating-a-physical-card" target="_blank">activated</a> before it can be used.

[block:api-header]
{
  "title": "Creating a card and card account"
}
[/block]

Use the `POST /cards` operation and provide the parameters as shown in the following table.

[block:parameters]
{
  "data": {
    "h-0": "Parameter",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "`account_id`\n<b><sup>required</sup></b>",
    "0-1": "string",
    "0-2": "Unique ID that identifies the customer's account, for example `931e2341-c3eb-4681-97d4-f6e09d90da14`.\nMay be either a secured deposit account or a credit account.",
    "1-0": "`card_design_id`",
    "1-1": "string",
    "1-2": "The visual design of the card. Contact Bond support regarding creating card designs."
  },
  "cols": 3,
  "rows": 2
}
[/block]

An example of a request to create a card is shown below.

[block:code]
{
  "codes": [
    {
      "code": "curl --request POST \\\n     --url https://sandbox.bond.tech/api/v0.1/cards \\\n     --header 'Accept: application/json' \\\n     --header 'Authorization: YOUR-AUTHENTICATION' \\\n     --header 'Content-Type: application/json' \\\n     --header 'Identity: <YOUR_IDENTITY>' \\\n     --data '\n{\n     \"account_id\": \"1c667427-5521-4ffd-ac59-16ab73dc133e\",\n     \"card_design_id\": \"7\"\n}\n'",
      "language": "curl",
      "name": "cURL"
    },
    {
      "code": "require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nurl = URI(\"https://sandbox.bond.tech/api/v0.1/cards\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = 'application/json'\nrequest[\"Content-Type\"] = 'application/json'\nrequest[\"Identity\"] = '<YOUR_IDENTITY>'\nrequest[\"Authorization\"] = 'YOUR-AUTHENTICATION'\nrequest.body = \"{\\\"account_id\\\":\\\"1c667427-5521-4ffd-ac59-16ab73dc133e\\\",\\\"card_design_id\\\":\\\"7\\\"}\"\n\nresponse = http.request(request)\nputs response.read_body",
      "language": "ruby"
    },
    {
      "code": "const options = {\n  method: 'POST',\n  headers: {\n    Accept: 'application/json',\n    'Content-Type': 'application/json',\n    Identity: '<YOUR_IDENTITY>',\n    Authorization: 'YOUR-AUTHENTICATION'\n  },\n  body: JSON.stringify({account_id: '1c667427-5521-4ffd-ac59-16ab73dc133e', card_design_id: '7'})\n};\n\nfetch('https://sandbox.bond.tech/api/v0.1/cards', options)\n  .then(response => response.json())\n  .then(response => console.log(response))\n  .catch(err => console.error(err));",
      "language": "javascript"
    },
    {
      "code": "import requests\n\nurl = \"https://sandbox.bond.tech/api/v0.1/cards\"\n\npayload = {\n    \"account_id\": \"1c667427-5521-4ffd-ac59-16ab73dc133e\",\n    \"card_design_id\": \"7\"\n}\nheaders = {\n    \"Accept\": \"application/json\",\n    \"Content-Type\": \"application/json\",\n    \"Identity\": \"<YOUR_IDENTITY>\",\n    \"Authorization\": \"YOUR-AUTHENTICATION\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\nprint(response.text)",
      "language": "python"
    },
    {
      "code": "var client = new RestClient(\"https://sandbox.bond.tech/api/v0.1/cards\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Accept\", \"application/json\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\nrequest.AddHeader(\"Identity\", \"<YOUR_IDENTITY>\");\nrequest.AddHeader(\"Authorization\", \"YOUR-AUTHENTICATION\");\nrequest.AddParameter(\"application/json\", \"{\\\"account_id\\\":\\\"1c667427-5521-4ffd-ac59-16ab73dc133e\\\",\\\"card_design_id\\\":\\\"7\\\"}\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);",
      "language": "csharp"
    },
    {
      "code": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\\"account_id\\\":\\\"1c667427-5521-4ffd-ac59-16ab73dc133e\\\",\\\"card_design_id\\\":\\\"7\\\"}\");\nRequest request = new Request.Builder()\n  .url(\"https://sandbox.bond.tech/api/v0.1/cards\")\n  .post(body)\n  .addHeader(\"Accept\", \"application/json\")\n  .addHeader(\"Content-Type\", \"application/json\")\n  .addHeader(\"Identity\", \"<YOUR_IDENTITY>\")\n  .addHeader(\"Authorization\", \"YOUR-AUTHENTICATION\")\n  .build();\n\nResponse response = client.newCall(request).execute();",
      "language": "java"
    }
  ]
}
[/block]

An example of a response to a successful request to create a card is shown below.

```json
{
  "card_id": "057c6074-a02d-4a5a-bad9-bbc64b047df7",
  "date_updated": "2020-08-16T19:39:34Z",
  "date_created": "2020-08-15T19:39:34Z",
  "customer_id": "c8940088-21e8-451c-987c-0a0398db3ee5",
  "account_id": "26bdeb70-157c-4c44-a04a-3727793b9779",
  "expiry_date": "tok_live_7g3eARzeEBJw89rJRCHqHv",
  "last_four": "6270",
  "card_number": "tok_live_q7kwTYb5YCYznpgRHHTs9p",
  "cvv": "tok_live_c94od3AsFWYQ1ecaaMYtFU",
  "status": "active",
  "card_design_id": null
}
```

To change the details on a card, see <a href="ref:patch_cards" target="_blank">Updating the details on a card</a>.

For a complete specification and interactive examples, see <a href="ref:post_cards" target="_blank">Creating a card</a> in the Bond API Reference.