> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.alphax.asia/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.alphax.asia/_mcp/server.

# Update spend settings

PATCH https://public-api.alphax.com/v1/cards/{cardId}/spend-settings
Content-Type: application/json

Reference: https://docs.alphax.asia/api-reference/card-api/cards/update-card-spend-settings

## Authentication

- `X-API-Key` header (required) — Your partner API key.

## Servers

- `https://public-api.alphax.com` (Production server, default)
- `https://public-api.demo.alphax.asia` (Staging (sandbox) server)

## Request

### Path parameters

- `cardId` (string, required)

### Headers

- `X-Company-Id` (string, required) — The company you are acting for (a company ULID).

### Body (application/json)

- `isUnlimitedLimitPerTransaction` (boolean, required)
- `isAllowedAllCurrencies` (boolean, required)
- `limitPerTransaction` (double, optional) — Required when `isUnlimitedLimitPerTransaction` is false.
- `allowedCurrencies` (list of string, optional) — Required when `isAllowedAllCurrencies` is false (ISO currency codes).

## Response

### 200

Success

## Examples

**Request**

```json
{
  "isUnlimitedLimitPerTransaction": false,
  "isAllowedAllCurrencies": true
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://public-api.alphax.com/v1/cards/cardId/spend-settings"

payload = {
    "isUnlimitedLimitPerTransaction": False,
    "isAllowedAllCurrencies": True
}
headers = {
    "X-Company-Id": "01KZ2WJKWVFPCVAB6MY106QRZV",
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://public-api.alphax.com/v1/cards/cardId/spend-settings';
const options = {
  method: 'PATCH',
  headers: {
    'X-Company-Id': '01KZ2WJKWVFPCVAB6MY106QRZV',
    'X-API-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"isUnlimitedLimitPerTransaction":false,"isAllowedAllCurrencies":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://public-api.alphax.com/v1/cards/cardId/spend-settings"

	payload := strings.NewReader("{\n  \"isUnlimitedLimitPerTransaction\": false,\n  \"isAllowedAllCurrencies\": true\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Company-Id", "01KZ2WJKWVFPCVAB6MY106QRZV")
	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

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

url = URI("https://public-api.alphax.com/v1/cards/cardId/spend-settings")

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

request = Net::HTTP::Patch.new(url)
request["X-Company-Id"] = '01KZ2WJKWVFPCVAB6MY106QRZV'
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"isUnlimitedLimitPerTransaction\": false,\n  \"isAllowedAllCurrencies\": true\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://public-api.alphax.com/v1/cards/cardId/spend-settings")
  .header("X-Company-Id", "01KZ2WJKWVFPCVAB6MY106QRZV")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"isUnlimitedLimitPerTransaction\": false,\n  \"isAllowedAllCurrencies\": true\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://public-api.alphax.com/v1/cards/cardId/spend-settings', [
  'body' => '{
  "isUnlimitedLimitPerTransaction": false,
  "isAllowedAllCurrencies": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
    'X-Company-Id' => '01KZ2WJKWVFPCVAB6MY106QRZV',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://public-api.alphax.com/v1/cards/cardId/spend-settings");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Company-Id", "01KZ2WJKWVFPCVAB6MY106QRZV");
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"isUnlimitedLimitPerTransaction\": false,\n  \"isAllowedAllCurrencies\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Company-Id": "01KZ2WJKWVFPCVAB6MY106QRZV",
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "isUnlimitedLimitPerTransaction": false,
  "isAllowedAllCurrencies": true
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://public-api.alphax.com/v1/cards/cardId/spend-settings")! 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()
```