How to create a card

In this tutorial, you'll learn how to

Register the relevant webhooks

Create and order a new card

Note

If you are new to card issuing we recommend you read the card issuing management documentation before starting this tutorial.

The tutorial assumes you have a knowledge of APIs and how they work. For more information on sending API calls, see the API overview page.

The tutorial uses these API endpoints

API

Description

POST /cardmanagement/v1/cards

Requests creation of a new debit card

The tutorial uses these webhooks.

Webhook

Description

Cards.Card.Created

Debit card created

Before you begin

Make sure you have:

1. Register the relevant webhook events

To receive the webhook events for this tutorial both partner accounts need to register each specific webhook event type. Once you are registered, the event objects are sent to the registered URLs.

The event object contains a list of resource identifiers used to download details on each event.

2. Order a new card

In this tutorial you will learn how to order/create a new debit card. by creating a card for John Smith.

a. To create the card

  1. Call POST /cardmanagement/v1/cards. For this call, some/all attributes are required. A full list of attributes is found here.

    Copy
    Sample create a card
    curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik0wRTJSa0k0UkRZM1FqWTJNRGhGTkRRd01VWXlPRFl6T1VSRE9FVkRNMEUzT1RNNFEwRTJRdyJ9.eyJpc3MiOiJodHRwczovL2NyYmNvcy1zYW5kYm94LmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw2Mzg0ZmY1ODI1OTllOWQ5YWFhZGM3YmUiLCJhdWQiOlsiaHR0cHM6Ly9hcGkuY3JiY29zLmNvbS8iLCJodHRwczovL2NyYmNvcy1zYW5kYm94LmF1dGgwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE2NzYyODA4OTQsImV4cCI6MTY3NjM2NzI5NCwiYXpwIjoieXNtZEljYjA0Z3dJeV9GQzBEU1VJNmxvQ251QTFYMmMiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIn0.q1A7-HEnBEfyOD-lzb6cRohwHuZTJXHdCp3Vqkz3ioH4bIg-cq54gEZkfZJKrdSw3g28fs0SfU3S3lNPJmLfg6FK5J7RgD642C8K67zsdyow42PxHq1A1KA-qUmDVUR9F05TzS_A2WzMp4BPQr9fyq3_Y4VXJrKWmpVrpLUCew8U4ytx15zCMDGTYf1l4FuPA9t8daY4a7Z4rFKXW6AXkQX1UFIrEh9idU3LfkaZvb49f7jMTwQdAEIS7q_IpiDn1uXpHFprVPCrGZ4MJYpLiBpIuM_DShZZPNZGiB9IK0iFKyhiHKf1GNKe4gWKMIm4J4mETVTHVYeZucAHaTRhEQ' -d '{ \ 
       "accountNumber": "2608927303", \ 
       "customerId": "2b15a695-13dc-4b10-b4e5-af5b0138873c", \ 
       "configurationId": "a6b5a94c-f8f9-462b-8ce8-afa400f5b640", \ 
       "firstName": "John", \ 
       "lastName": "Smith", \ 
         "phone": { \ 
         "phoneType": "Home", \ 
         "phoneNumber": "9133413131"
       }, \ 
       "emailAddress": "john%40anygoogle.com", \ 
       "shippingAddress": { \ 
         "street1": "Lane Ave", \ 
         "street2": "string", \ 
         "city": "Big Town", \ 
         "state": "IL", \ 
         "postalCode": "72410", \ 
         "countryCode": "US"
       }, \ 
       "billingAddress": { \ 
         "street1": "Lane Ave", \ 
         "street2": "string", \ 
         "city": "Big Town", \ 
         "state": "IL", \ 
         "postalCode": "72410", \ 
         "countryCode": "US"
       }, \ 
       "nameOnCard": "John Smith", \ 
         "shippingType": "Normal", \ 
       "clientIdentifier": "string"
     }' 'https://sandbox.crbcos.com/CardManagement/v1/cards'
  2. A successful API call returns a JSON response with the details of the new card. The card status will be unactivated until you activate the card. The id is the card ID, in this example 8709163d-140c-4d95-a111-afa8009e9cd1, which you will need to activate the card.

  3. Copy
    Sample order a card response
    {
      "id": "8709163d-140c-4d95-a111-afa8009e9cd1",
      "partnerId": "cd9c12f4-7691-424a-b38b-af5b0134c611",
      "productId": "83bed086-8182-4151-a1e3-af5b01362783",
      "accountNumber": "2608927303",
      "status": "Unactivated",
      "statusReasonCode": "NotSet",
      "firstName": "John",
      "lastName": "Smith",
      "shippingAddress": {
        "street1": "Lane Ave",
        "street2": "string",
        "city": "Big Town",
        "state": "IL",
        "postalCode": "72410",
        "countryCode": "US"
      },
      "billingAddress": {
        "street1": "Lane Ave",
        "street2": "string",
        "city": "Big Town",
        "state": "IL",
        "postalCode": "72410",
        "countryCode": "US"
      },
      "phone": {
        "phoneType": "Home",
        "phoneNumber": "9133413131"
      },
      "emailAddress": "john@anygoogle.com",
      "nameOnCard": "John Smith",
      "isPinSet": false,
      "adminBlocked": false,
      "fraudSuspect": false,
      "configurationId": "a6b5a94c-f8f9-462b-8ce8-afa400f5b640",
      "category": "Credit",
      "paymentInstrument": "VirtualPan",
      "processor": "i2c",
      "shippingType": "Normal",
      "orderStatus": "OrderPending",
      "replacementStatus": "NotApplicable",
      "customerId": "2b15a695-13dc-4b10-b4e5-af5b0138873c",
      "clientIdentifier": "string",
      "createdAt": "2023-02-13T04:37:29.4869172-05:00",
      "lastModifiedAt": "2023-02-13T04:37:29.4869172-05:00"
    }
  4. When the card is generated at i2c , the Cards.Card.createdwebhook event fires.

Copy

Sample Cards.Card.Created event

{
  "id": "cea6c5b5-13e7-4c2f-ba75-afce01110fe5",
  "eventName": "Cards.Card.Created",
  "status": "Pending",
  "partnerId": "cd9c12f4-7691-424a-b38b-af5b0134c611",
  "createdAt": "2023-02-13T04:42:29.4869172-05:00",
  "resources": [
    "cardmanagement/v1/cards/8709163d-140c-4d95-a111-afa8009e9cd1"
  ],
  "details": [
    {
      "cardId": "8709163d-140c-4d95-a111-afa8009e9cd1",
      "status": "Unactivated",
      "statusReasonCode": "NotSet"
    }
  ]
}