# Update a payment method

`PUT https://app.shuttleglobal.com/c/api/instances/{instance_key}/payment_methods/{payment_method_id}`

Update an existing payment method's details.

## Authentication

- basicAuth: Basic Authentication using secret key
- bearerAuth: OAuth 2.0 Bearer Token Authentication

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `payment_method_id` | path | string | yes | The payment method's ID (`pm_...`), or its `code`. |

## Request body (`application/json`), required

- `payment_method` (object, required)
  - `address` (object): Address fields. All fields are optional and any values are accepted to prevent interrupting payments due to address validation issues. Field behavior: 1. When updating an address, the entire address object is replaced with the new values 2. To clear/null out all address fields, set each field to an empty string Client applications can implement their own validation if needed.
    - `country` (string): Country code (any format accepted). Set to empty string to clear.
    - `line1` (string): First line of the address. Set to empty string to clear.
    - `line2` (string): Second line of the address. Set to empty string to clear.
    - `line3` (string): Third line of the address. Set to empty string to clear.
    - `line4` (string): City/Town. Set to empty string to clear.
    - `line5` (string): Postcode/ZIP. Set to empty string to clear.
    - `line6` (string): State/Region. Set to empty string to clear.
  - `code` (string): Your ID for this payment method
  - `expiry` (string): Expiry date in MM/YYYY format
  - `last4` (string): Last 4+ digits of the payment method identifier
  - `manual` (boolean): Must be true as only manual updates are currently supported
  - `name` (string): Display name of the payment method
  - `requires_cvc` (boolean): Whether CVC is required for ecommerce/MOTO payments
  - `token` (string): Gateway token (format varies by gateway)
  - `tags` (string): CSV of tags/references
  - `metadata` (object): Custom key-value pairs

## Responses

### 200: Updated payment method

```json
{
  "payment_method": {
    "id": "string",
    "account": "string",
    "address": {
      "country": "string",
      "line1": "string",
      "line2": "string",
      "line3": "string",
      "line4": "string",
      "line5": "string",
      "line6": "string"
    },
    "advanced_notice_hours": 180,
    "archived": "2026-01-01T12:00:00Z",
    "authorisation_url": "string",
    "code": "string",
    "created": "2026-01-01T12:00:00Z",
    "created_session": "string",
    "expiry": "string",
    "failing_reason": "string",
    "failing_since": "2026-01-01T12:00:00Z",
    "gateway": "string",
    "gateway_group": "string",
    "gateway_status": "string",
    "last4": "string",
    "last_used": "2026-01-01T12:00:00Z",
    "mandate_id": "string",
    "mandate_link": "string",
    "mandate_reference": "string",
    "mandate_text": "string",
    "name": "string",
    "requires_cvc": true,
    "source": "MOTO",
    "status": "ACTIVE",
    "sub_status": "string",
    "sub_status_reason": "string",
    "tags": "string",
    "metadata": {},
    "bin": "string",
    "card_holder_name": "string",
    "eci": "string",
    "network_token": true,
    "source_type": "string",
    "token": "string",
    "type": "string",
    "updated_session": "string",
    "v": 0
  }
}
```

### 400: Bad request

```json
{
  "code": "string",
  "message": "string"
}
```

### 401: Authentication required

```json
{
  "code": "UNAUTHORIZED",
  "message": "Unauthorised"
}
```

### 404: Resource not found

```json
{
  "code": "string",
  "message": "string"
}
```

### 500: Internal server error

```json
{
  "error": {
    "type": "string",
    "message": "string"
  }
}
```

## Example request

```sh
curl --request PUT \
  --url https://app.shuttleglobal.com/c/api/instances/YOUR_INSTANCE_KEY/payment_methods/PAYMENT_METHOD_ID \
  --header 'Authorization: Basic <base64 of SECRET_KEY:>' \
  --header 'Content-Type: application/json' \
  --data '{
  "payment_method": {}
}'
```

Reference page: https://docs.shuttleglobal.com/platforms/reference/operations/updatepaymentmethod/