Card Management
The Card resource represents a card under an account.
Card Resource Types
There are multiple types of card resources on Mansar, each solves for specific use cases. The table below outlines the different types and use cases.
IndividualVirtualPrepaidCard
A virtual prepaid card belonging to an Individual customer, including sole proprietors. The details of the card holder (name, email, phone number etc.) will be the individual customer's details.
BusinessVirtualPrepaidCard
A virtual prepaid card belonging to a Business customer. The cardholder may be any person associated with the business. The details of the card holder (name, email, phone number etc.) will be provided as part of the card creation request. In order to create the customer token that is needed to reveal the card information, the card holder must be the business contact or an (authorized user)[/api/customers/#authorized-users].
Card Statuses
Cards have a Status Property, which represent their current status and determines what actions can or can't be completed using the card.
Inactive
The Card has not been activated by the Customer
Cards can be activated using the Activate card or by calling a the toll-free number printed on the card. Virtual cards do not require activation.
Active
The Card has been activated and can be used regularly
Stolen
The Card has been reported stolen by the Customer
A stolen card cannot be reopened.
Lost
The Card has been reported lost by the customer
A lost card cannot be reopened.
Frozen
The Card has been frozen
ClosedByCustomer
The Card has been closed by the Customer
A closed card cannot be reopened.
SuspectedFraud
The Card has been flagged due to fraud suspicion
Cards are defined as "SuspectedFraud" by the card network (e.g. Visa). The network will reach out to the client to confirm recent transactions that were marked as potentially fraudulent and reactivate the card if the transactions are confirmed as not fraudulent. If the transactions are marked as fraudulent or if the client does not respond to the card network, the card will remain in SuspectedFraud status and cannot be used.
Cards are excluded from automatic re-reissue if one of these conditions applies:
The status is not active (i.e., stolen, lost, frozen, closed by customer, suspected fraud)
The card has not been activated by the customer (i.e., inactive)
There is no card activity in the last 6 months - this includes all card-related transactions
The new cards are issued with 4-year validity. Virtual cards are issued ready to use instantly. New physical cards require to be activated by the customer before the first use. Activation of the new card blocks the old cards from being used further.
Create Individual Virtual Prepaid Card
Creates a prepaid card for an individual. You must link the card to an account using the account field under relationships object. The linked account must belong to an individual customer (and not a business). The card creation request supports Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.
Verb
POST
Url
https://api.s.usemansar.xyz/cards
Required Scope
cards-write
Data Type
individualVirtualPrepaidCard
Timeout (Seconds)
120
Attributes
idempotencyKey
string
Optional.
tags
object
Optional.
limits
object
Optional.
expiryDate
string
Optional. Expiration date of the card in one of the formats MM/yy or yyyy-MM or yy-MM (e.g. "03/27"). Must be between 3 to 5 years. Default is 4 years.
Relationships
account
JSON:API Relationship
Link to the account the card belongs to. Holder of the account must be an individual.
customer
JSON:API Relationship
Optional, Link to the customer the card belongs to. Mandatory if the account has more than one customer. Holder of the account must be an individual.
Example Request:
Response
Response is a JSON:API document.
201 Created
data
IndividualVirtualPrepaidCard
The target resource after the operation was completed.
Example Response:
Create Business Virtual Prepaid Card
Creates a prepaid card for a business. You must link the card to an account using the account field under relationships object. The linked account must belong to a business customer. The card creation request supports Idempotency, ensuring that performing multiple identical requests will have the same effect as performing a single request.
Verb
POST
Url
https://api.s.usemansar.xyz/cards
Required Scope
cards-write
Data Type
businessVirtualPrepaidCard
Timeout (Seconds)
120
Attributes
fullName
FullName
Full name of the card holder.
dateOfBirth
RFC3339 Date string
Date of birth of the card holder (e.g. "2001-08-15").
address
Address
Address of the card holder.
phone
Phone
Phone of the card holder.
string
Email address of the card holder.
idempotencyKey
string
Optional.
tags
object
Optional.
limits
object
Optional.
expiryDate
string
Optional. Expiration date of the card in one of the formats MM/yy or yyyy-MM or yy-MM (e.g. "03/27"). Must be between 3 to 5 years. Default is 4 years.
passport
string
Optional. Passport number of the individual.
nationality
ISO31661-Alpha2 string
Required if a passport is used as the main ID. Two letters representing the individual nationality. (e.g. "CM").
Relationships
account
JSON:API Relationship
The account the card belongs to. Holder of the account must be a business.
Example Request:
Response
Response is a JSON:API document.
201 Created
data
BusinessVirtualPrepaidCard
The target resource after the operation was completed.
Example Response:
Displaying Sensitive Card Data
In order to display sensitive card data (card number and CVV2) to a customer, without any of it passing through your systems (which would subject you to PCI compliance requirements), Mansar utilizes a 3rd party service called Very Good Security or VGS for short.
VGS provides a JavaScript library (as well as iOS and Android SDKs) called VGS Show which allows easy integration with your UI components. VGS Show offloads the PCI compliance burden by enabling the encrypted transmission of sensitive card data from VGS directly to your cardholder.
The VGS Show JavaScript library enables you to securely display sensitive data in a webpage while safely isolating that sensitive data from your systems. VGS Show JavaScript library injects a secure iframe into your HTML. VGS hosts both the iframe, and the data on secure, compliant servers.
Integration steps
Import the VGS Show library:
<script type="text/javascript" src="https://js.verygoodvault.com/vgs-show/1.5/ACh8JJTM42LYxwe2wfGQxwj5.js"></script>
Initialize the component:
const show = VGSShow.create('tntazhyknp1');
Vault ID:
Sandbox
tntazhyknp1
Live
tnt8w6nrmbu
Provide a valid customer token:
const customerToken = "<CUSTOMER TOKEN>"
CAUTION
The customer token is required to include the cards-sensitive scope.
Mansar recommends avoiding adding additional scopes to the token.
Provide a valid card identifier
path: '/cards/<CARD ID>/secure-data/cvv2'
Note: Timeout for this API is 120 seconds
Example of creating a Customer Token for sensitive data:
Additional resources
Example of displaying card number and CVV2:
Activate Card
In order to activate a new card, without any sensitive data passing through your systems (which requires PCI compliance), Mansar utilizes a 3rd party service called Very Good Security or VGS for short.
VGS provides a JavaScript library (as well as iOS and Android SDKs) called VGS Collect which allows easy integration with your UI components. VGS Collect offloads the PCI compliance burden by enabling the encrypted transmission of sensitive card data from VGS directly to the card processor.
VGS Collect JavaScript library injects a secure iframe into your HTML. VGS hosts both the iframe, and the data on secure, compliant servers.
Integration steps
Import the VGS Collect library:
<script type="text/javascript" src="https://js.verygoodvault.com/vgs-collect/2.12.0/vgs-collect.js"></script>
Initialize the component:
const form = VGSCollect.create("tntazhyknp1", "sandbox", function(state) {});
Parameters:
Sandbox
tntazhyknp1
sandbox
Live
tnt8w6nrmbu
live
Provide a valid customer token:
const customerToken = "<CUSTOMER TOKEN>"
.
Provide a valid card identifier:
path: '/cards/<CARD ID>/activate'
Required field names and formats:
CVV2 field name should be
data.attributes.cvv2.Expiration Date field name should be
data.attributes.expirationDate.Expiration Date field format should be
YYYY-MM.Note: Timeout for this API is 120 seconds
Testing on Sandbox:
To simulate the scenario where the customer provides invalid data - send
1970-01as the expiration date.Sending anything other than that will result in a successful card activation.
Example of creating a Customer Token for Activate Card:
Example of Activate Card:
Report Stolen
Report card as stolen.
Verb
POST
Url
https://api.s.usemansar.xyz/cards/:cardId/report-stolen
Required Scope
cards-write
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
Report Lost
Report card as lost.
Verb
POST
Url
https://api.s.usemansar.xyz/cards/:cardId/report-lost
Required Scope
cards-write
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
Close Card
Close a card.
Verb
POST
Url
https://api.s.usemansar.xyz/cards/:cardId/close
Required Scope
cards-write
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
Freeze Card
Freeze a card (temporarily block a card).
Verb
POST
Url
https://api.s.usemansar.xyz/cards/:cardId/freeze
Required Scope
cards-write
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
Unfreeze Card
Unfreeze a frozen card.
Verb
POST
Url
https://api.s.usemansar.xyz/cards/:cardId/unfreeze
Required Scope
cards-write
Timeout (Seconds)
5
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
Get by Id
Get a card resource by id.
Verb
GET
Url
https://api.s.usemansar.xyz/cards/{id}
Required Scope
cards
Timeout (Seconds)
5
Query Parameters
include
string
(empty)
Optional. A comma-separated list of related resources to include in the response. Related resources include: customer, account.
Response
Response is a JSON:API document.
200 OK
data
IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Card resource, distinguished by the type field.
included
Array of CheckingAccount or DepositAccount or Customer
Array of resources requested by the include query parameter.
List
List cards. Filtering and paging can be applied.
Verb
GET
Url
https://api.s.usemansar.xyz/cards
Required Scope
cards
Timeout (Seconds)
5
Query Parameters
page[limit]
integer
100
Optional. Maximum number of resources that will be returned. Maximum is 1000 resources.
page[offset]
integer
0
Optional. Number of resources to skip.
filter[accountId]
string
(empty)
Optional. Filters the results by the specified account id.
filter[customerId]
string
(empty)
Optional. Filters the results by the specified customer id.
filter[tags]
Tags (JSON)
(empty)
Optional. Filter Cards by Tags.
filter[status][]
string
(empty)
Optional. Filter cards by Card Status. Usage example: filter[status][0]=Stolen&filter[status][1]=Lost
include
string
(empty)
Optional. A comma-separated list of related resources to include in the response. Related resources include: customer, account.
sort
string
sort=createdAt
Optional. sort=createdAt for ascending order or sort=-createdAt (leading minus sign) for descending order.
Response
Response is a JSON:API document.
200 OK
data
Array of IndividualVirtualPrepaidCard or BusinessVirtualPrepaidCard
Array of card resources, distinguished by the type field.
included
Array of Checking Account, DepositAccount or Customer
Array of resources requested by the include query parameter.
Example Response:
Update
Update a virtual card.
Verb
PATCH
Url
https://api.s.usemansar.xyz/cards/:cardId
Required Scope
cards-write
Timeout (Seconds)
5
Update Individual Virtual Prepaid Card
design
string
Optional. Card design name. To modify or add specify the key and value.
tags
object
Optional.
limits
object
Optional.
Update Business Virtual Prepaid Card
string
Optional. Email address of the card holder. To modify or add specify the new email address.
design
string
Optional. Card design name. To modify or add specify the key and value.
tags
object
Optional.
limits
object
Optional.
Update Individual Virtual Debit Card
tags
object
Optional.
limits
object
Optional.
Update Business Virtual Debit Card
address
Address
Optional. Address of the card holder. To modify or add specify the new address.
phone
Phone
Optional. Phone of the card holder. To modify or add specify the new phone number.
string
Optional. Email address of the card holder. To modify or add specify the new email address.
tags
object
Optional.
limits
object
Optional.
Response
Response is a JSON:API document.
200 OK
data
BusinessVirtualPrepaidCard Or IndividualVirtualPrepaidCard resource
The target resource after the operation was completed.
Example of update business virtual prepaid card:
Limits
Verb
GET
Url
https://api.s.usemansar.xyz/cards/:cardId/limits
Timeout (Seconds)
5
Card purchases and withdrawals can be subjected to daily and monthly amount limits. Limits are optional (by default there are no card-specific limits), and can be set when the card is created or updated. The limits are enforced by Mansar, and once the limit is reached, the transaction will be rejected.
The daily limits reset at 12:00 a.m. on the timezone of relevant bank. The monthly limits are reset at the same time on the first of each month.
Last updated