---
updatedAt: 2026-03-13T17:01:00.000Z
agentTools:
  projectIndex: https://developers.masspay.io/llms.txt
---

# Initiate a payout transaction

This **POST** endpoint is used to initiate a payout transaction from your account to a user with a specified token. <br> You can use this endpoint to pay out funds to your users, such as payments for services rendered or rewards for completing tasks. To use this endpoint, you need to provide the user token of the recipient in the URL Path. <br> The request body should include the funding source (`source_token`), payout destination (`destination_token`) and specify in which currency the payout should be made (`destination_currency_code`). <br> As a response API will return all details about your payout transaction.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "description": "MassPay API",
    "version": "1.0.0",
    "title": "MassPay API",
    "termsOfService": "https://www.masspay.io/terms/",
    "contact": {
      "name": "MassPay",
      "email": "info@masspay.io",
      "url": "https://www.masspay.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "tags": [
    {
      "name": "Payout",
      "description": "The payout resource describes a transfer from user’s account to a payout method."
    }
  ],
  "paths": {
    "/payout/{user_token}": {
      "post": {
        "tags": [
          "Payout"
        ],
        "summary": "Initiate a payout transaction",
        "description": "This **POST** endpoint is used to initiate a payout transaction from your account to a user with a specified token.\n<br> You can use this endpoint to pay out funds to your users, such as payments for services rendered or rewards for completing tasks. To use this endpoint, you need to provide the user token of the recipient in the URL Path.\n<br> The request body should include the funding source (`source_token`), payout destination (`destination_token`) and specify in which currency the payout should be made (`destination_currency_code`).\n<br> As a response API will return all details about your payout transaction.",
        "operationId": "initiatePayout",
        "parameters": [
          {
            "name": "user_token",
            "in": "path",
            "description": "Token representing the user to pay out. Accepted either as a bare UUID or prefixed with `usr_`; both forms reference the same user. 36 characters long, or 40 with the `usr_` prefix.",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(usr_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
              "minLength": 36,
              "maxLength": 40,
              "example": "usr_5b54fd79-2aa8-4965-85ed-0b3ad3739752"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Unique key to prevent duplicate processing",
            "schema": {
              "type": "string"
            }
          },
          {
            "schema": {
              "type": "number",
              "minimum": 0
            },
            "in": "query",
            "name": "limit",
            "description": "Limit amount for transaction amount + fee. If fee + amount are higher than the limit, the output will automatically adjust to maximize the possible amount sent. Amount is specified in `source_currency`."
          },
          {
            "schema": {
              "type": "boolean",
              "default": false
            },
            "in": "query",
            "name": "dry_run",
            "description": "When true, performs all validation checks without initiating the payout."
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayoutTxn"
              }
            }
          },
          "description": "Payout parameters for a quote",
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successfully created.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PayoutTxnResp"
                    },
                    {
                      "$ref": "#/components/schemas/PayoutTxnCommitResp"
                    }
                  ]
                },
                "examples": {
                  "Payout Response": {
                    "value": {
                      "payout_token": "payout_ba4275f2-bae1-488d-9d6f-20af1cd83574",
                      "client_transfer_id": "aEjn345",
                      "source_currency_code": "USD",
                      "destination_currency_code": "MXN",
                      "source_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574",
                      "destination_token": "dest_d2138fd0-00be-45a8-985f-4f5bde500962",
                      "destination_amount": 100.5,
                      "source_amount": 100.5,
                      "attr_set_token": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0",
                      "exchange_rate": 18.55,
                      "fee": 2.99,
                      "expiration": "2019-06-26T22:32:05.000Z",
                      "pickup_code": "54238173",
                      "status": "PENDING",
                      "payer_logo": "U3dhZ2dlciByb2Nrcw==",
                      "payer_name": "Elektra",
                      "delivery_type": "CASH_PICKUP",
                      "country_code": "MEX",
                      "metadata": {
                        "group_id": 541
                      },
                      "estimated_availability": "2020-07-21T17:32:28Z",
                      "status_reason": "Success",
                      "reversible_amount": 1.2,
                      "sender_user_token": "usr_5b54fd79-2aa8-4965-85ed-0b3ad3739752",
                      "attrs": {}
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. `error.details` names the cause — including a duplicate `client_transfer_id` (`Duplicate client id. Existing payout token: payout_<uuid>`) and insufficient funds (`Non sufficient funds in source token`).",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error400"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error401"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error403"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error404"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error405"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error500"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Time-out.",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error504"
                }
              }
            }
          }
        },
        "security": [
          {
            "AUTHORIZER_NAME": []
          },
          {
            "api_key": []
          }
        ]
      },
      "parameters": [
        {
          "schema": {
            "type": "string",
            "pattern": "^(usr_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 40,
            "example": "usr_5b54fd79-2aa8-4965-85ed-0b3ad3739752"
          },
          "name": "user_token",
          "in": "path",
          "required": true,
          "description": "Token representing the user to pay out/fetch. Accepted either as a bare UUID or prefixed with `usr_`; both forms reference the same user. 36 characters long, or 40 with the `usr_` prefix."
        }
      ]
    }
  },
  "servers": [
    {
      "url": "https://{environment}.masspay.io/{VERSION}",
      "description": "MassPay's API server",
      "variables": {
        "VERSION": {
          "default": "v1.0.0",
          "enum": [
            "v1.0.0"
          ]
        },
        "environment": {
          "default": "api",
          "enum": [
            "api",
            "staging-api"
          ]
        }
      }
    }
  ],
  "components": {
    "schemas": {
      "PayoutTxn": {
        "type": "object",
        "xml": {
          "name": "PayoutTxn"
        },
        "x-examples": {
          "PayoutTxn": {
            "client_transfer_id": "aEjn345",
            "source_currency_code": "USD",
            "destination_currency_code": "MXN",
            "source_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574",
            "destination_token": "dest_d2138fd0-00be-45a8-985f-4f5bde500962",
            "destination_amount": 100.5,
            "source_amount": 100.5,
            "attr_set_token": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0",
            "sender_user_token": "usr_5b54fd79-2aa8-4965-85ed-0b3ad3739752",
            "metadata": {
              "batch_identifier": "Commission 10-04-2025"
            }
          }
        },
        "x-tags": [
          "Payout"
        ],
        "required": [
          "destination_currency_code",
          "source_token"
        ],
        "properties": {
          "client_transfer_id": {
            "type": "string",
            "example": "aEjn345",
            "maxLength": 50,
            "description": "A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters. A value another payout of yours already carries is rejected with `400 Bad request` and `Duplicate client id. Existing payout token: payout_<uuid>` in `error.details`. By default a value becomes reusable once the earlier payout is `ERROR` or `EXPIRED` (or is a `PENDING` quote past its expiration); any other status, including `CANCELLED`, keeps it reserved. Accounts configured for strict uniqueness never allow reuse, whatever the earlier payout's status."
          },
          "source_currency_code": {
            "type": "string",
            "default": "USD",
            "pattern": "^[A-Z]{3,5}$",
            "minLength": 3,
            "maxLength": 5,
            "description": "The currency originating balance is stored in. Fiat currencies use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes (3 characters); cryptocurrency ticker symbols (e.g. `USDT`) may be up to 5 characters. In most cases this value will be USD, and therefore the default value if none is provided",
            "example": "USD"
          },
          "destination_currency_code": {
            "type": "string",
            "pattern": "^[A-Z]{3,5}$",
            "minLength": 3,
            "maxLength": 5,
            "example": "MXN",
            "description": "The currency the funds will be deposited into. Fiat currencies use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes (3 characters); cryptocurrency ticker symbols (e.g. `USDT`) may be up to 5 characters"
          },
          "source_token": {
            "type": "string",
            "pattern": "^([a-z]+(_[a-z]+)*_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 45,
            "description": "Token that represents the funding source for the payout, i.e. a bank account or wallet. Accepted either as a bare UUID or prefixed with the source type (e.g. `clnt_wlt_` for a client wallet); both forms reference the same funding source. 36 characters long, or up to 45 with a prefix.",
            "example": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574"
          },
          "destination_token": {
            "type": "string",
            "pattern": "^(dest_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 41,
            "description": "Optional. Token that represents the payout destination, i.e. MassPay->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback. Accepted either as a bare UUID or prefixed with `dest_`; both forms reference the same destination. If not provided, the last destination that was used for this user will be used. 36 characters long, or 41 with the `dest_` prefix.",
            "example": "dest_d2138fd0-00be-45a8-985f-4f5bde500962"
          },
          "destination_amount": {
            "type": "number",
            "description": "The amount to be sent for payout in destination currency. i.e USD. Must be provided if source_amount is empty",
            "format": "float",
            "example": 100.5
          },
          "source_amount": {
            "type": "number",
            "description": "The amount to be received by the payout in source currency. i.e USD. Must be provided if destination_amount is empty",
            "format": "float",
            "example": 100.5
          },
          "attr_set_token": {
            "type": "string",
            "pattern": "^(attr_set_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 45,
            "description": "Optional. Token that represents the set of attributes associated with the `destination_token`, for example a bank account, mobile account, or wallet id. Accepted either as a bare UUID or prefixed with `attr_set_`; both forms reference the same attribute set. If not provided, the last `attr_set_token` used is applied. If this is the first payout that is initiated for the `user_token` and `destination_token` combination and an `attr_set_token` is not provided, the latest attributes that were stored would be used. 36 characters long, or 45 with the `attr_set_` prefix.",
            "example": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0"
          },
          "metadata": {
            "type": "object",
            "description": "Optional JSON object with attributes that can later be searched to locate this payout. Do not include PII as this object is not encrypted.\nThere are two special attributes that can be provided in the metadata field: `batch_identifier` and `batch_name`. Either of those values, would group transactions in the ledger under the same description.",
            "example": {
              "group_id": 541
            }
          },
          "notify_user": {
            "type": "boolean",
            "default": false,
            "description": "Should we notify the user via email/sms about status updates for this payout?"
          },
          "auto_commit": {
            "type": "boolean",
            "default": false,
            "description": "Auto commit would commit the payout without requiring the API call to the commit payout endpoint. This option is only available when the `source_currency` and the `destination_currency` are the same. Whenever an exchange rate is applied to a transaction, a separate commit call is required."
          },
          "statement_description": {
            "type": "string",
            "description": "Optional descriptive line item that appears on the payout statement, providing details about the transaction. This field is intended to help identify the purpose or source of each payout by displaying a brief summary or itemized description. Commonly includes information such as transaction type, merchant name, or payout reason. Note: Not all countries and banks support displaying this field.",
            "example": "Merchant 4561",
            "maxLength": 140
          },
          "sender_user_token": {
            "type": "string",
            "pattern": "^(usr_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 40,
            "description": "Optional. Token that represents the user who is the sender (originator) of this payout. Accepted either as a bare UUID or prefixed with `usr_`; both forms reference the same user. Provide this field only when you are initiating the transaction on behalf of that sender, i.e. the transaction is not originated with you (the client) as the sender. When omitted, the client is considered the sender of record. The token must reference an existing user. Sender details are used for compliance, screening, and reporting purposes, so this value must accurately reflect the true originator of the funds. 36 characters long, or 40 with the `usr_` prefix.",
            "example": "usr_7f8e9d0c-1b2a-4c3d-9e5f-6a7b8c9d0e1f"
          },
          "value_added_services": {
            "$ref": "#/components/schemas/ValueAddedServicesPayouts"
          }
        }
      },
      "PayoutTxnResp": {
        "type": "object",
        "xml": {
          "name": "PayoutTxnResp"
        },
        "x-examples": {
          "PayoutTxnResp": {
            "payout_token": "payout_ba4275f2-bae1-488d-9d6f-20af1cd83574",
            "client_transfer_id": "aEjn345",
            "source_currency_code": "USD",
            "destination_currency_code": "MXN",
            "source_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574",
            "destination_token": "dest_d2138fd0-00be-45a8-985f-4f5bde500962",
            "destination_amount": 100.5,
            "source_amount": 100.5,
            "attr_set_token": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0",
            "exchange_rate": 18.55,
            "fee": 2.99,
            "expiration": "2019-12-16T09:28:28.102Z",
            "pickup_code": "54238173",
            "status": "PENDING"
          }
        },
        "x-tags": [
          "Payout"
        ],
        "required": [
          "payout_token",
          "client_transfer_id",
          "source_currency_code",
          "destination_currency_code",
          "source_token",
          "destination_token",
          "destination_amount",
          "source_amount",
          "attr_set_token",
          "exchange_rate",
          "fee",
          "expiration",
          "pickup_code",
          "status",
          "payer_name",
          "delivery_type",
          "country_code",
          "estimated_availability",
          "reversible_amount"
        ],
        "properties": {
          "payout_token": {
            "type": "string",
            "pattern": "^(payout_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 3,
            "maxLength": 43,
            "description": "Token that represents the transaction that was just created. Returned either as a bare UUID or prefixed with `payout_`; both forms reference the same payout. Needs to be used to commit the transaction in `/payout/{user_token}/{payout_token}`. Always a token: 36 characters long, or 43 with the `payout_` prefix. A duplicate `client_transfer_id` or insufficient funds in the `source_token` is not reported here but as `400 Bad request`, with the cause in `error.details` — for example `Duplicate client id. Existing payout token: payout_<uuid>` or `Non sufficient funds in source token`.",
            "example": "payout_ba4275f2-bae1-488d-9d6f-20af1cd83574"
          },
          "client_transfer_id": {
            "type": "string",
            "description": "A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters. A value another payout of yours already carries is rejected with `400 Bad request` and `Duplicate client id. Existing payout token: payout_<uuid>` in `error.details`. By default a value becomes reusable once the earlier payout is `ERROR` or `EXPIRED` (or is a `PENDING` quote past its expiration); any other status, including `CANCELLED`, keeps it reserved. Accounts configured for strict uniqueness never allow reuse, whatever the earlier payout's status.",
            "example": "aEjn345",
            "maxLength": 50
          },
          "source_currency_code": {
            "type": "string",
            "pattern": "^[A-Z]{3,5}$",
            "minLength": 3,
            "maxLength": 5,
            "example": "USD",
            "description": "The currency originating balance is stored in. Fiat currencies use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes (3 characters); cryptocurrency ticker symbols (e.g. `USDT`) may be up to 5 characters. In most cases this value will be USD, and therefore the default value if none is provided"
          },
          "destination_currency_code": {
            "type": "string",
            "pattern": "^[A-Z]{3,5}$",
            "minLength": 3,
            "maxLength": 5,
            "example": "MXN",
            "description": "The currency the funds will be deposited into. Fiat currencies use [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) codes (3 characters); cryptocurrency ticker symbols (e.g. `USDT`) may be up to 5 characters"
          },
          "source_token": {
            "type": "string",
            "pattern": "^([a-z]+(_[a-z]+)*_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 45,
            "description": "Token that represents the funding source used for this payout, i.e. your bank account or the user's wallet. Returned either as a bare UUID or prefixed with the source type (e.g. `clnt_wlt_` for a client wallet); both forms reference the same funding source. 36 characters long, or up to 45 with a prefix.",
            "example": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574"
          },
          "destination_token": {
            "type": "string",
            "pattern": "^(dest_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 41,
            "description": "Token that represents the payout destination, i.e. MassPay->Brazil->Bank Deposit->Itau. To be retrieved from the #pricing callback. Returned either as a bare UUID or prefixed with `dest_`; both forms reference the same destination. 36 characters long, or 41 with the `dest_` prefix.",
            "example": "dest_d2138fd0-00be-45a8-985f-4f5bde500962"
          },
          "destination_amount": {
            "type": "number",
            "description": "The amount to be sent for payout in destination currency. Must be provided if source_amount is empty",
            "format": "float",
            "example": 100.5
          },
          "source_amount": {
            "type": "number",
            "description": "The amount to be received by the payout in source currency. i.e USD. Must be provided if destination_amount is empty",
            "format": "float",
            "example": 100.5
          },
          "attr_set_token": {
            "type": "string",
            "pattern": "^(attr_set_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 45,
            "description": "Token that represents the set of attributes associated with the `destination_token`, for example a bank account, mobile account, or wallet id. Returned either as a bare UUID or prefixed with `attr_set_`; both forms reference the same attribute set. If not provided in the request, the last one used is applied. 36 characters long, or 45 with the `attr_set_` prefix.",
            "example": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0"
          },
          "exchange_rate": {
            "type": "number",
            "description": "The exchange rate to convert source_amount to destination_amount",
            "format": "float",
            "example": 18.55
          },
          "fee": {
            "type": "number",
            "description": "Fee to be charged for the transaction",
            "format": "float",
            "example": 2.99
          },
          "expiration": {
            "type": "string",
            "example": "2026-08-22T17:40:46.881Z",
            "description": "The time and date at which the transaction will expire, returned in UTC ([RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)) with millisecond precision, e.g. `2026-08-22T17:40:46.881Z`. The transaction has to be finalized before this time. Transactions are valid for 2 minutes from creation time. If expired, a new transaction has to be created.",
            "format": "date-time"
          },
          "pickup_code": {
            "type": "string",
            "example": "54238173",
            "description": "Confirmation/transaction code issued by the sending network or payout partner. For cash pickups, this is the code used to release cash to the recipient. For non-cash rails, it serves as a confirmation reference that you or banking partners can use to look up the transaction. Not the same as `trace_code`."
          },
          "trace_code": {
            "type": "string",
            "description": "Receiving-institution tracking identifier for the underlying transfer. Used by the **receiving** rail/operator to locate the transaction in its ledger (e.g., blockchain, ACH operator, bank). For crypto, this is the blockchain transaction hash. For ACH, this is the 15-digit ACH Trace Number. This value is distinct from `pickup_code`.<br>\n<br>\nTrace numbers are **not supported for all transactions** and will only be set when the rail supports them. In some cases, the value may be updated up to **14 days after the transaction** as the receiving institution posts or confirms it.",
            "example": "021214893903107"
          },
          "status": {
            "type": "string",
            "description": "The status of the transaction",
            "enum": [
              "PENDING",
              "EXPIRED",
              "PROCESSING",
              "COMPLETED",
              "CANCELLED",
              "SCHEDULED",
              "READY_FOR_PICKUP",
              "HOLD",
              "ERROR"
            ]
          },
          "payer_logo": {
            "type": "string",
            "format": "byte",
            "example": "U3dhZ2dlciByb2Nrcw==",
            "description": "base64 representation of the payer logo"
          },
          "payer_name": {
            "type": "string",
            "description": "Name of payer",
            "example": "Elektra"
          },
          "delivery_type": {
            "type": "string",
            "enum": [
              "CASH_PICKUP",
              "BANK_DEPOSIT",
              "HOME_DELIVERY",
              "MOBILE_WALLET",
              "MASSPAY_CARD",
              "PAPER_CHECK",
              "BILL",
              "CRYPTOCURRENCY"
            ],
            "description": "The type of delivery"
          },
          "country_code": {
            "type": "string",
            "example": "MEX",
            "pattern": "^[A-Z]{3}$",
            "minLength": 3,
            "maxLength": 3,
            "description": "Country code [ISO_3166](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3)"
          },
          "metadata": {
            "description": "Optional JSON object with attributes that can later be searched to locate this payout. Do not include PII as this object is not encrypted.",
            "example": {
              "group_id": 541
            },
            "type": "object"
          },
          "estimated_availability": {
            "type": "string",
            "format": "date-time",
            "example": "2020-07-21T17:32:28Z",
            "description": "Estimated availability of funds. When funds would be available to pickup/deposited"
          },
          "status_reason": {
            "type": "string",
            "description": "Optional. The reason for a CANCELLED or ERROR status, as text for people rather than a code: for example `Requested cancellation`, `Validation error`, `Payer no longer available`, a bank return code and description such as `R01 - Insufficient Funds`, or the validation message that rejected the payout. Display or log it, but do not branch on it."
          },
          "attrs": {
            "type": "object",
            "description": "The relevant attributes that were used to fulfill this payout"
          },
          "sender_user_token": {
            "type": "string",
            "pattern": "^(usr_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "minLength": 36,
            "maxLength": 40,
            "description": "Token that represents the user who is the sender (originator) of this payout, returned either as a bare UUID or with the `usr_` prefix. Only returned when the payout was initiated on behalf of a sender and the transaction was not originated with the client as the sender. If absent, the client is the sender of record. 36 characters long, or 40 with the `usr_` prefix.",
            "example": "usr_7f8e9d0c-1b2a-4c3d-9e5f-6a7b8c9d0e1f"
          },
          "reversible_amount": {
            "type": "number",
            "example": 100.5,
            "minimum": 0,
            "format": "float",
            "description": "The total amount that can be reversed against this payout. If 0, it means that either reversals are not available for this payout `destination_token` or the full amount of the original payout was already reversed in the `destination_currency` of the original payout."
          }
        },
        "title": ""
      },
      "PayoutTxnCommitResp": {
        "type": "object",
        "xml": {
          "name": "PayoutTxnCommitResp"
        },
        "x-examples": {
          "PayoutTxnCommitResp": {
            "payout_token": "ba4275f2-bae1-488d-9d6f-20af1cd83574",
            "status": "success",
            "pickup_code": 54238173,
            "errors": "Duplicate transfer"
          }
        },
        "x-tags": [
          "Payout"
        ],
        "properties": {
          "payout_token": {
            "type": "string",
            "description": "Token that represents the transaction that was just created.",
            "format": "uuid",
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "status": {
            "type": "string",
            "description": "Status that indicates whether the transaction was successfully processed. If `success`, everything was processed correctly. `failure` indicates a generic error. `addtl_attr_req` indicates that in order to process this transaction, additional attributes are required to be updated for this customer. `ex_rate_expired` indicates that the transaction exchange rate has expired and a new transaction has to be created.",
            "enum": [
              "success",
              "failure",
              "addtl_attr_req",
              "ex_rate_expired",
              "nsf"
            ]
          },
          "pickup_code": {
            "type": "string",
            "example": "54238173",
            "description": "Code/pin that is required when collecting the money. Should be provided to the recipient to present to payout location."
          },
          "errors": {
            "type": "string",
            "example": "Duplicate transfer",
            "description": "Description of errors preventing transfer from being injected."
          }
        },
        "required": [
          "payout_token",
          "status"
        ]
      },
      "Error400": {
        "description": "Bad request.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Bad request."
            ],
            "example": "Bad request."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included."
            ],
            "example": "The request was invalid or malformed. Please ensure that the request body conforms to the required format and that all required parameters are included."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              400
            ],
            "example": 400
          },
          "error": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "example": "Error initiating payout",
                "description": "Reason for error"
              },
              "details": {
                "type": "array",
                "description": "Specific details of the cause of the error",
                "items": {
                  "type": "string",
                  "example": "Source amount cannot be $0"
                }
              }
            }
          }
        },
        "required": [
          "message",
          "code"
        ]
      },
      "Error401": {
        "description": "Unauthorized.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Unauthorized."
            ],
            "example": "Unauthorized."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "Authentication failed or credentials were not provided. Please ensure that you have provided valid API credentials and that they are authorized to access the MassPay API."
            ],
            "example": "Authentication failed or credentials were not provided. Please ensure that you have provided valid API credentials and that they are authorized to access the MassPay API."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              401
            ],
            "example": 401
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error403": {
        "description": "Forbidden.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Forbidden."
            ],
            "example": "Forbidden."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The requested action is not allowed or the API credentials do not have sufficient permissions. Please ensure that the API credentials used for the request have the necessary permissions to perform the requested action."
            ],
            "example": "The requested action is not allowed or the API credentials do not have sufficient permissions. Please ensure that the API credentials used for the request have the necessary permissions to perform the requested action."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              403
            ],
            "example": 403
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error404": {
        "description": "Not found.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Not found."
            ],
            "example": "Not found."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The requested resource was not found. Please ensure that the URL for the request is correct and that the requested resource exists."
            ],
            "example": "The requested resource was not found. Please ensure that the URL for the request is correct and that the requested resource exists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              404
            ],
            "example": 404
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error405": {
        "description": "Method not allowed.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Method not allowed."
            ],
            "example": "Method not allowed."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The HTTP method used for the request is not supported by the MassPay API. Please ensure that you are using the correct HTTP method (e.g., POST) for the specific MassPay API endpoint."
            ],
            "example": "The HTTP method used for the request is not supported by the MassPay API. Please ensure that you are using the correct HTTP method (e.g., POST) for the specific MassPay API endpoint."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              405
            ],
            "example": 405
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error500": {
        "description": "Internal server error",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Internal server error."
            ],
            "example": "Internal server error."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "An unexpected error occurred on the server-side while processing the request. Please try again later or contact support if the issue persists."
            ],
            "example": "An unexpected error occurred on the server-side while processing the request. Please try again later or contact support if the issue persists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              500
            ],
            "example": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "Error504": {
        "description": "Gateway Time-out.",
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Error title.",
            "enum": [
              "Gateway Time-out."
            ],
            "example": "Gateway Time-out."
          },
          "message": {
            "type": "string",
            "description": "Error description.",
            "enum": [
              "The request timed out while waiting for a response from the server. Please try again later or contact support if the issue persists."
            ],
            "example": "The request timed out while waiting for a response from the server. Please try again later or contact support if the issue persists."
          },
          "code": {
            "type": "integer",
            "description": "Error code.",
            "enum": [
              500
            ],
            "example": 500
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "message",
          "code"
        ]
      },
      "ValueAddedServicesPayouts": {
        "type": "object",
        "title": "ValueAddedServicesPayouts",
        "description": "Optional per-transaction overrides for payout value added services. Omitted properties default to the account's configuration.",
        "properties": {
          "account_validation": {
            "$ref": "#/components/schemas/AccountValidationVAS"
          }
        }
      },
      "AccountValidationVAS": {
        "type": "object",
        "title": "AccountValidationVAS",
        "description": "Controls whether account validation runs for this transaction.",
        "properties": {
          "validation": {
            "type": "string",
            "enum": [
              "RUN",
              "SKIP",
              "ACCOUNT_DEFAULT"
            ],
            "default": "ACCOUNT_DEFAULT",
            "example": "SKIP",
            "description": "`RUN` always runs account validation for this transaction, even if the account configuration has it disabled. `SKIP` never runs account validation for this transaction, even if the account configuration has it enabled. `ACCOUNT_DEFAULT` (the default when omitted) defers to the account's configuration."
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      },
      "AUTHORIZER_NAME": {
        "name": "Authorization",
        "in": "header",
        "type": "apiKey"
      }
    }
  }
}
```