> 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

# Update card status

PATCH https://api-sandbox.payabli.com/api/MoneyOutCard/card/{entry}
Content-Type: application/json

Updates the status of a virtual card (including ghost cards) under a paypoint.

Reference: https://docs.payabli.com/developers/api-reference/cards/update-card-status

## Authentication

- `Authorization` header (bearer token, required)
- `requestToken` header (required) — Long-lived API token sent in the `requestToken` header. See [API token authentication](/developers/api-tokens).

## Servers

- `https://api-sandbox.payabli.com/api` (Sandbox, default)
- `https://api.payabli.com/api` (Production)

## Request

### Path parameters

- `entry` (string, required) — The entity's entrypoint identifier. [Learn more](/developers/api-reference/api-overview#entrypoint-vs-entry)

### Body (application/json)

- `cardToken` (string, required) — Token that uniquely identifies the card. This is the `ReferenceId` returned when the card was created.
- `status` (enum, optional) — The new status to set on the card.
  - Allowed values: `Active`, `Inactive`, `Cancelled`, `Expired`

## Response

### 200

Success response.

- `responseText` (string, required) — Response text for operation: 'Success' or 'Declined'.
- `isSuccess` (boolean, optional) — Boolean indicating whether the operation was successful. A `true` value indicates success. A `false` value indicates failure.
- `responseData` (map from string to any, optional) — The object containing the response data.

## Examples

### CancelGhostCard

**Request**

```json
{
  "cardToken": "gc_abc123def456",
  "status": "Cancelled"
}
```

**Response**

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

**SDK Code**

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

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

```

```python CancelGhostCard
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

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

```

```java CancelGhostCard
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.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

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

```ruby CancelGhostCard
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

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

```

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

public partial class Examples
{
    public async Task Example() {
        var client = new PayabliApiClient(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

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

}

```

```go CancelGhostCard
package example

import (
    context "context"

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

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

```

```php CancelGhostCard
<?php

namespace Example;

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

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

```

```swift CancelGhostCard
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cardToken": "gc_abc123def456",
  "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()
```

### CancelVCard

**Request**

```json
{
  "cardToken": "20231206142225226104",
  "status": "Cancelled"
}
```

**Response**

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

**SDK Code**

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

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

```

```python CancelVCard
from payabli import payabli

client = payabli(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)

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.withCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")
            .build()
        ;

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

```ruby CancelVCard
require "payabli"

client = Payabli::Client.new(api_key: "YOUR_API_KEY_HERE")

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(
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        );

        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"
    option "github.com/payabli/sdk-go/option"
)

func do() {
    client := client.NewClient(
        option.WithClientCredentials(
            "YOUR_CLIENT_ID",
            "YOUR_CLIENT_SECRET",
        ),
    )
    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(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
);
$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()
```