Creating a card

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

Introduction

After you create a customer resource and they've passed KYC verification, you need to create an account before you can create a card which simultaneously also creates an associated card account.

▶ Run in Postman

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 Card types.

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.

Upon creation, a virtual card is usable immediately but a physical card is issued as inactive and must be activated before it can be used.

Creating a card and card account

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

Parameter

Type

Description

account_id
required

string

Unique ID that identifies the customer's account, for example 931e2341-c3eb-4681-97d4-f6e09d90da14.
May be either a secured deposit account or a credit account.

card_design_id

string

The visual design of the card. Contact Bond support regarding creating card designs.

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

curl --request POST \
     --url https://sandbox.bond.tech/api/v0.1/cards \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHENTICATION' \
     --header 'Content-Type: application/json' \
     --header 'Identity: YOUR-IDENTITY' \
     --data '
{
     "account_id": "1c667427-5521-4ffd-ac59-16ab73dc133e",
     "card_design_id": "7"
}
'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0.1/cards")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHENTICATION'
request.body = "{\"account_id\":\"1c667427-5521-4ffd-ac59-16ab73dc133e\",\"card_design_id\":\"7\"}"

response = http.request(request)
puts response.read_body
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'Content-Type': 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHENTICATION'
  },
  body: JSON.stringify({account_id: '1c667427-5521-4ffd-ac59-16ab73dc133e', card_design_id: '7'})
};

fetch('https://sandbox.bond.tech/api/v0.1/cards', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0.1/cards"

payload = {
    "account_id": "1c667427-5521-4ffd-ac59-16ab73dc133e",
    "card_design_id": "7"
}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHENTICATION"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0.1/cards");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHENTICATION");
request.AddParameter("application/json", "{\"account_id\":\"1c667427-5521-4ffd-ac59-16ab73dc133e\",\"card_design_id\":\"7\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"account_id\":\"1c667427-5521-4ffd-ac59-16ab73dc133e\",\"card_design_id\":\"7\"}");
Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0.1/cards")
  .post(body)
  .addHeader("Accept", "application/json")
  .addHeader("Content-Type", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHENTICATION")
  .build();

Response response = client.newCall(request).execute();

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

{
  "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 Updating the details on a card.

For a complete specification and interactive examples, see Creating a card in the Bond API Reference.


Did this page help you?