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();

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?: never;
            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

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"
  },
  "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"
              }
            }
          }
        }
      }
    },
    "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: