Virtual Cards
This section details the mutations and queries available for managing virtual cards.
To leverage the full power of Virtual Cards, you'll need a User Access Token with specific permissions. Follow these steps:
1. Generate Your User Access Token:
Before making any Virtual Card API calls, you must obtain a temporary User Access Token. This token authenticates your requests and grants the necessary permissions (scopes).
You'll need your API Key, User ID, Account ID, and the following scopes for Virtual Card operations:
CREATE_VIRTUALCARD
REVEAL_VIRTUALCARD
EDIT_VIRTUALCARD
Here's an example cURL command to generate a token with these required scopes:
curl -X POST https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
-H "Authorization: Basic <YOUR_SANDBOX_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation generateUserAccessToken($userId: UUID!, $accountId: UUID!, $scopes: [ScopeType!]!, $seatId: UUID) { generateUserAccessToken(userId: $userId, accountId: $accountId, scopes: $scopes, seatId: $seatId) { token scopes } }",
"variables": {
"userId": "<YOUR_SANDBOX_USER_ID>",
"accountId": "<YOUR_ACCOUNT_ID>",
"scopes": [
"CREATE_VIRTUALCARD",
"REVEAL_VIRTUALCARD",
"EDIT_VIRTUALCARD"
]
}
}'
Once executed, copy the token
value from the response. You will use this in the Authorization: Bearer <YOUR_USER_ACCESS_TOKEN>
header for all subsequent authenticated requests.
2.Discover Virtual Card Offers:
Start by using the getVirtualCardOffers
query to explore all available virtual card types and programs.
3.Select Your Card & Get Offer ID:
Choose the offer that best fits your needs and securely obtain its unique offerId
.
4.Create Your Virtual Card:
Pass the selected offerId
to the createVirtualCard
mutation to instantly generate your new virtual card.
5.Manage with Ease:
Once created, you have full control! Utilize mutations to:
- Edit card settings (e.g., spend limits, nickname).
- Lock your card to prevent unauthorized use.
- Reveal sensitive card details when you need them.
See our code examples:
Want to learn more? Contact us at [email protected]
Speak with our experts for more info or to request a demo.
Updated 5 days ago