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.
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.
Sandbox. Sandbox issued the card during step 2. You see it with statusactive and card_typevirtual, 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.
Check that status is active and spending_controls.daily_transaction_limit is 300. Next, top up the card.
What can go wrong
Response
Why
Fix
400 Failed to check feature eligibility
The feature_id is unknown, there is no verification record, or a brief fault occurred
Send virtual_cards, and retry with a new key
Ada was completed and becomes pending
You called POST /v1/risk/start-kyc for a verified person
Call it only when basic is not_started or failed. Ada must finish the new link
customer.kyc.status.failed with failure_reason
The documents or selfie were rejected
Start verification again and give Ada the new web_url
400 failed to check liveness requirement: customer KYC must be completed before activating cards feature
Verification has not finished
Wait for customer.kyc.status.completed
400 cards service: annual_remuneration must be a number of at least 1000
The value is missing or too small
Send a number of at least 1000
400 cards service: estimated_monthly_limit must be a number of at least 1
The value is missing or 0
Send 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 account
Send 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 ready
Wait until it is active
400 cards service: internal server error
You left out account_id or sent a number as a string, or the application was refused
Send account_id, and send numbers as JSON numbers. If the error persists, contact support with the customer id
200 with messageFeature activation already exists with status: active
Cards are already activated for this customer
Find the card with GET /v1/cards?customer_id=…
400 card application is not yet approved!
In live, the application is still pending
Wait for approved, then retry with a new key
400 card application not found!
Activation never succeeded
Run step 2
400 CardLimit is required / NameOnCard is required
A field is missing. The message uses internal field names
Send it with a new key
403 feature_access_required
Card issuing is not switched on for your business
Request 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.