<!-- Source: https://docs.geopera.com/api-reference/operations/payment-methods · Markdown for LLMs -->

<!-- AUTO-GENERATED by scripts/generate-api-reference.cjs from the committed OpenAPI spec. Do not edit by hand. -->

# Payment methods operations

Manage payment methods.

Each operation below is reachable at `POST /v1/op/{operation_id}` or the resource path `POST /v1/{resource}/{action}`, with a Bearer token (a `gpra_` API key or a session token). Back to the [Operations Reference](/api-reference/operations) index.

## `payment_methods.attach`

Persist a saved card (Airwallex Payment Consent) for the org.

| | |
|---|---|
| **Scope** | `billing:write` |
| **Side-effect** | compute |
| **HTTP** | `POST /v1/op/payment_methods.attach`  ·  `POST /v1/payment_methods/attach` |
| **Python / TypeScript** | `client.payment_methods.attach(…)` |
| **CLI** | `geopera payment-methods attach …` |

**Request** — `AttachInput`

| Field | Type | Required | Description |
|---|---|---|---|
| `payment_method_id` | string | yes |  |

**Response** — `PaymentMethodOutput`.

## `payment_methods.create_setup_intent`

Start saving a card to the org (off-session) — returns the Airwallex client_secret + env.

| | |
|---|---|
| **Scope** | `billing:write` |
| **Side-effect** | compute |
| **HTTP** | `POST /v1/op/payment_methods.create_setup_intent`  ·  `POST /v1/payment_methods/create_setup_intent` |
| **Python / TypeScript** | `client.payment_methods.create_setup_intent(…)` |
| **CLI** | `geopera payment-methods create-setup-intent …` |

**Request** — `SetupIntentInput` _(see the OpenAPI schema for fields)_.

**Response** — `SetupIntentOutput`.

## `payment_methods.detach`

Detach (remove) a saved payment method from the org.

| | |
|---|---|
| **Scope** | `billing:write` |
| **Side-effect** | destructive |
| **HTTP** | `POST /v1/op/payment_methods.detach`  ·  `POST /v1/payment_methods/detach` |
| **Python / TypeScript** | `client.payment_methods.detach(…)` |
| **CLI** | `geopera payment-methods detach …` |

**Request** — `DetachInput`

| Field | Type | Required | Description |
|---|---|---|---|
| `payment_method_row_id` | string | yes |  |

**Response** — `DetachOutput`.

## `payment_methods.list`

List the org's saved payment methods.

| | |
|---|---|
| **Scope** | `billing:read` |
| **Side-effect** | read |
| **HTTP** | `POST /v1/op/payment_methods.list`  ·  `POST /v1/payment_methods/list` |
| **Python / TypeScript** | `client.payment_methods.list(…)` |
| **CLI** | `geopera payment-methods list …` |

**Request** — `_Empty` _(see the OpenAPI schema for fields)_.

**Response** — a streaming or binary payload (NDJSON / file / tile). Call the HTTP endpoint directly; the JSON SDK return does not apply.

## `payment_methods.set_default`

Make a saved payment method the org's default (used by off-session charges).

| | |
|---|---|
| **Scope** | `billing:write` |
| **Side-effect** | compute |
| **HTTP** | `POST /v1/op/payment_methods.set_default`  ·  `POST /v1/payment_methods/set_default` |
| **Python / TypeScript** | `client.payment_methods.set_default(…)` |
| **CLI** | `geopera payment-methods set-default …` |

**Request** — `SetDefaultInput`

| Field | Type | Required | Description |
|---|---|---|---|
| `payment_method_row_id` | string | yes |  |

**Response** — `PaymentMethodOutput`.
