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

# Update a payout



## OpenAPI

````yaml put /payouts/{id}
openapi: 3.0.0
info:
  title: Customer API
  version: v1
servers:
  - url: https://sandbox-api.fedapay.com/v1
  - url: https://api.fedapay.com/v1
security: []
paths:
  /payouts/{id}:
    put:
      summary: Update a payout
      parameters:
        - in: path
          name: id
          schema:
            type: integer
          required: true
          description: Payout ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: Amount of the payout.
                currency:
                  type: object
                  description: Currency information.
                  properties:
                    iso:
                      type: string
                      description: The ISO code of the currency (e.g., XOF).
                  required:
                    - iso
                customer:
                  type: object
                  description: Customer information.
                  properties:
                    firstname:
                      type: string
                      description: Customer's first name.
                    lastname:
                      type: string
                      description: Customer's last name.
                    email:
                      type: string
                      format: email
                      description: Customer's email address.
                    phone_number:
                      type: object
                      description: Customer's phone number.
                      properties:
                        number:
                          type: string
                          description: Phone number without national prefix.
                        country:
                          type: string
                          description: Country code.
                      required:
                        - number
                        - country
                  required:
                    - firstname
                    - lastname
                mode:
                  type: string
                  description: Payout mode (e.g., 'bank_transfer', 'mobile_money').
              required:
                - amount
                - currency
                - customer
                - mode
      responses:
        '200':
          description: Payout updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Payout ID.
                  reference:
                    type: string
                    description: Payout reference.
                  amount:
                    type: integer
                    description: Payout amount.
                  status:
                    type: string
                    description: >-
                      Payout status (e.g., 'pending', 'scheduled', 'sent',
                      'failed').
                  customer_id:
                    type: integer
                    description: Customer ID associated with the payout.
                  currency_id:
                    type: integer
                    description: Currency ID associated with the payout.
                  mode:
                    type: string
                    description: Payout mode.
                  last_error_code:
                    type: string
                    description: Last error code encountered during the payout.
                  commission:
                    type: integer
                    description: Payout commission.
                  fees:
                    type: integer
                    description: Payout fees.
                  fixed_commission:
                    type: integer
                    description: Fixed commission applied to the payout.
                  amount_transferred:
                    type: integer
                    description: Amount transferred to the beneficiary.
                  amount_debited:
                    type: integer
                    description: Amount debited from the payer.
                  created_at:
                    type: string
                    format: date-time
                    description: Date and time of payout creation.
                  updated_at:
                    type: string
                    format: date-time
                    description: Date and time of last payout update.
                  scheduled_at:
                    type: string
                    format: date-time
                    description: Date and time the payout is scheduled to be sent.
                  sent_at:
                    type: string
                    format: date-time
                    description: Date and time the payout was sent.
                  failed_at:
                    type: string
                    format: date-time
                    description: Date and time the payout failed.
                  deleted_at:
                    type: string
                    format: date-time
                    description: Date and time of payout deletion.
                  metadata:
                    type: object
                    description: Additional metadata related to the payout.
                  custom_metadata:
                    type: object
                    description: Custom metadata associated with the payout.
                  payment_method_id:
                    type: integer
                    description: Payment method ID used for the payout.
                  transaction_key:
                    type: string
                    description: Unique key associated with the payout.
                  merchant_reference:
                    type: string
                    description: Merchant reference provided for the payout.
                  account_id:
                    type: integer
                    description: Account ID associated with the payout.
                  balance_id:
                    type: integer
                    description: Balance ID associated with the payout.
        '400':
          description: Invalid request body.
        '404':
          description: Payout not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          label: NodeJs
          source: >-
            const { FedaPay, Payout } = require('fedapay');

            /* Replace YOUR_SECRETE_API_KEY with your real API key */

            FedaPay.setApiKey("YOUR_SECRETE_API_KEY");

            /* Specify whether you want to run your query in test or live mode
            */

            FedaPay.setEnvironment('sandbox'); //or setEnvironment('live');

            /* Update a payout */

            const payout = await Payout.update(params = {}, headers = {});
        - lang: PHP
          source: |-
            \FedaPay\Fedapay::setApiKey(MY_API_KEY);
            \FedaPay\Payout::update(ID, params = {}, headers = {});
        - lang: Ruby
          source: |-
            require 'fedapay';
            # configure FedaPay library
            FedaPay.api_key = '' # Your secret api key
            FedaPay.environment = '' # sandbox or live
            # Update a payout instance
            payout.amount = 5000
            payout.save
            # Or
            payout.save amount: 5000
            # Update a payout by id
            FedaPay.update ID, amount: 5000;
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````