Get payment methods
Result
client.getPaymentMethods() returns a Result<{ data: ListPaymentMethodsResponse }, GetPaymentMethodsError>.
Result envelope
Result<{ data: ListPaymentMethodsResponse }, GetPaymentMethodsError>
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | ✅ | Whether the operation succeeded. |
value | { data: ListPaymentMethodsResponse } | Present when ok is true. | |
error | GetPaymentMethodsError | Present when ok is false. |
ListPaymentMethodsResponse
| Field | Type | Required | Description |
|---|---|---|---|
paymentMethodConfigs | PaymentMethodConfig[] | Payment methods (Apple Pay, Google Pay, card, etc.) available to the customer with their capabilities and availability. | |
paymentMethods | StoredPaymentMethod[] | Payment methods the customer has stored on file, such as saved cards. |
PaymentMethodConfig
| Field | Type | Required | Description |
|---|---|---|---|
type | PaymentMethodType | ✅ | The payment method type (for example, "apple_pay", "google_pay", "card"). |
capabilities | PaymentMethodCapabilities | ✅ | Details about how this payment method can be used. |
availability | PaymentMethodAvailability | ✅ | Whether this payment method is available for the current session. |
PaymentMethodCapabilities
| Field | Type | Required | Description |
|---|---|---|---|
supportedCurrencies | string[] | ✅ | A list of ISO 4217 fiat currency codes that this payment method can be used with. |
supportedTransactionTypes | string[] | ✅ | The kinds of transactions this payment method can be used for. |
PaymentMethodAvailability
| Field | Type | Required | Description |
|---|---|---|---|
active | boolean | ✅ | Whether this payment method is available for the current session. |
unavailableReason | string | If the payment method is unavailable, a developer-friendly message. |
StoredPaymentMethod
A payment method the customer has stored on file. Use the id directly in client.getQuote() to quote against a specific stored payment method. Stored cards extend the base shape with card details — see the API reference for the full shape, including network brand, expiry, and last4.
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | The stored payment method identifier. Pass this to getQuote({ paymentMethod: { type: "card", id } }). |
type | string | ✅ | The payment method type, typically "card". |
GetPaymentMethodsError
GetPaymentMethodsError is the standard MoonPay Platform API error shape, DevPlatformApiError.
| Field | Type | Required | Description |
|---|---|---|---|
code | DevPlatformApiErrorCode | ✅ | A machine-readable error code (for example, "unauthorized", "not_found"). See the error reference for the full list. |
message | string | ✅ | A developer-friendly message. |
errors | DevPlatformApiErrorDetail[] | Optional list of field-level errors. |
TS Definition
TS Definition
types.ts