Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Recipes Card issuing Issue a virtual card after a hosted check

Issue a virtual card after a hosted check

Verify a person on a hosted page with a liveness check, activate cards for them, and issue their first virtual USD card.

9 min read

Use this recipe to verify a person on a hosted page with a liveness check, activate cards for them, and issue their first virtual USD card.

Who it is for. A savings app in Lagos that gives its users a USD virtual card for online subscriptions.

Status. Available.

Money example

1.
You issue Ada a virtual card with a daily limit of 300 USD. No money moves yet, and the card balance is 0.
2.
You move 150 USD from Ada's USD account to the card, as in Top up a card. The card balance is 150 USD.
3.
Ada pays 18.75 USD for a streaming subscription. The card balance is 131.25 USD.

Before you start

•
Your business's card account is active. To find it, or to set it up if there is none, see Set up your card account. In this recipe, its id is 9b40be8d-9d74-4d2a-8897-dea3ef80ad23.
•
Ada exists as an individual customer with a phone number and an address. See Customers and KYC.
•
If your API key is scoped, it holds feature:read, feature:activate, customer:update and card:create.
•
Card issuing is switched on for your business. If a card call returns 403 with feature_access_required, it is not switched on. Request access.
•
You have registered your webhook URL in the Dashboard.

Find out what is required

Read Ada's basic KYC first. If it is already completed, skip step 1.

cURLNodePython
curl --request GET \
--url https://api.gravv.xyz/v1/customers/5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42 \
--header 'Api-Key: <API_KEY>'

Then check what activation still needs. eligible false is normal before activation. The provider_data items are fields you send at activation.

cURLNodePython
curl --request POST \
--url https://api.gravv.xyz/v1/risk/features/eligibility \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: aa00412e-7fc8-4bf7-8dd2-4bc82e8ea4a6' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"feature_id": "virtual_cards"
}
'
Pending itemWhat to do
type kyc_statusVerify Ada first (step 1)
type provider_data, required annual_remuneration or estimated_monthly_limitSend it at activation (step 2)
type provider_data, required ip_addressNothing. Gravv fills it from your request

Steps

1. Start hosted verification

Run this step only when Ada's basic KYC is not_started or failed. The hosted page captures her ID, a selfie and a liveness check in one session.

cURLNodePython
curl --request POST \
--url https://api.gravv.xyz/v1/risk/start-kyc \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: b7b49982-1e90-458b-800f-7376e11f79c2' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42"
}
'
Response
{
"data": {
"status": "success",
"kyc_level": "basic",
"review_status": "pending",
"external_user_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"web_url": "https://<verification-host>/websdk/p/aBcD123"
},
"error": null
}

Show web_url to Ada. The link is valid for 1 hour. Wait for customer.kyc.status.completed, or read the customer until basic is completed. This route sends no customer.kyc.status.pending event.

2. Activate cards for Ada

This call opens Ada's card application and sends her verification with it.

cURLNodePython
curl --request POST \
--url https://api.gravv.xyz/v1/risk/features/activate \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: fbb8971a-3141-41c1-a076-a9f4f811887e' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"feature_id": "virtual_cards",
"provider_data": {
"annual_remuneration": 24000,
"estimated_monthly_limit": 300,
"account_id": "9b40be8d-9d74-4d2a-8897-dea3ef80ad23"
}
}
'
Response
{
"data": {
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"feature_id": "virtual_cards",
"status": "active",
"activated_at": "2026-10-13T11:20:05Z"
},
"error": null
}
•
annual_remuneration is a JSON number of at least 1000. estimated_monthly_limit is a JSON number of at least 1.
•
status active means the application was submitted, not that a card exists. The response has no application id.
•
If the response is pending_liveness with a websdk_url, see Verify a cardholder with your own ID capture.

3. Find the application or the card

cURLNodePython
curl --request GET \
--url 'https://api.gravv.xyz/v1/cards?customer_id=5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42' \
--header 'Api-Key: <API_KEY>'
•
Sandbox. Sandbox issued the card during step 2. You see it with status active and card_type virtual, and its daily limit is estimated_monthly_limit. Do not call POST /v1/cards unless you want a second card. Go to Top up a card.
•
Live. You see the application row with status "". Its id is the application id, and it becomes the first card's id.

4. Live only: wait for approval

Only the list of applications shows the application status. The list has no customer filter, so page through it and match customer_id.

cURLNodePython
curl --request GET \
--url 'https://api.gravv.xyz/v1/cards/applications?items_per_page=100' \
--header 'Api-Key: <API_KEY>'
application_statusWhat to do
approvedGo to step 5
needs_verification, needs_informationShow application_link to Ada, then wait for cards.application.update
pending, manual_reviewWait for cards.application.update
denied, locked, canceledStop and contact support

Never poll GET /v1/cards/applications/{application_id} for approval. Its status is the card's status, and it stays "" until a card is issued.

5. Live only: issue the card

cURLNodePython
curl --request POST \
--url https://api.gravv.xyz/v1/cards \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 63896683-7c1f-4109-ae3d-10a2be33e758' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "5b0f6c1e-2a8f-4c39-9d0e-0c7e3b9a1f42",
"card_type": "virtual",
"card_limit": 300,
"name_on_card": "Ada Obi"
}
'
Response
{
"data": {
"message": "Card creation request is processing",
"status": true,
"id": "a14ec356-f33d-4384-ba68-4d9bfa19765b",
"fee_charged": false
},
"error": null
}

card_limit is a daily limit in whole US dollars. Gravv sets a 4-digit PIN for you.

6. Confirm

cURLNodePython
curl --request GET \
--url https://api.gravv.xyz/v1/cards/a14ec356-f33d-4384-ba68-4d9bfa19765b \
--header 'Api-Key: <API_KEY>'

Check that status is active and spending_controls.daily_transaction_limit is 300. Next, top up the card.

What can go wrong

ResponseWhyFix
400 Failed to check feature eligibilityThe feature_id is unknown, there is no verification record, or a brief fault occurredSend virtual_cards, and retry with a new key
Ada was completed and becomes pendingYou called POST /v1/risk/start-kyc for a verified personCall it only when basic is not_started or failed. Ada must finish the new link
customer.kyc.status.failed with failure_reasonThe documents or selfie were rejectedStart verification again and give Ada the new web_url
400 failed to check liveness requirement: customer KYC must be completed before activating cards featureVerification has not finishedWait for customer.kyc.status.completed
400 cards service: annual_remuneration must be a number of at least 1000The value is missing or too smallSend a number of at least 1000
400 cards service: estimated_monthly_limit must be a number of at least 1The value is missing or 0Send a number of at least 1
400 cards service: account must be a card account, but this account's type is "regular"The account is not your card accountSend your card account id
400 cards service: account must be active to be used for cards, but its status is "pending"The card account is not readyWait until it is active
400 cards service: internal server errorYou left out account_id or sent a number as a string, or the application was refusedSend account_id, and send numbers as JSON numbers. If the error persists, contact support with the customer id
200 with message Feature activation already exists with status: activeCards are already activated for this customerFind the card with GET /v1/cards?customer_id=…
400 card application is not yet approved!In live, the application is still pendingWait for approved, then retry with a new key
400 card application not found!Activation never succeededRun step 2
400 CardLimit is required / NameOnCard is requiredA field is missing. The message uses internal field namesSend it with a new key
403 feature_access_requiredCard issuing is not switched on for your businessRequest access

Webhooks you will receive

1.
customer.kyc.status.completed, or customer.kyc.status.failed with failure_reason.
2.
In live, cards.application.update with event_data.application.status.
3.
No webhook arrives when a card is issued. Read the card with GET /v1/cards.

All events for one card share event_group_id, which is the card id. Deduplicate on event_id.

Testing in sandbox

•
Sandbox approves activation at once and issues the virtual card during step 2. Steps 4 and 5 do not apply, and application_link is always "".
•
Sandbox completes KYC about 3 minutes after the cardholder finishes the hosted check, whatever they upload. Activate only once basic reads completed, or activation returns customer KYC must be completed.

Reference

Was this page helpful? Yes No