Create payment method checkout
Create payment method checkout: createOrganizationPaymentMethodCheckout in the TypeScript, Python, Rust and Go clients.
POST /v1/organizations/{organizationId}/billing/checkout
Returns a hosted payment-method collection URL for the selected organization. An Idempotency-Key header is optional; supply one to make retries safe. Complete the returned checkout flow. Receiving the URL does not mean a card has been saved; check payment-method status afterward.
photon.organizations.billing.createOrganizationPaymentMethodCheckout(input: CreateOrganizationPaymentMethodCheckoutInput, options?: RequestOptions): Promise<CreateOrganizationPaymentMethodCheckoutOutput>photon.organizations.billing.create_organization_payment_method_checkout(input: CreateOrganizationPaymentMethodCheckoutInput, *, options: RequestOptions | None = None,) -> models.CreateOrganizationPaymentMethodCheckoutResponseclient.create_organization_payment_method_checkout(organization_id: String, params: Option<CreateOrganizationPaymentMethodCheckoutParams>).await -> Result<ResponseValue<types::CreateOrganizationPaymentMethodCheckoutResponse>, Error<CreateOrganizationPaymentMethodCheckoutError>>client.Organizations.Billing.CreateOrganizationPaymentMethodCheckout(ctx context.Context, params *CreateOrganizationPaymentMethodCheckoutParams, opts ...RequestOption) (*CreateOrganizationPaymentMethodCheckoutResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.organizations.billing.createOrganizationPaymentMethodCheckout({
path: {
organizationId: "organizationId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import CreateOrganizationPaymentMethodCheckoutInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.organizations.billing.create_organization_payment_method_checkout(
CreateOrganizationPaymentMethodCheckoutInput.model_validate({
"path": {
"organizationId": "organizationId",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.create_organization_payment_method_checkout("organizationId".to_owned(), None)
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Organizations.Billing.CreateOrganizationPaymentMethodCheckout(ctx, &photonapi.CreateOrganizationPaymentMethodCheckoutParams{
OrganizationID: "organizationId",
})
if err != nil {
return err
}
_ = result{
"checkoutUrl": "https://example.com"
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Identifies one logical mutation across retries.
Returns
200 Hosted card-capture page for the organization. CreateOrganizationPaymentMethodCheckoutResponse
Headers: Photon-Version. The raw response carries these headers; see Raw responses.
Hosted Stripe page; send the user here.