# List payment methods

`GET /apis/cra.diagrid.io/v1beta1/billing/paymentmethods`

List your organization's payment methods (cards and cloud-marketplace subscriptions) and its default.

## Responses

### 200 — The list of payment methods.

`application/json`

An organization's payment methods and its default.

- `enabled` (boolean) — Whether billing is enabled.
- `cloudMarketplaceEnabled` (boolean) — Whether the cloud-marketplace payment rail is configured for this deployment, i.e. whether an organization can be sent out to a marketplace listing to subscribe. Narrower than enabled: a Stripe-only deployment reports enabled=true with cloudMarketplaceEnabled=false. Absent only from servers predating the field. Meaningful only when enabled is true.
- `commitmentPurchaseEnabled` (boolean) — Whether this deployment sells prepaid annual commitment lots, i.e. whether the annual option at region create would be accepted. Deployment-wide and acquisition-only: it says nothing about whether a particular organization is eligible to buy, nor about lots already sold, whose coverage and renewals are unaffected. Absent only from servers predating the field. Meaningful only when enabled is true.
- `cards` (object[])
  - `id` (string) — The payment method's identifier.
  - `brand` (string) — Card brand, e.g. visa, mastercard.
  - `last4` (string)
  - `expMonth` (integer)
  - `expYear` (integer)
  - `status` (string) — The card's current status. One of: `pending`, `valid`, `invalid`, `expired`.
  - `default` (boolean) — Whether this is the org's default payment method.
- `cloudMarketplace` (object[])
  - `id` (string) — The fulfillment reference.
  - `provider` (string) — The cloud marketplace this method bills through. One of: `aws`, `azure`, `gcp`.
  - `listingId` (string) — The marketplace listing identifier.
  - `externalAccountId` (string) — The customer's cloud account identifier.
  - `externalSubId` (string) — The marketplace's own identifier for the subscription — the AWS Marketplace agreement id, or the Azure subscription id. For Azure that is the same value as externalAccountId, so only AWS gains an identifier by showing it. Display and support reference only; never billing.
  - `contractEnd` (string) — RFC3339 timestamp for the end of the current contract term, when the marketplace reports one. Absent for a subscription with no term. Informational — a passed date does not revoke entitlement.
  - `status` (string) — The payment method's current status. One of: `pending`, `valid`, `invalid`.
  - `statusReason` (string) — Explains a non-valid status in a sentence, when there is more to say than the status itself. Absent when the status needs no explanation.
  - `default` (boolean) — Whether this is the org's default payment method.
- `defaultPaymentMethodId` (string) — The id of the organization's default payment method, if any.
- `paymentPolicy` (string) — Effective global payment policy; absent means unset (no create-time card gate). One of: `upfront`, `after_trial`.
- `trialDurationDays` (integer) — Resolved length of the billing-subscription trial in whole days. Absent means unknown (billing disabled, or a server predating the field) — word around it rather than assuming a default.
- `billingMode` (string) — Billing-enforcement mode as authored on the organization. Absent means never set explicitly, which is grandfathered as exempt rather than self_serve — branch on billingExempt, not on this. One of: `self_serve`, `external`, `poc`.
- `billingExempt` (boolean) — Whether the organization is currently carved out of billing enforcement (entitled, never charged, never trials). Authoritative; absent only from servers predating the field. Meaningful only when enabled is true.

### default — Unexpected error.

`application/json`

In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.

- `code` (string) — Required. This is the same as the HTTP status of the response.
- `message` (string) — Required. A short description of the error.
- `status` (object) — Required. A status code that indicates the error type.
- `details` (object) — Additional details about the errors.
  - `@type` (string) — The type of error.
  - `reason` (string) — A reason for the error.
  - `domain` (string) — The domain in which the error occurred.
  - `metadata` (object) — Additional metadata about the error.

`application/vnd.api+json`

JSONAPI.org specification error response wrapper for UI.

- `error` (object) — In the case of an error, a standard format error response body will be returned and the HTTP status code will be set to an error status. The response contains an object with a single error object.
  - `code` (string) — Required. This is the same as the HTTP status of the response.
  - `message` (string) — Required. A short description of the error.
  - `status` (object) — Required. A status code that indicates the error type.
  - `details` (object) — Additional details about the errors.
    - `@type` (string) — The type of error.
    - `reason` (string) — A reason for the error.
    - `domain` (string) — The domain in which the error occurred.
    - `metadata` (object) — Additional metadata about the error.
- `meta` (object<string, object>) — Link members related to the primary data.
  - One of:
    - **string (uri-reference)** — A string containing the link's URL.
    - **object**
      - `href` (string (uri-reference)) — Required. A string containing the link's URL.
      - `meta` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
- `links` (object) — Non-standard meta-information that can not be represented as an attribute or relationship.
