> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plugtopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure gateway routing percentages

> Sets percentage-based routing for the company gateways. Optionally scoped to a payment method (card or pix). Omit payment_method to set a default that applies to all methods. Percentages must sum to 100 or all be 0 to clear routing.



## OpenAPI

````yaml /api-reference/openapi.json put /api/v1/company/gateways/routing
openapi: 3.0.0
info:
  title: PlugToPay API
  description: API to make payments easy in multiple gateways.
  version: 1.0.0
servers:
  - url: http://localhost:7701
    description: Test Server
security: []
paths:
  /api/v1/company/gateways/routing:
    put:
      tags:
        - Company Gateways
      summary: Configure gateway routing percentages
      description: >-
        Sets percentage-based routing for the company gateways. Optionally
        scoped to a payment method (card or pix). Omit payment_method to set a
        default that applies to all methods. Percentages must sum to 100 or all
        be 0 to clear routing.
      operationId: 7611ad07d589ee7602c79e7dbf5f28cb
      parameters:
        - $ref: '#/components/parameters/XClientId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - gateways
              properties:
                payment_method:
                  type: string
                  enum:
                    - card
                    - pix
                  example: card
                  nullable: true
                gateways:
                  type: array
                  items:
                    required:
                      - gateway_slug
                      - percentage
                    properties:
                      gateway_slug:
                        type: string
                        example: erede
                      percentage:
                        type: integer
                        maximum: 100
                        minimum: 0
                        example: 30
                    type: object
              type: object
      responses:
        '200':
          description: Routing percentages updated
        '401':
          description: Unauthorized — Invalid API Key
        '422':
          description: Validation Error — percentages do not sum to 100
      security:
        - ApiKeyAuth: []
components:
  parameters:
    XClientId:
      name: x-client-id
      in: header
      description: Client identifier for the company in the request.
      required: true
      schema:
        type: string
        example: client_abc123
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Company API key. Send in the X-API-Key header.
      name: X-API-Key
      in: header

````