> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Manage virtual cards with the API

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

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](/guides/pay-out-cards-overview).

## Create a virtual card

A single-use virtual card has no standalone create endpoint. You create one when you [authorize a payout](/guides/pay-out-developer-payouts-manage) 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](/developers/api-reference/moneyout/authorize-a-transaction-for-payout) for full documentation.

### Request

POST [https://api-sandbox.payabli.com/api/MoneyOut/authorize](https://api-sandbox.payabli.com/api/MoneyOut/authorize)

```curl AuthorizeVCardPayout
curl -X POST https://api-sandbox.payabli.com/api/MoneyOut/authorize \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "entryPoint": "8cfec329267",
  "paymentMethod": {
    "method": "vcard"
  },
  "paymentDetails": {
    "totalAmount": 47
  },
  "vendorData": {
    "vendorNumber": "VEN-123"
  },
  "orderDescription": "Window Painting",
  "invoiceData": [
    {
      "billId": 54323
    }
  ],
  "autoCapture": true
}'
```

```typescript AuthorizeVCardPayout
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.moneyOut.authorizeOut({
        entryPoint: "8cfec329267",
        orderDescription: "Window Painting",
        paymentMethod: {
            method: "vcard",
        },
        paymentDetails: {
            totalAmount: 47,
        },
        vendorData: {
            vendorNumber: "VEN-123",
        },
        invoiceData: [
            {
                billId: 54323,
            },
        ],
        autoCapture: true,
    });
}
main();

```

```python AuthorizeVCardPayout
from payabli import payabli, AuthorizePaymentMethod, RequestOutAuthorizePaymentDetails, RequestOutAuthorizeVendorData, RequestOutAuthorizeInvoiceData

client = payabli()

client.money_out.authorize_out(
    entry_point="8cfec329267",
    order_description="Window Painting",
    payment_method=AuthorizePaymentMethod(
        method="vcard",
    ),
    payment_details=RequestOutAuthorizePaymentDetails(
        total_amount=47,
    ),
    vendor_data=RequestOutAuthorizeVendorData(
        vendor_number="VEN-123",
    ),
    invoice_data=[
        RequestOutAuthorizeInvoiceData(
            bill_id=54323,
        )
    ],
    auto_capture=True,
)

```

```java AuthorizeVCardPayout
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.moneyout.requests.RequestOutAuthorize;
import io.github.payabli.api.types.AuthorizePaymentMethod;
import io.github.payabli.api.types.RequestOutAuthorizeInvoiceData;
import io.github.payabli.api.types.RequestOutAuthorizePaymentDetails;
import io.github.payabli.api.types.RequestOutAuthorizeVendorData;
import java.util.Arrays;
import java.util.Optional;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient
            .builder()
            .build();

        client.moneyOut().authorizeOut(
            RequestOutAuthorize
                .builder()
                .entryPoint("8cfec329267")
                .paymentMethod(
                    AuthorizePaymentMethod
                        .builder()
                        .method("vcard")
                        .build()
                )
                .paymentDetails(
                    RequestOutAuthorizePaymentDetails
                        .builder()
                        .totalAmount(47.0)
                        .build()
                )
                .vendorData(
                    RequestOutAuthorizeVendorData
                        .builder()
                        .vendorNumber("VEN-123")
                        .build()
                )
                .orderDescription("Window Painting")
                .invoiceData(
                    Optional.of(
                        Arrays.asList(
                            RequestOutAuthorizeInvoiceData
                                .builder()
                                .billId(54323L)
                                .build()
                        )
                    )
                )
                .autoCapture(true)
                .build()
        );
    }
}
```

```ruby AuthorizeVCardPayout
require "payabli"

client = Payabli::Client.new

client.money_out.authorize_out(
  entry_point: "8cfec329267",
  order_description: "Window Painting",
  payment_method: {
    method_: "vcard"
  },
  payment_details: {
    total_amount: 47
  },
  vendor_data: {
    vendor_number: "VEN-123"
  },
  invoice_data: [{
    bill_id: 54323
  }],
  auto_capture: true
)

```

```csharp AuthorizeVCardPayout
using PayabliApi;
using System.Threading.Tasks;
using System.Collections.Generic;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient();

        await client.MoneyOut.AuthorizeOutAsync(
            new RequestOutAuthorize {
                EntryPoint = "8cfec329267",
                OrderDescription = "Window Painting",
                PaymentMethod = new AuthorizePaymentMethod {
                    Method = "vcard"
                },
                PaymentDetails = new RequestOutAuthorizePaymentDetails {
                    TotalAmount = 47
                },
                VendorData = new RequestOutAuthorizeVendorData {
                    VendorNumber = "VEN-123"
                },
                InvoiceData = new List<RequestOutAuthorizeInvoiceData>(){
                    new RequestOutAuthorizeInvoiceData {
                        BillId = 54323L
                    },
                }
                ,
                AutoCapture = true
            }
        );
    }

}

```

```go AuthorizeVCardPayout
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    request := &payabli.RequestOutAuthorize{
        EntryPoint: "8cfec329267",
        PaymentMethod: &payabli.AuthorizePaymentMethod{
            Method: "vcard",
        },
        PaymentDetails: &payabli.RequestOutAuthorizePaymentDetails{
            TotalAmount: payabli.Float64(
                47,
            ),
        },
        VendorData: &payabli.RequestOutAuthorizeVendorData{
            VendorNumber: payabli.String(
                "VEN-123",
            ),
        },
        OrderDescription: payabli.String(
            "Window Painting",
        ),
        InvoiceData: []*payabli.RequestOutAuthorizeInvoiceData{
            &payabli.RequestOutAuthorizeInvoiceData{
                BillId: int64(54323),
            },
        },
        AutoCapture: payabli.Bool(
            true,
        ),
    }
    client.MoneyOut.AuthorizeOut(
        context.TODO(),
        request,
    )
}

```

```php AuthorizeVCardPayout
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\MoneyOut\Requests\RequestOutAuthorize;
use Payabli\Types\AuthorizePaymentMethod;
use Payabli\Types\RequestOutAuthorizePaymentDetails;
use Payabli\Types\RequestOutAuthorizeVendorData;
use Payabli\Types\RequestOutAuthorizeInvoiceData;

$client = new PayabliClient();
$client->moneyOut->authorizeOut(
    new RequestOutAuthorize([
        'entryPoint' => '8cfec329267',
        'orderDescription' => 'Window Painting',
        'paymentMethod' => new AuthorizePaymentMethod([
            'method' => 'vcard',
        ]),
        'paymentDetails' => new RequestOutAuthorizePaymentDetails([
            'totalAmount' => 47,
        ]),
        'vendorData' => new RequestOutAuthorizeVendorData([
            'vendorNumber' => 'VEN-123',
        ]),
        'invoiceData' => [
            new RequestOutAuthorizeInvoiceData([
                'billId' => 54323,
            ]),
        ],
        'autoCapture' => true,
    ]),
);

```

```swift AuthorizeVCardPayout
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "entryPoint": "8cfec329267",
  "paymentMethod": ["method": "vcard"],
  "paymentDetails": ["totalAmount": 47],
  "vendorData": ["vendorNumber": "VEN-123"],
  "orderDescription": "Window Painting",
  "invoiceData": [["billId": 54323]],
  "autoCapture": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/authorize")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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](/guides/pay-out-developer-payouts-audit).

### Response (200)

```json
{
  "responseCode": 1,
  "pageIdentifier": null,
  "roomId": 0,
  "isSuccess": true,
  "responseText": "Success",
  "responseData": {
    "authCode": null,
    "referenceId": "129-219",
    "resultCode": 1,
    "resultText": "Authorized",
    "avsResponseText": null,
    "cvvResponseText": null,
    "customerId": 456,
    "vendorId": 456,
    "methodReferenceId": null
  }
}
```

## 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](/developers/api-reference/cards/get-vcard) for full documentation.

### Request

GET [https://api-sandbox.payabli.com/api/MoneyOut/vcard/\{cardToken}](https://api-sandbox.payabli.com/api/MoneyOut/vcard/\{cardToken})

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

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.moneyOut.vCardGet("20230403315245421165");
}
main();

```

```python
from payabli import payabli

client = payabli()

client.money_out.v_card_get(
    card_token="20230403315245421165",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient
            .builder()
            .build();

        client.moneyOut().vCardGet("20230403315245421165");
    }
}
```

```ruby
require "payabli"

client = Payabli::Client.new

client.money_out.v_card_get(card_token: "20230403315245421165")

```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient();

        await client.MoneyOut.VCardGetAsync(
            "20230403315245421165"
        );
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    client.MoneyOut.VCardGet(
        context.TODO(),
        "20230403315245421165",
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient();
$client->moneyOut->vCardGet(
    '20230403315245421165',
);

```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/vcard/20230403315245421165")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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 (200)

```json
{
  "vcardSent": false,
  "cardToken": "20231206142225226104",
  "cardNumber": "553232XXXXXX3179",
  "cvc": "XXX",
  "expirationDate": "2025-05-01",
  "status": null,
  "amount": 120,
  "currentBalance": 120,
  "expenseLimit": 20,
  "expenseLimitPeriod": null,
  "maxNumberOfUses": 1,
  "currentNumberOfUses": 0,
  "exactAmount": true,
  "mcc": null,
  "tcc": null,
  "misc1": null,
  "misc2": null,
  "dateCreated": "2023-12-06T20:25:31.077",
  "dateModified": "2023-12-06T00:00:00",
  "associatedVendor": {
    "VendorNumber": "VEN-123",
    "Name1": "Smith Industries",
    "Name2": "John Smith",
    "EIN": "12-3456789",
    "Phone": "555-123-4567",
    "Email": "contact@smithindustries.com",
    "RemitEmail": null,
    "Address1": "1234 Main Street",
    "Address2": "Suite 200",
    "City": "New York",
    "State": "NY",
    "Zip": "10001",
    "Country": "USA",
    "Mcc": "5411",
    "LocationCode": null,
    "Contacts": [
      {
        "ContactName": "Herman Martinez",
        "ContactEmail": "herman@hermanscoatings.com",
        "ContactTitle": "Owner",
        "ContactPhone": "3055550000"
      }
    ],
    "BillingData": {
      "id": 123,
      "accountId": null,
      "nickname": "Checking Account",
      "bankName": "Chase Bank",
      "routingAccount": "021000021",
      "accountNumber": "3XXXXXX8888",
      "typeAccount": "Checking",
      "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
      "bankAccountHolderType": "Business",
      "bankAccountFunction": 0,
      "verified": true,
      "status": 1,
      "services": [],
      "default": true
    },
    "PaymentMethod": "vcard",
    "VendorStatus": 1,
    "VendorId": 456,
    "EnrollmentStatus": null,
    "Summary": {
      "ActiveBills": 1,
      "PendingBills": 1,
      "InTransitBills": 0,
      "PaidBills": 0,
      "OverdueBills": 1,
      "ApprovedBills": 1,
      "DisapprovedBills": 1,
      "TotalBills": 1,
      "ActiveBillsAmount": 1.1,
      "PendingBillsAmount": 100,
      "InTransitBillsAmount": 0,
      "PaidBillsAmount": 0,
      "OverdueBillsAmount": 100,
      "ApprovedBillsAmount": 1.1,
      "DisapprovedBillsAmount": 1.1,
      "TotalBillsAmount": 100
    },
    "PaypointLegalname": "Athlete Factory LLC",
    "PaypointDbaname": "Athlete Factory LLC",
    "PaypointEntryname": "PaypointEntryname",
    "ParentOrgName": "HOA Manager Pro",
    "ParentOrgId": 1232,
    "CreatedDate": "2022-07-01T15:00:01Z",
    "LastUpdated": "2022-07-01T15:00:01Z",
    "remitAddress1": "123 Walnut Street",
    "remitAddress2": "Suite 900",
    "remitCity": "Miami",
    "remitState": "FL",
    "remitZip": "31113",
    "remitCountry": "US",
    "payeeName1": null,
    "payeeName2": null,
    "customField1": "customField1",
    "customField2": "customField2",
    "customerVendorAccount": null,
    "InternalReferenceId": 27,
    "additionalData": null,
    "externalPaypointID": null,
    "StoredMethods": null
  },
  "associatedCustomer": null,
  "ParentOrgName": "HOA Manager Pro",
  "PaypointDbaname": "Athlete Factory LLC",
  "PaypointLegalname": "Athlete Factory LLC",
  "PaypointEntryname": "47acde49",
  "externalPaypointID": null,
  "paypointId": 3040
}
```

## 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](/developers/api-reference/cards/renew-vcard) 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.

### Request

PUT [https://api-sandbox.payabli.com/api/MoneyOutCard/vcard/\{cardToken}/renew](https://api-sandbox.payabli.com/api/MoneyOutCard/vcard/\{cardToken}/renew)

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

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.moneyOut.renewVCard("20231206142225226104", {
        expirationDate: "12-2027",
    });
}
main();

```

```python
from payabli import payabli

client = payabli()

client.money_out.renew_v_card(
    card_token="20231206142225226104",
    expiration_date="12-2027",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.moneyout.requests.RenewVCardRequest;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient
            .builder()
            .build();

        client.moneyOut().renewVCard(
            "20231206142225226104",
            RenewVCardRequest
                .builder()
                .expirationDate("12-2027")
                .build()
        );
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient();

        await client.MoneyOut.RenewVCardAsync(
            cardToken: "20231206142225226104",
            request: new RenewVCardRequest {
                ExpirationDate = "12-2027"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    request := &payabli.RenewVCardRequest{
        ExpirationDate: "12-2027",
    }
    client.MoneyOut.RenewVCard(
        context.TODO(),
        "20231206142225226104",
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\MoneyOut\Requests\RenewVCardRequest;

$client = new PayabliClient();
$client->moneyOut->renewVCard(
    '20231206142225226104',
    new RenewVCardRequest([
        'expirationDate' => '12-2027',
    ]),
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/MoneyOutCard/vcard/20231206142225226104/renew")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"expirationDate\": \"12-2027\"\n}"

response = http.request(request)
puts response.read_body
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["expirationDate": "12-2027"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOutCard/vcard/20231206142225226104/renew")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "responseText": "Success",
  "isSuccess": true,
  "responseData": {
    "authCode": null,
    "referenceId": "20231206142225227890",
    "resultCode": 1,
    "resultText": "Virtual card renewed",
    "avsResponseText": null,
    "cvvResponseText": null,
    "customerId": null,
    "vendorId": null,
    "methodReferenceId": null
  }
}
```

## Send a virtual card link

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](/developers/api-reference/cards/send-vcard-link) for full documentation.

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

### Request

POST [https://api-sandbox.payabli.com/api/MoneyOut/vcard/send-card-link](https://api-sandbox.payabli.com/api/MoneyOut/vcard/send-card-link)

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

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.moneyOut.sendVCardLink({
        transId: "01K33Z6YQZ6GD5QVKZ856MJBSC",
    });
}
main();

```

```python
from payabli import payabli

client = payabli()

client.money_out.send_v_card_link(
    trans_id="01K33Z6YQZ6GD5QVKZ856MJBSC",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.moneyout.requests.SendVCardLinkRequest;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient
            .builder()
            .build();

        client.moneyOut().sendVCardLink(
            SendVCardLinkRequest
                .builder()
                .transId("01K33Z6YQZ6GD5QVKZ856MJBSC")
                .build()
        );
    }
}
```

```csharp
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient();

        await client.MoneyOut.SendVCardLinkAsync(
            new SendVCardLinkRequest {
                TransId = "01K33Z6YQZ6GD5QVKZ856MJBSC"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    request := &payabli.SendVCardLinkRequest{
        TransId: "01K33Z6YQZ6GD5QVKZ856MJBSC",
    }
    client.MoneyOut.SendVCardLink(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\MoneyOut\Requests\SendVCardLinkRequest;

$client = new PayabliClient();
$client->moneyOut->sendVCardLink(
    new SendVCardLinkRequest([
        'transId' => '01K33Z6YQZ6GD5QVKZ856MJBSC',
    ]),
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/MoneyOut/vcard/send-card-link")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"transId\": \"01K33Z6YQZ6GD5QVKZ856MJBSC\"\n}"

response = http.request(request)
puts response.read_body
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["transId": "01K33Z6YQZ6GD5QVKZ856MJBSC"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/vcard/send-card-link")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "success": true,
  "message": "Email sent.",
  "link": "https://app.payabli.com/vendor/virtual-card-link/code"
}
```

## 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](/developers/api-reference/cards/update-card-status) 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.

### Request

PATCH [https://api-sandbox.payabli.com/api/MoneyOutCard/card/\{entry}](https://api-sandbox.payabli.com/api/MoneyOutCard/card/\{entry})

```curl CancelVCard
curl -X PATCH https://api-sandbox.payabli.com/api/MoneyOutCard/card/8cfec329267 \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
  "cardToken": "20231206142225226104",
  "status": "Cancelled"
}'
```

```typescript CancelVCard
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.ghostCard.updateCard("8cfec329267", {
        cardToken: "20231206142225226104",
        status: "Cancelled",
    });
}
main();

```

```python CancelVCard
from payabli import payabli

client = payabli()

client.ghost_card.update_card(
    entry="8cfec329267",
    card_token="20231206142225226104",
    status="Cancelled",
)

```

```java CancelVCard
package com.example.usage;

import io.github.payabli.api.PayabliApiClient;
import io.github.payabli.api.resources.ghostcard.requests.UpdateCardRequestBody;
import io.github.payabli.api.types.CardStatus;

public class Example {
    public static void main(String[] args) {
        PayabliApiClient client = PayabliApiClient
            .builder()
            .build();

        client.ghostCard().updateCard(
            "8cfec329267",
            UpdateCardRequestBody
                .builder()
                .cardToken("20231206142225226104")
                .status(CardStatus.CANCELLED)
                .build()
        );
    }
}
```

```ruby CancelVCard
require "payabli"

client = Payabli::Client.new

client.ghost_card.update_card(
  entry: "8cfec329267",
  card_token: "20231206142225226104",
  status: "Cancelled"
)

```

```csharp CancelVCard
using PayabliApi;
using System.Threading.Tasks;

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient();

        await client.GhostCard.UpdateCardAsync(
            entry: "8cfec329267",
            request: new UpdateCardRequestBody {
                CardToken = "20231206142225226104",
                Status = CardStatus.Cancelled
            }
        );
    }

}

```

```go CancelVCard
package example

import (
    context "context"

    payabli "github.com/payabli/sdk-go"
    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    request := &payabli.UpdateCardRequestBody{
        CardToken: "20231206142225226104",
        Status: payabli.CardStatusCancelled.Ptr(),
    }
    client.GhostCard.UpdateCard(
        context.TODO(),
        "8cfec329267",
        request,
    )
}

```

```php CancelVCard
<?php

namespace Example;

use Payabli\PayabliClient;
use Payabli\GhostCard\Requests\UpdateCardRequestBody;
use Payabli\Types\CardStatus;

$client = new PayabliClient();
$client->ghostCard->updateCard(
    '8cfec329267',
    new UpdateCardRequestBody([
        'cardToken' => '20231206142225226104',
        'status' => CardStatus::Cancelled->value,
    ]),
);

```

```swift CancelVCard
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cardToken": "20231206142225226104",
  "status": "Cancelled"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOutCard/card/8cfec329267")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

A successful response confirms the status change.

### Response (200)

```json
{
  "responseText": "Success",
  "isSuccess": true
}
```

## Related resources

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

#### Prerequisites

* **[Cards overview](/guides/pay-out-cards-overview)** - Understand how single-use virtual cards and ghost cards differ

#### Related topics

* **[Manage payouts with the API](/guides/pay-out-developer-payouts-manage)** - Authorize the payout that creates a virtual card
* **[Audit payout transactions with the API](/guides/pay-out-developer-payouts-audit)** - Find a payout's CardToken in its payment-method details
* **[Manage ghost cards with the API](/guides/pay-out-developer-ghost-cards-manage)** - Learn how to create and manage multi-use virtual debit cards for vendor spend with the Payabli API