API Reference
Virtual Cards
Create card [POST]

Create Card


https://sandboxapi.onbrails.com/api/v2/virtualcards/create (opens in a new tab)

create a new card for a customer

Body Parameters

ParameterTypeRequired
customerEmail
The customer's email address. Ensure the customer has already being indexed
string✅
cardBrand
Only required with Visa Card
string✅
cardType
Defaults to visa
string✅
reference
string✅
amount
Maximum amount is $2,500 and minimum is $3
string✅
firstName
Only needed on sandbox
string
lastName
Only needed on sandbox
string

Request

Virtual Cards/Create Card [POST]
curl --request POST \
   --url https://sandboxapi.onbrails.com/api/v2/virtualcards/create \
   --header 'Authorization: Bearer API-KEY' \
   --header 'accept: application/json' \
   --header 'content-type: application/json' \
   --data '{
      "customerEmail": "abc@gmail.com",
      "firstName": "Nana",
      "lastName": "Mends",
      "cardBrand": "mastercard",
      "cardType": "giftcard",
      "amount": 500,
      "reference": "jadadkaaiudkkjahyyy111"
    }'

Responses

🟢 200 - Result example
{
"status": true,
"message": "card creation in progress",
"data": {
  "id": "86435436-3c86-4d3d-bdcb-897fe2a20d88",
  "createdAt": "2023-03-02T15:58:17.775Z",
  "updatedAt": "2023-03-02T15:58:17.775Z",
  "cardType": "virtual",
  "cardBrand": "visa",
  "cardUserId": "1af3a823-10a5-4098-8bc9-d5c2e9f9ba44",
  "reference": "jadadkaaiudkkjahyyy111",
  "createdStatus": "pending",
  "customerId": null
}
}