Create virtual card
There are two types of virtual cards: Permanent and One-Time-Use.
TO create a virtual card, you can use the following endpoint:
POST https://[base_url]/v1/virtual-cards
Body parameters
| PARAMETER | TYPE | REQ. | DESCRIPTION |
|---|---|---|---|
| card_name | String | Yes | Name of the cardholder. |
| expiration | String | Yes | Desired expiration date for the card (max. one year). Must be in format YYYY-MM-DD. The state card will be changed to "cancelled." |
| activation | String | Yes | Desired activation date for the card. Must be in format YYYY-MM-DD. Due to security reasons, the card will be created in "frozen" state, then on the activation date, will be changed to "active" state. |
| organization_id | Integer | Yes | The card must be associated with an organization. Provide the organization ID. |
| one_time_use | Boolean | Yes | Identifies if the card is One-Time-Use. If true, the card will be cancelled once a payment is done. |
| destination.external_id | String | Yes | If the card is One-Time-Use, please provide the destination object's external ID. |
| destination.name | String | Yes | If the card is One-Time-Use, please provide the destination object's name. |
| destination.email | String | Yes | If the card is One-Time-Use, please provide the destination object's email where some data might be sent. |
| external_reference | String | Yes | External reference. This field will be used in the card's nickname. |
Body example
{
"card_name":"Jhon Doe",
"expiration": "2024-10-16",
"activation": "2024-10-15",
"organization_id": 10,
"one_time_use": false,
"destination": {
"external_id": 1,
"name": "Jhon Doe",
"email": "[email protected]"
},
"external_reference": "RESERVA36437"
}
Endpoint response
Status code: 200
{
"msg": "Tarjeta creada correctamente",
"data": {
"card_id": "car_02xyfe3",
"subaccount_id": "lacc_02xyIEE",
"one_time_use": false,
"nickname": "Tarjeta para Jhon Doe",
"last_four": "9884",
"expiration": "2024-10-16",
"activation": "2024-10-15",
"organization_id": 10,
"destination": {
"external_id": "1",
"name": "Jhon Doe",
"email": "[email protected]"
}
}
}
Status code: 400, 401, 403, 404
{
"code": "Status code",
"message":"Error description",
"detail": "Error details"
}