Get organization payment method
Get organization payment method: getOrganizationPaymentMethod in the TypeScript, Python, Rust and Go clients.
GET /v1/organizations/{organizationId}/billing/payment-method
Reports whether the selected organization has a card on file, its documented payment-method metadata, whether a purchase needs a card first (purchaseRefusal), and how it pays: by card, or by invoice on its contract's terms (agreement). Reading this endpoint does not collect a new card or create a checkout session.
photon.organizations.billing.getOrganizationPaymentMethod(input: GetOrganizationPaymentMethodInput, options?: RequestOptions): Promise<GetOrganizationPaymentMethodOutput>photon.organizations.billing.get_organization_payment_method(input: GetOrganizationPaymentMethodInput, *, options: RequestOptions | None = None) -> models.GetOrganizationPaymentMethodResponseclient.get_organization_payment_method(organization_id: String).await -> Result<ResponseValue<types::GetOrganizationPaymentMethodResponse>, Error<GetOrganizationPaymentMethodError>>client.Organizations.Billing.GetOrganizationPaymentMethod(ctx context.Context, params *GetOrganizationPaymentMethodParams, opts ...RequestOption) (*GetOrganizationPaymentMethodResponse, 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.getOrganizationPaymentMethod({
path: {
organizationId: "organizationId",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import GetOrganizationPaymentMethodInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.organizations.billing.get_organization_payment_method(
GetOrganizationPaymentMethodInput.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
.get_organization_payment_method("organizationId".to_owned())
.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.GetOrganizationPaymentMethod(ctx, &photonapi.GetOrganizationPaymentMethodParams{
OrganizationID: "organizationId",
})
if err != nil {
return err
}
_ = result{
"agreement": {
"kind": "self_serve"
},
"cardOnFile": true,
"paymentMethod": null,
"purchaseRefusal": null
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Returns
200 Whether the organization has a captured card and its metadata. GetOrganizationPaymentMethodResponse
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.
How the organization pays: self_serve by card, each purchase paid when made; enterprise by invoice on its contract's terms, its purchases added to its next monthly invoice.
True once a card is captured for the payer.
Metadata for the default card, or null.
Why the organization can't pay for a purchase now, or null when it can. payment_method_required: add a card first; an organization that pays by invoice never needs one. billing_not_ready: its billing is still being set up; try again shortly. Decide purchases on this, not on cardOnFile.
304 Not Modified. Sent only when If-None-Match matches the ETag of an earlier 200 response for the same representation; no body. No body.
Headers: ETag, Photon-Version. The raw response carries these headers; see Raw responses.