Skip to content

list-payment-methods

Method: GET
Path: /payments/payment-methods

Tags: Payments

Summary

List all payment methods

Description

List all payment methods

Storefront SDK Usage

SDK Method: sdk.payments.listPaymentMethods()

Example:

typescript
const { data, error } = await sdk.payments.listPaymentMethods({
  payment_method_type: "card",
  payment_provider_slug: "payu"
});

if (error) {
  console.error("Failed to list payment methods:", error.message);
} else {
  console.log("Payment methods:", data.payment_methods);

  data.payment_methods?.forEach(method => {
    console.log("Payment method:", method.name);
    console.log("Gateway:", method.payment_gateway);
  });
}

TypeScript Definition

typescript
"list-payment-methods": {
        parameters: {
            query?: {
                /** @description Payment method type */
                payment_method_type?: "card" | "upi" | "netbanking" | "wallet" | "manual";
                /** @description Payment provider slug */
                payment_provider_slug?: string;
            };
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message?: string;
                        success?: boolean;
                        content?: {
                            payment_methods?: (components["schemas"]["PayuPaymentMethod"] | components["schemas"]["JuspayPaymentMethod"] | components["schemas"]["ManualPaymentMethod"])[];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["schemas"]["PayuPaymentMethod"]PayuPaymentMethod
components["schemas"]["JuspayPaymentMethod"]JuspayPaymentMethod
components["schemas"]["ManualPaymentMethod"]ManualPaymentMethod
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters

  • payment_method_type (query): Payment method type
  • payment_provider_slug (query): Payment provider slug

Responses

200

OK

400

Bad request

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Payments"
  ],
  "operationId": "list-payment-methods",
  "summary": "List all payment methods",
  "description": "List all payment methods",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/list-payment-methods",
    "description": "API reference for the list-payment-methods operation"
  },
  "parameters": [
    {
      "name": "payment_method_type",
      "in": "query",
      "description": "Payment method type",
      "required": false,
      "schema": {
        "type": "string",
        "enum": [
          "card",
          "upi",
          "netbanking",
          "wallet",
          "manual"
        ]
      }
    },
    {
      "name": "payment_provider_slug",
      "in": "query",
      "description": "Payment provider slug",
      "required": false,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "payment_methods": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/PayuPaymentMethod"
                        },
                        {
                          "$ref": "#/components/schemas/JuspayPaymentMethod"
                        },
                        {
                          "$ref": "#/components/schemas/ManualPaymentMethod"
                        }
                      ]
                    }
                  }
                },
                "type": "object"
              }
            }
          }
        }
      },
      "links": {
        "CreateOrder": {
          "operationId": "create-order",
          "description": "Create an order with a payment method. Use `payment_provider_slug` and a `gateway_reference_id` from `details[].supported_reference_ids[]` to construct the `payment_method` payload."
        },
        "GetCardInfo": {
          "operationId": "get-card-info",
          "description": "Look up card BIN info to validate card brand support before creating an order with a new card."
        },
        "VerifyVpa": {
          "operationId": "verify-vpa",
          "description": "Validate a UPI VPA before creating an order with UPI Collect."
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "payments",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "listPaymentMethods"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: