Virtual Cards
Issue and manage virtual USD cards for your customers. Cards are funded from your Cashramp balance and are scoped to your own customers, so you can only create and manage cards belonging to a customer you own.
Verify a Customer
Before you can issue a card, the customer must pass a selfie check. Send a photo of the customer's face and a photo of their ID with verifyMerchantCustomer. This is a photo check, not a live video check.
mutation {
verifyMerchantCustomer(
merchantCustomer: "customer_id"
selfie: "https://example.com/selfie.jpg"
identificationDocument: "https://example.com/id.jpg"
)
}merchantCustomer
ID!
Yes
The ID of the customer to verify.
selfie
String!
Yes
URL of a photo of the customer's face.
identificationDocument
String!
Yes
URL of a photo of the customer's government-issued ID.
Returns true once the photos are received, and the customer's status moves to pending_verification. The selfie is matched against the photo on the ID, and the name on the ID against the name you gave in createCustomer. A clear match is approved automatically, and anything unclear is reviewed by the Cashramp team.
Verification is not instant. Fetch the customer with merchantCustomer and wait for status to be verified before you request a card. If the check is declined, status goes back to created and you can send new photos.
Uploading the photos
Both URLs must be downloadable by Cashramp. If you don't host the photos yourself, upload each one to the Cashramp upload endpoint with your API key and use the url it returns.
On staging, use https://staging.api.useaccrue.com/merchant/upload.
Submit Customer KYC
Once the customer is verified, submit the identity details the card issuer needs with submitCustomerKyc. Send it after verification so the card issuer gets exactly the details you submit.
customer
ID!
Yes
The ID of the customer to submit KYC for.
idType
IdentificationDocument!
Yes
The type of ID document. One of passport, national_id, voter_card, driver_license, nin.
idNumber
String!
Yes
The ID document number.
phoneNumber
String!
Yes
The customer's phone number in international format (e.g. +2348012345678).
bvn
String
No
Bank Verification Number. Required for Nigerian customers.
dateOfBirth
ISO8601Date
Sometimes
The customer's date of birth (YYYY-MM-DD). Required when the customer's ID is a Nigerian NIN (idType nin or national_id without a valid BVN).
idFrontImage
String
Sometimes
The front of the customer's ID as a base64-encoded JPEG or PNG, without a data: prefix. See ID image.
idBackImage
String
Sometimes
The back of the customer's ID, in the same format as idFrontImage. Send it for an ID with two sides. See ID image.
Address
address is an object with these keys. All are required except country.
address1
Street address.
city
City.
state
State, region or province.
zipcode
Postal or ZIP code.
country
Optional ISO 3166 country code (e.g. NG or NGA). Defaults to the customer's country.
ID image
The card issuer needs an image of the customer's ID unless the customer is Nigerian with a valid BVN, or their ID is a Nigerian NIN (then dateOfBirth is needed instead).
If the identificationDocument you sent to verifyMerchantCustomer was uploaded through the Cashramp upload endpoint, it is used and you can leave idFrontImage out. Otherwise send idFrontImage.
If the ID has two sides, such as a national ID card, driver's license or voter's card, also send the back as idBackImage. A passport doesn't need it. The card issuer can turn down a two-sided ID that comes with only the front.
If you call submitCustomerKyc again with a different idType or idNumber and no idBackImage, the back you sent before is dropped.
Existing customers
The card issuer now requires the address (and the date of birth or ID image above) before issuing a new card. For a customer who is already verified, call submitCustomerKyc again with their existing ID details plus the missing fields. The customer stays verified and you don't need to repeat verifyMerchantCustomer. The same goes for a customer with a two-sided ID who only had the front sent: call submitCustomerKyc again with idBackImage, then request the card again.
The identity number and BVN are stored encrypted. Call this before requestVirtualCard: issuance is rejected (before any charge) if the identity data, a usable phone number, the address, the date of birth or ID image, or, for a Nigerian customer, a valid BVN is missing.
Request a Virtual Card
label
String!
Yes
A name to identify the card.
amountUsd
Decimal!
Yes
The initial amount (USD) to fund the card with.
reference
String!
Yes
Your unique idempotency reference. Retrying with the same reference returns the original card instead of issuing or charging again.
The mutation returns the new card’s global id and its status (which starts as requested). Issuance completes asynchronously, so listen for the virtual_card.created webhook (or virtual_card.creation_failed on failure).
The mutation fails if:
The customer's
statusis notverified. See Verify a Customer.The customer's KYC details are missing: no identity data, no usable phone number, no address, no date of birth or ID image where one is needed, or (for a Nigerian customer) no valid BVN. Submit these first with
submitCustomerKyc.Your Cashramp balance is insufficient to cover the funding amount plus fees.
amountUsdis below the minimum or above the maximum funding amount (see Virtual Card Info).Card creation is currently unavailable.
Important Notes
The card is issued in the customer’s name and requires the customer to be verified through
verifyMerchantCustomer, with their identity details submitted viasubmitCustomerKyc.You are charged the creation fee, the funding fee, and the funding amount from your Cashramp balance. Fetch current fees and limits via
virtualCardInfo.referencemakes the request idempotent. Always send a unique reference per intended card so timeouts and retries never double-issue.
Fund a Virtual Card
virtualCard
ID!
Yes
The ID of the card to fund.
amountUsd
Decimal!
Yes
The amount (USD) to add to the card.
reference
String!
Yes
Your unique idempotency reference. Retrying with the same reference will not fund the card twice.
Returns true when the top-up is accepted. The card is credited asynchronously; a virtual_card.funded webhook is delivered on completion. If the top-up fails, the amount and fee are refunded to your balance and a virtual_card.funding_failed webhook carries your reference.
The mutation fails if the card is not active, the amount is outside the allowed funding range, or your balance is insufficient.
Withdraw from a Virtual Card
virtualCard
ID!
Yes
The ID of the card to withdraw from.
amountUsd
Decimal!
Yes
The amount (USD) to withdraw from the card back to your balance.
reference
String!
Yes
Your unique idempotency reference. Retrying with the same reference will not withdraw twice.
Returns true when the withdrawal request is accepted by the card issuer. This does not mean the funds have arrived: the withdrawal completes asynchronously, and your Cashramp balance is credited only once the issuer confirms it. Listen for the virtual_card.withdrawal_completed webhook before treating the funds as received.
Reveal Card Details
virtualCard
ID!
Yes
The ID of the card to unmask.
Returns the full PAN (cardNumber) and CVV. This is the only operation that returns unmasked card details. Every read (virtualCard, virtualCards) returns a masked number only.
Freeze or Unfreeze a Virtual Card
virtualCard
ID!
Yes
The ID of the card to freeze or unfreeze.
Toggles the card between active and frozen. Returns true on success. A virtual_card.frozen or virtual_card.unfrozen webhook is delivered, including when the card issuer freezes the card.
Delete a Virtual Card
virtualCard
ID!
Yes
The ID of the card to delete.
Terminates the card and refunds any remaining balance to your Cashramp balance. Returns true on success. A virtual_card.deleted webhook is delivered on completion, with a reason (see Webhooks).
Fetch a Customer’s Virtual Cards
customer
ID!
Yes
The ID of the customer whose cards to list.
status
VirtualCardStatus
No
Optionally filter by card status.
Returns the customer’s cards with masked details. cardNumber is masked, so use unmaskVirtualCard for the full PAN and CVV.
Fetch a Virtual Card
virtualCard
ID!
Yes
The ID of the card to fetch.
Returns the full (masked) details of a card belonging to one of your customers, or null if the card is not yours.
Fetch a Card's Transactions
A card's transactions are a paginated field on virtualCard, newest first.
first
Int
No
Page size, up to 50.
after
String
No
The endCursor of the previous page.
filter
VirtualCardTransactionFilter
No
ALL (default), ONE_OFF, or CYCLES (recurring subscription charges).
Keep requesting with after: endCursor while hasNextPage is true. A transaction's id matches transaction.id in the virtual_card.transaction webhook. Declined authorizations are not transactions and are only delivered by webhook.
txType
paymentType
Description
funding
credit
Card was topped up
withdrawal
debit
Funds were moved off the card
spend
debit
A purchase or card fee
reversal
credit
A purchase was reversed or refunded
Virtual Card Statuses
requested
Card has been requested; issuance is in progress
pending
Card is being provisioned with the card issuer
active
Card is issued and ready to use
freezing
Card is frozen or suspended
Virtual Card Info
Returns the current fee schedule and limits that apply when issuing and funding cards:
creationFee- Fee charged to issue a card.fundingFee/fundingFeeType- Fee charged when funding a card, and whether it is a flat or percentage fee.minimumFundingAmount/maximumFundingAmount- The allowed funding range per request.maxCardsPerMerchant- Maximum number of active cards you may hold (when enforced).maintenanceFee- Recurring maintenance fee, if any.bookBalance- The book balance (USD) configured for cards.creationAvailable- Whether card issuance is currently enabled.
Last updated