WooCommerce Payment Gateways API

Retrieve and configure available payment gateways

Documentation

Specifications

Schemas & Data

OpenAPI Specification

woocommerce-payment-gateways-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: WooCommerce REST Cart Payment Gateways API
  description: The WooCommerce REST API is the primary server-side interface for reading and writing WooCommerce store data programmatically. It follows REST conventions, uses JSON for all requests and responses, and is fully integrated with the WordPress REST API under the /wp-json/wc/v3/ namespace. The API covers products, product variations, product categories, product attributes, orders, order notes, order refunds, customers, coupons, tax rates, shipping zones, payment gateways, settings, webhooks, reports, and system status. Authentication uses Consumer Key and Consumer Secret pairs generated in the WooCommerce admin, transmitted over HTTPS via HTTP Basic Auth or OAuth 1.0a over plain HTTP.
  version: v3
  contact:
    name: WooCommerce Developer Support
    url: https://developer.woocommerce.com/docs/apis/rest-api/
  termsOfService: https://woocommerce.com/terms-conditions/
servers:
- url: https://example.com/wp-json/wc/v3
  description: Production Server (replace example.com with your store domain)
security:
- basicAuth: []
tags:
- name: Payment Gateways
  description: Retrieve and configure available payment gateways
paths:
  /payment_gateways:
    get:
      operationId: listPaymentGateways
      summary: WooCommerce List All Payment Gateways
      description: Returns all payment gateways installed in the store, including their enabled state, settings, and display order.
      tags:
      - Payment Gateways
      responses:
        '200':
          description: List of payment gateways
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PaymentGateway'
              examples:
                listPaymentGateways200Example:
                  summary: Default listPaymentGateways 200 response
                  x-microcks-default: true
                  value:
                  - id: '500123'
                    title: Example Name
                    description: A sample description
                    order: 1
                    enabled: true
                    method_title: Example Name
                    method_description: A sample description
                    method_supports:
                    - string-value
                    settings: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /payment_gateways/{id}:
    get:
      operationId: getPaymentGateway
      summary: WooCommerce Retrieve a Payment Gateway
      description: Returns a single payment gateway by its string ID (e.g. stripe, paypal).
      tags:
      - Payment Gateways
      parameters:
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Payment gateway details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGateway'
              examples:
                getPaymentGateway200Example:
                  summary: Default getPaymentGateway 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    title: Example Name
                    description: A sample description
                    order: 1
                    enabled: true
                    method_title: Example Name
                    method_description: A sample description
                    method_supports:
                    - string-value
                    settings: {}
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: updatePaymentGateway
      summary: WooCommerce Update a Payment Gateway
      description: Updates the settings or enabled state of a payment gateway.
      tags:
      - Payment Gateways
      parameters:
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentGatewayInput'
      responses:
        '200':
          description: Payment gateway updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentGateway'
              examples:
                updatePaymentGateway200Example:
                  summary: Default updatePaymentGateway 200 response
                  x-microcks-default: true
                  value:
                    id: '500123'
                    title: Example Name
                    description: A sample description
                    order: 1
                    enabled: true
                    method_title: Example Name
                    method_description: A sample description
                    method_supports:
                    - string-value
                    settings: {}
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    PaymentGatewayInput:
      type: object
      description: Input for updating a payment gateway.
      properties:
        enabled:
          type: boolean
          description: Whether to enable the gateway.
          example: true
        settings:
          type: object
          description: Gateway settings to update.
          additionalProperties: true
          example: {}
    PaymentGateway:
      type: object
      description: A payment gateway installed in the WooCommerce store.
      properties:
        id:
          type: string
          description: Payment gateway unique string identifier (e.g. stripe, paypal).
          example: '500123'
        title:
          type: string
          description: Gateway display name shown to customers at checkout.
          example: Example Name
        description:
          type: string
          description: Gateway description shown at checkout.
          example: A sample description
        order:
          type: integer
          description: Gateway display order at checkout.
          example: 1
        enabled:
          type: boolean
          description: Whether the gateway is active and available at checkout.
          example: true
        method_title:
          type: string
          description: Admin label for the gateway.
          example: Example Name
        method_description:
          type: string
          description: Admin description of the gateway.
          example: A sample description
        method_supports:
          type: array
          description: Features supported by this gateway (e.g. products, refunds, subscriptions).
          items:
            type: string
          example:
          - string-value
        settings:
          type: object
          description: Gateway settings as a key-value map. Each setting has id, label, description, type, value, and tip properties.
          additionalProperties: true
          example: {}
    Error:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code.
          example: string-value
        message:
          type: string
          description: Human-readable error message.
          example: string-value
        data:
          type: object
          description: Additional error context including HTTP status code.
          properties:
            status:
              type: integer
              description: HTTP status code associated with the error.
          example:
            status: 1
  parameters:
    id:
      name: id
      in: path
      description: Unique identifier for the resource.
      required: true
      schema:
        type: integer
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request body contains invalid or missing parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Auth using the WooCommerce Consumer Key as the username and Consumer Secret as the password over HTTPS. Over plain HTTP use OAuth 1.0a one-legged authentication instead.
externalDocs:
  description: WooCommerce REST API Documentation
  url: https://woocommerce.github.io/woocommerce-rest-api-docs/