---
updatedAt: 2025-06-03T05:23:38.000Z
agentTools:
  projectIndex: https://rootvx.readme.io/llms.txt
---

# Create a Ledger Account Payout

This endpoint facilitates making payments from one ledger account to another within the system.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "rootVX Ledger + Wallet",
    "description": "Interact with the rootVX API to manage users, ledgers, wallets and transactions.",
    "version": "1.0.0",
    "contact": {
      "email": "support@rootpe.com"
    }
  },
  "servers": [
    {
      "url": "https://api.sandbox.rootvx.com"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Payments"
    }
  ],
  "paths": {
    "/api/ledger/payment/create": {
      "post": {
        "summary": "Create a Ledger Account Payout",
        "deprecated": false,
        "description": "This endpoint facilitates making payments from one ledger account to another within the system.",
        "operationId": "createPayment",
        "tags": [
          "Payments"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "A unique key to prevent duplicate requests. Typically a UUID.",
            "required": true,
            "example": "123e4567-e89b-12d3-a456-426614174000",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LedgerPaymentCreationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerAccountPaymentResponse"
                }
              }
            }
          },
          "403": {
            "description": "forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "unsuccessful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Bearer token for authentication. Format: Bearer <token>"
      }
    },
    "schemas": {
      "BalanceType": {
        "type": "string",
        "description": "The `BalanceType` field categorizes the status of an account's balance into three enumerated values. POSTED indicates that the balance has been finalized and recorded in the account, PENDING represents a balance that is awaiting confirmation or final processing, and AVAILABLE refers to funds that are currently available for use or withdrawal.",
        "enum": [
          "POSTED",
          "PENDING",
          "AVAILABLE"
        ],
        "example": "POSTED"
      },
      "Balance": {
        "type": "object",
        "properties": {
          "created_at": {
            "type": "string",
            "description": "The `created_at` field records the date and time when the balance was initially established. The date and time are represented in the ISO 8601 format 'YYYY-MM-DDTHH:MM:SS.sssZ', where Z denotes Zulu time (UTC).",
            "example": "2024-05-27T03:59:17.041Z",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "The `updated_at` field records the date and time when the balance was initially updated. The date and time are represented in the ISO 8601 format 'YYYY-MM-DDTHH:MM:SS.sssZ', where Z denotes Zulu time (UTC).",
            "example": "2024-05-27T03:59:17.041Z",
            "format": "date-time"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "The amount field represents the total balance amount as an integer."
          },
          "balance_type": {
            "$ref": "#/components/schemas/BalanceType"
          }
        }
      },
      "LiveAccountBalance": {
        "type": "object",
        "description": "The `LiveAccountBalance` field categorizes the status of an account's balance into three values. PENDING represents a balance that is awaiting confirmation or final processing, POSTED indicates that the balance has been finalized and recorded in the account and AVAILABLE refers to funds that are currently available for use or withdrawal.",
        "properties": {
          "pendingBalance": {
            "$ref": "#/components/schemas/Balance"
          },
          "postedBalance": {
            "$ref": "#/components/schemas/Balance"
          },
          "availableBalance": {
            "$ref": "#/components/schemas/Balance"
          }
        },
        "example": {
          "pendingBalance": {
            "created_at": "2024-01-30T12:00:00Z",
            "updated_at": "2024-01-31T12:00:00Z",
            "amount": 5000,
            "balance_type": "PENDING"
          },
          "postedBalance": {
            "created_at": "2024-01-30T12:00:00Z",
            "updated_at": "2024-01-31T12:00:00Z",
            "amount": 10000,
            "balance_type": "POSTED"
          },
          "availableBalance": {
            "created_at": "2024-01-30T12:00:00Z",
            "updated_at": "2024-01-31T12:00:00Z",
            "amount": 15000,
            "balance_type": "AVAILABLE"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "Specific error code identifying the type of error.",
            "example": "VSE-001"
          },
          "errorMessage": {
            "type": "string",
            "description": "A brief message describing the error.",
            "example": "ENTITY_NOT_FOUND"
          },
          "details": {
            "type": "string",
            "description": "Additional details about the error.",
            "example": "User entity not found for the given ID."
          }
        }
      },
      "LedgerPaymentType": {
        "type": "string",
        "description": "Specifies the type of payment.",
        "enum": [
          "LEDGERTOLEDGER",
          "LEDGERTOCLIENTACCOUNT"
        ]
      },
      "LedgerPaymentCreationRequest": {
        "required": [
          "amount",
          "direction",
          "receivingAccountId",
          "sendingAccountId",
          "ledgerId"
        ],
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "nullable": true,
            "description": "A brief description of the ledger account payment."
          },
          "type": {
            "$ref": "#/components/schemas/LedgerPaymentType"
          },
          "receivingLedgerAccountId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the ledger account receiving the funds."
          },
          "sendingLedgerAccountId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the ledger account sending the funds."
          },
          "ledgerId": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the ledger that this ledger account payment belongs to."
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "The amount of the payment in the smallest currency unit."
          },
          "remarks": {
            "type": "string",
            "nullable": true,
            "description": "Optional remarks for the payment."
          },
          "paymentDirection": {
            "type": "string",
            "description": "One of `credit`, `debit`. Describes the direction money is flowing in the transaction. A `credit` moves money from your account to someone else's. A `debit` pulls money from someone else's account to your own.",
            "enum": [
              "credit",
              "debit"
            ]
          },
          "priority": {
            "type": "string",
            "description": "Specifies the priority of the payment, either `normal` or `high`.",
            "enum": [
              "high",
              "normal"
            ]
          },
          "purpose": {
            "type": "string",
            "nullable": true,
            "description": "The purpose of the payment."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Additional data represented as key-value pairs. Both the key and value must be strings.",
            "example": {
              "key": "value",
              "foo": "bar"
            },
            "properties": {}
          }
        },
        "example": {
          "description": "Payment for order #1234",
          "receivingAccountId": "10120323",
          "sendingAccountId": "10120323",
          "ledgerId": "052ef79f-8eca-3a0a-8ee0-d9760ab1a24e",
          "amount": 1000,
          "transactionType": "WITHDRAW",
          "direction": "WITHDRAW",
          "paymentDirection": "credit",
          "priority": "high",
          "purpose": "Payment for order #1234",
          "metadata": {
            "key": "value",
            "foo": "bar"
          }
        }
      },
      "TransactionStatusEnum": {
        "type": "string",
        "description": "Defines the possible statuses of a transaction within the ledger system. This field categorizes the transaction based on its processing stage. 'PENDING' - Indicates that the transaction has been initiated but is not yet completed. 'POSTED' - Indicates that the transaction has been successfully completed and the associated changes have been permanently recorded in the ledger. 'FAILED' - indicates that the transaction did not complete successfully.",
        "enum": [
          "PENDING",
          "POSTED",
          "FAILED",
          "PENDING_EXTERNAL",
          "EXTERNAL_SUCCESS",
          "EXTERNAL_FAILED"
        ],
        "example": "PENDING"
      },
      "LedgerAccountPaymentResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier of the ledger account payout."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp when the payout was created. The date and time are represented in the ISO 8601 format 'YYYY-MM-DDTHH:MM:SS.sssZ', where Z denotes Zulu time (UTC).",
            "example": "2024-08-26T06:33:51.089Z"
          },
          "finalizedAt": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp when the payout was finalized. The date and time are represented in the ISO 8601 format 'YYYY-MM-DDTHH:MM:SS.sssZ', where Z denotes Zulu time (UTC).",
            "example": "2024-08-26T06:33:51.089Z"
          },
          "ledgerId": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the ledger that this ledger account payout belongs to."
          },
          "description": {
            "type": "string",
            "nullable": true,
            "description": "A description of the ledger account payment."
          },
          "status": {
            "$ref": "#/components/schemas/TransactionStatusEnum"
          },
          "receivingLedgerAccountId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the ledger account receiving the payout."
          },
          "sendingLedgerAccountId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the ledger account sending the funds."
          },
          "ledgerTransactionId": {
            "type": "string",
            "nullable": true,
            "description": "The ID of the transaction associated with this payout."
          },
          "amount": {
            "type": "integer",
            "nullable": true,
            "format": "int64",
            "description": "The amount of the payout."
          },
          "paymentDirection": {
            "type": "string",
            "nullable": true,
            "description": "The direction of the ledger entry."
          },
          "metadata": {
            "type": "object",
            "description": "Additional data represented as key-value pairs. Both the key and value must be strings.",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "key": "value",
              "foo": "bar"
            }
          },
          "balances": {
            "$ref": "#/components/schemas/LiveAccountBalance"
          }
        },
        "additionalProperties": false,
        "minProperties": 17,
        "required": [
          "id",
          "createdAt",
          "ledgerId",
          "status",
          "receivingLedgerAccountId",
          "sendingLedgerAccountId",
          "ledgerTransactionId",
          "amount",
          "paymentDirection",
          "currency"
        ]
      }
    }
  },
  "x-visibility": "external",
  "x-readme-id": "65cc5b61e764d4000f2012f3"
}
```