Manage virtual cards with the API

Learn how to retrieve, renew, send, and cancel single-use virtual cards with the Payabli API

View as MarkdownOpen in Claude
Applies to:Developers

A single-use virtual card is tied to a specific payout and can be used only once. This guide covers retrieving, renewing, sending, and canceling single-use virtual cards through the API. For how they compare to ghost cards, see Cards overview.

Create a virtual card

A single-use virtual card has no standalone create endpoint. You create one when you authorize a payout with vcard as the payment method, or when a vendor selects a virtual card as the payment method through a vendor link. The card is then tied to that payout.

To create a virtual card, send a POST request to /api/MoneyOut/authorize with paymentMethod.method set to vcard. See the API reference for full documentation.

POST
/api/MoneyOut/authorize
1curl -X POST https://api-sandbox.payabli.com/api/MoneyOut/authorize \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "entryPoint": "8cfec329267",
6 "paymentMethod": {
7 "method": "vcard"
8 },
9 "paymentDetails": {
10 "totalAmount": 47
11 },
12 "vendorData": {
13 "vendorNumber": "VEN-123"
14 },
15 "invoiceData": [
16 {
17 "billId": 54323
18 }
19 ],
20 "orderDescription": "Window Painting",
21 "autoCapture": true
22}'

The response returns the payout’s referenceId in responseData. The card’s own token appears in the payout’s payment-method details, as CardToken. You need that token to retrieve, renew, or cancel the card. To find it on an existing payout, see Audit payout transactions with the API.

Response
1{
2 "responseCode": 1,
3 "pageIdentifier": null,
4 "roomId": 0,
5 "isSuccess": true,
6 "responseText": "Success",
7 "responseData": {
8 "authCode": null,
9 "referenceId": "129-219",
10 "resultCode": 1,
11 "resultText": "Authorized",
12 "avsResponseText": null,
13 "cvvResponseText": null,
14 "customerId": 456,
15 "vendorId": 456,
16 "methodReferenceId": null
17 }
18}

Retrieve a virtual card

To get the details of a single virtual card in an entrypoint, send a GET request to /api/MoneyOut/vcard/{cardToken}. See the API reference for full documentation.

GET
/api/MoneyOut/vcard/:cardToken
1curl https://api-sandbox.payabli.com/api/MoneyOut/vcard/20230403315245421165 \
2 -H "Authorization: Bearer <token>"

The response returns the expiration date, current balance, usage counts, and the associated vendor. The card number and CVC are masked, so use this endpoint for card status and balance rather than to retrieve usable card credentials.

Response
1{
2 "vcardSent": false,
3 "cardToken": "20231206142225226104",
4 "cardNumber": "553232XXXXXX3179",
5 "cvc": "XXX",
6 "expirationDate": "2025-05-01",
7 "status": null,
8 "amount": 120,
9 "currentBalance": 120,
10 "expenseLimit": 20,
11 "expenseLimitPeriod": null,
12 "maxNumberOfUses": 1,
13 "currentNumberOfUses": 0,
14 "exactAmount": true,
15 "mcc": null,
16 "tcc": null,
17 "misc1": null,
18 "misc2": null,
19 "dateCreated": "2023-12-06T20:25:31.077",
20 "dateModified": "2023-12-06T00:00:00",
21 "associatedVendor": {
22 "VendorNumber": "VEN-123",
23 "Name1": "Smith Industries",
24 "Name2": "John Smith",
25 "EIN": "12-3456789",
26 "Phone": "555-123-4567",
27 "Email": "contact@smithindustries.com",
28 "RemitEmail": null,
29 "Address1": "1234 Main Street",
30 "Address2": "Suite 200",
31 "City": "New York",
32 "State": "NY",
33 "Zip": "10001",
34 "Country": "USA",
35 "Mcc": "5411",
36 "LocationCode": null,
37 "Contacts": [
38 {
39 "ContactName": "Herman Martinez",
40 "ContactEmail": "herman@hermanscoatings.com",
41 "ContactTitle": "Owner",
42 "ContactPhone": "3055550000"
43 }
44 ],
45 "BillingData": {
46 "id": 123,
47 "accountId": null,
48 "nickname": "Checking Account",
49 "bankName": "Chase Bank",
50 "routingAccount": "021000021",
51 "accountNumber": "3XXXXXX8888",
52 "typeAccount": "Checking",
53 "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
54 "bankAccountHolderType": "Business",
55 "bankAccountFunction": 0,
56 "verified": true,
57 "status": 1,
58 "services": [],
59 "default": true
60 },
61 "PaymentMethod": "vcard",
62 "VendorStatus": 1,
63 "VendorId": 456,
64 "EnrollmentStatus": null,
65 "Summary": {
66 "ActiveBills": 1,
67 "PendingBills": 1,
68 "InTransitBills": 0,
69 "PaidBills": 0,
70 "OverdueBills": 1,
71 "ApprovedBills": 1,
72 "DisapprovedBills": 1,
73 "TotalBills": 1,
74 "ActiveBillsAmount": 1.1,
75 "PendingBillsAmount": 100,
76 "InTransitBillsAmount": 0,
77 "PaidBillsAmount": 0,
78 "OverdueBillsAmount": 100,
79 "ApprovedBillsAmount": 1.1,
80 "DisapprovedBillsAmount": 1.1,
81 "TotalBillsAmount": 100
82 },
83 "PaypointLegalname": "Athlete Factory LLC",
84 "PaypointDbaname": "Athlete Factory LLC",
85 "PaypointEntryname": "PaypointEntryname",
86 "ParentOrgName": "HOA Manager Pro",
87 "ParentOrgId": 1232,
88 "CreatedDate": "2022-07-01T15:00:01Z",
89 "LastUpdated": "2022-07-01T15:00:01Z",
90 "remitAddress1": "123 Walnut Street",
91 "remitAddress2": "Suite 900",
92 "remitCity": "Miami",
93 "remitState": "FL",
94 "remitZip": "31113",
95 "remitCountry": "US",
96 "payeeName1": null,
97 "payeeName2": null,
98 "customField1": "customField1",
99 "customField2": "customField2",
100 "customerVendorAccount": null,
101 "InternalReferenceId": 27,
102 "additionalData": null,
103 "externalPaypointID": null,
104 "StoredMethods": null
105 },
106 "associatedCustomer": null,
107 "ParentOrgName": "HOA Manager Pro",
108 "PaypointDbaname": "Athlete Factory LLC",
109 "PaypointLegalname": "Athlete Factory LLC",
110 "PaypointEntryname": "47acde49",
111 "externalPaypointID": null,
112 "paypointId": 3040
113}

Renew a virtual card

To extend the expiration date of an expired or expiring virtual card, send a PUT request to /api/MoneyOutCard/vcard/{cardToken}/renew. See the API reference for full documentation.

The card must not have been used yet. Pass the new expirationDate in MM-YYYY or MM/YYYY format, no more than 2 years and 363 days in the future. The card expires on the last day of the month you specify.

PUT
/api/MoneyOutCard/vcard/:cardToken/renew
1curl -X PUT https://api-sandbox.payabli.com/api/MoneyOutCard/vcard/20231206142225226104/renew \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "expirationDate": "12-2027"
6}'

On success, referenceId holds the renewed card’s token. The card processor may issue a new token, so store the returned value.

Response
1{
2 "responseText": "Success",
3 "isSuccess": true,
4 "responseData": {
5 "authCode": null,
6 "referenceId": "20231206142225227890",
7 "resultCode": 1,
8 "resultText": "Virtual card renewed",
9 "avsResponseText": null,
10 "cvvResponseText": null,
11 "customerId": null,
12 "vendorId": null,
13 "methodReferenceId": null
14 }
15}

To email a virtual card link to the vendor associated with a payout, send a POST request to /api/MoneyOut/vcard/send-card-link. See the API reference for full documentation.

Pass the transId of the payout. Payabli sends the link to the vendor’s email on file.

POST
/api/MoneyOut/vcard/send-card-link
1curl -X POST https://api-sandbox.payabli.com/api/MoneyOut/vcard/send-card-link \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "transId": "01K33Z6YQZ6GD5QVKZ856MJBSC"
6}'

A successful response returns success: true and the secure link sent to the vendor.

Response
1{
2 "success": true,
3 "message": "Email sent.",
4 "link": "https://app.payabli.com/vendor/virtual-card-link/code"
5}

Cancel a virtual card

Virtual cards have no hard delete. To cancel a virtual card, send a PATCH request to /api/MoneyOutCard/card/{entry} with the card’s status set to Cancelled. See the API reference for full documentation.

Pass the cardToken and the new status. Valid statuses are Active, Inactive, Cancelled, and Expired. Cancelled is terminal — a canceled card can’t be reactivated.

PATCH
/api/MoneyOutCard/card/:entry
1curl -X PATCH https://api-sandbox.payabli.com/api/MoneyOutCard/card/8cfec329267 \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "cardToken": "20231206142225226104",
6 "status": "Cancelled"
7}'

A successful response confirms the status change.

Response
1{
2 "responseText": "Success",
3 "isSuccess": true
4}

See these related resources to help you get the most out of Payabli.

  • Cards overview - Understand how single-use virtual cards and ghost cards differ