> 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 a payment method

PATCH https://api-sandbox.payabli.com/api/v2/payment-methods/{paymentMethodReference}
Content-Type: application/json

Applies a partial update to a payment method. Send only the fields you
want to change. Only payment methods in `PENDING` status can be updated.
Once a payment method is active, change it through the bank account
change process instead.


Reference: https://docs.payabli.com/developers/api-reference/payment-methods/update-a-payment-method

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

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

## Request

### Path parameters

- `paymentMethodReference` (string, required) — The payment method reference.

### Body (application/json)

This endpoint expects an UpdatePaymentMethodRequest.

- `nickname` (string, optional) — An optional label for the payment method.
- `financialInstitution` (string, optional) — The bank or financial institution that holds the account.
- `accountType` (string, optional) — The account type, for example `checking` or `savings`.
- `accountNumber` (string, optional) — The bank account number.
- `routingNumber` (string, optional) — The bank routing number.
- `usage` (list of enum, optional) — What the payment method is used for. Provide at least one value.
  - Allowed values: `deposits`, `billing`, `withdrawals`, `payOutFunding`, `refunds`, `returns`

## Response

### 200

Payment method updated.

- `success` (boolean, required) — Whether the request succeeded.
- `message` (string, required, nullable) — A human-readable result message.
- `traceId` (string, required, nullable) — The trace identifier for the request, useful for support.
- `data` (PaymentMethodResult, required, nullable) — The updated payment method.

## Errors

### 400 Bad Request Error

Bad request / invalid data.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 401 Unauthorized Error

Unauthorized request.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 404 Not Found Error

The requested resource wasn't found.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

### 500 Internal Server Error

Internal server error.

- `isSuccess` (boolean, required) — Always `false` for error responses.
- `responseText` (string, required) — Error text describing what went wrong.
- `responseCode` (integer, optional) — Code for the response. Learn more in [API Response Codes](/developers/api-reference/api-responses).
- `responseData` (PayabliErrorBodyResponseData, optional) — Object with detailed error context.

## Types

### PaymentMethodResult

A payment method as returned by create, update, and deactivate. Sensitive fields are masked.

- `paymentMethodReference` (string, required) — The payment method reference, used to read and manage the payment method.
- `type` (string, required) — The payment method type.
- `accountOwner` (string, required) — The reference of the person or business that owns the payment method (for example, a business `businessUuid` or a person `personReference`).
- `ownerType` (enum, required) — Whether the owner is a `person` or a `business`.
  - Allowed values: `person`, `business`
- `status` (string, required) — The payment method's current status.
- `createdAt` (datetime, required) — When the payment method was created.
- `lastUpdated` (datetime, required) — When the payment method was last updated.
- `_links` (PaymentMethodLinks, required) — Hypermedia links for the payment method resource.
- `fingerprint` (string, optional, nullable) — A hash that uniquely identifies the underlying account, used to detect duplicates.
- `tokenReference` (string, optional, nullable) — The reference of the stored token for the payment method.
- `nickname` (string, optional, nullable) — An optional label for the payment method.
- `financialInstitution` (string, optional, nullable) — The bank or financial institution that holds the account.
- `accountType` (string, optional, nullable) — The account type.
- `accountNumber` (string, optional) — The bank account number, masked (only the last four digits are shown).
- `routingNumber` (string, optional) — The bank routing number, masked.
- `usage` (list of enum, optional, nullable) — What the payment method is used for.
  - Allowed values: `deposits`, `billing`, `withdrawals`, `payOutFunding`, `refunds`, `returns`

### PayabliErrorBodyResponseData

Object with detailed error context.

- `explanation` (string, optional) — Human-readable explanation of what happened.
- `todoAction` (string, optional) — Suggested resolution.

### PaymentMethodLinks

Hypermedia links for a payment method resource.

- `self` (string, optional) — Relative path to the payment method resource.
- `owner` (string, optional) — Relative path to the entity that owns the payment method.

## Examples

**Request**

```json
{
  "nickname": "Primary operating account",
  "usage": [
    "deposits",
    "billing"
  ]
}
```

**Response**

```json
{
  "success": true,
  "message": "Payment method updated successfully",
  "traceId": "0HNNN6HH5NE2H:00000016",
  "data": {
    "paymentMethodReference": "019ff142-454b-7721-96a3-c8628b9d568f",
    "type": "bank_account",
    "accountOwner": "019fed1a-3d6e-75d3-a81e-cba3874b0a55",
    "ownerType": "business",
    "status": "PENDING",
    "createdAt": "2026-08-11T14:38:00.0117762Z",
    "lastUpdated": "2026-08-11T14:39:12.4471182Z",
    "_links": {
      "self": "/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f",
      "owner": "/api/v2/businesses/019fed1a-3d6e-75d3-a81e-cba3874b0a55"
    },
    "fingerprint": "2a0c2a64d03492ba45af4d01f329f22b41513411cab7658072739d17ed570675",
    "tokenReference": "deacc32d-81eb-470b-9cff-0ad2fab87096",
    "nickname": "Primary operating account",
    "financialInstitution": "Bank of Example",
    "accountType": "Checking",
    "accountNumber": "****6789",
    "routingNumber": "*****0021",
    "usage": [
      "deposits",
      "billing"
    ]
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f"

payload = {
    "nickname": "Primary operating account",
    "usage": ["deposits", "billing"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"nickname":"Primary operating account","usage":["deposits","billing"]}'
};

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://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f"

	payload := strings.NewReader("{\n  \"nickname\": \"Primary operating account\",\n  \"usage\": [\n    \"deposits\",\n    \"billing\"\n  ]\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f")

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"nickname\": \"Primary operating account\",\n  \"usage\": [\n    \"deposits\",\n    \"billing\"\n  ]\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://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"nickname\": \"Primary operating account\",\n  \"usage\": [\n    \"deposits\",\n    \"billing\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f', [
  'body' => '{
  "nickname": "Primary operating account",
  "usage": [
    "deposits",
    "billing"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"nickname\": \"Primary operating account\",\n  \"usage\": [\n    \"deposits\",\n    \"billing\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "nickname": "Primary operating account",
  "usage": ["deposits", "billing"]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/payment-methods/019ff142-454b-7721-96a3-c8628b9d568f")! 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()
```