---
title: "Create a billing payment method setup"
method: POST
path: "/organizations/{organization}/billing/payment-method-setups"
tags: ["Billing payment method setup"]
---

# Create a billing payment method setup

`POST /organizations/{organization}/billing/payment-method-setups`

Create a hosted checkout session for adding or replacing an organization's payment method
### Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:

**Service Token Accesses**
 `write_payment_method`

**OAuth Scopes**

 | Resource | Scopes |
| :------- | :---------- |
| Organization | `write_payment_method` |

## Path parameters

- `organization` string, required

## Response `201`

Returns the billing payment method setup

- object
  - `type` 'BillingPaymentMethodSetup', required — The resource type
  - `id` string, required — The billing payment method setup ID
  - `state` 'pending' | 'completed' | 'failed' | 'expired', required — The setup state
  - `checkout_url` string, nullable, required — The hosted checkout URL while the setup is pending
  - `error` string, nullable, required — The failure message when the setup failed
  - `expires_at` string, nullable, required — When the pending setup expires
  - `completed_at` string, nullable, required — When the setup completed
  - `failed_at` string, nullable, required — When the setup failed

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-08-28** `6d28c038c4fd` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/planetscale/apis/planetscale-api/changes/organizations/:organization/billing/payment-method-setups/post.md)

---

[API](https://skmtc.dev/planetscale/apis/planetscale-api.md) · [All operations](https://skmtc.dev/planetscale/apis/planetscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/planetscale/planetscale-api/revisions/6d28c038c4fd/schema)
