This guide details the steps to add Immersve card issuing capabilities into applications that have custody of user funds. It lists the API calls required to set up a partner, onboard users, and create and test a card, with card spending pre-funded through deposits to an on-chain contract.
If you do not have custody over your users' funds then the Web3 Wallet Card Issuing Integration Guide will provide a better starting point for your integration.
Before You Get Started
Verify Your Asset is Supported
Before you begin integrating ensure your chain and token combination is supported. See Supported Chains and Supported Tokens.
Select Funding Protocol
See the Funding Protocols guide to find which protocol would best suit your use case.
Select KYC Mode
Partner Conducted KYC is the recommended KYC mode for custodial apps that have already verified their users. If users have not already been verified then Immersve Conducted KYC can be used.
Provision Application Resources
Set Up Your Partner Account
Contact support to get your: Partner Account ID, Client Application, API Key(s) and Card Program ID. You will initially have credentials to integrate with the Immersve test environment. When you are ready to test a live integration you will also receive live credentials.
Register a Funding Channel
You will need a funding channel per token and chain. See: Creating a Funding Channel.
Setup Environment
Install Dependencies
This guide uses bash, curl and jq for example API interactions.
Configure Variables
The following variables are referenced from the example bash scripts throughout this guide.
Immersve Environments
The Immersve test environment allows you to interact with all Immersve APIs while utilizing testnet assets. Test payments are initiated using the Payment Simulator. Note that the XPay capability is not available in the test environment.
Environment | API Base URL |
---|---|
Test | https://test.immersve.com |
Live | https://api.immersve.com |
Resource identifiers are not shared between the live and test environments. Your Partner Account, Client Application, API Keys and Card Program will all be different in the live environment.
Per Cardholder Setup
Select Region
Prompting the user to select their region helps them to avoid the card onboarding journey if their region is not yet available. Call the Get Supported Regions endpoint to get the current list of available regions for your application.
See: Supported Regions.
Create a Cardholder Account
Provision each cardholder with an account and save their ID. In the custodial case it is assumed that you have gained permission to act on the cardholders behalf. All cardholder resources on our platform will be fully owned by your app. Each request on a cardholder resource must specify the cardholder by referencing the cardholder ID in the headers as specified in the Authentication Guide.
Prove Ownership of Web3 Address
In order to prove ownership of the respective EOA (Externally owned account), sign a challenge message using the EOA's private key. Use an address that you control and would like to use to fund a user's card(s). To learn more about web3 message signing, checkout Etherscan, Eth Signer and Ethers.js.
Register Cardholder Funding Source
Creating a Funding Source for a cardholder enables Immersve to attribute transactions from a funding address to individual cardholders. The "signature" parameter is the signature of the signed message from the previous step. For more context and information on card funding and executing deposits and withdrawals see the Card Funding guide.
Get KYC and Contact Details Prerequisites
The spending prerequisites endpoint can be used to check whether the KYC and contact details requirements for a cardholder have been satisfied.
Note that "spendableAmount" is required. If the user has not yet been prompted for the amount to load into their Immersve card then any non-zero placeholder amount can be used.
Supply KYC Details
KYC requirements need to be completed before a cardholder obtains a card. If your application has already captured user KYC details then you may be able to use Partner Conducted KYC. Otherwise, Immersve Conducted KYC should be used.
Request a Card
The Create Card, Get Card, and Get Card Token endpoints are all involved in requesting a card. See Issue a Virtual Card for further information.
Create a Card
Post the funding source ID and your provided card program ID to the card orders endpoint and record the returned card ID.
Get Card Details
Call Get Card Details to see card status and ensure it is active.
Get Sensitive Card Details
Card sensitive details are obtained by generating a unique time-limited token. The response contains a callback URL which can be used to obtain the sensitive card details. See Fetching Secure Card Information for more details.
Deposit Funds
Before spending with a card, funds must be deposited to a funding source connected to the card. Use the Get Spending Prerequisites endpoint to get the correct Smart Contract write transaction for the specified amount, chain, and token.
For more information on executing deposits and withdrawals see the Card Funding guide.
Note: "spendableAmount" uses minor units. For example, "100" USD minor units means $1.00.
Check Card Balance
Verify that the balance is reflected on the Funding Source.
Perform a Test Card Payment
Perform a card payment using the Immersve Payment Simulator. Call the simulator endpoint with the sensitive card details.
Note: "transactionAmount" uses USD minor units. For example, "10" means $0.10.