{
  "openapi": "3.0.1",
  "info": {
    "title": "Lead Bank",
    "description": "Lead Bank's APIs",
    "version": "v1.0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.lead.bank"
    },
    {
      "url": "https://api.lead.bank"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "ACH"
    },
    {
      "name": "Account Number"
    },
    {
      "name": "OAuth"
    },
    {
      "name": "Events"
    },
    {
      "name": "Instant Payments"
    },
    {
      "name": "Lending"
    },
    {
      "name": "Simulation"
    },
    {
      "name": "Internal Transfer"
    },
    {
      "name": "Disbursement"
    },
    {
      "name": "Entity"
    },
    {
      "name": "Wire"
    },
    {
      "name": "Originator"
    },
    {
      "name": "Funding"
    },
    {
      "name": "Balances"
    },
    {
      "name": "Compliance"
    },
    {
      "name": "UserAccount"
    },
    {
      "name": "Blockchain Payment"
    },
    {
      "name": "Core Account"
    },
    {
      "name": "Core Balance"
    },
    {
      "name": "Core Transaction"
    },
    {
      "name": "Event Subscription"
    }
  ],
  "paths": {
    "/v1/ach": {
      "post": {
        "tags": [
          "ACH"
        ],
        "operationId": "create-an-ach",
        "summary": "Create an ACH",
        "description": "Creates an outgoing ACH.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_number_id",
                  "counterparty",
                  "delivery_type",
                  "sec_code",
                  "transaction_type",
                  "amount",
                  "currency_code",
                  "statement_descriptor"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/Amount"
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode"
                  },
                  "transaction_type": {
                    "$ref": "#/components/schemas/TransactionType",
                    "description": "ACH transaction type:\n* `credit`: An ACH credit pushes funds from your account to the counterparty.\n* `debit`: An ACH debit will pull funds into your account from the counterparty."
                  },
                  "account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID"
                  },
                  "counterparty": {
                    "$ref": "#/components/schemas/Counterparty"
                  },
                  "delivery_type": {
                    "$ref": "#/components/schemas/DeliveryType"
                  },
                  "sec_code": {
                    "$ref": "#/components/schemas/OutgoingSecCode"
                  },
                  "statement_descriptor": {
                    "$ref": "#/components/schemas/StatementDescriptor"
                  },
                  "individual_id": {
                    "$ref": "#/components/schemas/IndividualId"
                  },
                  "descriptive_date": {
                    "$ref": "#/components/schemas/DescriptiveDate"
                  },
                  "additional_information": {
                    "$ref": "#/components/schemas/AdditionalInformation"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ACH object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "ACH"
        ],
        "operationId": "list-all-ach",
        "summary": "List all ACHes",
        "description": "List all ACH objects.",
        "parameters": [
          {
            "name": "account_id",
            "description": "Return ACHes associated with this `account_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_\\w+$"
            }
          },
          {
            "name": "account_number",
            "description": "Return ACHes associated with this `account_number`.",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 17
            }
          },
          {
            "name": "account_number_id",
            "description": "Return ACHes associated with this `account_number_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            }
          },
          {
            "name": "counterparty_account_number",
            "description": "Return ACHes associated with this counterparty's account_number.",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 17
            }
          },
          {
            "name": "direction",
            "description": "Return ACHes with this `direction`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Direction"
            }
          },
          {
            "name": "status",
            "description": "Return ACHes with this `status`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/AchStatus"
            }
          },
          {
            "name": "transaction_type",
            "description": "Return ACHes with this `transaction_type`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/TransactionType"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object’s field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of ACHes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ach"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "ach_id passed in is not a valid external ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ach/{ach_id}": {
      "get": {
        "tags": [
          "ACH"
        ],
        "operationId": "retrieve-an-ach",
        "summary": "Retrieve an ACH",
        "description": "Retrieve an ACH object.",
        "parameters": [
          {
            "name": "ach_id",
            "description": "ID of the ACH object you want to retrieve.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                }
              }
            }
          },
          "404": {
            "description": "ach_id passed in is not a valid external ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "ACH"
        ],
        "operationId": "update-an-ach",
        "summary": "Update an ACH",
        "description": "Update an ACH object.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "ach_id",
            "description": "ID of the ACH object you want to update.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "metadata"
                ],
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "ach_id passed in is not a valid external ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ach/{ach_id}/cancel": {
      "post": {
        "tags": [
          "ACH"
        ],
        "operationId": "cancel-an-ach",
        "summary": "Cancel an ACH",
        "description": "Cancel an outgoing ACH.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "ach_id",
            "description": "ID of the ACH to be canceled.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The canceled ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                },
                "examples": {
                  "canceled": {
                    "summary": "Canceled ACH",
                    "value": {
                      "id": "ach_xyz001",
                      "created_at": "2022-06-27T11:22:33Z",
                      "updated_at": "2022-06-27T11:22:33Z",
                      "status": "canceled",
                      "amount": 5000,
                      "account_id": "account_xyz123",
                      "account_number_id": "account_number_xyz123",
                      "direction": "outgoing",
                      "delivery_type": "same_business_day",
                      "transaction_type": "credit",
                      "sec_code": "WEB",
                      "currency_code": "USD",
                      "statement_descriptor": "P2P Credit",
                      "counterparty": {
                        "name": "Lara Smikle",
                        "account_number": "1032345678",
                        "routing_number": "021000021",
                        "account_type": "checking"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "This operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ach/{ach_id}/return": {
      "post": {
        "tags": [
          "ACH"
        ],
        "operationId": "return-an-ach",
        "summary": "Return an ACH",
        "description": "Issue a return against an incoming ACH.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "ach_id",
            "description": "ID of the ACH object to be returned.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^ach_\\w+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "return_code"
                ],
                "properties": {
                  "return_code": {
                    "$ref": "#/components/schemas/OutgoingReturnCode"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The now-returned original ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "ach_id passed in is not a valid external ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ach/{ach_id}/reverse": {
      "post": {
        "tags": [
          "ACH"
        ],
        "operationId": "reverse-an-ach",
        "summary": "Reverse an ACH",
        "description": "Reverse an outgoing ACH.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "ach_id",
            "description": "ID of the ACH you want to return.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reversal_reason"
                ],
                "properties": {
                  "reversal_reason": {
                    "$ref": "#/components/schemas/ReversalReason"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new reversal ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ach"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "ach_id passed in is not a valid external ACH object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "create-an-account-number",
        "summary": "Create an Account Number",
        "description": "Creates an Account Number. Optionally also assigns either a ClientCustomerID or EntityID to the Account Number",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "CreateAccountNumberRequest",
                "type": "object",
                "properties": {
                  "account_id": {
                    "$ref": "#/components/schemas/AccountID"
                  },
                  "client_customer_id": {
                    "$ref": "#/components/schemas/ClientCustomerID"
                  },
                  "entity_id": {
                    "$ref": "#/components/schemas/EntityID"
                  },
                  "ach_controls": {
                    "$ref": "#/components/schemas/AchControls"
                  },
                  "wire_controls": {
                    "$ref": "#/components/schemas/WireControls"
                  },
                  "internal_transfer_controls": {
                    "$ref": "#/components/schemas/InternalTransferControls"
                  },
                  "instant_payment_controls": {
                    "$ref": "#/components/schemas/InstantPaymentControls"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "account_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "This operation cannot be done on this object.",
                  "detail": "The maximum number of unassigned AccountNumbers has been reached. To create a new AccountNumber please pass in a `client_customer_id`, or assign one of your existing AccountNumbers.",
                  "status": "400"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Account Number"
        ],
        "operationId": "list-all-account-number",
        "summary": "List all Account Numbers",
        "description": "List all Account Numbers.",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "example": "account_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_\\w+$"
            },
            "description": "The ID of the account."
          },
          {
            "name": "account_number",
            "in": "query",
            "example": 123412341234,
            "schema": {
              "type": "string"
            },
            "description": "The account number."
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the account number to start the list after."
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the account number to end the list before."
          }
        ],
        "responses": {
          "200": {
            "description": "List of Account Numbers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAccountNumber"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/register": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "register-an-account-number",
        "summary": "Register an Account Number",
        "description": "Registers an Account Number.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "RegisterAccountNumberRequest",
                "type": "object",
                "properties": {
                  "account_id": {
                    "$ref": "#/components/schemas/AccountID"
                  },
                  "account_number": {
                    "type": "string",
                    "description": "The account number.",
                    "example": 123412341234,
                    "maxLength": 17,
                    "minLength": 8,
                    "pattern": "^[a-zA-Z0-9]+$"
                  },
                  "client_customer_id": {
                    "$ref": "#/components/schemas/ClientCustomerID"
                  },
                  "entity_id": {
                    "$ref": "#/components/schemas/EntityID"
                  },
                  "ach_controls": {
                    "$ref": "#/components/schemas/AchControls"
                  },
                  "wire_controls": {
                    "$ref": "#/components/schemas/WireControls"
                  },
                  "internal_transfer_controls": {
                    "$ref": "#/components/schemas/InternalTransferControls"
                  },
                  "instant_payment_controls": {
                    "$ref": "#/components/schemas/InstantPaymentControls"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "account_id",
                  "account_number"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "This operation cannot be done on this object.",
                  "detail": "The maximum number of unassigned AccountNumbers has been reached. To create a new AccountNumber please pass in a `client_customer_id`, or assign one of your existing AccountNumbers.",
                  "status": "400"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/{account_number_id}/assign": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "assign-an-account-number",
        "summary": "Assign an Account Number",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^account_number_\\w+$",
              "type": "string"
            },
            "description": "The ID of the Account Number to be assigned.",
            "example": "account_number_xyz"
          }
        ],
        "description": "Assigns an Account Number with either a ClientCustomerID or EntityID. Only one of these should be provided",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "AssignAccountNumberRequest",
                "type": "object",
                "properties": {
                  "client_customer_id": {
                    "$ref": "#/components/schemas/ClientCustomerID"
                  },
                  "entity_id": {
                    "$ref": "#/components/schemas/EntityID"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "This operation cannot be done on this object.",
                  "detail": "You cannot assign an already assigned client_customer_id, current value: <client_customer_id>.",
                  "status": "400"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/{account_number_id}": {
      "patch": {
        "tags": [
          "Account Number"
        ],
        "operationId": "update-an-account-number",
        "summary": "Update an Account Number",
        "description": "Update an Account Number's metadata.",
        "parameters": [
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the Account Number to be updated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "UpdateAccountNumberRequest",
                "type": "object",
                "properties": {
                  "ach_controls": {
                    "$ref": "#/components/schemas/AchControls"
                  },
                  "wire_controls": {
                    "$ref": "#/components/schemas/WireControls"
                  },
                  "internal_transfer_controls": {
                    "$ref": "#/components/schemas/InternalTransferControls"
                  },
                  "instant_payment_controls": {
                    "$ref": "#/components/schemas/InstantPaymentControls"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Account Number."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "detail": "The field passed in cannot be updated using this API.",
                  "instance": "{#invalid-field-name}",
                  "status": "400"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Account Number"
        ],
        "operationId": "retrieve-an-account-number",
        "summary": "Retrieve an Account Number",
        "description": "Retrieve an Account Number.",
        "parameters": [
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the Account Number to be retrieved."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_accounts": {
      "get": {
        "tags": [
          "Core Account"
        ],
        "operationId": "list-all-core-accounts",
        "summary": "List all Core Accounts",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CoreAccountType"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "core_account_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^core_account_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "core_account_xyz456",
            "schema": {
              "type": "string",
              "pattern": "^core_account_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of Core Account objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CoreAccount"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed query string).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The query string could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "422": {
            "description": "One or more query parameters failed validation. All failures are returned at once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "not_in_allowed_set",
                      "message": "type must be one of: attributed, direct, shadow.",
                      "parameters": [
                        "type"
                      ]
                    },
                    {
                      "code": "out_of_range",
                      "message": "limit must be between 1 and 100.",
                      "parameters": [
                        "limit"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_accounts/{id}": {
      "get": {
        "tags": [
          "Core Account"
        ],
        "operationId": "retrieve-a-core-account",
        "summary": "Retrieve a Core Account",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CoreAccountID"
            },
            "example": "core_account_xyz123"
          }
        ],
        "responses": {
          "200": {
            "description": "A Core Account object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreAccount"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The request URL could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "404": {
            "description": "No Core Account with this ID exists, or it is not visible to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "object_not_found",
                  "message": "The requested object does not exist or is not visible to this caller."
                }
              }
            }
          },
          "422": {
            "description": "The Core Account ID in the path is well-formed as a string but not a valid Core Account ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "malformed",
                      "message": "id must match the format core_account_*.",
                      "parameters": [
                        "id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_balances": {
      "get": {
        "tags": [
          "Core Balance"
        ],
        "operationId": "list-all-core-balances",
        "summary": "List all Core Balances",
        "parameters": [
          {
            "name": "core_account_id",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CoreAccountID"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "core_balance_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^core_balance_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "core_balance_xyz456",
            "schema": {
              "type": "string",
              "pattern": "^core_balance_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of Core Balance objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CoreAccountBalance"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed query string).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The query string could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "422": {
            "description": "One or more query parameters failed validation. All failures are returned at once.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "malformed",
                      "message": "core_account_id must match the format core_account_*.",
                      "parameters": [
                        "core_account_id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_balances/{id}": {
      "get": {
        "tags": [
          "Core Balance"
        ],
        "operationId": "retrieve-a-core-balance",
        "summary": "Retrieve a Core Balance",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CoreBalanceID"
            },
            "example": "core_balance_xyz123"
          }
        ],
        "responses": {
          "200": {
            "description": "A Core Balance object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreAccountBalance"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The request URL could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "404": {
            "description": "No Core Balance with this ID exists, or it is not visible to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "object_not_found",
                  "message": "The requested object does not exist or is not visible to this caller."
                }
              }
            }
          },
          "422": {
            "description": "The Core Balance ID in the path is well-formed as a string but not a valid Core Balance ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "malformed",
                      "message": "id must match the format core_balance_*.",
                      "parameters": [
                        "id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_transactions": {
      "get": {
        "tags": [
          "Core Transaction"
        ],
        "operationId": "list-all-core-transactions",
        "summary": "List all Core Transactions",
        "parameters": [
          {
            "name": "core_balance_id",
            "description": "Required. The core balance to list transactions for.",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CoreBalanceID"
            }
          },
          {
            "name": "type",
            "description": "Filter by payment rail or source mechanism.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CoreTransactionType"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object's field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^core_transaction_.+~\\d+$"
            }
          },
          {
            "name": "ending_before",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^core_transaction_.+~\\d+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of Core Transaction objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CoreTransaction"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed query string).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The query string could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "422": {
            "description": "One or more query parameters failed validation. All failures are returned at once. The required `core_balance_id` filter being absent surfaces here as `required`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "required",
                      "message": "core_balance_id is required.",
                      "parameters": [
                        "core_balance_id"
                      ]
                    },
                    {
                      "code": "not_in_allowed_set",
                      "message": "type is not a valid Core Transaction type.",
                      "parameters": [
                        "type"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v2/core_transactions/{id}": {
      "get": {
        "tags": [
          "Core Transaction"
        ],
        "operationId": "retrieve-a-core-transaction",
        "summary": "Retrieve a Core Transaction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/CoreTransactionID"
            },
            "example": "core_transaction_xyz123"
          }
        ],
        "responses": {
          "200": {
            "description": "A Core Transaction object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoreTransaction"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be parsed (e.g. a malformed URL).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "request_malformed",
                  "message": "The request is invalid and cannot be parsed by the server.",
                  "errors": [
                    {
                      "code": "url_malformed",
                      "message": "The request URL could not be parsed."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No valid authentication was supplied. `code` is `authentication_missing` when no credentials are present and `token_invalid` when the bearer token is missing, expired, or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "authentication_missing",
                  "message": "No authentication credentials were provided."
                }
              }
            }
          },
          "403": {
            "description": "The caller's source IP is not on Lead's allowlist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "source_ip_not_allowed",
                  "message": "The client making the request is not on Lead's IP allowlist."
                }
              }
            }
          },
          "404": {
            "description": "No Core Transaction with this ID exists, or it is not visible to this caller.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "object_not_found",
                  "message": "The requested object does not exist or is not visible to this caller."
                }
              }
            }
          },
          "422": {
            "description": "The Core Transaction ID in the path is well-formed as a string but not a valid Core Transaction ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "parameters_invalid",
                  "message": "One or more parameters are invalid.",
                  "errors": [
                    {
                      "code": "malformed",
                      "message": "id must match the format core_transaction_*.",
                      "parameters": [
                        "id"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "message": "You have exceeded the rate limit for this endpoint. Retry after the limit resets."
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Lead's side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "internal_server_error",
                  "message": "Something went wrong on our end. Contact Lead with the Request-Id if this persists."
                }
              }
            }
          },
          "503": {
            "description": "The endpoint is temporarily disabled (e.g. a migration cutover). Retry after a delay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "endpoint_disabled",
                  "message": "This endpoint is temporarily disabled. Retry after the indicated delay."
                }
              }
            }
          },
          "504": {
            "description": "An upstream system (the core) timed out. Retry with backoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "code": "gateway_timeout",
                  "message": "An upstream system timed out. Retry with backoff."
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/{account_number_id}/activate": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "activate-an-account-number",
        "summary": "Activate an Account Number",
        "description": "Activate an Account Number.",
        "parameters": [
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the Account Number to be activated."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "ActivateAccountNumberRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Account Number."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/{account_number_id}/deactivate": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "deactivate-an-account-number",
        "summary": "Deactivate an Account Number",
        "description": "Deactivate an Account Number.",
        "parameters": [
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the Account Number to be deactivated."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "DeactivateAccountNumberRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Account Number."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account_number/{account_number_id}/cancel": {
      "post": {
        "tags": [
          "Account Number"
        ],
        "operationId": "cancel-an-account-number",
        "summary": "Cancel an Account Number",
        "description": "Cancel an Account Number.",
        "parameters": [
          {
            "name": "account_number_id",
            "in": "path",
            "required": true,
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The ID of the Account Number to be canceled."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "CancelAccountNumberRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Account Number."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountNumber"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/oauth/token": {
      "post": {
        "security": [],
        "tags": [
          "OAuth"
        ],
        "operationId": "get-an-access-token",
        "summary": "Get an Access Token",
        "description": "Exchange your client credentials for an access code.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id",
                  "client_secret"
                ],
                "properties": {
                  "grant_type": {
                    "description": "The type of access token you want to request.",
                    "type": "string",
                    "enum": [
                      "client_credentials"
                    ]
                  },
                  "client_id": {
                    "description": "Your client ID.",
                    "type": "string",
                    "example": "<client_id>"
                  },
                  "client_secret": {
                    "description": "Your client secret.",
                    "type": "string",
                    "example": "<client_secret>"
                  },
                  "scope": {
                    "description": "A space delimited list of scopes your access token should be provisioned to allow.",
                    "type": "string",
                    "example": "ach/read",
                    "enum": [
                      "account_number/read",
                      "account_number/read_write",
                      "ach/read",
                      "ach/read_write",
                      "wire/read",
                      "wire/read_write",
                      "instant_payment/read",
                      "instant_payment/read_write",
                      "event/read",
                      "internal_transfer/read",
                      "internal_transfer/read_write",
                      "lending/read",
                      "lending/read_write",
                      "entity/read",
                      "entity/read_write",
                      "funding/read",
                      "funding/read_write",
                      "subledger_balance/read",
                      "subledger_balance/read_write",
                      "account/read",
                      "account/read_write",
                      "application/read",
                      "application/read_write",
                      "blockchain_payment/read",
                      "blockchain_payment/read_write",
                      "card/read",
                      "card/read_write"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful token exchange",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "description": "A Base64 access token.",
                      "type": "string",
                      "example": "AN_ACCESS_TOKEN"
                    },
                    "token_type": {
                      "description": "The token type.",
                      "type": "string",
                      "example": "Bearer"
                    },
                    "scope": {
                      "description": "A space delimited list of scopes your access token is provisioned for.",
                      "type": "string",
                      "example": "ach/read account_number/read"
                    },
                    "expires_in": {
                      "description": "The number of seconds the access token will expire in.",
                      "type": "integer",
                      "example": 86400
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request. Invalid parameters in request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number",
                      "description": "HTTP status code of the response.",
                      "example": 400
                    },
                    "code": {
                      "type": "string",
                      "description": "Error code.",
                      "example": "parameters_invalid"
                    },
                    "title": {
                      "type": "string",
                      "description": "High level description of the error `code`.",
                      "example": "Your request body did not parse."
                    },
                    "detail": {
                      "type": "string",
                      "description": "Why the parameter is invalid.",
                      "example": "Invalid grant type."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Your program is not provisioned for one or more of the requested scopes. Scopes are provisioned by Lead; contact support@lead.bank to request access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "status": "403",
                  "code": "insufficient_scope",
                  "title": "Your program is not provisioned for one or more of the requested scopes.",
                  "detail": "Scopes are provisioned by Lead. Check the documented scopes for this endpoint and contact support@lead.bank to request access.",
                  "invalid_parameters": [
                    {
                      "parameter": "scope",
                      "reason": "invalid_value"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/event/{event_id}": {
      "get": {
        "summary": "Retrieve an event",
        "tags": [
          "Events"
        ],
        "description": "Retrieves an event object.",
        "operationId": "retrieve-an-event",
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "ID of the Event object you want to retrieve.",
            "schema": {
              "type": "string",
              "example": "event_xyz001",
              "pattern": "^event_\\w+$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "An Event object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          }
        },
        "deprecated": false
      }
    },
    "/v1/event": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "List all events",
        "description": "List all event objects.",
        "operationId": "list-all-events",
        "parameters": [
          {
            "name": "events",
            "in": "query",
            "description": "ID of the Event object you want to retrieve.",
            "schema": {
              "type": "array",
              "description": "Return events of these type.",
              "items": {
                "$ref": "#/components/schemas/EventType"
              }
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object’s field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "format": "int32",
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "schema": {
              "type": "string",
              "pattern": "^event_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an Event ID that defines your place in the list.",
            "in": "query"
          },
          {
            "name": "ending_before",
            "schema": {
              "type": "string",
              "pattern": "^event_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an Event ID that defines your place in the list.",
            "in": "query"
          },
          {
            "name": "object_id",
            "in": "query",
            "description": "Filter events by the ID of the associated object (e.g., wire_12345). If the object_id doesn't match the event filter's object type, returns empty results.",
            "schema": {
              "type": "string",
              "pattern": "^(ach|wire|account_number|internal_transfer|disbursement|instant_payment|blockchain_payment)_\\w+$",
              "example": "wire_12345"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "detail": "The object_id parameter must be a valid object ID (e.g., ach_xyz, wire_xyz, account_number_xyz, internal_transfer_xyz, or disbursement_xyz).",
                  "status": "422"
                }
              }
            }
          }
        }
      }
    },
    "/v0/lending/disbursements": {
      "post": {
        "tags": [
          "Lending"
        ],
        "operationId": "create-a-disbursement",
        "summary": "Create a Disbursement",
        "description": "Creates a disbursement for a loan",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client_loan_id",
                  "payment_method",
                  "payment_details"
                ],
                "properties": {
                  "client_loan_id": {
                    "$ref": "#/components/schemas/ClientLoanID"
                  },
                  "payment_method": {
                    "$ref": "#/components/schemas/PaymentMethod"
                  },
                  "payment_details": {
                    "$ref": "#/components/schemas/CreateDisbursementPaymentDetails"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Disbursement object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disbursement"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "A request with the same idempotency key is in flight.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/lending/disbursements/{disbursement_id}": {
      "get": {
        "tags": [
          "Lending"
        ],
        "operationId": "retrieve-a-disbursement",
        "summary": "Retrieve a disbursement",
        "description": "Retrieve a disbursement object.",
        "parameters": [
          {
            "name": "disbursement_id",
            "description": "ID of the disbursement object you want to retrieve.",
            "example": "disbursement_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^disbursement_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A disbursement object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disbursement"
                }
              }
            }
          },
          "404": {
            "description": "disbursement_id passed in is not a valid external disbursement object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/lending/disbursements/{disbursement_id}/cancel": {
      "post": {
        "tags": [
          "Lending"
        ],
        "operationId": "cancel-a-disbursement",
        "summary": "Cancel a disbursement",
        "description": "Cancel a disbursement.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "disbursement_id",
            "description": "ID of the disbursement object you want to cancel.",
            "example": "disbursement_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^disbursement_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The canceled disbursement object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disbursement"
                }
              }
            }
          },
          "400": {
            "description": "This operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "disbursement_id passed in is not a valid external disbursement object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "A request with the same idempotency key is in flight.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/simulate/lending/disbursements/{disbursement_id}/advance": {
      "post": {
        "tags": [
          "Lending Simulation"
        ],
        "operationId": "advance-a-disbursement",
        "summary": "Advance Sandbox Disbursement",
        "description": "Advances a disbursement object status in the sandbox environment.",
        "parameters": [
          {
            "name": "disbursement_id",
            "description": "ID of the disbursement object you want to advance.",
            "example": "disbursement_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^disbursement_\\w+$"
            }
          },
          {
            "name": "event",
            "description": "Disbursement webhook event that you want to simulate. Possible values can be found in the Events & Webhooks section.",
            "example": "lending.disbursement.processing",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disbursement object advanced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Disbursement"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "disbursement_id passed in is not a valid external disbursement object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/ach/incoming_ach": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-ach",
        "summary": "Simulate Incoming ACH",
        "description": "Simulate an incoming ACH.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_number_id",
                  "sec_code",
                  "transaction_type",
                  "amount",
                  "currency_code",
                  "statement_descriptor",
                  "sender_name",
                  "sender_company_id",
                  "sender_routing_number"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/Amount"
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode"
                  },
                  "transaction_type": {
                    "$ref": "#/components/schemas/TransactionType"
                  },
                  "account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID"
                  },
                  "sec_code": {
                    "$ref": "#/components/schemas/OutgoingSecCode"
                  },
                  "statement_descriptor": {
                    "$ref": "#/components/schemas/StatementDescriptor"
                  },
                  "sender_name": {
                    "$ref": "#/components/schemas/SenderName"
                  },
                  "sender_company_id": {
                    "$ref": "#/components/schemas/SenderCompanyID"
                  },
                  "sender_routing_number": {
                    "$ref": "#/components/schemas/SenderRoutingNumber"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incoming ACH object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/ach/{ach_id}/incoming_return": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return",
        "summary": "Simulate Incoming Return",
        "description": "Simulate an incoming Return.",
        "parameters": [
          {
            "name": "ach_id",
            "description": "ID of the ACH object you want to return.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "return_code"
                ],
                "properties": {
                  "return_code": {
                    "$ref": "#/components/schemas/ReturnCode"
                  },
                  "return_additional_information": {
                    "type": "string",
                    "description": "Additional information to be added to the return."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ACH return created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/ach/{ach_id}/advance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-advance-ach",
        "summary": "Advance Sandbox ACH",
        "description": "Advance an ACH in Sandbox.",
        "parameters": [
          {
            "name": "ach_id",
            "description": "ID of the ACH object you want to advance.",
            "example": "ach_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ach_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ACH Object advanced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/internal_transfer": {
      "post": {
        "tags": [
          "Internal Transfer"
        ],
        "operationId": "create-an-internal-transfer-v1",
        "summary": "Create an asynchronous Internal Transfer",
        "description": "Creates an asynchronous Internal Transfer.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255,
              "minLength": 5
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "CreateInternalTransferRequestV1",
                "type": "object",
                "required": [
                  "sender_account_number_id",
                  "receiver_account_number_id",
                  "amount",
                  "description",
                  "currency_code"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/InternalTransferAmount"
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode"
                  },
                  "sender_account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID"
                  },
                  "receiver_account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 34,
                    "description": "Statement descriptor for the Internal Transfer",
                    "example": "Internal treasury transfer"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalTransferV1"
                },
                "example": {
                  "id": "internal_transfer_xyz123",
                  "amount": 5000,
                  "currency_code": "USD",
                  "sender_account_id": "account_xyz123",
                  "sender_account_number_id": "account_number_xyz123",
                  "receiver_account_id": "account_xyz123",
                  "receiver_account_number_id": "account_number_xyz123",
                  "status": "processing",
                  "description": "string",
                  "metadata": {
                    "additionalProp": "string"
                  },
                  "created_at": "2022-06-27T11:22:33Z",
                  "updated_at": "2022-06-27T11:22:33Z"
                }
              }
            }
          },
          "400": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Internal Transfer"
        ],
        "operationId": "list-all-internal-transfers-v1",
        "summary": "List all Internal Transfers",
        "description": "List all Internal Transfers.",
        "parameters": [
          {
            "name": "sender_account_number_id",
            "in": "query",
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The sender account number ID."
          },
          {
            "name": "receiver_account_number_id",
            "in": "query",
            "example": "account_number_xyz",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            },
            "description": "The receiver account number ID."
          },
          {
            "name": "status",
            "in": "query",
            "example": "posted",
            "schema": {
              "$ref": "#/components/schemas/InternalTransferStatusV1"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object’s field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Return objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "internal_transfer_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^internal_transfer_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list."
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "internal_transfer_xyz456",
            "schema": {
              "type": "string",
              "pattern": "^internal_transfer_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list."
          }
        ],
        "responses": {
          "200": {
            "description": "List of Internal Transfer objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InternalTransferV1"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/internal_transfer/{internal_transfer_id}": {
      "get": {
        "tags": [
          "Internal Transfer"
        ],
        "operationId": "retrieve-an-internal-transfer-v1",
        "summary": "Retrieve an Internal Transfer",
        "description": "Retrieve an Internal Transfer.",
        "parameters": [
          {
            "name": "internal_transfer_id",
            "in": "path",
            "required": true,
            "example": "internal_transfer_xyz23",
            "schema": {
              "type": "string",
              "minLength": 5,
              "pattern": "^internal_transfer_\\w+$"
            },
            "description": "The ID of the internal transfer object to be retrieved."
          }
        ],
        "responses": {
          "200": {
            "description": "An Internal Transfer object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalTransferV1"
                }
              }
            }
          },
          "404": {
            "description": "The internal_transfer_id passed in is not a valid InternalTransfer ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires/{wire_id}": {
      "get": {
        "tags": [
          "Wire"
        ],
        "operationId": "retrieve-a-wire-v1",
        "summary": "Retrieve a wire V1",
        "description": "Retrieve a wire object.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to retrieve.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid external wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Wire"
        ],
        "operationId": "update-a-wire-v1",
        "summary": "Update a wire V1",
        "description": "Update a wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to update.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires": {
      "get": {
        "tags": [
          "Wire"
        ],
        "operationId": "list-all-wires-v1",
        "summary": "List all wires V1",
        "description": "List all wire objects.",
        "parameters": [
          {
            "name": "account_id",
            "description": "Returns wires associated with this `account_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_\\w+$"
            }
          },
          {
            "name": "account_number_id",
            "description": "Returns wires associated with this `account_number_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            }
          },
          {
            "name": "end_to_end_identification",
            "description": "Returns wires associated with this `end_to_end_identification`.",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 35
            }
          },
          {
            "name": "direction",
            "description": "Returns wires with this `direction`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireDirection"
            }
          },
          {
            "name": "status",
            "description": "Returns wires with this `status`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireStatus"
            }
          },
          {
            "name": "return_request_status",
            "description": "Returns wires that have a return request with this status. Only wires where the matching return request is visible to the client are returned.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireReturnRequestStatus"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object’s field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of wire objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WireV1"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access wires.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. Please confirm your query param.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "create-a-wire-v1",
        "summary": "Create a wire V1",
        "description": "Create a new outgoing wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_number_id",
                  "amount",
                  "currency_code",
                  "creditor_agent",
                  "creditor",
                  "remittance_details"
                ],
                "properties": {
                  "account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID"
                  },
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "The amount of the wire in cents."
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode"
                  },
                  "creditor_agent": {
                    "$ref": "#/components/schemas/WireAgentRequest",
                    "description": "The financial institution receiving the wire from Fedwire."
                  },
                  "creditor": {
                    "$ref": "#/components/schemas/WireCreditorRequest"
                  },
                  "remittance_details": {
                    "type": "object",
                    "description": "Remittance details of the creditor.",
                    "required": [
                      "transfer_purpose"
                    ],
                    "properties": {
                      "message_to_creditor": {
                        "type": "string",
                        "description": "Information intended specifically for the creditor.",
                        "example": "Payment for invoice 12345",
                        "maxLength": 140,
                        "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]\\n]*$"
                      },
                      "transfer_purpose": {
                        "$ref": "#/components/schemas/WireTransferPurposeV1"
                      }
                    }
                  },
                  "payment_identifiers": {
                    "type": "object",
                    "description": "Payment identifiers of the creditor.",
                    "properties": {
                      "end_to_end_identification": {
                        "type": "string",
                        "description": "Unique identification that the initiating party in a wire message can use to unambiguously identify the transaction. This is passed through, unchanged, throughout the entire wire chain.",
                        "maxLength": 35,
                        "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                        "example": "EndtoEnd12345"
                      }
                    }
                  },
                  "instructed_agent": {
                    "$ref": "#/components/schemas/WireAgentRequest",
                    "description": "The financial institution that receives the payment via Fedwire. For international wires, this field is primarily used to specify the immediate intermediary in the payment chain following the instructing agent."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outgoing wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires/{wire_id}/return": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "return-a-wire-v1",
        "summary": "Return a wire V1",
        "description": "Initiate a return against an incoming wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to return.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "return_code"
                ],
                "properties": {
                  "return_code": {
                    "$ref": "#/components/schemas/WireReturnCode"
                  },
                  "return_additional_information": {
                    "type": "string",
                    "description": "Additional details about why the wire is being returned that will be included with the returned wire.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  },
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "The amount to be returned in cents. If not provided, the original wire amount will be used."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outgoing return wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access wires..",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires/{wire_id}/request_return": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "request-return-for-wire-v1",
        "summary": "Request return for a wire V1",
        "description": "Send a return request (camt.056) to the counterparty financial institution for a previously sent outgoing wire.\nReturns the updated wire object with a new entry in the `return_requests` array in `pending` status.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the outgoing wire you want to request a return for.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireOutgoingReturnRequestReason",
                    "description": "The reason for the return request."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 210,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                    "description": "Free-text explanation accompanying the return request. Required if `reason` is `narrative` or `wrong_amount`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object with a new return request in the `return_requests` array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires/{wire_id}/reject_return_request": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "reject-return-request-for-wire-v1",
        "summary": "Reject a return request",
        "description": "Reject the currently active incoming return request associated with the wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire whose active incoming return request you want to reject.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestRejectionReason",
                    "description": "The reason for rejecting the incoming return request."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                    "description": "Accompanying free text explanation for the reason. Required when `reason` is `narrative`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "The specified wire ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/wires/{wire_id}/cancel": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "cancel-a-wire-v1",
        "summary": "Cancel a wire V1",
        "description": "Cancel a wire object.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to cancel.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated canceled wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid external wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires": {
      "get": {
        "tags": [
          "Wire"
        ],
        "operationId": "list-all-wires-v2",
        "summary": "List all wires V2",
        "description": "List all wire objects.",
        "parameters": [
          {
            "name": "account_number_id",
            "description": "Returns wires associated with this `account_number_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            }
          },
          {
            "name": "core_transaction_id",
            "description": "Returns wires associated with this `core_transaction_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^core_transaction_.+$"
            }
          },
          {
            "name": "end_to_end_identification",
            "description": "Returns wires associated with this `end_to_end_identification`.",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 35
            }
          },
          {
            "name": "direction",
            "description": "Returns wires with this `direction`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireDirection"
            }
          },
          {
            "name": "status",
            "description": "Returns wires with this `status`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireStatus"
            }
          },
          {
            "name": "corridor_type",
            "description": "Returns wires with this `corridor_type`.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/CorridorType"
            }
          },
          {
            "name": "return_request_status",
            "description": "Returns wires that have a return request in this status.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/WireReturnRequestStatus"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object’s field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of wire objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WireV2"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access wires.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. Please confirm your query param.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "create-a-wire-v2",
        "summary": "Create a wire V2",
        "description": "Create a new outgoing wire",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAWireRequestBodyV2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outgoing wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires/{wire_id}": {
      "get": {
        "tags": [
          "Wire"
        ],
        "operationId": "retrieve-a-wire-v2",
        "summary": "Retrieve a wire V2",
        "description": "Retrieve a wire object.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to retrieve.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid external wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Wire"
        ],
        "operationId": "update-a-wire-v2",
        "summary": "Update a wire V2",
        "description": "Update a wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to update.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires/{wire_id}/cancel": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "cancel-a-wire-v2",
        "summary": "Cancel a wire V2",
        "description": "Cancel a wire object.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to cancel.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated canceled wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid external wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires/{wire_id}/return": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "return-a-wire-v2",
        "summary": "Return a wire V2",
        "description": "Initiate a return against an incoming wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to return. May be an incoming transfer wire or an incoming return wire.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnReasonV2"
                  },
                  "return_additional_information": {
                    "type": "string",
                    "description": "Additional details about why the wire is being returned that will be included with the returned wire. Required when `reason` is `narrative`.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  },
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "The amount to be returned in cents. If not provided, the original wire amount will be used."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outgoing return wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires/{wire_id}/request_return": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "request-return-for-wire-v2",
        "summary": "Request return for a wire V2",
        "description": "Create a return request for a previously sent outgoing wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to request a return for. Must be an outgoing transfer or return wire in `posted` status that has not been fully returned.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireOutgoingReturnRequestReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Accompanying free-text explanation for the reason. Required when `reason` is `narrative`, `wrong_amount`, or `service_not_rendered`.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the new return request in the `return_requests` array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. The wire may not be eligible for a return request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/wires/{wire_id}/reject_return_request": {
      "post": {
        "tags": [
          "Wire"
        ],
        "operationId": "reject-return-request-for-wire-v2",
        "summary": "Reject a return request for a wire V2",
        "description": "Reject the currently active incoming return request associated with the wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "wire_id",
            "description": "ID of the wire object whose active return request you want to reject.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestRejectionReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Accompanying free-text explanation for the reason. Required when `reason` is `narrative`.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the active return request now in `rejected` status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. There may be no active return request associated with this wire.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/{wire_id}/advance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-advance-wire",
        "summary": "Advance Sandbox Wire",
        "description": "Advance a Wire in Sandbox.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the Wire object you want to advance.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wire Object advanced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/incoming": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-wire",
        "summary": "Simulate Incoming Wire",
        "description": "Simulate an incoming Wire.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateIncomingWireRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incoming Wire object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/{wire_id}/incoming_return": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-wire-return",
        "summary": "Simulate Incoming Wire Return",
        "description": "Simulate an incoming Wire Return.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the Wire object you want to return.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "return_code"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "The amount to be returned in USD. Amount of the wire should be in currency's minor units."
                  },
                  "return_code": {
                    "$ref": "#/components/schemas/WireReturnCode"
                  },
                  "return_additional_information": {
                    "type": "string",
                    "description": "Additional details about why the wire is being returned that will be included with the returned wire.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wire return object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/{wire_id}/incoming_return_request": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request",
        "summary": "Simulate Incoming Wire Return Request",
        "description": "Simulate an incoming wire return request.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the outgoing wire you want to simulate an incoming return request against.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Free-text explanation included with the simulated request.",
                    "maxLength": 105
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, now containing the new return request entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. The wire must be an outgoing wire eligible for receiving a return request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/{wire_id}/incoming_return_request_rejection": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request-rejection",
        "summary": "Simulate Incoming Wire Return Request Rejection",
        "description": "Simulate an incoming wire return request rejection.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire whose outgoing return request you want to simulate a rejection of.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestRejectionReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Free-text explanation included with the simulated rejection.",
                    "maxLength": 105
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the outgoing return request now in `rejected` status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "No active outgoing return request found on this wire, or other validation failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/wires/{wire_id}/incoming_return_request_acceptance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request-acceptance",
        "summary": "Simulate Incoming Wire Return Request Acceptance",
        "description": "Simulate an incoming wire return request acceptance.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire whose outgoing return request you want to simulate an acceptance of.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "currency_code"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "Amount to be returned, in the currency's minor units. Must be greater than zero and not exceed the original wire amount."
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the outgoing return request now in `accepted` status and a return wire credited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV1"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "No active outgoing return request found, amount exceeds wire amount, or other validation failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/incoming": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-wire-v2",
        "summary": "Simulate Incoming Wire V2",
        "description": "Simulates an incoming wire against a creditor account in sandbox. Automatically advances to posted on creation; no call to advance required.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateIncomingWireRequestV2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incoming wire object created. The response body is empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. Field-level detail is returned, including CPMI\ncharacter set violations, a US BIC on `debtor_agent.business_identifier_code`, neither\nrouting field present on `debtor_agent`, or an invalid nine-digit ABA on\n`debtor_agent.local_routing_identifier.value` or `instructing_agent.local_routing_identifier.value`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/{wire_id}/incoming_return": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-wire-return-v2",
        "summary": "Simulate Incoming Wire Return V2",
        "description": "Simulates an incoming return wire against an outgoing wire in sandbox. Automatically advances to posted on creation.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the outgoing wire (or outgoing return wire) you want to return.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "Amount to return in USD cents."
                  },
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnReasonV2",
                    "description": "Return reason code."
                  },
                  "return_additional_information": {
                    "type": "string",
                    "description": "Additional details about why the wire is being returned.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incoming wire return object created. The response body is empty.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "wire_id is not in a valid state to be returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. Field-level detail is returned, including CPMI\ncharacter set violations and a missing `return_additional_information` when `reason` is\n`narrative`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/{wire_id}/incoming_return_request": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request-v2",
        "summary": "Simulate Incoming Wire Return Request V2",
        "description": "Simulate an incoming wire return request.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the outgoing wire you want to simulate an incoming return request against.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Free-text explanation included with the simulated request.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, now containing the new return request entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate. The wire must be an outgoing wire eligible for receiving a return request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/{wire_id}/incoming_return_request_rejection": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request-rejection-v2",
        "summary": "Simulate Incoming Wire Return Request Rejection V2",
        "description": "Simulate an incoming wire return request rejection.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire whose outgoing return request you want to simulate a rejection of.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/WireReturnRequestRejectionReason"
                  },
                  "additional_information": {
                    "type": "string",
                    "description": "Free-text explanation included with the simulated rejection.",
                    "minLength": 1,
                    "maxLength": 105,
                    "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the outgoing return request now in `rejected` status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "No active outgoing return request found on this wire, or other validation failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/{wire_id}/incoming_return_request_acceptance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-return-request-acceptance-v2",
        "summary": "Simulate Incoming Wire Return Request Acceptance V2",
        "description": "Simulate an incoming wire return request acceptance.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire whose outgoing return request you want to simulate an acceptance of.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/WireAmount",
                    "description": "Amount to be returned, in the currency's minor units. Must be greater than zero and not exceed the original wire amount. Defaults to the original wire's full amount when omitted."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated wire object, with the outgoing return request now in `accepted` status and a return wire credited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WireV2"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "No active outgoing return request found, amount exceeds wire amount, or other validation failure.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/simulate/wires/{wire_id}/advance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-advance-wire-v2",
        "summary": "Advance Sandbox Wire V2",
        "description": "Advance a Wire in Sandbox.",
        "parameters": [
          {
            "name": "wire_id",
            "description": "ID of the wire object you want to advance.",
            "example": "wire_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^wire_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wire object advanced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimulateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "wire_id passed in is not a valid wire object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/entities": {
      "post": {
        "tags": [
          "Entity"
        ],
        "operationId": "create-an-entity",
        "summary": "Create an entity",
        "description": "Create an Individual, Sole Prop or Business Entity.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAnEntityRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity object created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAnEntitySuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "An entity with the same client_customer_id already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Entity"
        ],
        "operationId": "retrieve-an-entity-by-client-customer-id",
        "summary": "Retrieve an entity by client customer id",
        "description": "Retrieve an entity by the client customer id",
        "parameters": [
          {
            "name": "client_customer_id",
            "in": "query",
            "required": true,
            "description": "Client Customer ID of the entity object you want to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An entity object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveAnEntitySuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "id passed in doesn't correspond to an entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/entities/{id}": {
      "patch": {
        "tags": [
          "Entity"
        ],
        "operationId": "Update-an-entity",
        "summary": "Update an entity",
        "description": "Certain updates on Entity trigger KYC re-screening, requiring an updated kyc_details.result and kyc_details.screened_at.\n\nFor individual entities, KYC re-screening is triggered by changes to: first name, last name, date of birth, tax ID value, switching between `us_entity` and `non_us_entity` when that adds or removes a tax ID, and an existing identification document (for non-US entities). The requirement applies only when kyc_details has previously been submitted for the entity, and the new kyc_details.screened_at must be later than the previous one.\n\nFor business and sole proprietorship entities, KYC re-screening is triggered by changes to: business name, business type, tax ID (US entities), and existing identification document (non-US entities).\n\nNote: Business and sole proprietors cannot switch between US and non-US entities. A new entity must be created in such case.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Entity ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAnEntityRequestBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity object updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateAnEntitySuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "id passed in doesn't correspond to an entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "A request to update this entity is already in progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Entity"
        ],
        "operationId": "retrieve-an-entity-by-entity-id",
        "summary": "Retrieve an entity by entity id",
        "description": "Retrieve an entity by entity id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Entity ID of the entity object you want to retrieve.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An entity object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetrieveAnEntitySuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "id passed in doesn't correspond to an entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/originators": {
      "post": {
        "tags": [
          "Originator"
        ],
        "operationId": "create-an-originator",
        "summary": "Create an Originator",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "CreateOriginatorRequest",
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "pattern": "^account_\\w+$",
                    "description": "The account ID to create the originator for.",
                    "example": "account_xyz123"
                  },
                  "entity_id": {
                    "$ref": "#/components/schemas/EntityID"
                  },
                  "company_name": {
                    "example": "Company, Inc.",
                    "type": "string",
                    "pattern": "^[\\x20-\\x7E]*$"
                  },
                  "ach": {
                    "$ref": "#/components/schemas/AchOriginatorParameters"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "entity_id",
                  "ach",
                  "company_name",
                  "account_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "You've reached the rate limit for this call, your request was not processed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Originator"
        ],
        "operationId": "list-all-originators",
        "summary": "List all Originators",
        "description": "List all Originators.",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "example": "account_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^account_\\w+$"
            },
            "description": "The account ID to retrieve the originators for."
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to start the list after."
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to end the list before."
          },
          {
            "name": "status",
            "in": "query",
            "example": "active",
            "schema": {
              "type": "string"
            },
            "description": "The status of the originator."
          }
        ],
        "responses": {
          "200": {
            "description": "List of Originators",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOriginator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/originators/{originator_id}": {
      "patch": {
        "tags": [
          "Originator"
        ],
        "operationId": "update-an-originator",
        "summary": "Update an Originator",
        "description": "Update an Originator's parameters.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "originator_id",
            "in": "path",
            "required": true,
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to be retrieved."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "UpdateOriginatorRequest",
                "type": "object",
                "properties": {
                  "ach": {
                    "$ref": "#/components/schemas/AchOriginatorUpdateParameters"
                  },
                  "company_name": {
                    "type": "string",
                    "pattern": "^[\\x20-\\x7E]*$"
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "404": {
            "description": "Originator ID not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "You've reached the rate limit for this call, your request was not processed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Originator"
        ],
        "operationId": "retrieve-an-originator",
        "summary": "Retrieve an Originator",
        "description": "Retrieve an Originator.",
        "parameters": [
          {
            "name": "originator_id",
            "in": "path",
            "required": true,
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to be retrieved."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "404": {
            "description": "Originator ID not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/originators/{originator_id}/activate": {
      "post": {
        "tags": [
          "Originator"
        ],
        "operationId": "activate-an-originator",
        "summary": "Activate an Originator",
        "description": "Activate an Originator.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "originator_id",
            "in": "path",
            "required": true,
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to be activated."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "ActivateOriginatorRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Originator."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "404": {
            "description": "Originator ID not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/originators/{originator_id}/deactivate": {
      "post": {
        "tags": [
          "Originator"
        ],
        "operationId": "deactivate-an-originator",
        "summary": "Deactivate an Originator",
        "description": "Deactivate an Originator.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "originator_id",
            "in": "path",
            "required": true,
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to be deactivated."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "DeactivateOriginatorRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Originator."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "404": {
            "description": "Originator ID not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/originators/{originator_id}/cancel": {
      "post": {
        "tags": [
          "Originator"
        ],
        "operationId": "cancel-an-originator",
        "summary": "Cancel an Originator",
        "description": "Cancel an Originator.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "originator_id",
            "in": "path",
            "required": true,
            "example": "originator_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^originator_\\w+$"
            },
            "description": "The ID of the originator to be cancelled."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "title": "CancelAnOriginatorRequest",
                "type": "object",
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata",
                    "description": "Updated metadata for the Originator."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Originator"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "status": "400"
                }
              }
            }
          },
          "403": {
            "description": "Operation Not Allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "operation_not_allowed",
                  "title": "Operation cannot be done on this object.",
                  "status": "403"
                }
              }
            }
          },
          "404": {
            "description": "Originator ID not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/fundings": {
      "post": {
        "tags": [
          "Funding"
        ],
        "operationId": "create-a-funding-v0",
        "summary": "Create a Funding",
        "description": "Creates a Funding object to request that Lead move funds from a Lead GL to the partner's funding FBO account.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255,
              "minLength": 5
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "CreateFundingRequestV0",
                "type": "object",
                "required": [
                  "subledger_balance_id",
                  "currency_code",
                  "principal"
                ],
                "properties": {
                  "subledger_balance_id": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Unique ID of the credit subledger balance object that a funding object is being created for. The referenced Subledger Balance must be in an `active` status. If the Subledger Balance has an `expected_maturity_date`, it must not be in the past.",
                    "example": "subledger_balance_1HCpXwx2EK9oYluWbacgeCnFcLf"
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/FundingCurrencyCode"
                  },
                  "principal": {
                    "type": "object",
                    "description": "The total amount of funding that is part of the loan product's principal. All amounts are in minor units. If the referenced Subledger Balance has a `details.structure` of `non_revolving`, the sum of all `principal.*` fields on this request plus the sum of `principal.*` fields on any prior Funding in a `posted` or `processing` status associated with that Subledger Balance must not exceed the Subledger Balance's `max_funding_amount`.",
                    "properties": {
                      "external_disbursement_amount": {
                        "type": "integer",
                        "description": "The portion of the principal amount that will be made available for external disbursement at the time of funding (in minor units). Either this field or `withheld_amount` must be greater than 0.",
                        "example": 100000
                      },
                      "withheld_amount": {
                        "type": "integer",
                        "description": "The portion of the principal amount that will be withheld and not disbursed externally at the time of funding (in minor units). Either this field or `external_disbursement_amount` must be greater than 0.",
                        "example": 1000
                      },
                      "merchant_origination_fee_amount": {
                        "type": "integer",
                        "description": "The amount of origination fees charged to the merchant that is included in the principal amount (in minor units). Must be less than `external_disbursement_amount` + `withheld_amount`.",
                        "example": 100
                      }
                    }
                  },
                  "other_fees": {
                    "type": "object",
                    "description": "Fees relating to the funding request that Lead needs awareness of for bookkeeping purposes only.",
                    "properties": {
                      "borrower_origination_fee_amount": {
                        "type": "integer",
                        "description": "Non-capitalized origination fee charged to the borrower at the point of funding (in minor units).",
                        "example": 200
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Additional metadata associated with the funding.",
                    "additionalProperties": true,
                    "example": {
                      "client_draw_id": "X67BU"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundingV0"
                },
                "example": {
                  "id": "funding_0o5Fs0EELR0fUjHjbCnEtdUwQe3",
                  "subledger_balance_id": "subledger_balance_1HCpXwx2EK9oYluWbacgeCnFcLf",
                  "currency_code": "USD",
                  "principal": {
                    "external_disbursement_amount": 100000,
                    "withheld_amount": 1000,
                    "merchant_origination_fee_amount": 100
                  },
                  "other_fees": {
                    "borrower_origination_fee_amount": 200
                  },
                  "metadata": {
                    "client_draw_id": "X67BU"
                  },
                  "status": "processing",
                  "rejection": {
                    "reason": "",
                    "details": ""
                  },
                  "created_at": "2025-09-02T11:01:36Z",
                  "updated_at": "2025-09-02T11:05:00Z"
                }
              }
            }
          },
          "400": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token was provided but lacks the proper scopes/permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/fundings/{id}": {
      "get": {
        "tags": [
          "Funding"
        ],
        "operationId": "retrieve-a-funding-v0",
        "summary": "Retrieve a Funding",
        "description": "Retrieve a Funding object.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "example": "funding_0o5Fs0EELR0fUjHjbCnEtdUwQe3",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "The ID of the funding object to be retrieved."
          }
        ],
        "responses": {
          "200": {
            "description": "A Funding object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundingV0"
                },
                "example": {
                  "id": "funding_0o5Fs0EELR0fUjHjbCnEtdUwQe3",
                  "subledger_balance_id": "subledger_balance_1HCpXwx2EK9oYluWbacgeCnFcLf",
                  "currency_code": "USD",
                  "principal": {
                    "external_disbursement_amount": 100000,
                    "withheld_amount": 1000,
                    "merchant_origination_fee_amount": 100
                  },
                  "other_fees": {
                    "borrower_origination_fee_amount": 200
                  },
                  "metadata": {
                    "client_draw_id": "X67BU"
                  },
                  "status": "posted",
                  "rejection": {
                    "reason": "",
                    "details": ""
                  },
                  "created_at": "2025-09-02T11:01:36Z",
                  "updated_at": "2025-09-02T11:05:00Z"
                }
              }
            }
          },
          "400": {
            "description": "The format of the funding ID passed in is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token was not used to call the API or lacks proper permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "The funding_id passed in is not a valid Funding ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/fundings/{id}/advance": {
      "post": {
        "tags": [
          "Funding"
        ],
        "operationId": "advance-a-funding-v0",
        "summary": "Advance a Funding (Simulation)",
        "description": "Advances a Funding object from processing to posted status in the Sandbox environment.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "example": "funding_0o5Fs0EELR0fUjHjbCnEtdUwQe3",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "description": "The ID of the funding object to advance."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "The format of the funding ID is invalid or the funding object is not in a processing status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token was not used to call the API or lacks proper permissions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "The funding_id passed in is not a valid Funding ID or this endpoint is only available in Sandbox.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/subledger_balances": {
      "post": {
        "tags": [
          "Subledger Balances"
        ],
        "operationId": "create-a-subledger-balance-v0",
        "summary": "Create a Subledger Balance",
        "description": "Create a Subledger Balance object. The newly created Subledger Balance will have a `status` of `active` and a `status_reason` of `active`, and a unique `id` with prefix `subledger_balance_` will be auto-generated.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 5,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubledgerBalanceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subledger Balance created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubledgerBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request body did not parse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "The token passed in is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Token has insufficient permissions for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "You've reached the rate limit for this call.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/subledger_balances/{id}": {
      "get": {
        "tags": [
          "Subledger Balances"
        ],
        "operationId": "retrieve-a-subledger-balance-v0",
        "summary": "Retrieve a Subledger Balance",
        "description": "Retrieve a Subledger Balance object.",
        "parameters": [
          {
            "name": "id",
            "description": "Return Subledger Balance associated with this `id`.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^subledger_balance_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An individual Subledger Balance object",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubledgerBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "id passed in is not a valid Subledger Balance object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "create-an-instant-payment",
        "summary": "Create an instant payment",
        "description": "Initiates an outgoing instant payment.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "account_number_id",
                  "amount",
                  "currency_code",
                  "creditor_agent",
                  "creditor"
                ],
                "properties": {
                  "account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID",
                    "description": "The ID of the Lead Bank Account Number object."
                  },
                  "amount": {
                    "$ref": "#/components/schemas/InstantPaymentAmount",
                    "description": "The amount of the instant payment in cents."
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode",
                    "description": "A three-letter currency code as defined in ISO 4217. Only USD is supported."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 140,
                    "description": "Free-form information on the reason for the payment.",
                    "example": "Payment for invoice 12345"
                  },
                  "creditor_agent": {
                    "$ref": "#/components/schemas/InstantPaymentAgent",
                    "description": "The details of the financial institution where the creditor (payee) holds their account."
                  },
                  "creditor": {
                    "$ref": "#/components/schemas/InstantPaymentParty",
                    "description": "The details of the creditor (payee) receiving the funds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new instant payment object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "list-all-instant-payments",
        "summary": "List all instant payments",
        "description": "List instant payments with optional filtering.",
        "parameters": [
          {
            "name": "account_id",
            "description": "Returns instant payments associated with this `account_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_\\w+$"
            }
          },
          {
            "name": "account_number_id",
            "description": "Returns instant payments associated with this `account_number_id`.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^account_number_\\w+$"
            }
          },
          {
            "name": "direction",
            "description": "Returns instant payments with the given direction.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Direction"
            }
          },
          {
            "name": "status",
            "description": "Returns instant payments with the given status.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InstantPaymentStatus"
            }
          },
          {
            "name": "counterparty_status",
            "description": "Returns instant payments with the given counterparty status.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InstantPaymentCounterpartyStatus"
            }
          },
          {
            "name": "return_request_status",
            "description": "Returns instant payments that have a return request with the given status.",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/InstantPaymentReturnRequestStatus"
            }
          },
          {
            "name": "created_at",
            "description": "A set of filters on the list using the object's field `created_at`.",
            "in": "query",
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "properties": {
                "after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is after the entered timestamp."
                },
                "on_or_after": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or after the entered timestamp."
                },
                "before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is before the entered timestamp."
                },
                "on_or_before": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Returns objects where the `created_at` timestamp is the same as or before the entered timestamp."
                }
              }
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          },
          {
            "name": "ending_before",
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list.",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of instant payment objects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InstantPayment"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access instant payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/{instant_payment_id}": {
      "get": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "retrieve-an-instant-payment",
        "summary": "Retrieve an instant payment",
        "description": "Retrieve the details of an instant payment.",
        "parameters": [
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to retrieve.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "An instant payment object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access this instant payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/{instant_payment_id}/return": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "return-an-instant-payment",
        "summary": "Return an instant payment",
        "description": "Initiates an outgoing instant payment return. If there is an outstanding return request, invoking this endpoint is\nalso understood as accepting the active return request.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to return.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/OutgoingInstantPaymentReturnReason",
                    "description": "The reason for the return."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 105,
                    "description": "Accompanying free text explanation for the reason. Required if reason is \"narrative\" or \"wrong_amount\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new outgoing return instant payment object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access instant payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/{instant_payment_id}/cancel": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "cancel-an-instant-payment",
        "summary": "Cancel an instant payment",
        "description": "Attempt to cancel an outgoing instant payment that is currently in \"created\" or \"under_review\"\nstatus.",
        "parameters": [
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to cancel.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated canceled instant payment object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "400": {
            "description": "Operation cannot be done on this object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "The instant payment has already been submitted and cannot be canceled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/{instant_payment_id}/request_return": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "request-return-for-instant-payment",
        "summary": "Request return for an instant payment",
        "description": "Send a return request to the counterparty for a previously posted outgoing instant payment.\nReturns the updated instant payment object with a new entry in the return_requests array.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to request a return for.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/OutgoingInstantPaymentReturnRequestReason",
                    "description": "The reason for the return request."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 105,
                    "description": "Accompanying free text explanation for the reason. Required if reason is \"wrong_amount\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated instant payment object with a new return request in the return_requests array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access instant payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "There is an active return request already associated with this payment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/{instant_payment_id}/reject_return_request": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "reject-return-request-for-instant-payment",
        "summary": "Reject return request for an instant payment",
        "description": "Reject the active return request associated with an incoming instant payment.\nReturns the updated instant payment object with the status of the active return request set to \"rejected\".",
        "parameters": [
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object whose return request you want to reject.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/OutgoingInstantPaymentReturnRequestRejectionReason",
                    "description": "The reason for rejecting the return request."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated instant payment object with the return request status set to \"rejected\".",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPayment"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "You do not have permission to access instant payments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/instant_payments/check_availability": {
      "post": {
        "tags": [
          "Instant Payments"
        ],
        "operationId": "check-instant-payment-availability",
        "summary": "Check instant payment availability",
        "description": "Check if a given routing number is eligible to receive an instant payment.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "routing_number"
                ],
                "properties": {
                  "routing_number": {
                    "type": "string",
                    "description": "The routing number of the financial institution where the creditor (payee) holds their account.",
                    "minLength": 9,
                    "maxLength": 9,
                    "pattern": "^[0-9]+$",
                    "example": "111000111"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Availability check result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstantPaymentAvailability"
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "The routing number is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/instant_payments/incoming": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-instant-payment",
        "summary": "Simulate Incoming Instant Payment",
        "description": "Simulate an incoming instant payment.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "creditor_account_number_id",
                  "amount",
                  "currency_code",
                  "debtor",
                  "debtor_agent"
                ],
                "properties": {
                  "creditor_account_number_id": {
                    "$ref": "#/components/schemas/AccountNumberID",
                    "description": "The ID of the Account Number object receiving the instant payment."
                  },
                  "amount": {
                    "$ref": "#/components/schemas/InstantPaymentAmount",
                    "description": "The amount of the instant payment in cents."
                  },
                  "currency_code": {
                    "$ref": "#/components/schemas/CurrencyCode",
                    "description": "A three-letter currency code as defined in ISO 4217. Only USD is supported."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 140,
                    "description": "Free-form information on the reason for the payment.",
                    "example": "Payment for invoice 12345"
                  },
                  "debtor": {
                    "$ref": "#/components/schemas/InstantPaymentParty",
                    "description": "The details of the debtor (payer) sending the funds."
                  },
                  "debtor_agent": {
                    "$ref": "#/components/schemas/InstantPaymentAgent",
                    "description": "The details of the financial institution where the debtor (payer) holds their account."
                  },
                  "payment_identifiers": {
                    "type": "object",
                    "description": "Optional payment identifiers.",
                    "properties": {
                      "end_to_end_id": {
                        "type": "string",
                        "description": "The identifier assigned by the party initiating the instant payment to be delivered to the customer unchanged.",
                        "maxLength": 35,
                        "example": "E2E-20240101-001"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intentionally empty - incoming instant payment will be created asynchronously."
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/instant_payments/{instant_payment_id}/incoming_return": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-instant-payment-return",
        "summary": "Simulate Incoming Instant Payment Return",
        "description": "Simulate an incoming instant payment return.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to return.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount",
                  "reason"
                ],
                "properties": {
                  "amount": {
                    "$ref": "#/components/schemas/InstantPaymentAmount",
                    "description": "The amount of the return in cents. Must be less than or equal to the original transaction amount."
                  },
                  "reason": {
                    "$ref": "#/components/schemas/OutgoingInstantPaymentReturnReason",
                    "description": "The reason for the return."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 105,
                    "description": "Accompanying free text explanation for the reason."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intentionally empty - incoming instant payment return will be created asynchronously."
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/instant_payments/{instant_payment_id}/incoming_return_request": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-instant-payment-return-request",
        "summary": "Simulate Incoming Instant Payment Return Request",
        "description": "Simulate an incoming instant payment return request.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object you want to request a return for.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/OutgoingInstantPaymentReturnRequestReason",
                    "description": "The reason for the return request."
                  },
                  "additional_information": {
                    "type": "string",
                    "maxLength": 105,
                    "description": "Accompanying free text explanation for the reason."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intentionally empty - instant payment record will be updated with return request details asynchronously."
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/instant_payments/{instant_payment_id}/incoming_return_request_rejection": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-instant-payment-return-request-rejection",
        "summary": "Simulate Incoming Instant Payment Return Request Rejection",
        "description": "Simulate an incoming instant payment return request rejection.",
        "parameters": [
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object whose return request you want to reject.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "$ref": "#/components/schemas/IncomingInstantPaymentReturnRequestRejectionReason",
                    "description": "The reason for rejecting the return request."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Intentionally empty - return request will be rejected asynchronously."
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/simulate/instant_payments/{instant_payment_id}/incoming_return_request_acceptance": {
      "post": {
        "tags": [
          "Simulation"
        ],
        "operationId": "simulate-incoming-instant-payment-return-request-acceptance",
        "summary": "Simulate Incoming Instant Payment Return Request Acceptance",
        "description": "Simulate an incoming instant payment return request acceptance.",
        "parameters": [
          {
            "name": "instant_payment_id",
            "description": "ID of the instant payment object whose return request you want to accept.",
            "example": "instant_payment_xyz001",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Intentionally empty - return request will be accepted asynchronously."
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Instant payment not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "We couldn't process your request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/applications": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "create-an-application",
        "summary": "Create an application",
        "description": "Creates a new credit application in terminal status.\n\n## Business Rules\n- Applications MUST be created in terminal status (approved, declined, canceled)\n- Maximum 20 entities per relationship type\n- Credit fields required for all applications\n- Adverse action notice required for declined applications\n- Authorized signers required for commercial account holders\n- credit.limit cannot exceed credit.max_limit\n\n## Idempotency\nThe Idempotency-Key header is required. Reusing a key with a different request\nbody will return a 422 error.\n",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "app-create-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApplicationRequest"
              },
              "examples": {
                "approved_commercial": {
                  "summary": "Approved commercial application",
                  "value": {
                    "status": "approved",
                    "entities": {
                      "account_holder_type": "commercial",
                      "account_holders": [
                        "entity_123456789"
                      ],
                      "authorized_signers": [
                        "entity_987654321"
                      ]
                    },
                    "details": {
                      "product_name": "Growth Business Credit Line",
                      "credit": {
                        "is_secured": true,
                        "is_mla": false,
                        "currency": "USD",
                        "underwriting_grade": "99",
                        "limit": 5000000,
                        "max_limit": 10000000,
                        "report": {
                          "score": 780,
                          "pulled_at": "2025-11-15T09:30:00Z",
                          "source": "experian"
                        }
                      }
                    },
                    "decision": {
                      "decided_at": "2025-11-17T14:00:00Z",
                      "reason": "Approved based on strong cash flow and collateral.",
                      "exception_approval_reason": "Manual override of automated debt-to-income threshold."
                    },
                    "documents": [
                      {
                        "document_id": "doc_consent_001",
                        "type": "credit_pull_consent",
                        "consented_at": "2025-11-15T09:00:00Z"
                      }
                    ]
                  }
                },
                "declined_consumer": {
                  "summary": "Declined consumer application",
                  "value": {
                    "status": "declined",
                    "entities": {
                      "account_holder_type": "consumer",
                      "account_holders": [
                        "entity_consumer_555000111"
                      ]
                    },
                    "details": {
                      "product_name": "Everyday Consumer Card",
                      "credit": {
                        "is_secured": false,
                        "is_mla": true,
                        "currency": "USD",
                        "underwriting_grade": "D",
                        "limit": 0,
                        "max_limit": 0,
                        "report": {
                          "score": 580,
                          "pulled_at": "2025-11-16T10:15:00Z",
                          "source": "transunion"
                        }
                      },
                      "adverse_action_notice": {
                        "delivered_at": "2025-11-16T10:17:00Z",
                        "reason": "Delinquent past credit obligations.",
                        "delivery_method": "email"
                      }
                    },
                    "decision": {
                      "decided_at": "2025-11-16T10:16:00Z",
                      "reason": "Does not meet minimum credit score requirements."
                    },
                    "documents": [
                      {
                        "document_id": "doc_aan_999",
                        "type": "aan",
                        "displayed_at": "2025-11-16T10:17:00Z"
                      }
                    ]
                  }
                },
                "canceled_commercial": {
                  "summary": "Canceled commercial application",
                  "value": {
                    "status": "canceled",
                    "entities": {
                      "account_holder_type": "commercial",
                      "account_holders": [
                        "entity_biz_777888999"
                      ],
                      "authorized_signers": [
                        "entity_person_111222333"
                      ]
                    },
                    "details": {
                      "product_name": "Secured Starter Loan",
                      "credit": {
                        "is_secured": true,
                        "is_mla": false,
                        "currency": "USD",
                        "limit": 0,
                        "max_limit": 0
                      }
                    },
                    "decision": {
                      "decided_at": "2025-11-17T08:00:00Z",
                      "reason": "Applicant withdrew request."
                    },
                    "documents": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Malformed JSON",
                    "value": {
                      "code": "payload_invalid",
                      "title": "Your request body did not parse.",
                      "detail": "We couldn't parse your request body, please check that your request body is valid JSON.",
                      "invalid_parameters": []
                    }
                  },
                  "missing_idempotency_key": {
                    "summary": "Missing Idempotency-Key header",
                    "value": {
                      "code": "idempotency_error",
                      "title": "A required HTTP header is missing.",
                      "detail": "Please add the Idempotency-Key header to the request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "An application with the same data already exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "missing_required_fields": {
                    "summary": "Missing required parameters",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The request is well-formed but contains semantic errors.",
                      "invalid_parameters": [
                        {
                          "name": "status",
                          "reason": "missing"
                        },
                        {
                          "name": "entities",
                          "reason": "missing"
                        }
                      ]
                    }
                  },
                  "missing_aan_for_declined": {
                    "summary": "Missing adverse action notice for declined status",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "details.decision.adverse_action_notice is required when status is 'declined'.",
                      "invalid_parameters": [
                        {
                          "name": "details.decision.adverse_action_notice",
                          "reason": "missing_for_status_declined"
                        }
                      ]
                    }
                  },
                  "missing_decision_reason": {
                    "summary": "Missing decision reason",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "details.decision.reason is required when status is 'approved', 'declined', or 'canceled'.",
                      "invalid_parameters": [
                        {
                          "name": "details.decision.reason",
                          "reason": "missing"
                        }
                      ]
                    }
                  },
                  "entity_not_found": {
                    "summary": "Entity ID not found",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "No Entity exists for the provided entity_id 'entity_123...'",
                      "invalid_parameters": [
                        {
                          "name": "entities.account_holders[0]",
                          "reason": "not_found"
                        }
                      ]
                    }
                  },
                  "limit_exceeds_max": {
                    "summary": "Credit limit exceeds max limit",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "credit_limit (10000) cannot exceed max_credit_limit (5000).",
                      "invalid_parameters": [
                        {
                          "name": "details.credit.limit",
                          "reason": "exceeds_max_limit"
                        }
                      ]
                    }
                  },
                  "idempotency_mismatch": {
                    "summary": "Idempotency key reused with different request",
                    "value": {
                      "code": "idempotency_request_inconsistent",
                      "title": "The request made does not match the previous request made with this idempotency key.",
                      "detail": "If you are trying to make a new request, then please update the idempotency key; otherwise, please use the same request body to make this request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-an-application-by-client-application-id",
        "summary": "Retrieve an application by client application ID",
        "description": "Retrieves an application by the `client_application_id` you assigned, supplied\nas a query parameter: `GET /v0/applications?client_application_id=...`. This is\nthe filtered form of the applications collection and is distinct from\n`GET /v0/applications/{id}`, which takes the server-generated Application ID\n(`application_*`). The response body is identical to `GET /v0/applications/{id}`.\n",
        "parameters": [
          {
            "name": "client_application_id",
            "in": "query",
            "required": true,
            "description": "The `client_application_id` assigned to the application.",
            "schema": {
              "type": "string"
            },
            "example": "APP-2024-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Application object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be processed (e.g. missing client_application_id).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "client_application_id passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/applications/{id}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-an-application",
        "summary": "Retrieve an application",
        "description": "Retrieves a specific application by its server-generated ID (application_*).\n\nTo retrieve an application by the client_application_id you assigned, use the\nfiltered collection form instead: GET /v0/applications?client_application_id=...\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Server-generated application ID (application_*)",
            "schema": {
              "$ref": "#/components/schemas/ApplicationID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Application object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "The format of the application ID is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "detail": "The format of the application ID is invalid.",
                  "invalid_parameters": [
                    {
                      "name": "id",
                      "reason": "String must match format application_*"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Application ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Compliance"
        ],
        "operationId": "update-an-application",
        "summary": "Update an application",
        "description": "Updates properties on an existing application.\n\nUses JSON Merge Patch semantics (RFC 7396): omitted fields are unchanged,\nexplicit values overwrite, nested objects merge recursively.\n\nNote: Entity relationships are set when the application is created and cannot be\nmodified afterward. There is no endpoint for adding or removing entity relationships\non an existing application; GET /v0/applications/{id}/entity_relationships is read-only.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Application ID",
            "schema": {
              "$ref": "#/components/schemas/ApplicationID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "app-update-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchApplicationRequest"
              },
              "examples": {
                "update_metadata": {
                  "summary": "Update metadata",
                  "value": {
                    "metadata": {
                      "external_id": "APP-2024-001"
                    }
                  }
                },
                "update_credit": {
                  "summary": "Update credit details",
                  "value": {
                    "details": {
                      "credit": {
                        "limit": 7500000
                      }
                    }
                  }
                },
                "update_decision": {
                  "summary": "Update decision",
                  "value": {
                    "decision": {
                      "decided_at": "2026-01-15T14:30:00Z",
                      "reason": "Updated after additional review"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Application ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict - idempotency key reuse with different payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/applications/{id}/entity_relationships": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "list-application-entity-relationships",
        "summary": "List application entity relationships",
        "description": "Lists all entity relationships for a specific application.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Application ID",
            "schema": {
              "$ref": "#/components/schemas/ApplicationID"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results to return. Defaults to 25, max 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "A cursor for pagination. Returns results starting after this cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of entity relationships for the application.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available beyond this page."
                    },
                    "cursor": {
                      "type": "string",
                      "description": "Cursor to retrieve the next page of results. Only present when has_more is true."
                    },
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EntityRelationship"
                      }
                    }
                  },
                  "required": [
                    "has_more",
                    "objects"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Application ID does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "create-an-account",
        "summary": "Create an account",
        "description": "Creates a new account.\n\n## Business Rules\n- Status is set to `active` by default on creation\n- Maximum 20 entities per relationship type\n- Cannot mix individual and business/sole_prop entities in account_holders\n- Authorized signers required for business/sole_prop account holders\n- application_id is required for credit accounts\n\n## Idempotency\nThe Idempotency-Key header is required. Reusing a key with a different request\nbody will return a 422 error.\n",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "acct-create-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccountRequest"
              },
              "examples": {
                "consumer_deposit": {
                  "summary": "Consumer deposit account",
                  "value": {
                    "capabilities": [
                      "deposit"
                    ],
                    "entities": {
                      "account_holder_type": "consumer",
                      "account_holders": [
                        "entity_consumer_123"
                      ]
                    },
                    "details": {
                      "product_name": "Everyday Checking"
                    },
                    "metadata": {},
                    "documents": []
                  }
                },
                "commercial_credit": {
                  "summary": "Commercial credit account",
                  "value": {
                    "application_id": "application_xyz123",
                    "capabilities": [
                      "credit_with_underwriting"
                    ],
                    "entities": {
                      "account_holder_type": "commercial",
                      "account_holders": [
                        "entity_biz_456"
                      ],
                      "authorized_signers": [
                        "entity_signer_789"
                      ]
                    },
                    "details": {
                      "product_name": "Business Credit Line",
                      "credit": {
                        "is_secured": false,
                        "is_mla": false,
                        "underwriting_grade": "A",
                        "currency": "USD",
                        "available_credit": 5000000,
                        "limit": 5000000,
                        "max_limit": 10000000
                      }
                    },
                    "metadata": {
                      "external_id": "BIZ-2024-001"
                    },
                    "documents": [
                      {
                        "document_id": "doc_terms_001",
                        "type": "loan_agreement",
                        "displayed_at": "2025-11-15T09:00:00Z"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Malformed JSON",
                    "value": {
                      "code": "payload_invalid",
                      "title": "Your request body did not parse.",
                      "detail": "We couldn't parse your request body, please check that your request body is valid JSON.",
                      "invalid_parameters": []
                    }
                  },
                  "missing_idempotency_key": {
                    "summary": "Missing Idempotency-Key header",
                    "value": {
                      "code": "idempotency_error",
                      "title": "A required HTTP header is missing.",
                      "detail": "Please add the Idempotency-Key header to the request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "missing_required_fields": {
                    "summary": "Missing required parameters",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The request is well-formed but contains semantic errors.",
                      "invalid_parameters": [
                        {
                          "name": "capabilities",
                          "reason": "missing"
                        },
                        {
                          "name": "entities",
                          "reason": "missing"
                        }
                      ]
                    }
                  },
                  "entity_not_found": {
                    "summary": "Entity ID not found",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "No Entity exists for the provided entity_id 'entity_123...'",
                      "invalid_parameters": [
                        {
                          "name": "entities.account_holders[0]",
                          "reason": "not_found"
                        }
                      ]
                    }
                  },
                  "missing_authorized_signers": {
                    "summary": "Missing authorized signers for commercial account",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "Authorized signers are required for commercial account holders.",
                      "invalid_parameters": [
                        {
                          "name": "entities.authorized_signers",
                          "reason": "missing_for_commercial"
                        }
                      ]
                    }
                  },
                  "idempotency_mismatch": {
                    "summary": "Idempotency key reused with different request",
                    "value": {
                      "code": "idempotency_request_inconsistent",
                      "title": "The request made does not match the previous request made with this idempotency key.",
                      "detail": "If you are trying to make a new request, then please update the idempotency key; otherwise, please use the same request body to make this request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-an-account-by-client-account-id",
        "summary": "Retrieve an account by client account ID",
        "description": "Retrieves an account by the `client_account_id` you assigned, supplied as a\nquery parameter: `GET /v0/accounts?client_account_id=...`. This is the filtered\nform of the accounts collection and is distinct from `GET /v0/accounts/{id}`,\nwhich takes the server-generated Account ID (`account_*`). The response body is\nidentical to `GET /v0/accounts/{id}`.\n",
        "parameters": [
          {
            "name": "client_account_id",
            "in": "query",
            "required": true,
            "description": "The `client_account_id` assigned to the account.",
            "schema": {
              "type": "string"
            },
            "example": "BIZ-2024-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Account object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be processed (e.g. missing client_account_id).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "client_account_id passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-an-account",
        "summary": "Retrieve an account",
        "description": "Retrieves a specific account by its ID.\nAccepts a server-generated ID (account_*).\n\nNote: Entity relationships are not included in the response.\nUse GET /v0/accounts/{id}/entity_relationships to retrieve them.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            },
            "example": "account_2N5Hk8xYmQpL9rBvC3jD"
          }
        ],
        "responses": {
          "200": {
            "description": "Account object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "The format of the account ID is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "parameters_invalid",
                  "title": "Your request parameters did not validate.",
                  "detail": "The format of the account ID is invalid.",
                  "invalid_parameters": [
                    {
                      "name": "id",
                      "reason": "String must match format account_*"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Compliance"
        ],
        "operationId": "update-an-account",
        "summary": "Update an account",
        "description": "Updates properties on an existing account.\n\nNote: To manage entity relationships, use the /entity_relationships endpoints.\nStatus changes should use dedicated endpoints (/activate, /deactivate, /close).\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "acct-update-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAccountRequest"
              },
              "examples": {
                "update_metadata": {
                  "summary": "Update metadata",
                  "value": {
                    "metadata": {
                      "external_id": "BIZ-2024-002"
                    }
                  }
                },
                "update_credit": {
                  "summary": "Update credit details",
                  "value": {
                    "details": {
                      "credit": {
                        "available_credit": 3000000,
                        "limit": 3000000
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/activate": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "activate-an-account",
        "summary": "Activate an account",
        "description": "Transitions an account from `inactive` to `active` status.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "acct-activate-12345-abc"
          }
        ],
        "responses": {
          "200": {
            "description": "Account activated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Account cannot be activated from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/deactivate": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "deactivate-an-account",
        "summary": "Deactivate an account",
        "description": "Transitions an account from `active` to `inactive` status.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "acct-deactivate-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountDeactivateRequest"
              },
              "examples": {
                "deactivate_with_reason": {
                  "summary": "Deactivate with reason",
                  "value": {
                    "status_reason": "dormant"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account deactivated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Account cannot be deactivated from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/close": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "close-an-account",
        "summary": "Close an account",
        "description": "Transitions an account to `closed` status (terminal state).\nThis action cannot be undone.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "acct-close-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCloseRequest"
              },
              "examples": {
                "close_with_reason": {
                  "summary": "Close with reason",
                  "value": {
                    "status_reason": "client_closed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account closed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Account cannot be closed from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/entity_relationships": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "list-account-entity-relationships",
        "summary": "List account entity relationships",
        "description": "Lists all entity relationships for a specific account.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results to return. Defaults to 25, max 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "required": false,
            "description": "A cursor for pagination. Returns results starting after this cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of entity relationships for the account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available beyond this page."
                    },
                    "cursor": {
                      "type": "string",
                      "description": "Cursor to retrieve the next page of results. Only present when has_more is true."
                    },
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EntityRelationship"
                      }
                    }
                  },
                  "required": [
                    "has_more",
                    "objects"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/entity_relationships/{entity_id}": {
      "delete": {
        "tags": [
          "Compliance"
        ],
        "operationId": "delete-account-entity-relationship",
        "summary": "Delete account entity relationship",
        "description": "Deletes a specific entity relationship from an account and returns the updated list of entity relationships.\nThe relationship_type must be specified to identify which relationship to delete.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "entity_id",
            "in": "path",
            "required": true,
            "description": "Entity ID to remove from the account relationships",
            "schema": {
              "$ref": "#/components/schemas/EntityID"
            }
          },
          {
            "name": "relationship_type",
            "in": "query",
            "required": true,
            "description": "The specific relationship type to delete for the entity.",
            "schema": {
              "$ref": "#/components/schemas/EntityRelationshipType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entity relationship deleted successfully. Returns the updated list of entity relationships for the account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EntityRelationship"
                      }
                    }
                  },
                  "required": [
                    "objects"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID or Entity ID does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "account_not_found": {
                    "summary": "Account not found",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "Account ID does not exist.",
                      "invalid_parameters": [
                        {
                          "name": "id",
                          "reason": "not_found"
                        }
                      ]
                    }
                  },
                  "entity_relationship_not_found": {
                    "summary": "Entity relationship not found",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The specified relationship type for this entity does not exist on this account.",
                      "invalid_parameters": [
                        {
                          "name": "entity_id",
                          "reason": "not_found"
                        },
                        {
                          "name": "relationship_type",
                          "reason": "not_found"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/accounts/{id}/entity_relationships/batch": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "batch-create-account-entity-relationships",
        "summary": "Batch create account entity relationships",
        "description": "Associates multiple entities with an account under a single relationship type.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Account ID",
            "schema": {
              "$ref": "#/components/schemas/AccountID"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "batch-entity-rel-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateEntityRelationshipsRequest"
              },
              "examples": {
                "authorized_user": {
                  "summary": "Batch add authorized users",
                  "value": {
                    "entity_ids": [
                      "entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
                      "entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
                      "entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
                      "entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
                      "entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
                    ],
                    "relationship_type": "authorized_user"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity relationships created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account_id": {
                      "$ref": "#/components/schemas/AccountID"
                    },
                    "relationship_type": {
                      "$ref": "#/components/schemas/EntityRelationshipType"
                    },
                    "entity_ids": {
                      "type": "array",
                      "description": "List of entity IDs associated with the account under the specified relationship type.",
                      "items": {
                        "$ref": "#/components/schemas/EntityID"
                      }
                    }
                  },
                  "required": [
                    "account_id",
                    "relationship_type",
                    "entity_ids"
                  ]
                },
                "examples": {
                  "authorized_user": {
                    "summary": "Batch add authorized users",
                    "value": {
                      "account_id": "account_9h8g7f6e5d4c3b2a1z0y9x8w7v6",
                      "relationship_type": "authorized_user",
                      "entity_ids": [
                        "entity_8kL9jH7gF6dS5aQ4wE3rT2yU1iO",
                        "entity_2mN3bV4cX5zL6kwdJ7hG8fD9sA0",
                        "entity_1qW2eR3tY4uI5oP6aS7dF8gH9jK",
                        "entity_9pLuO8iK7yJ6hT5gR4fE3dD2sS1",
                        "entity_5zX4cV3bN2m1qW0eR9tY8uI7oP6"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Account ID does not exist.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "A request with this Idempotency-Key has already been processed with different parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please slow down your request rate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/cards": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-a-card-by-client-card-id",
        "summary": "Retrieve a card by client card ID",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nRetrieves a card by the `client_card_id` you assigned, supplied as a query\nparameter: `GET /v0/cards?client_card_id=...`. This is the filtered form of\nthe cards collection and is distinct from `GET /v0/cards/{id}`, which takes\nthe server-generated Card ID (`card_*`). The response body is identical to\n`GET /v0/cards/{id}`.\n",
        "parameters": [
          {
            "name": "client_card_id",
            "in": "query",
            "required": true,
            "description": "The `client_card_id` assigned to the card.",
            "schema": {
              "type": "string"
            },
            "example": "my-client-card-001"
          }
        ],
        "responses": {
          "200": {
            "description": "Card object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be processed (e.g. an empty `client_card_id` or invalid program context).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "client_card_id passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed (e.g. the `client_card_id` query parameter is missing).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "missing_client_card_id": {
                    "summary": "Missing client_card_id query parameter",
                    "value": {
                      "code": "validation_error",
                      "title": "Validation Error",
                      "detail": "One or more request parameters failed validation",
                      "invalid_parameters": [
                        {
                          "name": "client_card_id",
                          "reason": "parameter \"client_card_id\" in query has an error: value is required but missing"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "create-a-card",
        "summary": "Create a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nCreates a new card.\n\n## Business Rules\n- A new card is created in the `active` state. `status` is system-managed and cannot be set on create; status changes go through the status-transition endpoints.\n- `details.replacement_for` references an existing card that this card replaces. When provided, the referenced card must be in `closed` status at the time of the write and must not already be referenced by another card.\n\n## Idempotency\nThe Idempotency-Key header is required. Reusing a key with a different request\nbody will return a 422 error.\n",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "card-create-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCardRequest"
              },
              "examples": {
                "consumer_card": {
                  "summary": "Consumer card",
                  "value": {
                    "account_id": "account_xyz123",
                    "entity_id": "entity_xyz123",
                    "details": {
                      "card_product_name": "Rewards Visa",
                      "is_virtual": false,
                      "card_type": "consumer",
                      "expiry_date": "2029-01-31",
                      "last_four": "1234"
                    },
                    "metadata": {}
                  }
                },
                "replacement_card": {
                  "summary": "Replacement card for a closed card",
                  "value": {
                    "account_id": "account_xyz123",
                    "entity_id": "entity_xyz123",
                    "details": {
                      "card_product_name": "Rewards Visa",
                      "is_virtual": false,
                      "card_type": "consumer",
                      "expiry_date": "2029-01-31",
                      "last_four": "5678",
                      "replacement_for": "card_old123"
                    },
                    "metadata": {
                      "replacement_reason": "lost"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "invalid_json": {
                    "summary": "Malformed JSON",
                    "value": {
                      "code": "payload_invalid",
                      "title": "Your request body did not parse.",
                      "detail": "We couldn't parse your request body, please check that your request body is valid JSON.",
                      "invalid_parameters": []
                    }
                  },
                  "missing_idempotency_key": {
                    "summary": "Missing Idempotency-Key header",
                    "value": {
                      "code": "operation_not_allowed",
                      "title": "This operation cannot be done on this object.",
                      "detail": "One or more request parameters failed validation",
                      "invalid_parameters": [
                        {
                          "name": "Idempotency-Key",
                          "reason": "parameter \"Idempotency-Key\" in header has an error: value is required but missing"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "missing_required_fields": {
                    "summary": "Missing required parameters",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The request is well-formed but contains semantic errors.",
                      "invalid_parameters": [
                        {
                          "name": "account_id",
                          "reason": "missing"
                        },
                        {
                          "name": "entity_id",
                          "reason": "missing"
                        }
                      ]
                    }
                  },
                  "replacement_for_target_not_closed": {
                    "summary": "replacement_for target is not in closed status",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The card referenced by replacement_for must be in `closed` status at the time of the write.",
                      "invalid_parameters": [
                        {
                          "name": "details.replacement_for",
                          "reason": "target_not_closed"
                        }
                      ]
                    }
                  },
                  "replacement_for_conflict": {
                    "summary": "replacement_for target is already referenced",
                    "value": {
                      "code": "parameters_invalid",
                      "title": "Your request parameters did not validate.",
                      "detail": "The card referenced by replacement_for is already referenced by another card.",
                      "invalid_parameters": [
                        {
                          "name": "details.replacement_for",
                          "reason": "target_already_replaced"
                        }
                      ]
                    }
                  },
                  "idempotency_mismatch": {
                    "summary": "Idempotency key reused with different request",
                    "value": {
                      "code": "idempotency_request_inconsistent",
                      "title": "The request made does not match the previous request made with this idempotency key.",
                      "detail": "If you are trying to make a new request, then please update the idempotency key; otherwise, please use the same request body to make this request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/cards/{id}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "operationId": "retrieve-a-card",
        "summary": "Retrieve a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nRetrieves a specific card by its ID. Accepts either the server-generated\nCard ID (`card_*`) or the `client_card_id` of a card created via file\nupload.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The Card ID. Either the server-generated Card ID (`card_*`) or the\n`client_card_id` assigned when the card was created via file upload.\n",
            "schema": {
              "type": "string"
            },
            "example": "card_2N5Hk8xYmQpL9rBvC3jD"
          }
        ],
        "responses": {
          "200": {
            "description": "Card object retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "The request could not be processed (e.g. invalid program context).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Card ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call, your request was not processed.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Compliance"
        ],
        "operationId": "update-a-card",
        "summary": "Update a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nUpdates mutable attributes of a card. This is a partial update: only the\nfields present in the request body are changed; omitted fields are left\nunchanged. Card `status` is system-managed and changes through the\nstatus-transition endpoints, not this endpoint.\n\n## Idempotency\nThe Idempotency-Key header is required. Reusing a key with a different request\nbody will return a 422 error.\n",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "card-update-12345-abc"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The server-generated Card ID (`card_*`). Unlike retrieve, this endpoint\naccepts only the server-generated ID, not a `client_card_id`.\n",
            "schema": {
              "$ref": "#/components/schemas/CardID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchCardRequest"
              },
              "examples": {
                "update_metadata": {
                  "summary": "Update metadata",
                  "value": {
                    "metadata": {
                      "cost_center": "1234"
                    }
                  }
                },
                "update_product_name": {
                  "summary": "Rename the card product",
                  "value": {
                    "details": {
                      "card_product_name": "Rewards Visa Signature"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Card ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Request validation failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "examples": {
                  "idempotency_mismatch": {
                    "summary": "Idempotency key reused with different request",
                    "value": {
                      "code": "idempotency_request_inconsistent",
                      "title": "The request made does not match the previous request made with this idempotency key.",
                      "detail": "If you are trying to make a new request, then please update the idempotency key; otherwise, please use the same request body to make this request.",
                      "invalid_parameters": []
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "rate_limit_exceeded",
                  "title": "You've reached the rate limit for this call.",
                  "detail": "If you are continuously hitting rate limits please contact the Lead team.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/cards/{id}/activate": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "activate-a-card",
        "summary": "Activate a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nTransitions a card from `inactive` or `closed` to `active` status.\nReactivating a closed card clears its `closed_at` and `status_reason`.\nA card that has been replaced (i.e., its ID has been referenced in the\n`replacement_for` field on a separate card) or has an `expiry_date`\nin the past cannot be reactivated.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The server-generated Card ID.",
            "schema": {
              "$ref": "#/components/schemas/CardID"
            },
            "example": "card_2N5Hk8xYmQpL9rBvC3jD"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "card-activate-12345-abc"
          }
        ],
        "responses": {
          "200": {
            "description": "Card activated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Card ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Card cannot be activated from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/cards/{id}/deactivate": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "deactivate-a-card",
        "summary": "Deactivate a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nTransitions a card from `active` or `closed` to `inactive` status.\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The server-generated Card ID.",
            "schema": {
              "$ref": "#/components/schemas/CardID"
            },
            "example": "card_2N5Hk8xYmQpL9rBvC3jD"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "card-deactivate-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDeactivateRequest"
              },
              "examples": {
                "deactivate_with_reason": {
                  "summary": "Deactivate with reason",
                  "value": {
                    "status_reason": "dormant"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card deactivated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Card ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Card cannot be deactivated from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/cards/{id}/close": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "operationId": "close-a-card",
        "summary": "Close a card",
        "description": "> **Beta:** This endpoint is in beta and may change before general availability.\n\nTransitions a card from `active` or `inactive` to `closed` status.\nA closed card can later be referenced as a `replacement_for` target\nor reactivated via the activate endpoint (unless it has been replaced).\n\n## Idempotency\nThe Idempotency-Key header is required.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The server-generated Card ID.",
            "schema": {
              "$ref": "#/components/schemas/CardID"
            },
            "example": "card_2N5Hk8xYmQpL9rBvC3jD"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique key to ensure idempotent requests",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "card-close-12345-abc"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardCloseRequest"
              },
              "examples": {
                "close_with_reason": {
                  "summary": "Close with reason",
                  "value": {
                    "status_reason": "client_closed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Card closed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Card"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request or missing required header.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Valid access token was not used to call the API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "403": {
            "description": "Valid access token lacks the proper scopes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "Card ID passed in is not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid status transition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                },
                "example": {
                  "code": "invalid_status_transition",
                  "title": "Invalid status transition.",
                  "detail": "Card cannot be closed from current status.",
                  "invalid_parameters": []
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Please try your request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/blockchain_payments": {
      "post": {
        "tags": [
          "Blockchain Payment"
        ],
        "operationId": "create-a-blockchain-payment",
        "summary": "Create a Blockchain Payment",
        "description": "Creates a blockchain payment for fiat or cross-border payments.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Idempotency key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 5,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBlockchainPaymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockchainPayment"
                }
              }
            }
          },
          "400": {
            "description": "We couldn't parse your request body, please check that your request body is valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "The referenced entity was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency key has already been used with a different request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "422": {
            "description": "Your request parameters did not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please retry after some time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Blockchain Payment"
        ],
        "operationId": "list-all-blockchain-payments",
        "summary": "List all Blockchain Payments",
        "description": "List all Blockchain Payments.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter payments by their current status.",
            "schema": {
              "$ref": "#/components/schemas/BlockchainPaymentStatus"
            }
          },
          {
            "name": "limit",
            "description": "Maximum number of objects to be returned.",
            "in": "query",
            "example": 10,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "example": "blockchain_payment_xyz123",
            "schema": {
              "type": "string",
              "pattern": "^blockchain_payment_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list."
          },
          {
            "name": "ending_before",
            "in": "query",
            "example": "blockchain_payment_xyz456",
            "schema": {
              "type": "string",
              "pattern": "^blockchain_payment_\\w+$"
            },
            "description": "A cursor for use in pagination; this is an ID that defines your place in the list."
          }
        ],
        "responses": {
          "200": {
            "description": "List of Blockchain Payment objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "objects",
                    "has_more"
                  ],
                  "properties": {
                    "objects": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlockchainPayment"
                      }
                    },
                    "has_more": {
                      "type": "boolean",
                      "description": "Indicates whether more results are available."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid query parameter value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please retry after some time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    },
    "/v0/blockchain_payments/{blockchain_payment_id}": {
      "get": {
        "tags": [
          "Blockchain Payment"
        ],
        "operationId": "retrieve-a-blockchain-payment",
        "summary": "Retrieve a Blockchain Payment",
        "description": "Retrieve a Blockchain Payment.",
        "parameters": [
          {
            "name": "blockchain_payment_id",
            "in": "path",
            "required": true,
            "example": "blockchain_payment_xyz123",
            "schema": {
              "type": "string",
              "minLength": 5,
              "pattern": "^blockchain_payment_\\w+$"
            },
            "description": "The ID of the blockchain payment object to be retrieved."
          }
        ],
        "responses": {
          "200": {
            "description": "A Blockchain Payment object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockchainPayment"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "404": {
            "description": "The blockchain_payment_id passed in is not a valid Blockchain Payment ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests. Please retry after some time.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Direction": {
        "type": "string",
        "description": "Who is initiating the transaction.\n\noutgoing: You are sending a transaction to a counterparty.\nincoming: You are receiving a transaction from a counterparty.",
        "example": "outgoing",
        "enum": [
          "outgoing",
          "incoming"
        ]
      },
      "AchStatus": {
        "description": "The current status of the ACH object.",
        "type": "string",
        "example": "submitted",
        "enum": [
          "scheduled",
          "processing",
          "submitted",
          "posted",
          "canceled",
          "under_review",
          "approved",
          "rejected",
          "pending_return",
          "returned",
          "pending_dishonored_return",
          "return_dishonored",
          "pending_contested_return",
          "return_contested"
        ]
      },
      "TransactionType": {
        "type": "string",
        "description": "ACH transaction type.",
        "example": "credit",
        "enum": [
          "credit",
          "debit"
        ]
      },
      "Amount": {
        "description": "The amount of the transaction in cents.",
        "type": "integer",
        "format": "int64",
        "example": 5000,
        "minimum": 0,
        "maximum": 9900000000
      },
      "AccountID": {
        "type": "string",
        "description": "The ID of the Account object.",
        "example": "account_xyz123",
        "pattern": "^account_\\w+$"
      },
      "AccountNumberID": {
        "type": "string",
        "description": "The ID of the Lead Bank Account Number object.",
        "example": "account_number_xyz123",
        "pattern": "^account_number_\\w+$"
      },
      "DeliveryType": {
        "type": "string",
        "example": "same_business_day",
        "description": "How fast you want the counterparty to receive the ACH.\n* `same_business_day`: if the ACH request is submitted before the cutoff window with the same business day option, funds will settle on the same day. \n* `next_business_day`: standard ACH processing, for funds to settle on the next business day.",
        "enum": [
          "same_business_day",
          "next_business_day"
        ]
      },
      "SecCode": {
        "type": "string",
        "description": "Standard Entry Class (SEC) code to use for this ACH object.\n\nLead currently only supports `CCD`, `PPD`, `WEB`, and `TEL` for outgoing ACHes.",
        "example": "WEB",
        "enum": [
          "PPD",
          "CCD",
          "ARC",
          "BOC",
          "CIE",
          "CTX",
          "IAT",
          "POP",
          "POS",
          "RCK",
          "TEL",
          "WEB",
          "ADV",
          "DNE",
          "ENR",
          "MTE",
          "SHR",
          "TRC",
          "TRX",
          "COR"
        ]
      },
      "CurrencyCode": {
        "description": "A three-letter currency code as defined in ISO 4217.",
        "type": "string",
        "example": "USD",
        "enum": [
          "USD"
        ]
      },
      "StatementDescriptor": {
        "type": "string",
        "description": "The description you would like to appear on your customers’ statement. Maximum number of characters is 10.",
        "example": "P2P Credit",
        "minLength": 1,
        "maxLength": 10,
        "pattern": "^(?!0+$)(?! +$)[\\x20-\\x7E]*$"
      },
      "TransactionCode": {
        "type": "string",
        "example": "checking_credit",
        "description": "Identifies the type of debit or credit Entry and the account type",
        "enum": [
          "checking_credit",
          "checking_credit_prenote",
          "checking_debit",
          "checking_debit_prenote",
          "savings_credit",
          "savings_credit_prenote",
          "savings_debit",
          "savings_debit_prenote"
        ]
      },
      "IndividualId": {
        "type": "string",
        "description": "The name of the individual you are sending funds to. _Required for P2P payments._",
        "maxLength": 15,
        "pattern": "^[\\x20-\\x7E]*$"
      },
      "ReceiverName": {
        "type": "string",
        "description": "The name of the receiver of funds. _Note: This field is set by the counterparty and may or not be accurate._",
        "pattern": "^[\\x20-\\x7E]*$"
      },
      "DescriptiveDate": {
        "type": "string",
        "description": "The date you would like displayed to the counterparty.\n*Receiving financial institutions may utilize this field to display on the statement.*",
        "example": "220627",
        "maxLength": 6,
        "pattern": "^[\\x20-\\x7E]*$"
      },
      "AdditionalInformation": {
        "type": "string",
        "description": "Additional information for the ACH recipient. _Not all banks will share this message with their end customer._",
        "maxLength": 80,
        "pattern": "^[\\x20-\\x7E]*$"
      },
      "AccountType": {
        "type": "string",
        "example": "checking",
        "description": "The account type for the bank account. This should be one of checking or savings.",
        "enum": [
          "checking",
          "savings"
        ]
      },
      "Counterparty": {
        "type": "object",
        "description": "The details of the counterparty you are sending/receiving money from.",
        "required": [
          "account_number",
          "routing_number",
          "account_type",
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the counterparty you are transacting with.",
            "example": "Lara Smikle",
            "maxLength": 22,
            "pattern": "^(?!\\s*$)[\\x20-\\x7E]*$"
          },
          "account_number": {
            "type": "string",
            "description": "The account number for the bank account.",
            "example": "1032345678",
            "maxLength": 17,
            "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$"
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number for the bank account. This should be the ACH routing number, not the wire routing number.",
            "example": "021000021",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          },
          "account_type": {
            "$ref": "#/components/schemas/AccountType"
          }
        }
      },
      "ReturnCode": {
        "type": "string",
        "description": "NACHA Return codes.",
        "example": "R02",
        "enum": [
          "R01",
          "R02",
          "R03",
          "R04",
          "R05",
          "R06",
          "R07",
          "R08",
          "R09",
          "R10",
          "R11",
          "R12",
          "R13",
          "R14",
          "R15",
          "R16",
          "R17",
          "R18",
          "R19",
          "R20",
          "R21",
          "R22",
          "R23",
          "R24",
          "R25",
          "R26",
          "R27",
          "R28",
          "R29",
          "R30",
          "R31",
          "R32",
          "R33",
          "R34",
          "R35",
          "R36",
          "R37",
          "R38",
          "R39",
          "R40",
          "R41",
          "R42",
          "R43",
          "R44",
          "R45",
          "R46",
          "R47",
          "R50",
          "R51",
          "R52",
          "R53",
          "R61",
          "R62",
          "R67",
          "R68",
          "R69",
          "R70",
          "R71",
          "R72",
          "R73",
          "R74",
          "R75",
          "R76",
          "R77",
          "R80",
          "R81",
          "R82",
          "R83",
          "R84",
          "R85"
        ]
      },
      "Return": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Type of the return record, determined by the respective return code.",
            "example": "return",
            "enum": [
              "return",
              "dishonored_return",
              "contested_return"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/AchStatus"
          },
          "return_code": {
            "$ref": "#/components/schemas/ReturnCode"
          },
          "return_reason": {
            "type": "string",
            "description": "Short description of the associated return code."
          },
          "trace_number": {
            "type": "string",
            "description": "The unique number assigned to this ACH return by the ODFI, which identifies the entry within a specific ACH file.",
            "example": "123456789012345"
          },
          "additional_information": {
            "type": "string",
            "description": "Based on the associated return code, if the content is provided by the parties, the additional information field in the ACH addenda."
          }
        }
      },
      "ReversalReason": {
        "type": "string",
        "description": "Reason you want to initiate a reversal.",
        "enum": [
          "duplicate",
          "receiver_incorrect",
          "amount_incorrect",
          "debit_too_early",
          "credit_too_late"
        ]
      },
      "RejectionReason": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "The rejection code that indicates the type of rejection",
            "example": "account_number_status"
          },
          "details": {
            "type": "string",
            "description": "Additional info about the rejection",
            "example": "Account number account_123 is inactive."
          }
        }
      },
      "AchCorrection": {
        "type": "object",
        "description": "The corrected `counterparty` details.",
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The updated account number for the `counterparty`.",
            "example": "1032345678",
            "maxLength": 17
          },
          "routing_number": {
            "type": "string",
            "description": "The updated routing number for the `counterparty`.",
            "example": "021000021",
            "minLength": 9,
            "maxLength": 9
          },
          "account_type": {
            "type": "string",
            "description": "The updated account type for the `counterparty`.",
            "enum": [
              "checking",
              "savings"
            ]
          }
        }
      },
      "Metadata": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "description": "A set of key-value pairs that can be used to store additional information related to this object."
      },
      "IatTransactionTypeCode": {
        "type": "string",
        "description": "Identifies the purpose of the IAT transaction.",
        "example": "business",
        "enum": [
          "annuity",
          "business",
          "deposit",
          "loan",
          "miscellaneous",
          "mortgage",
          "pension",
          "rental_lease",
          "salary",
          "tax",
          "telephone",
          "internet",
          "accounts_receivable",
          "back_office_conversion",
          "point_of_purchase",
          "represented_check"
        ]
      },
      "IatParty": {
        "type": "object",
        "description": "Name and address of a party to an IAT transaction, in NACHA format.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the party.",
            "example": "Acme Inc.",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "street_address": {
            "type": "string",
            "description": "Physical street address of the party.",
            "example": "123 Main Street",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "city_state_province": {
            "type": "string",
            "description": "City and state or province of the party. Max 35 characters",
            "example": "New York*NY\\",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "country_postal_code": {
            "type": "string",
            "description": "Country code and postal code of the party. Country code is ISO 3166-1 alpha-2. Max 35 characters.",
            "example": "US*10001\\",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          }
        }
      },
      "IatFinancialInstitution": {
        "type": "object",
        "description": "Financial institution details for an IAT transaction.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the financial institution.",
            "example": "First National Bank",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "identifier_type": {
            "type": "string",
            "description": "Type of bank identifier",
            "example": "swift_bic",
            "enum": [
              "national_clearing_system",
              "business_identifier_code",
              "iban"
            ]
          },
          "identifier_code": {
            "type": "string",
            "description": "The identifier value for the financial institution, corresponding to the `identifier_type` (e.g., SWIFT BIC, routing number, IBAN).",
            "example": "FNBUS33XXX",
            "maxLength": 34,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "branch_country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code for the branch country of the financial institution.",
            "example": "US",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          }
        }
      },
      "IatReceiver": {
        "type": "object",
        "description": "Name, reference number, and address of the receiver of an IAT transaction.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the receiver or beneficiary of the transaction.",
            "example": "Lara Smikle",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "reference_number": {
            "type": "string",
            "description": "Reference number assigned by the originator for tracking this receiver or payment.",
            "example": "RCV-2024-001",
            "maxLength": 15,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "street_address": {
            "type": "string",
            "description": "Physical street address of the receiver.",
            "example": "456 Maple Avenue",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "city_state_province": {
            "type": "string",
            "description": "City and state or province of the receiver. Max 35 characters.",
            "example": "Toronto*ON\\",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "country_postal_code": {
            "type": "string",
            "description": "Country code and postal code of the receiver. Country code is ISO 3166-1 alpha-2. Max 35 characters.",
            "example": "CA*M5H 2N2\\",
            "maxLength": 35,
            "pattern": "^[\\x20-\\x7E]*$"
          }
        }
      },
      "IatDetails": {
        "type": "object",
        "description": "IAT (International ACH Transaction) specific details. Present only when sec_code is IAT.",
        "properties": {
          "transaction_type_code": {
            "$ref": "#/components/schemas/IatTransactionTypeCode"
          },
          "destination_country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code identifying the destination country of the transaction.",
            "example": "CA",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          },
          "originator_currency_code": {
            "type": "string",
            "description": "ISO 4217 three-letter currency code in which the ACH was originated.",
            "example": "USD",
            "minLength": 3,
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$"
          },
          "destination_currency_code": {
            "type": "string",
            "description": "ISO 4217 three-letter currency code in which the ACH will be received.",
            "example": "CAD",
            "minLength": 3,
            "maxLength": 3,
            "pattern": "^[A-Z]{3}$"
          },
          "foreign_trace_number": {
            "type": "string",
            "description": "Trace number assigned to the Entry in the originating national payments system. Only present for inbound IAT entries.",
            "example": "FRN-2024-98765-INTL",
            "maxLength": 22,
            "pattern": "^[\\x20-\\x7E]*$"
          },
          "additional_information": {
            "$ref": "#/components/schemas/AdditionalInformation"
          },
          "originator": {
            "$ref": "#/components/schemas/IatParty"
          },
          "originating_financial_institution": {
            "$ref": "#/components/schemas/IatFinancialInstitution"
          },
          "receiver": {
            "$ref": "#/components/schemas/IatReceiver"
          },
          "receiving_financial_institution": {
            "$ref": "#/components/schemas/IatFinancialInstitution"
          },
          "foreign_correspondent_banks": {
            "type": "array",
            "description": "Intermediary or correspondent banks in the payment chain. Up to 5 banks may be listed.",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/IatFinancialInstitution"
            }
          }
        }
      },
      "Ach": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "id of the ACH object",
            "example": "ach_xyz001",
            "pattern": "^ach_\\w+$"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the ACH object was created.",
            "example": "2022-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the ACH object was last updated.",
            "example": "2022-06-27T11:22:33Z"
          },
          "status": {
            "$ref": "#/components/schemas/AchStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "delivery_type": {
            "$ref": "#/components/schemas/DeliveryType"
          },
          "transaction_type": {
            "$ref": "#/components/schemas/TransactionType"
          },
          "sec_code": {
            "$ref": "#/components/schemas/SecCode"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "statement_descriptor": {
            "$ref": "#/components/schemas/StatementDescriptor"
          },
          "record_details": {
            "type": "object",
            "properties": {
              "transaction_code": {
                "$ref": "#/components/schemas/TransactionCode"
              },
              "company_name": {
                "type": "string",
                "description": "The company that initiated the outgoing ACH.\n\n- For outgoing ACH, this value is set from the Account Number object.\n- For incoming ACH, this value is what we receive from the sender.",
                "example": "Acme Inc.",
                "pattern": "^[\\x20-\\x7E]*$"
              },
              "company_id": {
                "type": "string",
                "description": "A 10-digit unique identifier used for identify companies collecting payments via ACH debit. If you would like to use a specific company ID when sending outgoing ACH, please contact us.\n\n- For outgoing ACH, this value is set from the Account Number object.\n- For incoming ACH, this value is what we receive from the sender.",
                "example": "1234"
              },
              "company_discretionary_data": {
                "type": "string",
                "description": "Additional information from the ACH sender on incoming ACHes.",
                "example": "Acme Inc."
              },
              "effective_date": {
                "type": "string",
                "description": "The date the ACH transaction is expected to settle with the financial institution.\n\n- For outgoing ACH, the date is set by Lead based on the delivery_type field.\n- For incoming ACH, this value is what we receive from the sender.",
                "example": "2022-06-27"
              },
              "settlement_date": {
                "type": "string",
                "description": "Date by which funds must be posted to the counterparty's account.",
                "example": "2022-06-27"
              },
              "individual_id": {
                "$ref": "#/components/schemas/IndividualId"
              },
              "receiver_name": {
                "$ref": "#/components/schemas/ReceiverName"
              },
              "descriptive_date": {
                "$ref": "#/components/schemas/DescriptiveDate"
              },
              "additional_information": {
                "$ref": "#/components/schemas/AdditionalInformation"
              },
              "trace_number": {
                "type": "string",
                "description": "The unique number assigned to every ACH entry by an ODFI which identifies that entry within a specific ACH file.\n\n- For outgoing ACH, this is generated by Lead when we submit the ACH.\n- For incoming ACH, this value is what we receive from the sender.",
                "example": "123456789012345"
              }
            }
          },
          "counterparty": {
            "$ref": "#/components/schemas/Counterparty"
          },
          "returns": {
            "type": "array",
            "description": "Associated returns.",
            "items": {
              "$ref": "#/components/schemas/Return"
            }
          },
          "reversal": {
            "type": "object",
            "description": "A reversal associated with this object.",
            "properties": {
              "reversal_reason": {
                "$ref": "#/components/schemas/ReversalReason"
              },
              "linked_ach_id": {
                "type": "string",
                "description": "Id of the reversal object."
              }
            }
          },
          "rejection": {
            "$ref": "#/components/schemas/RejectionReason"
          },
          "correction": {
            "$ref": "#/components/schemas/AchCorrection"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "iat_details": {
            "$ref": "#/components/schemas/IatDetails"
          }
        }
      },
      "InvalidParameterDetail": {
        "type": "object",
        "properties": {
          "parameter": {
            "type": "string",
            "description": "Which parameter is invalid.",
            "example": "transaction_type"
          },
          "reason": {
            "type": "string",
            "description": "Why the parameter is invalid."
          }
        }
      },
      "APIError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The error code."
          },
          "title": {
            "type": "string",
            "description": "The error title."
          },
          "detail": {
            "type": "string",
            "description": "A detailed error description."
          },
          "status": {
            "type": "string",
            "description": "The HTTP status code."
          },
          "invalid_parameters": {
            "type": "array",
            "description": "Invalid request parameters with reasons, if applicable.",
            "items": {
              "$ref": "#/components/schemas/InvalidParameterDetail"
            }
          },
          "instance": {
            "type": "string",
            "description": "The object causing this specific occurrence of the error, if applicable."
          }
        }
      },
      "OutgoingSecCode": {
        "type": "string",
        "description": "The Standard Entry Class, SEC, to code the outgoing ACH.\nLead currently supports:\n* `CCD`: Corporate payment\n* `PPD`: Written authorization to initiate payment\n* `TEL`: Telephone initiated payment\n* `WEB`: Web initiated payment\n* `CIE`: Customer initiated entry\n",
        "example": "WEB",
        "enum": [
          "CCD",
          "PPD",
          "TEL",
          "WEB",
          "CIE"
        ]
      },
      "OutgoingReturnCode": {
        "type": "string",
        "description": "The NACHA Return code under which to initiate this return.\nR0x–R5x initiate a standard return against the original ACH origination.\nR61, R62, R67, R68, R69, R70 dishonor an existing return.\nR71–R77 contest an existing dishonored return.\nThe return code must match the current state of the return chain.\n",
        "example": "R02",
        "enum": [
          "R01",
          "R02",
          "R03",
          "R05",
          "R07",
          "R08",
          "R09",
          "R10",
          "R11",
          "R14",
          "R15",
          "R16",
          "R17",
          "R22",
          "R23",
          "R29",
          "R61",
          "R62",
          "R67",
          "R68",
          "R69",
          "R70",
          "R71",
          "R72",
          "R73",
          "R74",
          "R75",
          "R76",
          "R77"
        ]
      },
      "ClientCustomerID": {
        "type": "string",
        "description": "The ID of your customer.",
        "example": "<your_customer_id>",
        "maxLength": 64
      },
      "EntityID": {
        "type": "string",
        "description": "The ID of your entity.",
        "example": "entity_xyz123",
        "pattern": "^entity_[^\\s]{1,33}$"
      },
      "AccountNumberStatus": {
        "type": "string",
        "description": "Account Number Status",
        "example": "active",
        "enum": [
          "active",
          "inactive",
          "canceled",
          "unassigned"
        ]
      },
      "OriginatorID": {
        "type": "string",
        "description": "The ID of the Originator object.",
        "example": "originator_xyz123",
        "pattern": "^originator_[^\\s]{1,33}$"
      },
      "CounterpartyFilter": {
        "type": "string",
        "description": "Control mode for counterparty filtering",
        "example": "accept_all",
        "enum": [
          "accept_all",
          "reject_all",
          "allowlist_only"
        ]
      },
      "CompanyId": {
        "type": "string",
        "description": "ACH Company Id",
        "example": 1234567890,
        "pattern": "^\\d{10}$"
      },
      "IncomingAch": {
        "type": "object",
        "description": "Incoming ACH payment controls",
        "properties": {
          "accept_credit": {
            "type": "boolean",
            "description": "Accept ACH credits"
          },
          "accept_debit": {
            "type": "boolean",
            "description": "Accept ACH debits"
          },
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_company_ids_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed Company IDs when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/CompanyId"
            }
          }
        }
      },
      "AllowedCounterpartyAccount": {
        "type": "object",
        "required": [
          "type",
          "account_number",
          "routing_number"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "us_domestic"
            ]
          },
          "account_number": {
            "type": "string",
            "example": 123412341234,
            "maxLength": 17,
            "minLength": 8,
            "pattern": "^[a-zA-Z0-9]+$"
          },
          "routing_number": {
            "type": "string",
            "example": 123412341234,
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          }
        }
      },
      "OutgoingAch": {
        "type": "object",
        "description": "Outgoing ACH payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedCounterpartyAccount"
            }
          }
        }
      },
      "AchControls": {
        "type": "object",
        "description": "ACH payment controls",
        "properties": {
          "originator_id": {
            "$ref": "#/components/schemas/OriginatorID"
          },
          "incoming": {
            "$ref": "#/components/schemas/IncomingAch"
          },
          "outgoing": {
            "$ref": "#/components/schemas/OutgoingAch"
          }
        }
      },
      "IncomingWire": {
        "type": "object",
        "description": "Incoming Wire payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedCounterpartyAccount"
            }
          }
        }
      },
      "OutgoingWire": {
        "type": "object",
        "description": "Outgoing Wire payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedCounterpartyAccount"
            }
          }
        }
      },
      "AllowedInternationalCounterpartyAccount": {
        "type": "object",
        "required": [
          "business_identifier_code",
          "account_identifier"
        ],
        "properties": {
          "business_identifier_code": {
            "type": "string",
            "description": "BIC (Business Identifier Code / SWIFT code)",
            "example": "CHASUS33",
            "pattern": "^[A-Za-z]{4}[A-Za-z]{2}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$"
          },
          "account_identifier": {
            "type": "object",
            "description": "Account identifier for the international account",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of account identifier",
                "enum": [
                  "IBAN",
                  "account_number"
                ]
              },
              "value": {
                "type": "string",
                "description": "The account identifier value",
                "example": "GB29NWBK60161331926819",
                "minLength": 1,
                "maxLength": 34
              }
            }
          }
        }
      },
      "OutgoingInternationalWire": {
        "type": "object",
        "description": "Outgoing International Wire payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_international_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed international destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedInternationalCounterpartyAccount"
            }
          }
        }
      },
      "WireControls": {
        "type": "object",
        "description": "Wire payment controls",
        "properties": {
          "incoming": {
            "$ref": "#/components/schemas/IncomingWire"
          },
          "outgoing": {
            "$ref": "#/components/schemas/OutgoingWire"
          },
          "outgoing_international": {
            "$ref": "#/components/schemas/OutgoingInternationalWire"
          }
        }
      },
      "IncomingInternalTransfer": {
        "type": "object",
        "description": "Controls for receiving internal transfers",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_number_ids_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowlist of account_number IDs that can send",
            "items": {
              "$ref": "#/components/schemas/AccountNumberID"
            }
          }
        }
      },
      "OutgoingInternalTransfer": {
        "type": "object",
        "description": "Controls for sending internal transfers",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_number_ids_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowlist of account_number IDs to send to",
            "items": {
              "$ref": "#/components/schemas/AccountNumberID"
            }
          }
        }
      },
      "InternalTransferControls": {
        "type": "object",
        "description": "Internal Transfer controls",
        "properties": {
          "incoming": {
            "$ref": "#/components/schemas/IncomingInternalTransfer"
          },
          "outgoing": {
            "$ref": "#/components/schemas/OutgoingInternalTransfer"
          }
        }
      },
      "AllowedUsDomesticCounterpartyAccount": {
        "type": "object",
        "required": [
          "account_number",
          "routing_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "example": 123412341234,
            "maxLength": 17,
            "minLength": 8,
            "pattern": "^[a-zA-Z0-9]+$"
          },
          "routing_number": {
            "type": "string",
            "example": 123412341234,
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          }
        }
      },
      "IncomingInstantPayment": {
        "type": "object",
        "description": "Incoming Instant Payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedUsDomesticCounterpartyAccount"
            }
          }
        }
      },
      "OutgoingInstantPayment": {
        "type": "object",
        "description": "Outgoing Instant Payment controls",
        "properties": {
          "counterparty_filter": {
            "$ref": "#/components/schemas/CounterpartyFilter",
            "default": "accept_all"
          },
          "counterparty_account_numbers_allowlist": {
            "type": "array",
            "maxLength": 20,
            "description": "Allowed destinations when mode is allowlist_only",
            "items": {
              "$ref": "#/components/schemas/AllowedUsDomesticCounterpartyAccount"
            }
          }
        }
      },
      "InstantPaymentControls": {
        "type": "object",
        "description": "Instant Payment controls",
        "properties": {
          "incoming": {
            "$ref": "#/components/schemas/IncomingInstantPayment"
          },
          "outgoing": {
            "$ref": "#/components/schemas/OutgoingInstantPayment"
          }
        }
      },
      "AccountNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the retrieved Account Number.",
            "example": "account_number_xyz",
            "pattern": "^account_number_\\w+$"
          },
          "account_number": {
            "type": "string",
            "description": "The account number.",
            "example": 123412341234
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number.",
            "example": 123456789
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "client_customer_id": {
            "$ref": "#/components/schemas/ClientCustomerID"
          },
          "entity_id": {
            "$ref": "#/components/schemas/EntityID"
          },
          "status": {
            "$ref": "#/components/schemas/AccountNumberStatus"
          },
          "ach_controls": {
            "$ref": "#/components/schemas/AchControls"
          },
          "wire_controls": {
            "$ref": "#/components/schemas/WireControls"
          },
          "internal_transfer_controls": {
            "$ref": "#/components/schemas/InternalTransferControls"
          },
          "instant_payment_controls": {
            "$ref": "#/components/schemas/InstantPaymentControls"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of creation in ISO-8601 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The timestamp of last update in ISO-8601 format."
          }
        }
      },
      "ListAccountNumber": {
        "type": "object",
        "required": [
          "objects",
          "has_more"
        ],
        "properties": {
          "objects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountNumber"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Indicates if there are more account numbers to retrieve."
          }
        }
      },
      "CoreAccountType": {
        "type": "string",
        "example": "attributed",
        "enum": [
          "attributed",
          "direct",
          "shadow"
        ]
      },
      "CoreAccountID": {
        "type": "string",
        "example": "core_account_xyz123",
        "pattern": "^core_account_\\w+$"
      },
      "CoreAccountStatus": {
        "type": "string",
        "example": "active",
        "enum": [
          "active",
          "inactive",
          "closed"
        ]
      },
      "CoreAccountHolderType": {
        "type": "string",
        "example": "lead",
        "enum": [
          "lead",
          "partner"
        ]
      },
      "CoreAccountEntities": {
        "type": "object",
        "properties": {
          "account_holder_type": {
            "$ref": "#/components/schemas/CoreAccountHolderType"
          },
          "account_holders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 1
          },
          "authorized_users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 1
          }
        }
      },
      "CoreAccountPermissions": {
        "type": "object",
        "properties": {
          "allowed_actors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            }
          }
        }
      },
      "CoreAccount": {
        "type": "object",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CoreAccountID"
          },
          "name": {
            "type": "string",
            "example": "Consumer FBO"
          },
          "type": {
            "$ref": "#/components/schemas/CoreAccountType"
          },
          "status": {
            "$ref": "#/components/schemas/CoreAccountStatus"
          },
          "entities": {
            "$ref": "#/components/schemas/CoreAccountEntities"
          },
          "permissions": {
            "$ref": "#/components/schemas/CoreAccountPermissions"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-09-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-21T12:00:00Z"
          }
        }
      },
      "ErrorCode": {
        "type": "string",
        "description": "A snake_case code identifying the error family — the stable, machine-readable value partners branch on, together with the HTTP status.",
        "example": "parameters_invalid",
        "enum": [
          "request_malformed",
          "idempotency_key_missing",
          "authentication_missing",
          "token_invalid",
          "source_ip_not_allowed",
          "url_invalid",
          "object_not_found",
          "method_not_allowed",
          "idempotency_key_in_use",
          "idempotency_request_inconsistent",
          "rate_limit_exceeded",
          "internal_server_error",
          "service_unavailable",
          "endpoint_disabled",
          "gateway_timeout",
          "unclassified",
          "parameters_invalid",
          "related_object_invalid",
          "related_object_not_ready",
          "related_object_conflict",
          "limit_exceeded",
          "client_control_restricted",
          "lead_control_restricted",
          "object_state_conflict",
          "object_modified_concurrently",
          "operation_invalid"
        ]
      },
      "ErrorItem": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A snake_case code naming the specific error or sub-category.",
            "example": "required"
          },
          "message": {
            "type": "string",
            "description": "A human-readable description of this specific error, with interpolated values where relevant.",
            "example": "account_number_id is required."
          },
          "parameters": {
            "type": "array",
            "description": "The request fields this error implicates, in dot notation for nested fields. Present for validation errors.",
            "items": {
              "type": "string"
            },
            "example": [
              "account_number_id"
            ]
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "message": {
            "type": "string",
            "description": "A human-readable description of the error family. Identical for every occurrence of a given `code`; carries no request-specific detail.",
            "example": "One or more parameters are invalid."
          },
          "errors": {
            "type": "array",
            "description": "Zero or more specific errors within this family. Always present for validation errors, one entry per failing field.",
            "items": {
              "$ref": "#/components/schemas/ErrorItem"
            }
          }
        }
      },
      "CoreBalanceID": {
        "type": "string",
        "example": "core_balance_xyz123",
        "pattern": "^core_balance_\\w+$"
      },
      "CoreBalanceStatus": {
        "type": "string",
        "example": "active",
        "enum": [
          "active",
          "inactive",
          "closed"
        ]
      },
      "CoreBalanceType": {
        "type": "string",
        "example": "deposit",
        "enum": [
          "deposit"
        ]
      },
      "CoreBalanceAmounts": {
        "type": "object",
        "properties": {
          "spendable": {
            "type": "integer",
            "format": "int64",
            "example": 65095000
          },
          "cash_available": {
            "type": "integer",
            "format": "int64",
            "example": 24995000
          },
          "posted": {
            "type": "integer",
            "format": "int64",
            "example": 25000000
          },
          "sweeps": {
            "type": "integer",
            "format": "int64",
            "example": 40000000
          },
          "holds": {
            "type": "integer",
            "format": "int64",
            "example": 5000
          }
        }
      },
      "CoreBalanceOverdraft": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "format": "int64",
            "example": 100000
          },
          "used": {
            "type": "integer",
            "format": "int64",
            "example": 0,
            "nullable": true
          },
          "unused": {
            "type": "integer",
            "format": "int64",
            "example": 100000
          }
        }
      },
      "CoreBalanceInterest": {
        "type": "object",
        "properties": {
          "rate": {
            "type": "string",
            "example": "1.000000",
            "nullable": true
          },
          "accrued": {
            "type": "integer",
            "format": "int64",
            "example": 12450
          }
        }
      },
      "CoreAccountBalance": {
        "type": "object",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CoreBalanceID"
          },
          "core_account_id": {
            "$ref": "#/components/schemas/CoreAccountID"
          },
          "name": {
            "type": "string",
            "example": "Consumer FBO"
          },
          "status": {
            "$ref": "#/components/schemas/CoreBalanceStatus"
          },
          "type": {
            "$ref": "#/components/schemas/CoreBalanceType"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "amounts": {
            "$ref": "#/components/schemas/CoreBalanceAmounts"
          },
          "overdraft": {
            "$ref": "#/components/schemas/CoreBalanceOverdraft"
          },
          "interest": {
            "$ref": "#/components/schemas/CoreBalanceInterest"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2025-09-01T00:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-21T12:00:00Z"
          }
        }
      },
      "CoreTransactionType": {
        "type": "string",
        "enum": [
          "ach",
          "checks",
          "domestic_wires",
          "international_wires",
          "instant_payments",
          "blockchain_payments",
          "internal_transfers",
          "fundings",
          "receivable_sales",
          "interest",
          "fees",
          "sweeps",
          "lead_generated",
          "legacy_banking"
        ]
      },
      "CoreTransactionID": {
        "type": "string",
        "example": "core_transaction_xyz123",
        "pattern": "^core_transaction_.+~\\d+$"
      },
      "CoreTransaction": {
        "type": "object",
        "required": [
          "id",
          "core_balance_id",
          "type",
          "description",
          "amount",
          "currency_code",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CoreTransactionID"
          },
          "core_balance_id": {
            "$ref": "#/components/schemas/CoreBalanceID"
          },
          "type": {
            "$ref": "#/components/schemas/CoreTransactionType"
          },
          "description": {
            "type": "string",
            "description": "Human-readable description.",
            "maxLength": 120,
            "example": "ACH settlement — Payroll deposit"
          },
          "amount": {
            "type": "integer",
            "description": "Signed value in minor units. Positive = credit, negative = debit.",
            "example": 150000
          },
          "currency_code": {
            "type": "string",
            "description": "Currency of the transaction (ISO 4217).",
            "example": "USD"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this transaction was created and affected the balance.",
            "example": "2026-04-01T09:00:05Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp.",
            "example": "2026-04-01T09:00:05Z"
          }
        }
      },
      "EventType": {
        "type": "string",
        "description": "The type of event.",
        "enum": [
          "ach.processing",
          "ach.submitted",
          "ach.posted",
          "ach.under_review",
          "ach.approved",
          "ach.rejected",
          "ach.pending_return",
          "ach.returned",
          "ach.corrected",
          "ach.canceled",
          "ach.scheduled",
          "ach.return_dishonored",
          "ach.return_contested",
          "account_number.created",
          "account_number.activated",
          "account_number.deactivated",
          "account_number.canceled",
          "internal_transfer.succeeded",
          "internal_transfer.failed",
          "internal_transfer.posted",
          "internal_transfer.rejected",
          "lending.disbursement.processing",
          "lending.disbursement.succeeded",
          "lending.disbursement.failed",
          "lending.disbursement.ach_correction",
          "wire.created",
          "wire.under_review",
          "wire.scheduled",
          "wire.processing",
          "wire.posted",
          "wire.rejected",
          "wire.canceled",
          "wire.cancel_pending",
          "instant_payment.posted",
          "instant_payment.rejected",
          "instant_payment.under_review",
          "instant_payment.counterparty_status_updated",
          "instant_payment.return_request_response_needed",
          "instant_payment.return_request_status_updated",
          "funding.posted",
          "funding.rejected",
          "receivable_sale.created",
          "receivable_sale.no_receivables_for_sale",
          "receivable_sale.settled",
          "receivable_sale.failed",
          "blockchain_payment.payment_created",
          "blockchain_payment.payment_under_review",
          "blockchain_payment.payment_submitted",
          "blockchain_payment.payment_posted",
          "blockchain_payment.payment_rejected",
          "blockchain_payment.payment_canceled"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the Event object."
          },
          "event": {
            "$ref": "#/components/schemas/EventType"
          },
          "created_at": {
            "type": "string",
            "description": "Timestamp at which the Event object was created."
          },
          "object_version": {
            "type": "string",
            "description": "Version of the resource object included in the event."
          },
          "object": {
            "type": "object",
            "description": "The object associated with this event."
          }
        }
      },
      "ClientLoanID": {
        "type": "string",
        "description": "The ID of your loan. This must be the same loan_id used in the Loan Origination Request."
      },
      "PaymentMethod": {
        "type": "string",
        "example": "ach",
        "description": "The payment method chosen for disbursement. Only ACH is supported today.",
        "enum": [
          "ach"
        ]
      },
      "CreateDisbursementPaymentDetails": {
        "type": "object",
        "required": [
          "counterparty",
          "statement_descriptor"
        ],
        "properties": {
          "delivery_type": {
            "$ref": "#/components/schemas/DeliveryType"
          },
          "statement_descriptor": {
            "$ref": "#/components/schemas/StatementDescriptor"
          },
          "counterparty": {
            "type": "object",
            "description": "The details of the counterparty you are sending money to.",
            "required": [
              "routing_number",
              "account_number",
              "account_type",
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "The name of the counterparty you are transacting with.",
                "example": "Lara Smikle",
                "maxLength": 22
              },
              "account_number": {
                "type": "string",
                "description": "The account number for the bank account.",
                "example": "1032345678",
                "maxLength": 17,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$"
              },
              "routing_number": {
                "type": "string",
                "description": "The routing number for the bank account. This should be the ACH routing number, not the wire routing number.",
                "example": "021000021",
                "minLength": 9,
                "maxLength": 9,
                "pattern": "^[0-9]+$"
              },
              "account_type": {
                "$ref": "#/components/schemas/AccountType"
              }
            }
          }
        }
      },
      "DisbursementStatus": {
        "description": "The current status of this Disbursement object.",
        "type": "string",
        "example": "succeeded",
        "enum": [
          "created",
          "processing",
          "succeeded",
          "canceled",
          "failed"
        ]
      },
      "DisbursementFailure": {
        "type": "object",
        "properties": {
          "failure_code": {
            "type": "string",
            "description": "The failure code for failed disbursement. This applies in the case of rejected disbursements either by the Fed, ODFI or RDFI.",
            "example": "account_closed",
            "enum": [
              "account_closed",
              "no_account",
              "bad_account_number",
              "account_frozen",
              "contact_lead"
            ]
          },
          "failure_details": {
            "type": "string",
            "description": "Details on failure reason and recommended next steps for failed disbursements.\n* `account_closed`: This account is closed. Please contact the account owner and request valid bank account details.\n* `no_account`: This account cannot be located. Please contact the account owner and request valid bank account details.\n* `bad_account_number`: This account contains invalid account number structure. Please contact the account owner and request valid bank account details.\n* `account_frozen`: This account is frozen and funds cannot be disbursed.\n* `contact_lead`: We were unable to complete the disbursement. Please contact Lead for more information.",
            "enum": [
              "account_closed",
              "no_account",
              "bad_account_number",
              "account_frozen",
              "contact_lead"
            ]
          }
        }
      },
      "DisbursementPaymentDetails": {
        "type": "object",
        "required": [
          "delivery_type",
          "counterparty",
          "statement_descriptor"
        ],
        "properties": {
          "delivery_type": {
            "$ref": "#/components/schemas/DeliveryType"
          },
          "effective_date": {
            "type": "string",
            "description": "The date the ACH transaction is expected to settle with the financial institution. Lead will set this date based on the delivery_type field."
          },
          "trace_number": {
            "type": "string",
            "description": "The unique number assigned to every ACH entry by an ODFI which identifies that entry within a specific ACH file. This is generated by Lead when we submit the ACH.",
            "example": "123456789012345"
          },
          "statement_descriptor": {
            "$ref": "#/components/schemas/StatementDescriptor"
          },
          "counterparty": {
            "type": "object",
            "description": "The details of the counterparty you are sending money to.",
            "required": [
              "routing_number",
              "account_number",
              "account_type",
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "The name of the counterparty you are transacting with.",
                "example": "Lara Smikle",
                "maxLength": 22
              },
              "account_number": {
                "type": "string",
                "description": "The account number for the bank account.",
                "example": "1032345678",
                "maxLength": 17,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$"
              },
              "routing_number": {
                "type": "string",
                "description": "The routing number for the bank account. This should be the ACH routing number, not the wire routing number.",
                "example": "021000021",
                "minLength": 9,
                "maxLength": 9,
                "pattern": "^[0-9]+$"
              },
              "account_type": {
                "$ref": "#/components/schemas/AccountType"
              }
            }
          },
          "correction": {
            "$ref": "#/components/schemas/AchCorrection"
          },
          "failure": {
            "$ref": "#/components/schemas/DisbursementFailure"
          }
        }
      },
      "Disbursement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "id of the Disbursement object",
            "example": "disbursement_xyz001",
            "pattern": "^disbursement_\\w+$"
          },
          "client_loan_id": {
            "$ref": "#/components/schemas/ClientLoanID"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the Disbursement object was created.",
            "example": "2022-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the Disbursement object was last updated.",
            "example": "2022-06-27T11:22:33Z"
          },
          "status": {
            "$ref": "#/components/schemas/DisbursementStatus"
          },
          "amount": {
            "type": "integer",
            "format": "int64",
            "description": "Amount disbursed to the counterparty in cents. This amount will align with disbursement_amount from the Loan Origination Request"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "payment_details": {
            "$ref": "#/components/schemas/DisbursementPaymentDetails"
          }
        }
      },
      "SenderName": {
        "type": "string",
        "description": "The name of the sender. Maximum number of characters is 16.",
        "example": "Lorum Inc."
      },
      "SenderCompanyID": {
        "type": "string",
        "description": "The company id of the sender. Maximum number of characters is 10.",
        "example": 1234567890
      },
      "SenderRoutingNumber": {
        "type": "integer",
        "format": "int32",
        "description": "The 9 digit routing number of the sender.",
        "example": 111122222,
        "minLength": 9,
        "maxLength": 9
      },
      "SimulateResponse": {
        "type": "object"
      },
      "InternalTransferStatusV1": {
        "description": "The current status of the InternalTransfer object.",
        "type": "string",
        "example": "posted",
        "enum": [
          "processing",
          "posted",
          "rejected"
        ]
      },
      "InternalTransferRejectionReason": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "The rejection code that indicates the type of rejection",
            "example": "account_number_not_active",
            "enum": [
              "account_number_not_active",
              "beneficiary_account_number_unrecognized",
              "non_sufficient_funds",
              "ofac_rejection",
              "internal_error"
            ]
          },
          "details": {
            "type": "string",
            "description": "Additional info about the rejection",
            "example": "Account number account_123 is inactive."
          }
        }
      },
      "InternalTransferV1": {
        "type": "object",
        "required": [
          "id",
          "amount",
          "currency_code",
          "sender_account_id",
          "sender_account_number_id",
          "receiver_account_id",
          "receiver_account_number_id",
          "status",
          "description",
          "metadata",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the Internal Transfer object.",
            "example": "internal_transfer_xyz123",
            "pattern": "^internal_transfer_\\w+$"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "sender_account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "sender_account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "receiver_account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "receiver_account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "status": {
            "$ref": "#/components/schemas/InternalTransferStatusV1"
          },
          "description": {
            "type": "string",
            "description": "Memo string for the transfer"
          },
          "rejection": {
            "$ref": "#/components/schemas/InternalTransferRejectionReason"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The RFC3339 timestamp at which the InternalTransfer object was created.",
            "example": "2022-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The RFC3339 timestamp at which the InternalTransfer object was last updated.",
            "example": "2022-06-27T11:22:33Z"
          }
        }
      },
      "InternalTransferAmount": {
        "description": "The amount of the internal transfer transaction in cents.",
        "type": "integer",
        "format": "int64",
        "example": 5000,
        "minimum": 1,
        "maximum": 9900000000
      },
      "WireDirection": {
        "type": "string",
        "description": "Who is initiating the transaction.\n\noutgoing: You are sending a wire transaction to a counterparty.\nincoming: You are receiving an wire transaction from a counterparty.",
        "example": "incoming",
        "enum": [
          "outgoing",
          "incoming"
        ]
      },
      "WireStatus": {
        "description": "The current status of the wire object.",
        "type": "string",
        "example": "created",
        "enum": [
          "created",
          "scheduled",
          "processing",
          "posted",
          "under_review",
          "rejected",
          "canceled",
          "cancel_pending"
        ]
      },
      "WireAmount": {
        "description": "The amount of the wire transaction in cents.",
        "type": "integer",
        "format": "int64",
        "example": 5000,
        "minimum": 1,
        "maximum": 990000000000
      },
      "WireAmounts": {
        "type": "object",
        "properties": {
          "settlement_amount": {
            "$ref": "#/components/schemas/WireAmount",
            "description": "Amount of money that moved across the Fedwire network from the instructing agent to the instructed agent."
          },
          "settlement_currency_code": {
            "$ref": "#/components/schemas/CurrencyCode",
            "description": "The currency code of the settlement amount."
          },
          "instructed_amount": {
            "$ref": "#/components/schemas/WireAmount",
            "description": "Amount of money to be moved between the debtor and creditor, before deduction of charges, expressed in the currency as ordered by the initiating party."
          },
          "instructed_currency_code": {
            "type": "string",
            "description": "The currency code of the instructed amount. A three-letter currency code as defined in ISO 4217."
          },
          "instructed_to_settlement_exchange_rate": {
            "description": "Factor used to convert an amount from the instructed currency to the settlement currency.",
            "type": "string",
            "example": 1
          }
        }
      },
      "WirePartyAccountIdentifier": {
        "type": "object",
        "description": "Object representing the account that the party holds at its financial institution",
        "properties": {
          "type": {
            "type": "string",
            "description": "The type of account identifier.",
            "example": "other",
            "enum": [
              "other",
              "IBAN"
            ]
          },
          "value": {
            "type": "string",
            "description": "The value of the account identifier where the wire is being sent. For U.S. domestic wires, this should always be the full account number.",
            "example": 1234567890
          }
        }
      },
      "WirePostalAddress": {
        "type": "object",
        "properties": {
          "department": {
            "type": "string",
            "description": "Identification of a division of a large organization or building.",
            "example": "Procurement Department"
          },
          "sub_department": {
            "type": "string",
            "description": "Identification of a sub-division of a large organization or building.",
            "example": "IT Procurement"
          },
          "street_name": {
            "type": "string",
            "description": "Name of a street or thoroughfare.",
            "example": "Main Street"
          },
          "building_number": {
            "type": "string",
            "description": "Number that identifies the position of a building on a street.",
            "example": "100"
          },
          "building_name": {
            "type": "string",
            "description": "Name of the building or house.",
            "example": "City Hall"
          },
          "floor": {
            "type": "string",
            "description": "Floor or storey within a building.",
            "example": "4th Floor"
          },
          "post_box": {
            "type": "string",
            "description": "Numbered box in a post office, assigned to a person or organisation, where letters are kept until called for.",
            "example": "PO Box 12345"
          },
          "room": {
            "type": "string",
            "description": "Building room number.",
            "example": "600"
          },
          "post_code": {
            "type": "string",
            "description": "Identifier consisting of a group of letters and/or numbers that is added to a postal address to assist the sorting of mail.",
            "example": "12345"
          },
          "town_name": {
            "type": "string",
            "description": "Name of a built-up area, with defined boundaries, and a local government.",
            "example": "Kansas City"
          },
          "town_location_name": {
            "type": "string",
            "description": "Specific location name within the town. Note that this field is not commonly used for US-based addresses.",
            "example": "Westside North"
          },
          "district_name": {
            "type": "string",
            "description": "Identifies a subdivision within a country sub-division. Note that this field is not commonly used for US-based addresses.",
            "example": "Manhattan"
          },
          "country_sub_division": {
            "type": "string",
            "description": "Identifies a subdivision of a country such as state, region, county.",
            "example": "NY"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166, alpha-2 code representing a nation with its own government.",
            "example": "US",
            "pattern": "[A-Z]{2,2}"
          },
          "line_one": {
            "type": "string",
            "description": "Line one address of the party represented in an unstructured format.",
            "maxLength": 70,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "123 Main St"
          },
          "line_two": {
            "type": "string",
            "description": "Line two address of the party represented in an unstructured format.",
            "maxLength": 70,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Suite 100"
          },
          "line_three": {
            "type": "string",
            "description": "Line three address of the party represented in an unstructured format.",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Kansas City, MO 64105"
          }
        }
      },
      "WireParty": {
        "type": "object",
        "description": "Wire party information.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the party.",
            "example": "Alan Scott"
          },
          "account_identifier": {
            "$ref": "#/components/schemas/WirePartyAccountIdentifier"
          },
          "address": {
            "description": "Address of the party.",
            "$ref": "#/components/schemas/WirePostalAddress"
          }
        }
      },
      "LocalRoutingIdentifier": {
        "type": "object",
        "description": "Routing or transit code used by the financial institution's local clearing system for international wire transfers, such as a sort code, IFSC, or BSB.",
        "properties": {
          "scheme": {
            "type": "string",
            "description": "The scheme or type of the local routing identifier (e.g. GBDSC for UK sort codes).",
            "example": "GBDSC"
          },
          "value": {
            "type": "string",
            "description": "The value of the local routing identifier.",
            "minLength": 1,
            "maxLength": 35,
            "example": "123456"
          }
        }
      },
      "WireAgent": {
        "type": "object",
        "description": "Wire agent information.",
        "properties": {
          "business_identifier_code": {
            "type": "string",
            "description": "Business Identifier Code (BIC) of the financial institution.",
            "example": "BOFAUS3NXXX"
          },
          "name": {
            "type": "string",
            "description": "Name of the financial institution.",
            "example": "Bank of America"
          },
          "routing_number": {
            "type": "string",
            "description": "Nine-character numeric ABA routing number of the financial institution."
          },
          "address": {
            "description": "Address of the financial institution.",
            "$ref": "#/components/schemas/WirePostalAddress"
          },
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifier"
          }
        }
      },
      "WireInstructAgent": {
        "type": "object",
        "description": "Wire instruct agent information.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the financial institution.",
            "example": "Bank of America"
          },
          "routing_number": {
            "type": "string",
            "description": "Nine-character numeric ABA routing number of the financial institution.",
            "example": "021000021"
          },
          "business_identifier_code": {
            "type": "string",
            "description": "Business Identifier Code (BIC) of the financial institution.",
            "minLength": 8,
            "maxLength": 11,
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$",
            "example": "CHASUS33"
          }
        }
      },
      "WireOtherAgents": {
        "description": "Details of any other agents involved in the wire transfer.",
        "type": "object",
        "properties": {
          "previous_instructing_agent_one": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Previous Instructing Agent One”, which is a financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "previous_instructing_agent_two": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Previous Instructing Agent Two”, which is a financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "previous_instructing_agent_three": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Previous Instructing Agent Three”, which is a financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "intermediary_agent_one": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Intermediary Agent One”, which is a financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          },
          "intermediary_agent_two": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Intermediary Agent Two”, which is a financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          },
          "intermediary_agent_three": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Object representing the “Intermediary Agent Three”, which is a financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          }
        }
      },
      "WirePaymentIdentifiers": {
        "type": "object",
        "description": "Wire payment identifiers.",
        "properties": {
          "message_identification": {
            "type": "string",
            "readOnly": true,
            "description": "Point to point reference, as assigned by the instructing party, and sent to the next party in the chain to unambiguously identify the message..",
            "example": "20241215MMQFMP2L017736"
          },
          "end_to_end_identification": {
            "type": "string",
            "description": "Unique identification that the initiating party in a wire message can use to unambiguously identify the transaction. This is passed through, unchanged, throughout the entire wire chain.",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "EndtoEnd12345"
          },
          "uetr": {
            "type": "string",
            "readOnly": true,
            "description": "Universally unique identifier to provide an end-to-end reference of a payment transaction.",
            "format": "uuid",
            "example": "dae7d83c-1624-4a79-a8ef-3794de115c13"
          },
          "instruction_identification": {
            "type": "string",
            "readOnly": true,
            "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the instruction.",
            "example": "Instruction12345"
          },
          "return_identification": {
            "type": "string",
            "readOnly": true,
            "description": "Unique identification, as assigned by an instructing party for an instructed party, to unambiguously identify the returned transaction.",
            "example": "ReturnInstruction12345"
          }
        }
      },
      "WireTransferPurposeV1": {
        "type": "object",
        "description": "The purpose or reason for which the wire is being sent.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "description": "Code representing the purpose of the transfer.",
            "type": "string",
            "enum": [
              "salary_payment",
              "invoice_payment",
              "gift",
              "payment_for_goods",
              "payment_for_services",
              "insurance_premium_payment",
              "interest_payment",
              "loan",
              "loan_repayment",
              "account_management",
              "cash_management_transfer",
              "tax_payment",
              "government_payment",
              "benefits_payment",
              "pension_payment",
              "rent_payment",
              "utilities_payment",
              "education_payment",
              "healthcare_payment",
              "charitable_payment",
              "refund",
              "fee_payment",
              "intercompany_transfer",
              "investment_payment",
              "fx_or_treasury",
              "derivatives_payment",
              "card_network_settlement",
              "other"
            ],
            "example": "invoice_payment"
          },
          "other_details": {
            "type": "string",
            "description": "Free-formatted text for wire sender if `other` is selected for `type`.",
            "minLength": 3,
            "maxLength": 140,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Payment for consulting services"
          }
        }
      },
      "WireRemittanceDetails": {
        "type": "object",
        "description": "Wire remittance details.",
        "properties": {
          "payment_notification": {
            "type": "string",
            "readOnly": true,
            "description": "Information about the payment notification.",
            "example": "ba77ae30-efb8-4139-8e51-37e3fd905b2b"
          },
          "message_to_creditor": {
            "type": "string",
            "description": "Information intended specifically for the creditor.",
            "example": "Payment for invoice 12345",
            "maxLength": 140,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]\\n]*$"
          },
          "message_to_receiving_fi": {
            "type": "string",
            "readOnly": true,
            "description": "Information intended specifically for the receiving financial institution.",
            "example": "message for receiving financial institution"
          },
          "fi_to_fi_message": {
            "type": "string",
            "readOnly": true,
            "description": "Financial institution to financial institution information, most often used by a financial institution to explain additional detail of a wire.",
            "example": "message from financial institution to financial institution"
          },
          "transfer_purpose": {
            "$ref": "#/components/schemas/WireTransferPurposeV1"
          }
        }
      },
      "WireChargeBearer": {
        "type": "string",
        "description": "Specifies which party bears the charges associated with the wire transfer.",
        "example": "shared",
        "enum": [
          "debtor",
          "shared",
          "creditor"
        ]
      },
      "WireChargeInfo": {
        "type": "object",
        "description": "Details of a single charge assessed during wire transfer processing.",
        "required": [
          "amount",
          "currency_code"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "The amount of the charge.",
            "example": "12.50"
          },
          "currency_code": {
            "type": "string",
            "description": "ISO 4217 three-letter currency code for the charge.",
            "example": "USD"
          },
          "charging_agent": {
            "$ref": "#/components/schemas/WireAgent"
          }
        }
      },
      "WireCharges": {
        "type": "object",
        "description": "Information about charges associated with the wire transfer.",
        "properties": {
          "charge_bearer": {
            "$ref": "#/components/schemas/WireChargeBearer",
            "description": "Specifies which party bears the charges for the wire transfer."
          },
          "breakdown": {
            "type": "array",
            "description": "Itemized list of charges assessed during wire transfer processing.",
            "items": {
              "$ref": "#/components/schemas/WireChargeInfo"
            }
          }
        }
      },
      "RelatedWiresV1": {
        "type": "object",
        "description": "Related wire objects.",
        "properties": {
          "original_wire_id": {
            "type": "string",
            "description": "If this wire is a return wire (i.e., returning a wire previously received), this field will provide the preceding wire's identifier (wire_id).",
            "example": "wire_xyz001"
          },
          "return_wire_ids": {
            "type": "array",
            "description": "If this wire has been returned by any following wires, you can find the returning wire id(s) here.",
            "items": {
              "type": "string",
              "example": "wire_xyz002"
            }
          }
        }
      },
      "WireReturnReasonEnum": {
        "type": "string",
        "description": "Reason to return a wire payment.",
        "example": "honor_return_request",
        "enum": [
          "account_number_incorrect",
          "creditor_account_number_invalid",
          "account_closed",
          "account_blocked",
          "debtor_account_type_invalid",
          "agent_invalid",
          "account_details_changed",
          "account_sequestered",
          "account_liquidated",
          "transaction_forbidden",
          "bank_operation_code_invalid",
          "zero_amount",
          "amount_too_high",
          "currency_not_allowed",
          "non_sufficient_funds",
          "duplication",
          "amount_too_low",
          "amount_blocked",
          "wrong_amount",
          "control_sum_invalid",
          "returned_previously",
          "creditor_name_mismatch",
          "creditor_address_incorrect",
          "initiating_party_unrecognized",
          "unknown_customer",
          "debtor_address_invalid",
          "bank_error",
          "authorization_canceled",
          "creditor_bank_not_registered",
          "currency_incorrect",
          "customer_requested",
          "debtor_bank_not_registered",
          "return_for_technical_reason",
          "settlement_date_invalid",
          "correspondent_bank_unattainable",
          "balance_information_requested",
          "settlement_failed",
          "emv_liability_shifted",
          "eri_option_unsupported",
          "local_instrument_code_invalid",
          "honor_return_request",
          "fraud_suspected",
          "final_response_mandate_canceled",
          "no_mandate",
          "missing_mandate_information",
          "end_customer_requested",
          "end_customer_deceased",
          "creditor_request",
          "per_agent_request",
          "narrative",
          "customer_no_response",
          "non_compliant",
          "transaction_not_found",
          "pin_liability_shifted",
          "routing_number_format_incorrect",
          "creditor_bic_incorrect",
          "transaction_reference_not_unique",
          "missing_debtor_account_number",
          "missing_debtor_data",
          "missing_creditor_data",
          "regulatory_reason",
          "returned_unable_to_apply",
          "debtor_agent_specific_service",
          "creditor_agent_specific_service",
          "creditor_not_whitelisted_by_debtor",
          "creditor_blacklisted_by_debtor",
          "direct_debit_count_exceeded",
          "direct_debit_limit_exceeded",
          "payment_stopped",
          "payment_stopped_previously",
          "service_not_rendered",
          "untimely_transaction",
          "removed_from_tracking",
          "undue_payment",
          "other"
        ]
      },
      "WireReturnV1": {
        "type": "object",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/WireReturnReasonEnum",
            "description": "If wire is a return, this field will indicate the reason for the return"
          },
          "code": {
            "type": "string",
            "description": "The return code for the wire return."
          },
          "additional_information": {
            "type": "string",
            "description": "If the return reason is NARR (stands for “narrative”), then an accompanying free-form explanation is required and will appear here. For other reasons, participants may optionally send additional information as well."
          }
        }
      },
      "WireRejectionReasonEnum": {
        "type": "string",
        "description": "Reason to return a wire payment.",
        "example": "honor_return_request",
        "enum": [
          "account_blocked",
          "account_closed",
          "account_number_incorrect",
          "amount_blocked",
          "creditor_account_number_invalid",
          "creditor_address_incorrect",
          "creditor_name_mismatch",
          "creditor_request",
          "debtor_address_invalid",
          "honor_return_request",
          "narrative",
          "per_agent_request",
          "non_sufficient_funds",
          "regulatory_reason",
          "routing_number_format_incorrect",
          "aggregate_limit_exceeded"
        ]
      },
      "IMAD": {
        "type": "string",
        "description": "Input Message Accountability Data (IMAD), a unique identifier available to originating and receiving banks of a wire message.",
        "example": "20241215MMQFMP2L017736"
      },
      "WireRejectionReasonV1": {
        "type": "object",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/WireRejectionReasonEnum",
            "description": "If a wire is rejected, this field will indicate the reason for the rejection."
          },
          "additional_information": {
            "type": "string",
            "description": "If the rejection reason is “narrative”, then an accompanying free-form explanation is required and will appear here. For other reasons, participants may optionally send additional information as well."
          },
          "message_identification": {
            "$ref": "#/components/schemas/IMAD",
            "description": "If Lead rejected an incoming wire on your behalf, this field contains the message identification (formerly known as imad) of the return wire that we sent."
          }
        }
      },
      "WireReturnRequestStatus": {
        "type": "string",
        "description": "Current status of the return request.\n\n- For incoming return requests: `response_needed`, `accepted`, `rejected`.\n- For outgoing return requests: `pending`, `accepted`, `rejected`.\n\n`accepted` and `rejected` are terminal.",
        "enum": [
          "response_needed",
          "pending",
          "accepted",
          "rejected"
        ]
      },
      "WireReturnRequestReason": {
        "type": "string",
        "description": "Reason for the return request.\n\n- `creditor_account_number_invalid` — ISO `AC03`. Wire was sent to the wrong account number.\n- `wrong_amount` — ISO `AM09`. Wire amount is not the agreed amount or expected.\n- `customer_requested` — ISO `CUST`. The partner's end customer requested the return.\n- `duplication` — ISO `DUPL`. Duplicate wire sent.\n- `fraud_suspected` — ISO `FRAD`. Fraud suspected.\n- `narrative` — ISO `NARR`. Catch-all when no structured reason fits; details field carries the explanation.\n- `technical_problem` — ISO `TECH`. A technical issue caused the wire to be sent.\n- `undue_payment` — ISO `UPAY`. Payment was not due or for services not performed.\n- `per_agent_request` — ISO `AGNT`. Incoming only — Lead is the agent for outgoing payments.\n- `other` — Incoming only. Catch-all for unmapped ISO codes received from the counterparty.",
        "enum": [
          "creditor_account_number_invalid",
          "wrong_amount",
          "customer_requested",
          "duplication",
          "fraud_suspected",
          "narrative",
          "technical_problem",
          "undue_payment",
          "per_agent_request",
          "other"
        ]
      },
      "WireReturnRequestResolvedBy": {
        "type": "string",
        "description": "The party that resolved the return request.\n\n- `lead` — Resolved by Lead through validation or manual review.\n- `client` — Resolved by the partner via API or by initiating a return.\n- `counterparty` — Resolved by the counterparty financial institution's response. Outgoing return requests only.",
        "enum": [
          "lead",
          "client",
          "counterparty"
        ]
      },
      "WireReturnRequestRejectionReason": {
        "type": "string",
        "description": "Reason the return request was rejected.\n\n- `account_closed` — ISO `AC04`.\n- `non_sufficient_funds` — ISO `AM04`.\n- `customer_requested` — ISO `CUST`. Customer declined the return.\n- `legal_decision` — ISO `LEGL`.\n- `customer_no_response` — ISO `NOAS`. Customer did not respond by the deadline.\n- `returned_previously` — ISO `ARDT`. Wire already fully returned. Auto-set by Lead when applicable.\n- `narrative` — ISO `NARR`. Catch-all; details field carries the explanation.\n- `per_agent_request` — ISO `AGNT`. Incoming only.\n- `other` — Incoming only. Catch-all for unmapped ISO codes received from the counterparty.",
        "enum": [
          "account_closed",
          "non_sufficient_funds",
          "customer_requested",
          "legal_decision",
          "customer_no_response",
          "returned_previously",
          "narrative",
          "per_agent_request",
          "other"
        ]
      },
      "WireReturnRequestResolution": {
        "type": "object",
        "description": "Resolution details. Populated once the return request reaches a terminal status (`accepted` or `rejected`).",
        "properties": {
          "resolved_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the resolution occurred."
          },
          "resolved_by": {
            "$ref": "#/components/schemas/WireReturnRequestResolvedBy"
          },
          "rejection_reason": {
            "$ref": "#/components/schemas/WireReturnRequestRejectionReason"
          },
          "rejection_details": {
            "type": "string",
            "description": "Free-text explanation of the rejection. For incoming responses, includes the original 4-character ISO code.",
            "maxLength": 105
          }
        }
      },
      "WireReturnRequest": {
        "type": "object",
        "description": "A return request associated with a wire.",
        "required": [
          "created_at",
          "status",
          "reason"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the return request was created.",
            "example": "2024-06-27T12:15:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/WireReturnRequestStatus"
          },
          "reason": {
            "$ref": "#/components/schemas/WireReturnRequestReason"
          },
          "details": {
            "type": "string",
            "description": "Details of the reason for the return request including the 4-character ISO code when possible.",
            "maxLength": 1000,
            "example": "suspected unauthorized activity"
          },
          "deadline": {
            "type": "string",
            "format": "date-time",
            "description": "The deadline by which a final response to the return request is expected.\nFor incoming return requests, you must respond by 11:30PM ET on the 10th business day. If you do not respond, we will respond on your behalf with a rejection at midnight.\nFor outgoing return requests, this field will not be populated.",
            "example": "2024-07-08T23:30:00Z"
          },
          "resolution": {
            "$ref": "#/components/schemas/WireReturnRequestResolution"
          }
        }
      },
      "WireV1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the wire object.",
            "example": "wire_xyz123",
            "pattern": "^wire_\\w+$"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "core_transaction_id": {
            "type": "string",
            "description": "Linked core transaction ID associated with the wire.",
            "example": "core_transaction_xyz123",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the wire object was created.",
            "example": "2024-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the wire object was last updated.",
            "example": "2024-06-27T11:22:33Z"
          },
          "settlement_date": {
            "type": "string",
            "format": "date",
            "description": "The ISO-8601 Datestamp indicating the wire settlement date based on the Fedwire's business day definition.",
            "example": "2024-06-27"
          },
          "direction": {
            "$ref": "#/components/schemas/WireDirection"
          },
          "type": {
            "type": "string",
            "description": "Indicates the type of wire message that the object represents.",
            "example": "transfer",
            "enum": [
              "transfer",
              "return"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/WireStatus"
          },
          "amounts": {
            "$ref": "#/components/schemas/WireAmounts"
          },
          "debtor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "Details of the debtor sending funds."
          },
          "debtor_agent": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Details of the financial institution where the debtor (payer) holds their account. This object may be absent if the instructing agent does not provide this information."
          },
          "instructing_agent": {
            "$ref": "#/components/schemas/WireInstructAgent",
            "description": "The financial institution that transmitted the payment through Fedwire. In some cases, this may differ from the bank where the account is held. This object will always be populated."
          },
          "instructed_agent": {
            "$ref": "#/components/schemas/WireInstructAgent",
            "description": "The financial institution that received the payment through Fedwire. This may not always be the bank where the recipient's account is held. This object will always be populated."
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/WireAgent",
            "description": "Details of the financial institution where the creditor (payee) holds their account. This object may be absent if the instructing agent does not provide this information."
          },
          "creditor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "Details of the creditor receiving funds."
          },
          "ultimate_debtor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "The ultimate party on whose behalf the payment is made, if different from the debtor."
          },
          "ultimate_creditor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "The ultimate party to which the payment is intended, if different from the creditor."
          },
          "other_agents": {
            "$ref": "#/components/schemas/WireOtherAgents"
          },
          "payment_identifiers": {
            "$ref": "#/components/schemas/WirePaymentIdentifiers"
          },
          "remittance_details": {
            "$ref": "#/components/schemas/WireRemittanceDetails"
          },
          "charges": {
            "$ref": "#/components/schemas/WireCharges",
            "description": "Information about any charges assessed during wire transfer processing."
          },
          "related_wires": {
            "$ref": "#/components/schemas/RelatedWiresV1"
          },
          "return": {
            "$ref": "#/components/schemas/WireReturnV1"
          },
          "rejection": {
            "$ref": "#/components/schemas/WireRejectionReasonV1"
          },
          "return_requests": {
            "type": "array",
            "description": "Return requests associated with this wire.",
            "items": {
              "$ref": "#/components/schemas/WireReturnRequest"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "LocalRoutingIdentifierRequest": {
        "type": "object",
        "description": "Routing or transit code used by the creditor agent's local clearing system for international wire transfers, such as a sort code, IFSC, or BSB. This field may be required for certain destinations.",
        "properties": {
          "value": {
            "type": "string",
            "description": "The value of the local routing identifier.",
            "minLength": 1,
            "maxLength": 35,
            "example": "123456"
          }
        }
      },
      "WireAgentRequest": {
        "type": "object",
        "description": "Wire agent information.",
        "properties": {
          "routing_number": {
            "type": "string",
            "description": "Nine-character numeric ABA routing number of the financial institution.",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$",
            "example": "021000021"
          },
          "business_identifier_code": {
            "type": "string",
            "nullable": true,
            "description": "Business Identifier Code (BIC) of the financial institution. Required for international wires.",
            "minLength": 8,
            "maxLength": 11,
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$",
            "example": "CHASUS33"
          },
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifierRequest"
          }
        }
      },
      "WirePostalAddressRequest": {
        "type": "object",
        "required": [
          "line_one"
        ],
        "properties": {
          "line_one": {
            "type": "string",
            "description": "Line one address of the party represented in an unstructured format.",
            "minLength": 1,
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "123 Main St"
          },
          "line_two": {
            "type": "string",
            "description": "Line two address of the party represented in an unstructured format.",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Suite 100"
          },
          "line_three": {
            "type": "string",
            "description": "Line three address of the party represented in an unstructured format.",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Kansas City, MO 64105"
          }
        }
      },
      "WireCreditorRequest": {
        "type": "object",
        "description": "The person or entity to which the wire is being sent.",
        "required": [
          "name",
          "account_identifier",
          "address"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the person or entity to which the wire is being sent.",
            "minLength": 3,
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Allan Scott"
          },
          "account_identifier": {
            "type": "object",
            "description": "Account identifier of the creditor.",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Indicator for the type of account identifier to which the wire is being sent.",
                "enum": [
                  "account_number",
                  "IBAN"
                ],
                "example": "account_number"
              },
              "value": {
                "type": "string",
                "description": "The value associated with the account identifier to which the wire is being sent.",
                "minLength": 1,
                "maxLength": 34,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$",
                "example": "1032345678"
              }
            }
          },
          "address": {
            "description": "Address of the creditor.",
            "$ref": "#/components/schemas/WirePostalAddressRequest"
          }
        }
      },
      "WireReturnCode": {
        "type": "string",
        "description": "List of eligible return reason codes for wire transfers.\n* `AC06` - account_blocked\n* `AM09` - wrong_amount\n* `BE01` - creditor_name_mismatch\n* `FOCR` - honor_return_request\n* `FR01` - fraud_suspected\n* `MS02` - creditor_request\n* `NARR` - narrative\n* `RR02` - missing_debtor_data\n* `RR03` - missing_creditor_data",
        "example": "AC06",
        "enum": [
          "AC06",
          "AM09",
          "BE01",
          "FOCR",
          "FR01",
          "MS02",
          "NARR",
          "RR02",
          "RR03"
        ]
      },
      "WireOutgoingReturnRequestReason": {
        "type": "string",
        "description": "The reason for initiating a return request.\n\n- `creditor_account_number_invalid` — ISO `AC03`. Wire was sent to the wrong account number.\n- `wrong_amount` — ISO `AM09`. Wire amount is not the agreed amount or expected.\n- `customer_requested` — ISO `CUST`. The partner's end customer requested the return.\n- `duplication` — ISO `DUPL`. Duplicate wire sent.\n- `fraud_suspected` — ISO `FRAD`. Fraud suspected.\n- `narrative` — ISO `NARR`. Catch-all when no structured reason fits; `additional_information` carries the explanation.\n- `service_not_rendered` — ISO `SVNR`. Goods or services paid for were not delivered.\n- `technical_problem` — ISO `TECH`. A technical issue caused the wire to be sent.\n- `undue_payment` — ISO `UPAY`. Payment was not due or for services not performed.",
        "enum": [
          "creditor_account_number_invalid",
          "wrong_amount",
          "customer_requested",
          "duplication",
          "fraud_suspected",
          "narrative",
          "service_not_rendered",
          "technical_problem",
          "undue_payment"
        ]
      },
      "CorridorType": {
        "type": "string",
        "description": "Indicates whether the wire is domestic or international.",
        "example": "domestic",
        "enum": [
          "domestic",
          "international"
        ]
      },
      "WireAgentV2": {
        "type": "object",
        "description": "Wire agent information.",
        "properties": {
          "business_identifier_code": {
            "type": "string",
            "description": "Business Identifier Code (BIC) of the financial institution.",
            "example": "BOFAUS3NXXX"
          },
          "name": {
            "type": "string",
            "description": "Name of the financial institution.",
            "example": "Bank of America"
          },
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifier"
          },
          "address": {
            "description": "Address of the financial institution.",
            "$ref": "#/components/schemas/WirePostalAddress"
          }
        }
      },
      "WireInstructAgentV2": {
        "type": "object",
        "description": "Wire instruct agent information.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the financial institution.",
            "example": "Bank of America"
          },
          "business_identifier_code": {
            "type": "string",
            "description": "Business Identifier Code (BIC) of the financial institution.",
            "minLength": 8,
            "maxLength": 11,
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$",
            "example": "CHASUS33"
          },
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifier"
          }
        }
      },
      "WireOtherAgentsV2": {
        "description": "Details of any other agents involved in the wire transfer.",
        "type": "object",
        "properties": {
          "previous_instructing_agent_one": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "previous_instructing_agent_two": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "previous_instructing_agent_three": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Debtor Agent and the Instructing Agent."
          },
          "intermediary_agent_one": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          },
          "intermediary_agent_two": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          },
          "intermediary_agent_three": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Financial institution sitting in the payment chain between the Creditor Agent and the Instructed Agent."
          }
        }
      },
      "WireChargeInfoV2": {
        "type": "object",
        "description": "Details of a single charge assessed during wire transfer processing.",
        "required": [
          "amount",
          "currency_code"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "The amount of the charge.",
            "example": "12.50"
          },
          "currency_code": {
            "type": "string",
            "description": "ISO 4217 three-letter currency code for the charge.",
            "example": "USD"
          },
          "charging_agent": {
            "$ref": "#/components/schemas/WireAgentV2"
          }
        }
      },
      "WireChargesV2": {
        "type": "object",
        "description": "Information about charges associated with the wire transfer.",
        "properties": {
          "charge_bearer": {
            "$ref": "#/components/schemas/WireChargeBearer",
            "description": "Specifies which party bears the charges for the wire transfer."
          },
          "breakdown": {
            "type": "array",
            "description": "Itemized list of charges assessed during wire transfer processing.",
            "items": {
              "$ref": "#/components/schemas/WireChargeInfoV2"
            }
          }
        }
      },
      "WireReturnV2": {
        "type": "object",
        "description": "Return details associated with a returned wire.",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/WireReturnReasonEnum",
            "description": "If the wire is a return, this field indicates the reason for the return. When the return originates from a counterparty with an unmapped ISO code, this field is set to `other` and the raw ISO code is included in `additional_information` in the format \"ISO Code: <code>; <details>\"."
          },
          "additional_information": {
            "type": "string",
            "description": "If the return reason is `narrative`, an accompanying free-form explanation is required and will appear here. When the reason is `other`, this is populated with the raw ISO code in the format \"ISO Code: <code>; <details>\". For other reasons, participants may optionally send additional information as well."
          }
        }
      },
      "WireV2": {
        "type": "object",
        "description": "A wire object.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the wire object.",
            "example": "wire_xyz123",
            "pattern": "^wire_\\w+$"
          },
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "core_transaction_id": {
            "type": "string",
            "description": "Linked core transaction ID associated with the wire.",
            "example": "core_transaction_xyz123",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the wire object was created.",
            "example": "2024-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the wire object was last updated.",
            "example": "2024-06-27T11:22:33Z"
          },
          "settlement_date": {
            "type": "string",
            "format": "date",
            "description": "The ISO-8601 datestamp indicating the wire settlement date based on Fedwire's business day definition.",
            "example": "2024-06-27"
          },
          "direction": {
            "$ref": "#/components/schemas/WireDirection"
          },
          "type": {
            "type": "string",
            "description": "Indicates the type of wire message that the object represents.",
            "example": "transfer",
            "enum": [
              "transfer",
              "return"
            ]
          },
          "corridor_type": {
            "$ref": "#/components/schemas/CorridorType"
          },
          "status": {
            "$ref": "#/components/schemas/WireStatus"
          },
          "amounts": {
            "$ref": "#/components/schemas/WireAmounts"
          },
          "debtor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "Details of the debtor sending funds."
          },
          "debtor_agent": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Details of the financial institution where the debtor holds their account. This object may be absent if the instructing agent does not provide this information."
          },
          "instructing_agent": {
            "$ref": "#/components/schemas/WireInstructAgentV2",
            "description": "The financial institution that transmitted the payment through Fedwire. In some cases, this may differ from the bank where the account is held. This object will always be populated."
          },
          "instructed_agent": {
            "$ref": "#/components/schemas/WireInstructAgentV2",
            "description": "The financial institution that received the payment through Fedwire. This may not always be the bank where the recipient's account is held. This object will always be populated."
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/WireAgentV2",
            "description": "Details of the financial institution where the creditor holds their account. This object may be absent if the instructing agent does not provide this information."
          },
          "creditor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "Details of the creditor receiving funds."
          },
          "initiating_party": {
            "$ref": "#/components/schemas/WireParty",
            "description": "Details of the party that initiates the payment on behalf of the debtor. For outgoing wires, automatically populated with your organization's name. For incoming wires, populated from the ISO initiating party when provided by the sending institution."
          },
          "ultimate_debtor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "The ultimate party on whose behalf the payment is made, if different from the debtor."
          },
          "ultimate_creditor": {
            "$ref": "#/components/schemas/WireParty",
            "description": "The ultimate party to which the payment is intended, if different from the creditor."
          },
          "other_agents": {
            "$ref": "#/components/schemas/WireOtherAgentsV2"
          },
          "payment_identifiers": {
            "$ref": "#/components/schemas/WirePaymentIdentifiers"
          },
          "remittance_details": {
            "$ref": "#/components/schemas/WireRemittanceDetails"
          },
          "charges": {
            "$ref": "#/components/schemas/WireChargesV2",
            "description": "Information about any charges assessed during wire transfer processing."
          },
          "related_wires": {
            "$ref": "#/components/schemas/RelatedWiresV1"
          },
          "return_requests": {
            "type": "array",
            "description": "Return requests associated with the wire, sorted oldest first. Empty when no return requests exist.",
            "items": {
              "$ref": "#/components/schemas/WireReturnRequest"
            }
          },
          "return": {
            "$ref": "#/components/schemas/WireReturnV2"
          },
          "rejection": {
            "$ref": "#/components/schemas/WireRejectionReasonV1"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "WireAgentRequestV2": {
        "type": "object",
        "description": "Financial institution details for an agent on the wire request.",
        "properties": {
          "business_identifier_code": {
            "type": "string",
            "nullable": true,
            "description": "Business Identifier Code (BIC) of the financial institution. Required when `corridor_type` is `international`; not accepted when `corridor_type` is `domestic`.",
            "minLength": 8,
            "maxLength": 11,
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$",
            "example": "CHASUS33"
          },
          "local_routing_identifier": {
            "description": "Local clearing-system routing identifier. For domestic wires this is the nine-digit US ABA routing number and is required when `corridor_type` is `domestic`. The clearing scheme is populated by Lead and is not accepted as input.",
            "$ref": "#/components/schemas/LocalRoutingIdentifierRequest"
          }
        }
      },
      "WirePostalAddressRequestV2": {
        "type": "object",
        "description": "Hybrid ISO 20022 postal address. `country` and `town_name` are required; up to two\nunstructured lines plus the structured fields are otherwise optional.",
        "required": [
          "country",
          "town_name"
        ],
        "properties": {
          "line_one": {
            "type": "string",
            "description": "Line one of the address in unstructured format.",
            "maxLength": 70,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "123 Main St"
          },
          "line_two": {
            "type": "string",
            "description": "Line two of the address in unstructured format.",
            "maxLength": 70,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Suite 100"
          },
          "town_name": {
            "type": "string",
            "description": "Name of a built-up area, with defined boundaries, and a local government.",
            "minLength": 1,
            "maxLength": 35,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Kansas City"
          },
          "country_sub_division": {
            "type": "string",
            "description": "Identifies a subdivision of a country such as a state, region, or county.",
            "maxLength": 35,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "MO"
          },
          "post_code": {
            "type": "string",
            "description": "Identifier of letters and/or numbers added to a postal address to assist mail sorting.",
            "maxLength": 16,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "64105"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code representing a nation with its own government.",
            "pattern": "^[A-Z]{2}$",
            "example": "US"
          }
        }
      },
      "WireCreditorRequestV2": {
        "type": "object",
        "description": "The person or entity to which the wire is being sent.",
        "required": [
          "name",
          "account_identifier",
          "address"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the person or entity to which the wire is being sent.",
            "minLength": 3,
            "maxLength": 35,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Example Beneficiary Inc."
          },
          "account_identifier": {
            "type": "object",
            "description": "Account identifier of the creditor.",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Indicator for the type of account identifier to which the wire is being sent.",
                "enum": [
                  "account_number",
                  "IBAN"
                ],
                "example": "account_number"
              },
              "value": {
                "type": "string",
                "description": "The value associated with the account identifier to which the wire is being sent.",
                "minLength": 1,
                "maxLength": 34,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$",
                "example": "GB29NWBK60161331926819"
              }
            }
          },
          "address": {
            "description": "Postal address of the creditor.",
            "$ref": "#/components/schemas/WirePostalAddressRequestV2"
          }
        }
      },
      "WireUltimateDebtorRequest": {
        "type": "object",
        "description": "The ultimate party on whose behalf the payment is made, if different from the debtor.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the ultimate debtor.",
            "minLength": 1,
            "maxLength": 35,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "John Smith"
          }
        }
      },
      "CreateAWireRequestBodyV2": {
        "title": "Create a wire",
        "type": "object",
        "required": [
          "account_number_id",
          "corridor_type",
          "amount",
          "currency_code",
          "creditor_agent",
          "creditor",
          "remittance_details"
        ],
        "properties": {
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "corridor_type": {
            "$ref": "#/components/schemas/CorridorType"
          },
          "amount": {
            "$ref": "#/components/schemas/WireAmount",
            "description": "The amount of the wire in the currency's minor units."
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/WireAgentRequestV2",
            "description": "The financial institution where the creditor (payee) holds their account. When `corridor_type` is `domestic`, `local_routing_identifier` is required; when `international`, `business_identifier_code` is required."
          },
          "creditor": {
            "$ref": "#/components/schemas/WireCreditorRequestV2"
          },
          "instructed_agent": {
            "$ref": "#/components/schemas/WireAgentRequestV2",
            "description": "The financial institution that receives the payment via Fedwire. For international wires, this specifies the immediate intermediary in the payment chain following the instructing agent."
          },
          "ultimate_debtor": {
            "$ref": "#/components/schemas/WireUltimateDebtorRequest"
          },
          "remittance_details": {
            "type": "object",
            "description": "Remittance details of the creditor.",
            "required": [
              "transfer_purpose"
            ],
            "properties": {
              "message_to_creditor": {
                "type": "string",
                "description": "Information intended specifically for the creditor.",
                "example": "Payment for invoice 12345",
                "maxLength": 140,
                "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]\\n]*$"
              },
              "transfer_purpose": {
                "$ref": "#/components/schemas/WireTransferPurposeV1"
              }
            }
          },
          "payment_identifiers": {
            "type": "object",
            "description": "Payment identifiers of the creditor.",
            "properties": {
              "end_to_end_identification": {
                "type": "string",
                "description": "Unique identification that the initiating party in a wire message can use to unambiguously identify the transaction. This is passed through, unchanged, throughout the entire wire chain.",
                "maxLength": 35,
                "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                "example": "EndtoEnd12345"
              }
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "WireReturnReasonV2": {
        "type": "string",
        "description": "The reason for returning the wire.",
        "example": "creditor_request",
        "enum": [
          "account_blocked",
          "wrong_amount",
          "creditor_name_mismatch",
          "honor_return_request",
          "fraud_suspected",
          "creditor_request",
          "narrative",
          "missing_debtor_data",
          "missing_creditor_data"
        ]
      },
      "SimulateWireDebtorRequest": {
        "type": "object",
        "description": "The person or entity sending the wire.",
        "required": [
          "name",
          "account_identifier",
          "address"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the person or entity sending the wire.",
            "minLength": 3,
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Allan Scott"
          },
          "account_identifier": {
            "type": "object",
            "description": "Account identifier of the debtor.",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Indicator for the type of account identifier sending the wire.",
                "enum": [
                  "account_number"
                ],
                "example": "account_number"
              },
              "value": {
                "type": "string",
                "description": "The value associated with the account identifier sending the wire.",
                "minLength": 1,
                "maxLength": 17,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$",
                "example": "1032345678"
              }
            }
          },
          "address": {
            "description": "Address of the debtor.",
            "$ref": "#/components/schemas/WirePostalAddress",
            "required": [
              "line_one"
            ]
          }
        }
      },
      "DebtorAgent": {
        "type": "object",
        "description": "Details of the debtor agent financial institution.",
        "properties": {
          "routing_number": {
            "type": "string",
            "description": "Nine-character numeric ABA routing number for the debtor agent financial institution.",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$",
            "example": "021000021"
          }
        }
      },
      "SimulateIncomingWireRequest": {
        "type": "object",
        "description": "Request body to simulate an incoming wire.",
        "required": [
          "amount",
          "creditor_account_number_id",
          "debtor",
          "debtor_agent"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/WireAmount"
          },
          "creditor_account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID",
            "description": "The ID of the creditor account number associated with the wire."
          },
          "debtor": {
            "$ref": "#/components/schemas/SimulateWireDebtorRequest",
            "description": "Details of the debtor sending funds."
          },
          "remittance_details": {
            "type": "object",
            "description": "Details of the remittance information for the wire.",
            "properties": {
              "message_to_creditor": {
                "type": "string",
                "description": "Information intended specifically for the creditor.",
                "example": "Payment for invoice 12345",
                "maxLength": 140,
                "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
              }
            }
          },
          "payment_identifiers": {
            "type": "object",
            "description": "Payment identifiers for the wire.",
            "properties": {
              "end_to_end_identification": {
                "type": "string",
                "description": "Unique identification that the initiating party in a wire message can use to unambiguously identify the transaction. This is passed through, unchanged, throughout the entire wire chain.",
                "maxLength": 35,
                "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                "example": "EndtoEnd12345"
              }
            }
          },
          "debtor_agent": {
            "$ref": "#/components/schemas/DebtorAgent",
            "description": "Debtor Agent financial institution details."
          }
        }
      },
      "SimulateWireDebtorRequestV2": {
        "type": "object",
        "description": "The party sending the wire.",
        "required": [
          "name",
          "account_identifier",
          "address"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the sending party.",
            "minLength": 1,
            "maxLength": 140,
            "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
            "example": "Alex Smith"
          },
          "account_identifier": {
            "type": "object",
            "description": "Account identifier of the sending party.",
            "required": [
              "type",
              "value"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "Type of account identifier.",
                "enum": [
                  "account_number",
                  "iban"
                ],
                "example": "account_number"
              },
              "value": {
                "type": "string",
                "description": "Account identifier value of the sending party.",
                "minLength": 1,
                "maxLength": 34,
                "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$",
                "example": "1032345678"
              }
            }
          },
          "address": {
            "$ref": "#/components/schemas/WirePostalAddressRequestV2",
            "description": "Postal address of the sending party."
          }
        }
      },
      "SimulateWireDebtorAgentRequest": {
        "type": "object",
        "description": "The debtor's financial institution.",
        "properties": {
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifierRequest",
            "description": "Routing or transit code used by the financial institution's local clearing system. For\ndomestic wires, this is always a US ABA routing number. For international wires, this may be\nanother local clearing code."
          },
          "business_identifier_code": {
            "type": "string",
            "description": "Business Identifier Code (BIC) of the financial institution. A foreign financial\ninstitution's BIC is required to simulate an international wire.",
            "minLength": 8,
            "maxLength": 11,
            "pattern": "^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$",
            "example": "DEUTDEDB"
          }
        }
      },
      "SimulateWireInstructingAgentRequest": {
        "type": "object",
        "description": "The financial institution that transmitted the payment to Lead.",
        "properties": {
          "local_routing_identifier": {
            "$ref": "#/components/schemas/LocalRoutingIdentifierRequest",
            "description": "Routing or transit code used to identify the instructing agent within a local clearing system."
          }
        }
      },
      "SimulateIncomingWireRequestV2": {
        "type": "object",
        "description": "Request body to simulate an incoming wire in sandbox. The corridor is inferred from the\nshape of `debtor_agent` rather than an explicit field, matching how Lead derives the\ncorridor from the ISO 20022 payload on real incoming wires: a `business_identifier_code`\nwith a non-US country code produces an international wire, while providing only\n`local_routing_identifier` produces a domestic wire.",
        "required": [
          "amount",
          "creditor_account_number_id",
          "debtor",
          "debtor_agent"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/WireAmount",
            "description": "Wire amount in USD cents."
          },
          "creditor_account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID",
            "description": "The ID of the account number that will receive the simulated wire."
          },
          "debtor": {
            "$ref": "#/components/schemas/SimulateWireDebtorRequestV2",
            "description": "The party sending the wire."
          },
          "debtor_agent": {
            "$ref": "#/components/schemas/SimulateWireDebtorAgentRequest",
            "description": "The debtor's financial institution."
          },
          "instructing_agent": {
            "$ref": "#/components/schemas/SimulateWireInstructingAgentRequest",
            "description": "The financial institution that transmitted the payment to Lead."
          },
          "remittance_details": {
            "type": "object",
            "description": "Details of the remittance information for the wire.",
            "properties": {
              "message_to_creditor": {
                "type": "string",
                "description": "Information intended specifically for the creditor.",
                "example": "Payment for invoice 12345",
                "maxLength": 140,
                "pattern": "^[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*[0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]][0-9a-zA-Z/\\-\\?:\\(\\)\\.,'\\+ !@#$%^&\\*=_`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
              }
            }
          },
          "payment_identifiers": {
            "type": "object",
            "description": "Payment identifiers for the wire.",
            "properties": {
              "end_to_end_identification": {
                "type": "string",
                "description": "Unique identification that the initiating party in a wire message can use to unambiguously identify the transaction. This is passed through, unchanged, throughout the entire wire chain.",
                "maxLength": 35,
                "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$",
                "example": "EndtoEnd12345"
              }
            }
          }
        }
      },
      "EntityTypeIndividual": {
        "type": "string",
        "pattern": "^individual$",
        "default": "individual",
        "description": "Type of entity = individual."
      },
      "IntendedRolesEnum": {
        "type": "string",
        "enum": [
          "authorized_user",
          "authorized_signer",
          "account_holder",
          "minor_account_holder"
        ],
        "example": "account_holder",
        "description": "The entity's intended role. Lead highly recommends using this field to confirm data requirements for different roles to minimize errors later. In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed. It will be an all or nothing behavior.\nLead currently supports:\n* `authorized_user`: Individual entity with restricted access to the account, without legal responsibility. Only applies to individual entity.\n* `authorized_signer`: Individual entity allowed to sign on behalf of the account holder, without legal responsibility. Only applies to individual entity.\n* `account_holder`: Entity with full control and legal responsibility for the account. Applies to all entity types.\n* `minor_account_holder`: Individual entity aged 16-17 with account-holder eligibility. Individual entities only.\n"
      },
      "EntityRiskScoreEnum": {
        "type": "string",
        "enum": [
          "low",
          "medium",
          "high"
        ],
        "example": "low",
        "description": "The entity's risk score, mapped to Lead by the client. Client should have provided risk score mapping to Lead."
      },
      "ContactMethodTypeEmail": {
        "type": "string",
        "pattern": "^email$",
        "default": "email",
        "description": "ContactMethodType = email."
      },
      "ContactMethodEmail": {
        "title": "Email",
        "type": "object",
        "required": [
          "type",
          "email"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ContactMethodTypeEmail"
          },
          "email": {
            "type": "string",
            "description": "Must be a valid email address in the form `local-part@domain.tld`. The domain must contain at least one dot. Addresses using `localhost`, IP literals (e.g., user@[127.0.0.1]), or quoted local parts (e.g., \"user\"@example.com) are not accepted. Only common, real-world email formats are supported.",
            "example": "abc@gmail.com"
          }
        }
      },
      "ContactMethodTypePhone": {
        "type": "string",
        "pattern": "^phone_number$",
        "default": "phone_number",
        "example": "+22 607 123 4567",
        "description": "ContactMethodType = phone_number. Conforms to E.123 standard"
      },
      "ContactMethodPhone": {
        "title": "Phone Number",
        "type": "object",
        "required": [
          "type",
          "phone_number"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/ContactMethodTypePhone"
          },
          "phone_number": {
            "type": "string",
            "description": "Primary phone number of the entity. Must follow E.123 format."
          }
        }
      },
      "ContactMethod": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ContactMethodEmail"
          },
          {
            "$ref": "#/components/schemas/ContactMethodPhone"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "email": "#/components/schemas/ContactMethodEmail",
            "phone_number": "#/components/schemas/ContactMethodPhone"
          }
        }
      },
      "Address": {
        "type": "object",
        "required": [
          "line_1",
          "city",
          "country"
        ],
        "properties": {
          "line_1": {
            "type": "string",
            "description": "Address line 1 is the required primary street-address field. It must contain the full base address needed to identify the physical location, such as the street number and street name together, or the closest local equivalent in countries where addresses do not use that exact structure.\n\nUse address line 1 for all core location details that describe the main property or thoroughfare. Regardless of how each component of an address is collected from your end-users, they must be combined into address line 1 before sending to Lead.\n\nDo not:\n- split the primary street address across line 1 and line 2\n- put only the street number in line 1 and the street name in line 2\n- pad line 1 with false or altered data just to satisfy validation",
            "example": "123 Main St."
          },
          "line_2": {
            "type": "string",
            "description": "Address line 2 is optional and should be used only for secondary or sub-premise information, such as:\n- apartment\n- unit\n- suite\n- floor\n- building\n- care-of / attention\n\nIf there is no secondary or sub-premise information, address line 2 should be blank.\n\nDo not use address line 2 for any part of the primary street address.",
            "example": "Apt 25"
          },
          "city": {
            "type": "string",
            "description": "City.",
            "example": "Denver"
          },
          "postal_code": {
            "type": "string",
            "description": "Postal Code, required for US addresses. Please follow the following format: US: ^\\d5(?:-\\d4)?$, CN: ^\\d6$, GB: ^[A-Z]{1,2}d[A-Z0-9]? ?d[A-Z]{2}$, JP: ^\\d3-\\d4$",
            "example": 80014
          },
          "state": {
            "type": "string",
            "description": "State. required for US addresses in 2 character code (e.g. NY).",
            "example": "CO"
          },
          "country": {
            "type": "string",
            "description": "ISO3166-1 Alpha-2 country code.",
            "example": "US"
          }
        }
      },
      "AddressDetails": {
        "type": "object",
        "properties": {
          "physical_address": {
            "$ref": "#/components/schemas/Address",
            "description": "Physical address for the entity. Physical addresses must not be P.O. boxes, registered agent addresses or in prohibited countries."
          },
          "mailing_address": {
            "$ref": "#/components/schemas/Address",
            "description": "Mailing address for the entity."
          },
          "other_addresses": {
            "type": "array",
            "description": "Other addresses for the entity.",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          }
        }
      },
      "UsEntityTypeEnum": {
        "type": "string",
        "pattern": "^us_entity$",
        "default": "us_entity",
        "description": "Use `us_entity` for an entity with US tax identification, including one you have not collected yet. `tax_identification` is required for the `account_holder`, `minor_account_holder`, and `authorized_signer` roles and for beneficial owners, control persons, and sole proprietors. It is not required for an `authorized_user`. Include other government-verified identification documents in `identification_documents` when collected."
      },
      "TaxIdentificationTypeEnum": {
        "type": "string",
        "enum": [
          "ssn",
          "itin",
          "ein"
        ],
        "example": "ssn",
        "description": "The entity's US tax identification type: `ssn`, `itin`, or `ein`.\n- For `individual` entity, use SSN or ITIN.\n- For `business` entity, use EIN. For single-member LLC entities where no EIN is available, SSN or ITIN may be used.\n- For `sole_prop` entity, use SSN, ITIN, or EIN.\n"
      },
      "TaxIdentification": {
        "type": "object",
        "description": "The entity's own US tax identification. Do not submit another person's SSN or ITIN (e.g. a parent's for a minor). If you have not collected it, omit `tax_identification`; `type` without a valid `value` is rejected. See https://docs.lead.bank/products/entity/entity-object#identification-for-us-and-non-us-entities.",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/TaxIdentificationTypeEnum"
          },
          "value": {
            "type": "string",
            "description": "The entity's US tax identification number. Must be 9 digits (e.g. XXXXXXXXX). An SSN must not start with 9. An EIN must begin with a number between 00 and 99. An ITIN must begin with 9. Required whenever `tax_identification` is sent; omit the whole object if you have not collected the tax identification.",
            "pattern": "^\\d{9}$"
          }
        }
      },
      "IdentificationDocumentsTypeEnum": {
        "type": "string",
        "enum": [
          "drivers_license",
          "state_or_provincial_id",
          "passport",
          "permanent_residency_id",
          "military_id",
          "national_id",
          "matriculate_id",
          "other",
          "tax_certificate",
          "tax_returns",
          "partnership_agreement",
          "certificate_of_good_standing",
          "formation_document",
          "proof_of_place_on_stock_exchange",
          "name_certificate"
        ],
        "example": "drivers_license",
        "description": "The entity's government-verified identification document type. This will apply for identification types other than US tax identification.\n- For `individual` entity, possible types are: `drivers_license`, `state_or_provincial_id`, `passport`, `permanent_residency_id`, `military_id`, `national_id`, `matriculate_id`, `other`. Note that `national_id` and `matriculate_id` are not applicable for `us_entity`.\n- For `business` entity, possible types are: `tax_certificate`, `tax_returns`, `partnership_agreement`, `certificate_of_good_standing`, `formation_document`, `proof_of_place_on_stock_exchange`, `other`.\n- For `sole_prop` entity, possible types are: `tax_certificate`, `tax_returns`, `name_certificate`, `drivers_license`, `state_or_provincial_id`, `passport`, `permanent_residency_id`, `military_id`, `national_id`, `matriculate_id`, `other`. Note that `national_id` and `matriculate_id` are not applicable for `us_entity`.\n"
      },
      "IdentificationDocument": {
        "type": "object",
        "required": [
          "type",
          "identification_number",
          "issuing_country"
        ],
        "properties": {
          "client_document_id": {
            "type": "string",
            "description": "Client document ID for the identification document."
          },
          "type": {
            "$ref": "#/components/schemas/IdentificationDocumentsTypeEnum"
          },
          "description": {
            "type": "string",
            "description": "Description about the identification document. Required if identification document type is `other`."
          },
          "identification_number": {
            "type": "string",
            "description": "Unique identification number on the identification document."
          },
          "expiration_date": {
            "type": "string",
            "format": "date",
            "description": "Expiration date of the identification document."
          },
          "issuing_state": {
            "type": "string",
            "description": "Issuing state of the identification document. Must be 2 character code (e.g. NY). If the issuing country is US, this value must be a valid US State."
          },
          "issuing_country": {
            "type": "string",
            "description": "Issuing country of the identification document. ISO3166-1 Alpha-2 country code."
          }
        }
      },
      "UsEntity": {
        "title": "US Entity",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/UsEntityTypeEnum"
          },
          "tax_identification": {
            "$ref": "#/components/schemas/TaxIdentification"
          },
          "identification_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentificationDocument"
            }
          }
        }
      },
      "NonUsEntityTypeEnum": {
        "type": "string",
        "pattern": "^non_us_entity$",
        "default": "non_us_entity",
        "description": "Use `non_us_entity` for an entity without US tax identification. At least one government-verified document in `identification_documents` is required for the `account_holder`, `minor_account_holder`, and `authorized_signer` roles and for beneficial owners, control persons, and sole proprietors. It is not required for an `authorized_user`."
      },
      "NonUsEntityIndividual": {
        "title": "Non US Entity",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/NonUsEntityTypeEnum"
          },
          "identification_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentificationDocument"
            }
          }
        }
      },
      "IdentificationDetailsIndividual": {
        "type": "object",
        "description": "Required on every individual; only `type` is required inside it. The identification itself (`tax_identification` for `us_entity`, `identification_documents` for `non_us_entity`) is required for the `account_holder`, `minor_account_holder`, and `authorized_signer` roles and for beneficial owners, control persons, and sole proprietors, not for an `authorized_user`.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/UsEntity"
          },
          {
            "$ref": "#/components/schemas/NonUsEntityIndividual"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "us_entity": "#/components/schemas/UsEntity",
            "non_us_entity": "#/components/schemas/NonUsEntityIndividual"
          }
        }
      },
      "AdditionalDocumentTypeEnum": {
        "type": "string",
        "enum": [
          "bank_statement",
          "utility_bills",
          "proof_of_address",
          "investigation_report",
          "financial_statement",
          "public_records",
          "adverse_media",
          "id_selfie",
          "other"
        ],
        "example": "bank_statement",
        "description": "Type of additional non-government documents being provided to verify entity. Possible values are `bank_statement`, `utility_bills`, `proof_of_address`, `investigation_report`, `financial_statement`, `public_records`, `adverse_media`, `id_selfie`, `other`."
      },
      "AdditionalDocument": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "client_document_id": {
            "type": "string",
            "description": "Client document ID for the additional document."
          },
          "type": {
            "$ref": "#/components/schemas/AdditionalDocumentTypeEnum"
          },
          "description": {
            "type": "string",
            "description": "Description about the identification document. Required if additional document type is `other`."
          }
        }
      },
      "IndividualDetails": {
        "type": "object",
        "required": [
          "first_name",
          "last_name",
          "identification_details"
        ],
        "properties": {
          "first_name": {
            "type": "string",
            "description": "Legal first name."
          },
          "preferred_first_name": {
            "type": "string",
            "description": "Preferred first name."
          },
          "middle_name": {
            "type": "string",
            "description": "Middle name."
          },
          "last_name": {
            "type": "string",
            "description": "Legal last name. Must be at least 2 alphanumeric characters."
          },
          "date_of_birth": {
            "type": "string",
            "format": "date",
            "description": "Date of birth, in YYYY-MM-DD format. Authorized signers and account holders must be 18 years or older.",
            "example": "2002-02-15"
          },
          "occupation": {
            "type": "string",
            "description": "Occupation / job."
          },
          "contact_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMethod"
            }
          },
          "address_details": {
            "$ref": "#/components/schemas/AddressDetails"
          },
          "identification_details": {
            "$ref": "#/components/schemas/IdentificationDetailsIndividual"
          },
          "additional_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdditionalDocument"
            }
          }
        },
        "description": "Details for the individual entity. An `authorized_user` requires only `first_name`, `last_name`, a contact method, and `identification_details.type`. Other roles require more; see https://docs.lead.bank/products/entity/roles#data-requirements."
      },
      "RfiDetailsResultEnum": {
        "type": "string",
        "enum": [
          "requested",
          "completed"
        ],
        "example": "completed",
        "description": "Result of request for information with the end customer. Leave blank if RFI has not been sent to the customer."
      },
      "RfiDetails": {
        "type": "object",
        "required": [
          "result",
          "requested_at"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/RfiDetailsResultEnum"
          },
          "requested_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time RFI is requested at."
          }
        }
      },
      "OfacDetailsResultEnum": {
        "type": "string",
        "enum": [
          "pending",
          "passed",
          "failed"
        ],
        "example": "passed",
        "description": "OFAC result. Possible values: pending | passed | failed. "
      },
      "OfacDetails": {
        "type": "object",
        "required": [
          "result",
          "screened_at"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/OfacDetailsResultEnum"
          },
          "screened_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time OFAC screen is screened at."
          }
        },
        "description": "Details on OFAC on the entity."
      },
      "KycDetailsResultEnum": {
        "type": "string",
        "enum": [
          "pending",
          "passed",
          "failed"
        ],
        "example": "passed",
        "description": "KYC result. Possible values: pending | passed | failed. "
      },
      "KycDetails": {
        "type": "object",
        "required": [
          "result",
          "screened_at"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/KycDetailsResultEnum"
          },
          "screened_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time KYC screen is screened at."
          }
        },
        "description": "Details on KYC on the entity."
      },
      "CreditReportNonScoreValueEnum": {
        "type": "string",
        "enum": [
          "unestablished",
          "frozen"
        ],
        "example": "unestablished",
        "description": "Indicates the state of a credit file when a numeric score is not available."
      },
      "CreditReportSourceEnum": {
        "type": "string",
        "enum": [
          "equifax",
          "experian",
          "transunion"
        ],
        "example": "equifax",
        "description": "The name of the credit bureau."
      },
      "CreditDetails": {
        "type": "object",
        "required": [
          "credit_report_source",
          "credit_pulled_at"
        ],
        "properties": {
          "credit_score": {
            "type": "string",
            "description": "Credit score given by the credit bureau. Cannot be above 850. Mutually exclusive with `credit_report_non_score_value`."
          },
          "credit_report_non_score_value": {
            "$ref": "#/components/schemas/CreditReportNonScoreValueEnum"
          },
          "credit_report_source": {
            "$ref": "#/components/schemas/CreditReportSourceEnum"
          },
          "credit_pulled_at": {
            "type": "string",
            "format": "date-time",
            "description": "Date time credit is pulled at."
          }
        },
        "description": "Details on credit data from credit bureaus on the entity. Exactly one of `credit_score` or `credit_report_non_score_value` must be provided."
      },
      "RoleDetailsStatus": {
        "type": "string",
        "description": "Role Details Status",
        "example": "active",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "CriteriaDetails": {
        "type": "object",
        "properties": {
          "failed_checks": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "entity_id": {
            "type": "string"
          }
        }
      },
      "RoleDetails": {
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/IntendedRolesEnum"
          },
          "status": {
            "$ref": "#/components/schemas/RoleDetailsStatus"
          },
          "criteria_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CriteriaDetails"
            }
          }
        }
      },
      "CreateAnIndividualEntityResponse": {
        "title": "Individual",
        "type": "object",
        "required": [
          "id",
          "type",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID for the Entity object."
          },
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object is created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object was last updated."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeIndividual"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "individual_details": {
            "$ref": "#/components/schemas/IndividualDetails"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "role_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "EntityTypeBusiness": {
        "type": "string",
        "pattern": "^business$",
        "default": "business",
        "description": "Type of entity = business."
      },
      "BusinessTypeEnum": {
        "type": "string",
        "enum": [
          "corporation",
          "partnership",
          "sole_prop",
          "llc",
          "trust",
          "cooperative",
          "other"
        ],
        "example": "llc",
        "description": "Business Types. Possible business types are `corporation`, `partnership`, `sole_prop`, `llc`, `trust`, `cooperative`, `other`.\n- For business entity, cannot use `sole_prop` as business type.\n- For sole_prop entity, must use `sole_prop` as business type.\n"
      },
      "NonUsEntityBusiness": {
        "title": "Non US Entity",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/NonUsEntityTypeEnum"
          },
          "identification_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentificationDocument"
            }
          }
        }
      },
      "IdentificationDetailsBusiness": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/UsEntity"
          },
          {
            "$ref": "#/components/schemas/NonUsEntityBusiness"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "us_entity": "#/components/schemas/UsEntity",
            "non_us_entity": "#/components/schemas/NonUsEntityBusiness"
          }
        }
      },
      "BusinessDetails": {
        "type": "object",
        "required": [
          "name",
          "identification_details",
          "address_details"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/BusinessTypeEnum"
          },
          "name": {
            "type": "string",
            "description": "Legal name of the business. Must be at least 2 characters."
          },
          "gross_annual_revenue": {
            "type": "string",
            "description": "Business gross revenue for prior fiscal year."
          },
          "currency_code": {
            "type": "string",
            "description": "A three-letter currency code as defined in ISO 4217."
          },
          "industry": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "NAICS code(s) for the applicable industries. 2-6 digits of NAICS code(s) are accepted and valid NAICS codes can be found on naics.com/search. Please refer to 2022 NAICS Reference Files."
          },
          "doing_business_as": {
            "type": "string",
            "description": "Business name if the business operates under a different name."
          },
          "website": {
            "type": "string",
            "description": "The website of the business. Must start with http:// or https://."
          },
          "contact_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMethod"
            }
          },
          "address_details": {
            "$ref": "#/components/schemas/AddressDetails"
          },
          "identification_details": {
            "$ref": "#/components/schemas/IdentificationDetailsBusiness"
          },
          "additional_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdditionalDocument"
            }
          }
        },
        "description": "Details for the business entity"
      },
      "BeneficialOwners": {
        "type": "object",
        "required": [
          "entity_id"
        ],
        "properties": {
          "entity_id": {
            "type": "string",
            "description": "Individual entity_id created for the beneficial owner. Data requirements for beneficial owners match those of authorized_signer roles."
          },
          "ownership_percentage": {
            "type": "string",
            "description": "Percentage ownership (0-100.00 or 0-1.00 for decimal representation).",
            "pattern": "^(0(\\.\\d{1,2})?|[1-9]\\d{0,1}(\\.\\d{1,2})?|100(\\.0{1,2})?)$"
          },
          "relationship_established_at": {
            "type": "string",
            "format": "date",
            "description": "The date the relationship was established."
          }
        }
      },
      "ControlPersons": {
        "type": "object",
        "required": [
          "entity_id",
          "title"
        ],
        "properties": {
          "entity_id": {
            "type": "string",
            "description": "Individual entity_id created for the control person. Data requirements for control persons match those of authorized_signer roles."
          },
          "title": {
            "type": "string",
            "description": "The title of this control person."
          },
          "relationship_established_at": {
            "type": "string",
            "format": "date",
            "description": "The date the relationship was established."
          }
        }
      },
      "CreateABusinessEntityResponse": {
        "title": "Business",
        "type": "object",
        "required": [
          "id",
          "type",
          "business_details",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID for the Entity object."
          },
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object is created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object was last updated."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeBusiness"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/BusinessDetails"
          },
          "beneficial_owners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwners"
            }
          },
          "control_persons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ControlPersons"
            }
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "role_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "EntityTypeSoleProp": {
        "type": "string",
        "pattern": "^sole_prop$",
        "default": "sole_prop",
        "description": "Type of entity = sole_prop."
      },
      "SoleProprietor": {
        "type": "object",
        "required": [
          "entity_id"
        ],
        "properties": {
          "entity_id": {
            "type": "string",
            "minLength": 1,
            "description": "Individual entity_id created for the sole proprietor. Data requirements for sole proprietors match those of authorized_signer roles."
          }
        }
      },
      "CreateASolePropEntityResponse": {
        "title": "Sole Prop",
        "type": "object",
        "required": [
          "id",
          "type",
          "business_details",
          "sole_proprietor",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID for the Entity object."
          },
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object is created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp at which the entity object was last updated."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeSoleProp"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/BusinessDetails"
          },
          "sole_proprietor": {
            "$ref": "#/components/schemas/SoleProprietor"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "role_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RoleDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "RetrieveAnEntitySuccessResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateAnIndividualEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateABusinessEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateASolePropEntityResponse"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "individual": "#/components/schemas/CreateAnIndividualEntityResponse",
            "business": "#/components/schemas/CreateABusinessEntityResponse",
            "sole_prop": "#/components/schemas/CreateASolePropEntityResponse"
          }
        }
      },
      "CreateAnIndividualEntityRequestBody": {
        "title": "Individual",
        "type": "object",
        "required": [
          "type",
          "individual_details"
        ],
        "properties": {
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeIndividual"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "individual_details": {
            "$ref": "#/components/schemas/IndividualDetails"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateABusinessEntityRequestBody": {
        "title": "Business",
        "type": "object",
        "required": [
          "type",
          "business_details"
        ],
        "properties": {
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeBusiness"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/BusinessDetails"
          },
          "beneficial_owners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwners"
            }
          },
          "control_persons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ControlPersons"
            }
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateASolePropEntityRequestBody": {
        "title": "Sole Prop",
        "type": "object",
        "required": [
          "type",
          "business_details",
          "sole_proprietor"
        ],
        "properties": {
          "client_customer_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Client customer ID for the entity object. Limit of 64 characters."
          },
          "type": {
            "$ref": "#/components/schemas/EntityTypeSoleProp"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/BusinessDetails"
          },
          "sole_proprietor": {
            "$ref": "#/components/schemas/SoleProprietor"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateAnEntityRequestBody": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateAnIndividualEntityRequestBody"
          },
          {
            "$ref": "#/components/schemas/CreateABusinessEntityRequestBody"
          },
          {
            "$ref": "#/components/schemas/CreateASolePropEntityRequestBody"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "individual": "#/components/schemas/CreateAnIndividualEntityRequestBody",
            "business": "#/components/schemas/CreateABusinessEntityRequestBody",
            "sole_prop": "#/components/schemas/CreateASolePropEntityRequestBody"
          }
        }
      },
      "CreateAnEntitySuccessResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateAnIndividualEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateABusinessEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateASolePropEntityResponse"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "individual": "#/components/schemas/CreateAnIndividualEntityResponse",
            "business": "#/components/schemas/CreateABusinessEntityResponse",
            "sole_prop": "#/components/schemas/CreateASolePropEntityResponse"
          }
        }
      },
      "UpdateAddress": {
        "type": "object",
        "properties": {
          "line_1": {
            "type": "string",
            "description": "Address line 1 is the required primary street-address field. It must contain the full base address needed to identify the physical location, such as the street number and street name together, or the closest local equivalent in countries where addresses do not use that exact structure.\n\nUse address line 1 for all core location details that describe the main property or thoroughfare. Regardless of how each component of an address is collected from your end-users, they must be combined into address line 1 before sending to Lead.\n\nDo not:\n- split the primary street address across line 1 and line 2\n- put only the street number in line 1 and the street name in line 2\n- pad line 1 with false or altered data just to satisfy validation"
          },
          "line_2": {
            "type": "string",
            "description": "Address line 2 is optional and should be used only for secondary or sub-premise information, such as:\n- apartment\n- unit\n- suite\n- floor\n- building\n- care-of / attention\n\nIf there is no secondary or sub-premise information, address line 2 should be blank.\n\nDo not use address line 2 for any part of the primary street address."
          },
          "city": {
            "type": "string",
            "description": "City."
          },
          "postal_code": {
            "type": "string",
            "description": "Postal Code, required for US addresses. Please follow the following format: US: ^\\d5(?:-\\d4)?$, CN: ^\\d6$, GB: ^[A-Z]{1,2}d[A-Z0-9]? ?d[A-Z]{2}$, JP: ^\\d3-\\d4$"
          },
          "state": {
            "type": "string",
            "description": "State. required for US addresses in 2 character code (e.g. NY)."
          },
          "country": {
            "type": "string",
            "description": "ISO3166-1 Alpha-2 country code."
          }
        }
      },
      "UpdateAddressDetails": {
        "type": "object",
        "properties": {
          "physical_address": {
            "$ref": "#/components/schemas/UpdateAddress",
            "description": "Physical address for the entity. Physical addresses must not be P.O. boxes, registered agent addresses or in prohibited countries."
          },
          "mailing_address": {
            "$ref": "#/components/schemas/UpdateAddress",
            "description": "Mailing address for the entity."
          },
          "other_addresses": {
            "type": "array",
            "description": "Other addresses for the entity.",
            "items": {
              "$ref": "#/components/schemas/Address"
            }
          }
        }
      },
      "UpdateIndividualDetails": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string",
            "description": "Legal first name. Must be at least 2 character.",
            "example": "Lucy"
          },
          "preferred_first_name": {
            "type": "string",
            "description": "Preferred first name.",
            "example": "Lu"
          },
          "middle_name": {
            "type": "string",
            "description": "Middle name.",
            "example": "Reginald"
          },
          "last_name": {
            "type": "string",
            "description": "Legal last name. Must be at least 2 character.",
            "example": "Collins"
          },
          "date_of_birth": {
            "type": "string",
            "format": "date",
            "description": "Date of birth, in YYYY-MM-DD format.  Authorized signers and account holders must be 18 years or older.",
            "example": "2002-02-15"
          },
          "occupation": {
            "type": "string",
            "description": "Occupation / job.",
            "example": "Author"
          },
          "contact_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMethod"
            }
          },
          "address_details": {
            "$ref": "#/components/schemas/UpdateAddressDetails"
          },
          "identification_details": {
            "$ref": "#/components/schemas/IdentificationDetailsIndividual"
          },
          "additional_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdditionalDocument"
            }
          }
        },
        "description": "Details for the individual entity"
      },
      "UpdateAnIndividualEntityRequestBody": {
        "title": "Individual",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EntityTypeIndividual"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "individual_details": {
            "$ref": "#/components/schemas/UpdateIndividualDetails"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateBusinessDetails": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/BusinessTypeEnum"
          },
          "name": {
            "type": "string",
            "description": "Legal name of the business. Must be at least 2 characters."
          },
          "gross_annual_revenue": {
            "type": "string",
            "description": "Business gross revenue for prior fiscal year."
          },
          "currency_code": {
            "type": "string",
            "description": "A three-letter currency code as defined in ISO 4217."
          },
          "industry": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "NAICS code(s) for the applicable industries. 2-6 digits of NAICS code(s) are accepted and valid NAICS codes can be found on naics.com."
          },
          "doing_business_as": {
            "type": "string",
            "description": "Business name if the business operates under a different name."
          },
          "website": {
            "type": "string",
            "description": "The website of the business. Must start with http:// or https://."
          },
          "contact_methods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMethod"
            }
          },
          "address_details": {
            "$ref": "#/components/schemas/UpdateAddressDetails"
          },
          "identification_details": {
            "$ref": "#/components/schemas/IdentificationDetailsBusiness"
          },
          "additional_documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdditionalDocument"
            }
          }
        },
        "description": "Details for the business entity"
      },
      "UpdateABusinessEntityRequestBody": {
        "title": "Business",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EntityTypeBusiness"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/UpdateBusinessDetails"
          },
          "beneficial_owners": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BeneficialOwners"
            }
          },
          "control_persons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ControlPersons"
            }
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateASolePropEntityRequestBody": {
        "title": "Sole Prop",
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EntityTypeSoleProp"
          },
          "intended_roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntendedRolesEnum"
            },
            "description": "The entity's intended role(s). In the event more than 1 role is passed in and at least 1 role doesn’t pass validation, the request will not succeed; it is an all or nothing behavior. For type `business` or `sole_prop`, only `account_holder` should be provided.",
            "example": [
              "account_holder"
            ]
          },
          "risk_score": {
            "$ref": "#/components/schemas/EntityRiskScoreEnum"
          },
          "business_details": {
            "$ref": "#/components/schemas/UpdateBusinessDetails"
          },
          "sole_proprietor": {
            "$ref": "#/components/schemas/SoleProprietor"
          },
          "rfi_details": {
            "$ref": "#/components/schemas/RfiDetails"
          },
          "ofac_details": {
            "$ref": "#/components/schemas/OfacDetails"
          },
          "kyc_details": {
            "$ref": "#/components/schemas/KycDetails"
          },
          "credit_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreditDetails"
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "UpdateAnEntityRequestBody": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/UpdateAnIndividualEntityRequestBody"
          },
          {
            "$ref": "#/components/schemas/UpdateABusinessEntityRequestBody"
          },
          {
            "$ref": "#/components/schemas/UpdateASolePropEntityRequestBody"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "individual": "#/components/schemas/UpdateAnIndividualEntityRequestBody",
            "business": "#/components/schemas/UpdateABusinessEntityRequestBody",
            "sole_prop": "#/components/schemas/UpdateASolePropEntityRequestBody"
          }
        }
      },
      "UpdateAnEntitySuccessResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateAnIndividualEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateABusinessEntityResponse"
          },
          {
            "$ref": "#/components/schemas/CreateASolePropEntityResponse"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "individual": "#/components/schemas/CreateAnIndividualEntityResponse",
            "business": "#/components/schemas/CreateABusinessEntityResponse",
            "sole_prop": "#/components/schemas/CreateASolePropEntityResponse"
          }
        }
      },
      "OriginatorStatus": {
        "type": "string",
        "description": "Originator Status",
        "example": "active",
        "enum": [
          "pending",
          "active",
          "inactive",
          "rejected",
          "canceled",
          "suspended"
        ]
      },
      "AchCalendarDayMaximumAmount": {
        "type": "object",
        "required": [
          "credit",
          "debit"
        ],
        "properties": {
          "credit": {
            "type": "integer",
            "format": "int64",
            "description": "Credit limit per transaction in cents.",
            "minimum": 0,
            "maximum": 990000000000
          },
          "debit": {
            "type": "integer",
            "format": "int64",
            "description": "Debit limit per transaction in cents.",
            "minimum": 0,
            "maximum": 990000000000
          }
        }
      },
      "AchRolling30CalendarDayMaximumAmount": {
        "type": "object",
        "required": [
          "credit",
          "debit"
        ],
        "properties": {
          "credit": {
            "type": "integer",
            "format": "int64",
            "description": "Credit limit per transaction in cents.",
            "minimum": 0,
            "maximum": 990000000000
          },
          "debit": {
            "type": "integer",
            "format": "int64",
            "description": "Debit limit per transaction in cents.",
            "minimum": 0,
            "maximum": 990000000000
          }
        }
      },
      "AchOriginatorLimits": {
        "type": "object",
        "required": [
          "calendar_day_maximum_amount",
          "rolling_30_calendar_day_maximum_amount"
        ],
        "properties": {
          "calendar_day_maximum_amount": {
            "$ref": "#/components/schemas/AchCalendarDayMaximumAmount",
            "description": "Maximum amount per calendar day."
          },
          "rolling_30_calendar_day_maximum_amount": {
            "$ref": "#/components/schemas/AchRolling30CalendarDayMaximumAmount",
            "description": "Maximum amount per rolling 30 calendar days."
          }
        }
      },
      "AchOriginatorParameters": {
        "type": "object",
        "description": "ACH controls for originators.",
        "required": [
          "limits",
          "allowed_sec_codes"
        ],
        "properties": {
          "allowed_sec_codes": {
            "type": "array",
            "description": "List of allowed SEC codes for ACH transactions.",
            "items": {
              "$ref": "#/components/schemas/OutgoingSecCode"
            }
          },
          "nested_third_parties": {
            "type": "array",
            "description": "List of nested third-party entity IDs.",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 5
          },
          "limits": {
            "$ref": "#/components/schemas/AchOriginatorLimits",
            "description": "The ACH limits for the originator."
          }
        }
      },
      "Originator": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the Originator.",
            "example": "originator_xyz123",
            "pattern": "^originator_\\w+$"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "entity_id": {
            "$ref": "#/components/schemas/EntityID"
          },
          "status": {
            "$ref": "#/components/schemas/OriginatorStatus"
          },
          "company_name": {
            "type": "string",
            "example": "Acme Inc.",
            "maxLength": 16
          },
          "company_id": {
            "$ref": "#/components/schemas/CompanyId"
          },
          "ach": {
            "$ref": "#/components/schemas/AchOriginatorParameters"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2022-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2022-06-27T11:22:33Z"
          }
        }
      },
      "ListOriginator": {
        "type": "object",
        "required": [
          "objects",
          "has_more"
        ],
        "properties": {
          "objects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Originator"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Indicates if there are more originators to retrieve."
          }
        }
      },
      "AchOriginatorUpdateLimits": {
        "type": "object",
        "properties": {
          "calendar_day_maximum_amount": {
            "$ref": "#/components/schemas/AchCalendarDayMaximumAmount",
            "description": "Maximum amount per calendar day."
          },
          "rolling_30_calendar_day_maximum_amount": {
            "$ref": "#/components/schemas/AchRolling30CalendarDayMaximumAmount",
            "description": "Maximum amount per rolling 30 calendar days."
          }
        }
      },
      "AchOriginatorUpdateParameters": {
        "type": "object",
        "description": "ACH controls for updating originators.",
        "properties": {
          "allowed_sec_codes": {
            "type": "array",
            "description": "List of allowed SEC codes for ACH transactions.",
            "items": {
              "$ref": "#/components/schemas/OutgoingSecCode"
            }
          },
          "nested_third_parties": {
            "type": "array",
            "description": "List of nested third-party entity IDs.",
            "maxItems": 5,
            "items": {
              "$ref": "#/components/schemas/EntityID"
            }
          },
          "limits": {
            "$ref": "#/components/schemas/AchOriginatorUpdateLimits",
            "description": "The ACH limits for the originator."
          }
        }
      },
      "FundingCurrencyCode": {
        "type": "string",
        "description": "A three-letter currency code as defined in ISO 4217. Must match the `currency_code` on the associated Subledger Balance object.",
        "example": "USD",
        "enum": [
          "USD"
        ]
      },
      "FundingStatus": {
        "type": "string",
        "description": "The current status of the Funding object.",
        "enum": [
          "processing",
          "posted",
          "rejected"
        ],
        "example": "processing"
      },
      "FundingRejectionReason": {
        "type": "string",
        "description": "The rejection code that indicates the type of rejection. Note that Lead may introduce additional enums in the future; partner integrations should be ready to handle them as non-breaking changes.",
        "enum": [
          "internal_error"
        ],
        "example": "internal_error"
      },
      "FundingRejection": {
        "type": "object",
        "description": "Object containing information relevant for cases where the Funding object is in a rejected status. When the object is not in a rejected status, fields will still be present with empty strings.",
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/FundingRejectionReason"
          },
          "details": {
            "type": "string",
            "description": "Additional info about the rejection. Reserved for future use.",
            "example": "Funding object rejected due to an internal error."
          }
        }
      },
      "FundingV0": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique ID of the funding object.",
            "maxLength": 64,
            "example": "funding_123",
            "pattern": "^funding_\\w+$"
          },
          "subledger_balance_id": {
            "type": "string",
            "description": "Unique ID of the credit subledger balance object that a funding object is being created for. The referenced Subledger Balance must be in an `active` status. If the Subledger Balance has an `expected_maturity_date`, it must not be in the past.",
            "maxLength": 64,
            "example": "subledger_balance_123"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "principal": {
            "type": "object",
            "description": "The total amount of funding that is part of the loan product's principal. Note that upon funding, this amount will be considered disbursed, and Lead will begin applying imputed interest. All amounts will be assumed to be in the currency set on the Subledger Balance object.\nInvariant: (external_disbursement_amount > 0) OR (withheld_amount > 0).",
            "properties": {
              "external_disbursement_amount": {
                "type": "integer",
                "description": "The portion of the principal amount that will be made available for external disbursement at the time of funding (in minor units). Either this field or `withheld_amount` must be greater than 0.",
                "example": 100000
              },
              "withheld_amount": {
                "type": "integer",
                "description": "The portion of the principal amount that will be withheld and not disbursed externally at the time of funding (in minor units). Either this field or `external_disbursement_amount` must be greater than 0.",
                "example": 1000
              },
              "merchant_origination_fee_amount": {
                "type": "integer",
                "description": "The amount of origination fees charged to the merchant that is included in the principal amount (in minor units). Must be less than `external_disbursement_amount` + `withheld_amount`.",
                "example": 100
              }
            }
          },
          "other_fees": {
            "type": "object",
            "description": "Fees relating to the funding request that Lead needs awareness of for bookkeeping purposes only.",
            "properties": {
              "borrower_origination_fee_amount": {
                "type": "integer",
                "description": "Non-capitalized origination fee charged to the borrower at the point of funding (in minor units).",
                "example": 200
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "Additional metadata associated with the funding.",
            "additionalProperties": true,
            "example": {
              "client_draw_id": "X67BU"
            }
          },
          "status": {
            "$ref": "#/components/schemas/FundingStatus"
          },
          "rejection": {
            "$ref": "#/components/schemas/FundingRejection"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the Funding object was created.",
            "example": "2025-09-02T11:01:36Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the Funding object was last updated.",
            "example": "2025-09-02T11:05:00Z"
          }
        }
      },
      "CreditDetailsBase": {
        "type": "object",
        "required": [
          "structure"
        ],
        "properties": {
          "structure": {
            "type": "string"
          },
          "balances": {
            "type": "object",
            "properties": {
              "rewards": {
                "type": "object",
                "required": [
                  "unit"
                ],
                "properties": {
                  "unit": {
                    "type": "string",
                    "enum": [
                      "usd",
                      "points"
                    ],
                    "example": "points"
                  }
                }
              }
            }
          },
          "autopay_method": {
            "type": "string",
            "description": "The autopay method. Required if `type` is `credit`.",
            "example": "ach",
            "enum": [
              "ach",
              "debit_card",
              "wire",
              "virtual_wallet",
              "credit_card",
              "none"
            ]
          },
          "is_interest_based": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates whether the Subledger Balance is interest-based. Required if `type` is `credit`.",
            "example": true
          },
          "effective_apr": {
            "type": "string",
            "description": "The APR as disclosed to the borrower. Required if `type` is `credit`. Must have exactly 3 decimal places (e.g., `10.250`).",
            "example": "10.250"
          },
          "effective_interest_rate": {
            "type": "string",
            "description": "The true annualized cost of borrowing, taking into account the interest rate and impact of compounding. Required if `type` is `credit`. Must have exactly 6 decimal places (e.g., `9.500000`).",
            "example": "9.500000"
          },
          "interest_rate": {
            "type": "string",
            "description": "For deposit products, the annualized interest rate offered to customers on this Subledger Balance. For credit products, the contractual annual rate of interest charged on the loan’s outstanding principal, without taking into account compounding frequency or additional fees. Also known as the stated interest rate or nominal interest rate. Required when `is_interest_based` is `true`. Must have exactly 6 decimal places (e.g., `9.990000`).",
            "example": "9.990000"
          }
        }
      },
      "RepaymentDetails": {
        "type": "object",
        "required": [
          "expected_payment_frequency"
        ],
        "properties": {
          "expected_payment_frequency": {
            "type": "string",
            "description": "The expected frequency with which customer payments will occur.\n\n**Calendar-based frequencies:**\n- `weekly` — Once per week.\n- `biweekly` — Once every two weeks (26 payments/year).\n- `semi_monthly` — Twice per month on fixed calendar days (24 payments/year).\n- `monthly` — Once per calendar month.\n- `quarterly` — Once every calendar quarter (4 payments/year).\n- `semi_annually` — Once every 6 months (2 payments/year).\n- `annually` — Once per calendar year.\n- `business_daily` — Once per business day.\n\n**Fixed-interval frequencies:**\n- `fixed_interval` — Payments occur after a fixed number of elapsed days rather than on calendar-based dates. When using this value, `expected_payment_frequency_interval_days` is required.\n\n**Non-time-based frequencies:**\n- `maturity` — A single payment at loan maturity.\n- `variable` — Repayment does not follow a predictable time-based cadence; instead, payments are event-driven (e.g., repayment occurs the next time funds enter the borrower's account).\n",
            "example": "monthly",
            "enum": [
              "business_daily",
              "weekly",
              "biweekly",
              "semi_monthly",
              "monthly",
              "quarterly",
              "semi_annually",
              "annually",
              "fixed_interval",
              "maturity",
              "variable"
            ]
          },
          "expected_payment_frequency_interval_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "The number of days between expected customer payments when the repayment schedule follows a fixed interval.\n\n**Required** when `expected_payment_frequency` is `fixed_interval`. **Must not be present** when `expected_payment_frequency` is any other value.\n",
            "example": 60
          },
          "expected_number_of_payments": {
            "type": "integer",
            "description": "The expected number of payments if the customer pays according to the loan schedule.",
            "example": 24
          },
          "expected_first_payment_date": {
            "type": "string",
            "format": "date",
            "description": "The expected date of the first customer repayment. If there is only one repayment please use this field.",
            "example": "2025-10-01"
          },
          "expected_first_payment_amount": {
            "type": "integer",
            "description": "The expected amount of the first customer repayment expressed as an integer in minor units. If there is only one repayment please use this field.",
            "example": 4167
          },
          "expected_last_payment_date": {
            "type": "string",
            "format": "date",
            "description": "The expected date of the last customer repayment.",
            "example": "2027-09-01"
          },
          "expected_last_payment_amount": {
            "type": "integer",
            "description": "The expected amount of the last customer repayment expressed as an integer in minor units.",
            "example": 4167
          },
          "expected_payment_amount": {
            "type": "integer",
            "description": "The expected payment amount in each repayment expressed as an integer in minor units.",
            "example": 4167
          }
        }
      },
      "Term": {
        "type": "object",
        "required": [
          "value",
          "unit"
        ],
        "properties": {
          "value": {
            "type": "integer",
            "description": "The number of units in the contractual term length.",
            "example": 24
          },
          "unit": {
            "type": "string",
            "description": "The unit of the contractual term length. E.g., for a term loan, this represents the contractual loan term from the date of origination to the expected maturity date.",
            "example": "months",
            "enum": [
              "days",
              "weeks",
              "months",
              "years"
            ]
          }
        }
      },
      "NonRevolvingCreditDetailsRequest": {
        "title": "Non-Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsBase"
          },
          {
            "type": "object",
            "required": [
              "expected_maturity_date",
              "repayment_details",
              "max_funding_amount",
              "term",
              "expected_finance_charge_amount"
            ],
            "properties": {
              "expected_maturity_date": {
                "type": "string",
                "format": "date",
                "description": "The expected maturity date of the loan. Must not be in the past when creating a Funding against this Subledger Balance.",
                "example": "2027-09-01"
              },
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepaymentDetails"
                }
              },
              "max_funding_amount": {
                "type": "integer",
                "description": "The maximum funding amount as an integer in minor units. For a term loan, this would be equivalent to the total loan amount. Cumulative Funding requests against this Subledger Balance cannot exceed this amount.",
                "example": 10000000
              },
              "term": {
                "$ref": "#/components/schemas/Term"
              },
              "expected_finance_charge_amount": {
                "type": "integer",
                "description": "The expected finance charge amount expressed as an integer in minor units.",
                "example": 1000
              }
            }
          }
        ]
      },
      "RevolvingRepaymentDetails": {
        "type": "object",
        "required": [
          "expected_payment_frequency"
        ],
        "properties": {
          "expected_payment_frequency": {
            "type": "string",
            "description": "The expected frequency with which customer payments will occur.\n\n**Calendar-based frequencies:**\n- `weekly` — Once per week.\n- `biweekly` — Once every two weeks (26 payments/year).\n- `semi_monthly` — Twice per month on fixed calendar days (24 payments/year).\n- `monthly` — Once per calendar month.\n- `quarterly` — Once every calendar quarter (4 payments/year).\n- `semi_annually` — Once every 6 months (2 payments/year).\n- `annually` — Once per calendar year.\n- `business_daily` — Once per business day.\n\n**Fixed-interval frequencies:**\n- `fixed_interval` — Payments occur after a fixed number of elapsed days rather than on calendar-based dates. When using this value, `expected_payment_frequency_interval_days` is required.\n\n**Non-time-based frequencies:**\n- `maturity` — A single payment at loan maturity.\n- `variable` — Repayment does not follow a predictable time-based cadence; instead, payments are event-driven (e.g., repayment occurs the next time funds enter the borrower's account).\n",
            "example": "monthly",
            "enum": [
              "business_daily",
              "weekly",
              "biweekly",
              "semi_monthly",
              "monthly",
              "quarterly",
              "semi_annually",
              "annually",
              "fixed_interval",
              "maturity",
              "variable"
            ]
          },
          "expected_payment_frequency_interval_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "The number of days between expected customer payments when the repayment schedule follows a fixed interval.\n\n**Required** when `expected_payment_frequency` is `fixed_interval`. **Must not be present** when `expected_payment_frequency` is any other value.\n",
            "example": 60
          }
        }
      },
      "RevolvingCreditDetailsRequest": {
        "title": "Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsBase"
          },
          {
            "type": "object",
            "required": [
              "repayment_details"
            ],
            "properties": {
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RevolvingRepaymentDetails"
                }
              }
            }
          }
        ]
      },
      "CreditDetailsRequest": {
        "type": "object",
        "required": [
          "structure"
        ],
        "properties": {
          "structure": {
            "type": "string",
            "description": "The structure of the credit product.",
            "enum": [
              "non_revolving",
              "revolving"
            ]
          }
        },
        "discriminator": {
          "propertyName": "structure",
          "mapping": {
            "non_revolving": "#/components/schemas/NonRevolvingCreditDetailsRequest",
            "revolving": "#/components/schemas/RevolvingCreditDetailsRequest"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/NonRevolvingCreditDetailsRequest"
          },
          {
            "$ref": "#/components/schemas/RevolvingCreditDetailsRequest"
          }
        ]
      },
      "CreateSubledgerBalanceRequest": {
        "type": "object",
        "required": [
          "account_id",
          "client_subledger_balance_name",
          "currency_code",
          "type",
          "details"
        ],
        "properties": {
          "account_id": {
            "type": "string",
            "maxLength": 64,
            "description": "Unique identifier for the Account object that the Subledger Balance belongs to. Must reference an Account object in a permitted status (`active` or `inactive`). If the Account includes a `capabilities` array, the requested Subledger Balance `type` must be supported.",
            "example": "account_v9K4p2M7nL1wQ8xR5zB6tY3jH0gA"
          },
          "client_subledger_balance_name": {
            "type": "string",
            "maxLength": 64,
            "description": "A name for the product or Subledger Balance being offered to the end-user (e.g., Rainy Day Fund, BNPL loan).",
            "example": "Personal Loan - Home Improvement"
          },
          "client_settlement_bank_account_id": {
            "type": "string",
            "description": "ID of the underlying settlement bank account where funds for the Subledger Balance are held. Only applicable for certain use cases.",
            "example": "12345"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "type": {
            "type": "string",
            "enum": [
              "credit"
            ],
            "description": "The type of Subledger Balance.",
            "example": "credit"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "details": {
            "$ref": "#/components/schemas/CreditDetailsRequest"
          }
        }
      },
      "SubledgerBalanceStatus": {
        "type": "string",
        "description": "Status of the Subledger Balance.",
        "example": "active",
        "enum": [
          "active",
          "inactive",
          "closed"
        ]
      },
      "SubledgerBalanceType": {
        "type": "string",
        "description": "The type of Subledger Balance.",
        "example": "credit",
        "enum": [
          "credit",
          "deposit"
        ]
      },
      "CoreBalanceResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total balance amount as an integer in minor units.",
            "example": 8944
          },
          "amount_in_usd": {
            "type": "integer",
            "description": "The total balance amount in USD as an integer in minor units.",
            "example": 8944
          },
          "outstanding_principal": {
            "type": "integer",
            "description": "The outstanding principal amount as an integer in minor units.",
            "example": 5000
          },
          "outstanding_interest": {
            "type": "integer",
            "description": "The outstanding interest amount as an integer in minor units.",
            "example": 2522
          },
          "outstanding_fees": {
            "type": "integer",
            "description": "The outstanding fees amount as an integer in minor units.",
            "example": 1422
          }
        }
      },
      "RewardsBalanceResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The rewards balance amount as an integer in minor units.",
            "example": 10
          },
          "unit": {
            "type": "string",
            "description": "The unit of measurement for the rewards balance amount.",
            "example": "points",
            "enum": [
              "usd",
              "points"
            ]
          }
        }
      },
      "DisputeBalanceResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total amount that is currently under dispute as an integer in minor units.",
            "example": 0
          },
          "principal": {
            "type": "integer",
            "description": "The amount of principal that is currently under dispute as an integer in minor units",
            "example": 0
          },
          "interest": {
            "type": "integer",
            "description": "The amount of interest that is currently under dispute as an integer in minor units",
            "example": 0
          },
          "fees": {
            "type": "integer",
            "description": "The amount of fees that is currently under dispute as an integer in minor units",
            "example": 0
          }
        }
      },
      "ChargeOffBalanceResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The charged-off amount as an integer in minor units.",
            "example": 0
          },
          "principal": {
            "type": "integer",
            "description": "The charged-off principal amount as an integer in minor units.",
            "example": 0
          },
          "interest": {
            "type": "integer",
            "description": "The charged-off interest amount as an integer in minor units.",
            "example": 0
          },
          "fees": {
            "type": "integer",
            "description": "The charged-off fees amount as an integer in minor units.",
            "example": 0
          }
        }
      },
      "PastDueBalanceResponse": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total past due amount as an integer in minor units.",
            "example": 15
          },
          "past_due_days": {
            "type": "integer",
            "description": "The number of days that the balance is past due.",
            "example": 15
          },
          "principal": {
            "type": "integer",
            "description": "The past due principal amount as an integer in minor units.",
            "example": 15
          },
          "interest": {
            "type": "integer",
            "description": "The past due interest amount as an integer in minor units.",
            "example": 15
          },
          "fees": {
            "type": "integer",
            "description": "The past due fees amount as an integer in minor units.",
            "example": 15
          }
        }
      },
      "BalanceAmountsResponse": {
        "type": "object",
        "properties": {
          "core": {
            "$ref": "#/components/schemas/CoreBalanceResponse"
          },
          "rewards": {
            "$ref": "#/components/schemas/RewardsBalanceResponse"
          },
          "dispute": {
            "$ref": "#/components/schemas/DisputeBalanceResponse"
          },
          "charge_off": {
            "$ref": "#/components/schemas/ChargeOffBalanceResponse"
          },
          "past_due": {
            "$ref": "#/components/schemas/PastDueBalanceResponse"
          }
        }
      },
      "CreditDetailsResponseBaseOptional": {
        "type": "object",
        "properties": {
          "structure": {
            "type": "string"
          },
          "balances": {
            "$ref": "#/components/schemas/BalanceAmountsResponse"
          },
          "autopay_method": {
            "type": "string",
            "description": "The autopay method. Required if `type` is `credit`.",
            "example": "ach",
            "enum": [
              "ach",
              "debit_card",
              "wire",
              "virtual_wallet",
              "credit_card",
              "none"
            ]
          },
          "is_interest_based": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates whether the Subledger Balance is interest-based. Required if `type` is `credit`.",
            "example": true
          },
          "effective_apr": {
            "type": "string",
            "description": "The APR as disclosed to the borrower. Required if `type` is `credit`.",
            "example": "10.250"
          },
          "effective_interest_rate": {
            "type": "string",
            "description": "The true annualized cost of borrowing, taking into account the interest rate and impact of compounding. Required if `type` is `credit`.",
            "example": "9.500000"
          },
          "interest_rate": {
            "type": "string",
            "description": "For deposit products, the annualized interest rate offered to customers on this Subledger Balance. For credit products, the contractual annual rate of interest charged on the loan’s outstanding principal, without taking into account compounding frequency or additional fees. Also known as the stated interest rate or nominal interest rate.",
            "example": "9.990000"
          }
        }
      },
      "RepaymentDetailsResponse": {
        "type": "object",
        "properties": {
          "expected_payment_frequency": {
            "type": "string",
            "description": "The expected frequency with which customer payments will occur.\n\n**Calendar-based frequencies:**\n- `weekly` — Once per week.\n- `biweekly` — Once every two weeks (26 payments/year).\n- `semi_monthly` — Twice per month on fixed calendar days (24 payments/year).\n- `monthly` — Once per calendar month.\n- `quarterly` — Once every calendar quarter (4 payments/year).\n- `semi_annually` — Once every 6 months (2 payments/year).\n- `annually` — Once per calendar year.\n- `business_daily` — Once per business day.\n\n**Fixed-interval frequencies:**\n- `fixed_interval` — Payments occur after a fixed number of elapsed days rather than on calendar-based dates. When using this value, `expected_payment_frequency_interval_days` is required.\n\n**Non-time-based frequencies:**\n- `maturity` — A single payment at loan maturity.\n- `variable` — Repayment does not follow a predictable time-based cadence; instead, payments are event-driven (e.g., repayment occurs the next time funds enter the borrower's account).\n",
            "example": "monthly",
            "enum": [
              "business_daily",
              "weekly",
              "biweekly",
              "semi_monthly",
              "monthly",
              "quarterly",
              "semi_annually",
              "annually",
              "fixed_interval",
              "maturity",
              "variable"
            ]
          },
          "expected_payment_frequency_interval_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "The number of days between expected customer payments when the repayment schedule follows a fixed interval.\n\nPresent when `expected_payment_frequency` is `fixed_interval`. Not present for any other frequency value.\n",
            "example": 60
          },
          "expected_number_of_payments": {
            "type": "integer",
            "description": "The expected number of payments if the customer pays according to the loan schedule.",
            "example": 24
          },
          "expected_first_payment_date": {
            "type": "string",
            "format": "date",
            "description": "The expected date of the first customer repayment. If there is only one repayment please use this field.",
            "example": "2025-10-01"
          },
          "expected_first_payment_amount": {
            "type": "integer",
            "description": "The expected amount of the first customer repayment expressed as an integer in minor units. If there is only one repayment please use this field.",
            "example": 4167
          },
          "expected_last_payment_date": {
            "type": "string",
            "format": "date",
            "description": "The expected date of the last customer repayment.",
            "example": "2027-09-01"
          },
          "expected_last_payment_amount": {
            "type": "integer",
            "description": "The expected amount of the last customer repayment expressed as an integer in minor units.",
            "example": 4167
          },
          "expected_payment_amount": {
            "type": "integer",
            "description": "The expected payment amount in each repayment expressed as an integer in minor units.",
            "example": 4167
          }
        }
      },
      "TermResponse": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "description": "The number of units in the contractual term length.",
            "example": 24
          },
          "unit": {
            "type": "string",
            "description": "The unit of the contractual term length. E.g., for a term loan, this represents the contractual loan term from the date of origination to the expected maturity date.",
            "example": "months",
            "enum": [
              "days",
              "weeks",
              "months",
              "years"
            ]
          }
        }
      },
      "NonRevolvingCreditDetailsResponse": {
        "title": "Non-Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsResponseBaseOptional"
          },
          {
            "type": "object",
            "required": [
              "structure"
            ],
            "properties": {
              "expected_maturity_date": {
                "type": "string",
                "format": "date",
                "description": "The expected maturity date of the loan.",
                "example": "2027-09-01"
              },
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepaymentDetailsResponse"
                }
              },
              "max_funding_amount": {
                "type": "integer",
                "description": "The maximum funding amount expressed as an integer in minor units. For a term loan, this would be equivalent to the total loan amount.",
                "example": 10000000
              },
              "term": {
                "$ref": "#/components/schemas/TermResponse"
              },
              "expected_finance_charge_amount": {
                "type": "integer",
                "description": "The expected finance charge amount expressed as an integer in minor units.",
                "example": 100000
              }
            }
          }
        ]
      },
      "RevolvingRepaymentDetailsResponse": {
        "type": "object",
        "properties": {
          "expected_payment_frequency": {
            "type": "string",
            "description": "The expected frequency with which customer payments will occur.\n\n**Calendar-based frequencies:**\n- `weekly` — Once per week.\n- `biweekly` — Once every two weeks (26 payments/year).\n- `semi_monthly` — Twice per month on fixed calendar days (24 payments/year).\n- `monthly` — Once per calendar month.\n- `quarterly` — Once every calendar quarter (4 payments/year).\n- `semi_annually` — Once every 6 months (2 payments/year).\n- `annually` — Once per calendar year.\n- `business_daily` — Once per business day.\n\n**Fixed-interval frequencies:**\n- `fixed_interval` — Payments occur after a fixed number of elapsed days rather than on calendar-based dates. When using this value, `expected_payment_frequency_interval_days` is required.\n\n**Non-time-based frequencies:**\n- `maturity` — A single payment at loan maturity.\n- `variable` — Repayment does not follow a predictable time-based cadence; instead, payments are event-driven (e.g., repayment occurs the next time funds enter the borrower's account).\n",
            "example": "monthly",
            "enum": [
              "business_daily",
              "weekly",
              "biweekly",
              "semi_monthly",
              "monthly",
              "quarterly",
              "semi_annually",
              "annually",
              "fixed_interval",
              "maturity",
              "variable"
            ]
          },
          "expected_payment_frequency_interval_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 730,
            "description": "The number of days between expected customer payments when the repayment schedule follows a fixed interval.\n\nPresent when `expected_payment_frequency` is `fixed_interval`. Not present for any other frequency value.\n",
            "example": 60
          }
        }
      },
      "RevolvingCreditDetailsResponse": {
        "title": "Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsResponseBaseOptional"
          },
          {
            "type": "object",
            "required": [
              "structure"
            ],
            "properties": {
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RevolvingRepaymentDetailsResponse"
                }
              }
            }
          }
        ]
      },
      "SubledgerBalanceCreditDetailsResponse": {
        "type": "object",
        "discriminator": {
          "propertyName": "structure",
          "mapping": {
            "non_revolving": "#/components/schemas/NonRevolvingCreditDetailsResponse",
            "revolving": "#/components/schemas/RevolvingCreditDetailsResponse"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/NonRevolvingCreditDetailsResponse"
          },
          {
            "$ref": "#/components/schemas/RevolvingCreditDetailsResponse"
          }
        ]
      },
      "SubledgerBalanceResponse": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Unique identifier for the account that the Subledger Balance belongs to.",
            "example": "account_v9K4p2M7nL1wQ8xR5zB6tY3jH0gA"
          },
          "id": {
            "type": "string",
            "description": "Lead-generated unique identifier for the Subledger Balance. This ID should subsequently be used when reporting on this object in the Balance file.",
            "example": "subledger_balance_k8L2n9QpW3xR5vT7mZ4jS1bA6cG"
          },
          "client_subledger_balance_name": {
            "type": "string",
            "description": "A name for the product or Subledger Balance being offered to the end-user (e.g., Rainy Day Fund, BNPL loan).",
            "example": "Personal Loan - Home Improvement"
          },
          "client_settlement_bank_account_id": {
            "type": "string",
            "description": "ID of the underlying settlement bank account where funds for the Subledger Balance are held. Only applicable for certain use cases.",
            "example": "12345"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "An ISO-8601 timestamp at which the Subledger Balance was created in Lead's system.",
            "example": "2025-09-02T11:01:36Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "An ISO-8601 timestamp at which the Subledger Balance was last updated in Lead's system.",
            "example": "2025-09-02T11:05:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/SubledgerBalanceStatus"
          },
          "status_reason": {
            "type": "string",
            "description": "Reason associated with the status of the Subledger Balance.",
            "example": "active"
          },
          "type": {
            "$ref": "#/components/schemas/SubledgerBalanceType"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "details": {
            "$ref": "#/components/schemas/SubledgerBalanceCreditDetailsResponse"
          }
        }
      },
      "InstantPaymentStatus": {
        "description": "The current status of the instant payment object.\nIf outgoing: created, under_review, canceled, rejected, posted.\nIf incoming: under_review, rejected, posted.",
        "type": "string",
        "example": "posted",
        "enum": [
          "created",
          "under_review",
          "canceled",
          "rejected",
          "posted"
        ]
      },
      "InstantPaymentCounterpartyStatus": {
        "description": "The current status of the instant payment from the counterparty's perspective.\nIf outgoing: posted, under_review, or rejected.\nIf incoming: posted or null.",
        "type": "string",
        "example": "posted",
        "nullable": true,
        "enum": [
          "posted",
          "under_review",
          "rejected"
        ]
      },
      "InstantPaymentReturnRequestStatus": {
        "type": "string",
        "description": "The current status of the return request object.\nFor incoming return requests: response_needed, accepted, rejected.\nFor outgoing return requests: pending, accepted, rejected.",
        "example": "pending",
        "enum": [
          "pending",
          "response_needed",
          "accepted",
          "rejected"
        ]
      },
      "InstantPaymentAmount": {
        "description": "The amount of the instant payment in cents.",
        "type": "integer",
        "format": "int64",
        "example": 5000,
        "minimum": 0
      },
      "InstantPaymentParty": {
        "type": "object",
        "description": "Details of a party in an instant payment.",
        "required": [
          "name",
          "account_number"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The party's name.",
            "minLength": 3,
            "maxLength": 35,
            "example": "Alex Smith"
          },
          "account_number": {
            "type": "string",
            "description": "The party's account number.",
            "minLength": 1,
            "maxLength": 17,
            "example": "1234567890"
          }
        }
      },
      "InstantPaymentAgent": {
        "type": "object",
        "description": "Details of a financial institution in an instant payment.",
        "required": [
          "routing_number"
        ],
        "properties": {
          "routing_number": {
            "type": "string",
            "description": "The party's routing number.",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$",
            "example": "111000111"
          }
        }
      },
      "InstantPaymentIdentifiers": {
        "type": "object",
        "description": "The instant payment's identifiers.",
        "properties": {
          "end_to_end_id": {
            "type": "string",
            "description": "The identifier assigned by the party initiating the instant payment to be delivered to the customer unchanged.",
            "maxLength": 35,
            "example": "033me5upSkktRorr3J6TKZ"
          },
          "uetr": {
            "type": "string",
            "description": "Unique End-to-End Transaction Reference (UETR). Must be an IETF RFC 4122 UUID.",
            "format": "uuid",
            "example": "8dc981d2-e8c2-4a7b-8df0-0781b46328d9"
          },
          "transaction_id": {
            "type": "string",
            "description": "The identifier assigned by the initiating party or debtor to uniquely identify the transaction.",
            "maxLength": 35,
            "example": "3G0CQxK8gKLpzaaxc7A9spDiifK"
          }
        }
      },
      "IncomingInstantPaymentReturnReason": {
        "type": "string",
        "description": "The reason for a return.\n* `honor_return_request` - Honoring a return request\n* `wrong_amount` - Wrong amount\n* `duplication` - Duplicate payment\n* `initiating_party_unrecognized` - Unknown sender\n* `fraud_suspected` - Fraud suspected\n* `undue_payment` - Unduly paid\n* `narrative` - Narrative reason, additional_information required\n* `customer_requested` - Requested by customer\n* `regulatory_reason` - Regulatory reason\n* `amount_too_low` - Amount too low\n* `other` - Other",
        "example": "duplication",
        "enum": [
          "honor_return_request",
          "wrong_amount",
          "duplication",
          "initiating_party_unrecognized",
          "fraud_suspected",
          "undue_payment",
          "narrative",
          "customer_requested",
          "regulatory_reason",
          "amount_too_low",
          "other"
        ]
      },
      "InstantPaymentReturnDetails": {
        "type": "object",
        "description": "If this instant payment is a return, this object contains details on the return.",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/IncomingInstantPaymentReturnReason"
          },
          "details": {
            "type": "string",
            "description": "Details of the reason for the return including the 4-character ISO code when possible."
          }
        }
      },
      "InstantPaymentRejectionReason": {
        "type": "string",
        "description": "The reason for the rejection.\n* `account_closed` - Closed creditor account\n* `creditor_account_number_invalid` - Invalid creditor account number\n* `account_blocked` - Blocked account\n* `wrong_amount` - Wrong amount\n* `creditor_name_mismatch` - Inconsistent end customer\n* `creditor_address_incorrect` - Missing or incorrect creditor address\n* `creditor_identification_invalid` - Invalid creditor identification\n* `duplication` - Duplicate\n* `regulatory_reason` - Regulatory\n* `narrative` - Narrative\n* `account_number_incorrect` - Account number incorrect or not active\n* `non_sufficient_funds` - Non-sufficient funds\n* `aggregate_limit_exceeded` - Aggregate limit exceeded\n* `participant_not_on_network` - Participant is not on an instant payment network\n* `routing_number_format_incorrect` - Routing number format is incorrect\n* `participant_signed_off` - Participant signed off\n* `restricted_by_account_number_controls` - Restricted by account number controls\n* `other` - Other",
        "example": "non_sufficient_funds",
        "enum": [
          "account_closed",
          "creditor_account_number_invalid",
          "account_blocked",
          "wrong_amount",
          "creditor_name_mismatch",
          "creditor_address_incorrect",
          "creditor_identification_invalid",
          "duplication",
          "regulatory_reason",
          "narrative",
          "account_number_incorrect",
          "non_sufficient_funds",
          "aggregate_limit_exceeded",
          "participant_not_on_network",
          "routing_number_format_incorrect",
          "participant_signed_off",
          "restricted_by_account_number_controls",
          "other"
        ]
      },
      "InstantPaymentRejection": {
        "type": "object",
        "description": "If this instant payment was rejected, this object contains details on the rejection.",
        "required": [
          "rejected_by",
          "reason"
        ],
        "properties": {
          "rejected_by": {
            "type": "string",
            "description": "The party that rejected the instant payment.",
            "enum": [
              "lead",
              "network",
              "counterparty"
            ],
            "example": "lead"
          },
          "reason": {
            "$ref": "#/components/schemas/InstantPaymentRejectionReason"
          },
          "details": {
            "type": "string",
            "description": "Details of the reason for the rejection including the 4-character ISO code when possible."
          }
        }
      },
      "InstantPaymentRelatedObjects": {
        "type": "object",
        "description": "This instant payment's related instant payments or other objects.",
        "properties": {
          "original_payment_id": {
            "type": "string",
            "description": "If this instant payment is a return, the ID of the original payment this return is in reference to.",
            "pattern": "^instant_payment_\\w+$",
            "example": "instant_payment_xyz123"
          },
          "return_payment_ids": {
            "type": "array",
            "description": "If this instant payment was subsequently returned, the IDs of the payment returns.",
            "items": {
              "type": "string",
              "pattern": "^instant_payment_\\w+$",
              "example": "instant_payment_xyz456"
            }
          }
        }
      },
      "IncomingInstantPaymentReturnRequestReason": {
        "type": "string",
        "description": "The reason for the return request.\n* `creditor_account_number_invalid` - Invalid creditor account number\n* `wrong_amount` - Wrong amount\n* `customer_requested` - Requested by customer\n* `duplication` - Duplicate payment\n* `fraud_suspected` - Fraud suspected\n* `technical_problem` - Technical problem\n* `undue_payment` - Unduly paid\n* `other` - Other",
        "example": "duplicate",
        "enum": [
          "creditor_account_number_invalid",
          "wrong_amount",
          "customer_requested",
          "duplication",
          "fraud_suspected",
          "technical_problem",
          "undue_payment",
          "other"
        ]
      },
      "IncomingInstantPaymentReturnRequestRejectionReason": {
        "type": "string",
        "description": "The reason for a rejected return request.\n* `account_closed` - Account closed\n* `non_sufficient_funds` - Insufficient funds\n* `customer_requested` - Customer decision\n* `legal_decision` - Legal decision\n* `customer_no_response` - No answer from customer\n* `returned_previously` - Already returned\n* `other` - Other",
        "example": "customer_no_response",
        "enum": [
          "account_closed",
          "non_sufficient_funds",
          "customer_requested",
          "legal_decision",
          "customer_no_response",
          "returned_previously",
          "other"
        ]
      },
      "InstantPaymentReturnRequestResolution": {
        "type": "object",
        "description": "The resolution details of the return request.",
        "required": [
          "resolved_at",
          "resolved_by"
        ],
        "properties": {
          "resolved_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO 8601 format timestamp that represents when the resolution occurred.",
            "example": "2022-06-27T11:22:33Z"
          },
          "resolved_by": {
            "type": "string",
            "description": "The party that resolved the return request.",
            "enum": [
              "client",
              "lead",
              "network",
              "counterparty"
            ],
            "example": "counterparty"
          },
          "rejection_reason": {
            "$ref": "#/components/schemas/IncomingInstantPaymentReturnRequestRejectionReason",
            "description": "If the return request was rejected, the reason for the rejection."
          },
          "rejection_details": {
            "type": "string",
            "description": "If the return request was rejected, details of the rejection reason including the 4-character ISO code when possible."
          }
        }
      },
      "InstantPaymentReturnRequest": {
        "type": "object",
        "description": "A return request associated with an instant payment.",
        "required": [
          "created_at",
          "status",
          "reason"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/InstantPaymentReturnRequestStatus"
          },
          "reason": {
            "$ref": "#/components/schemas/IncomingInstantPaymentReturnRequestReason"
          },
          "details": {
            "type": "string",
            "description": "Details of the reason for the return request including the 4-character ISO code when possible."
          },
          "deadline": {
            "type": "string",
            "format": "date-time",
            "description": "The deadline by which a final response to the return request is expected.\nFor incoming return requests, you must respond by 11:30PM ET on the 10th business day. If you do not respond, we will respond on your behalf with a rejection at midnight.\nFor outgoing return requests, the network deadline for the counterparty is 12:00AM ET on the 10th business day.",
            "example": "2022-07-11T23:30:00-04:00"
          },
          "resolution": {
            "$ref": "#/components/schemas/InstantPaymentReturnRequestResolution"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO 8601 format timestamp that represents when the return request object was created.",
            "example": "2022-06-27T11:22:33Z"
          }
        }
      },
      "InstantPayment": {
        "type": "object",
        "required": [
          "id",
          "account_id",
          "account_number_id",
          "created_at",
          "updated_at",
          "direction",
          "status",
          "amount",
          "currency_code",
          "related_objects",
          "return_requests",
          "creditor",
          "creditor_agent",
          "debtor",
          "debtor_agent",
          "payment_identifiers"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier of the instant payment object.",
            "example": "instant_payment_xyz123",
            "pattern": "^instant_payment_\\w+$"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "status": {
            "$ref": "#/components/schemas/InstantPaymentStatus"
          },
          "counterparty_status": {
            "$ref": "#/components/schemas/InstantPaymentCounterpartyStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/InstantPaymentAmount"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "description": {
            "type": "string",
            "description": "Free-form information on the reason for the payment.",
            "example": "Payment for invoice 12345"
          },
          "debtor": {
            "$ref": "#/components/schemas/InstantPaymentParty",
            "description": "The details of the debtor (payer) sending the funds."
          },
          "debtor_agent": {
            "$ref": "#/components/schemas/InstantPaymentAgent",
            "description": "The details of the financial institution where the debtor (payer) holds their account."
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/InstantPaymentAgent",
            "description": "The details of the financial institution where the creditor (payee) holds their account."
          },
          "creditor": {
            "$ref": "#/components/schemas/InstantPaymentParty",
            "description": "The details of the creditor (payee) receiving the funds."
          },
          "payment_identifiers": {
            "$ref": "#/components/schemas/InstantPaymentIdentifiers"
          },
          "return": {
            "$ref": "#/components/schemas/InstantPaymentReturnDetails"
          },
          "rejection": {
            "$ref": "#/components/schemas/InstantPaymentRejection"
          },
          "related_objects": {
            "$ref": "#/components/schemas/InstantPaymentRelatedObjects"
          },
          "return_requests": {
            "type": "array",
            "description": "The return requests that reference this instant payment.",
            "items": {
              "$ref": "#/components/schemas/InstantPaymentReturnRequest"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO 8601 format timestamp that represents when the instant payment object was created.",
            "example": "2022-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO 8601 format timestamp that represents when the instant payment object was last updated.",
            "example": "2022-06-27T11:22:40Z"
          }
        }
      },
      "OutgoingInstantPaymentReturnReason": {
        "type": "string",
        "description": "The reason for initiating an return.\n* `honor_return_request` - Honoring a return request\n* `wrong_amount` - Wrong amount\n* `duplication` - Duplicate payment\n* `initiating_party_unrecognized` - Unknown sender\n* `fraud_suspected` - Fraud suspected\n* `undue_payment` - Unduly paid\n* `narrative` - Narrative reason, additional_information required\n* `customer_requested` - Requested by customer",
        "example": "duplication",
        "enum": [
          "honor_return_request",
          "wrong_amount",
          "duplication",
          "initiating_party_unrecognized",
          "fraud_suspected",
          "undue_payment",
          "narrative",
          "customer_requested"
        ]
      },
      "OutgoingInstantPaymentReturnRequestReason": {
        "type": "string",
        "description": "The reason for initiating a return request.\n* `creditor_account_number_invalid` - Invalid creditor account number\n* `wrong_amount` - Wrong amount\n* `customer_requested` - Requested by customer\n* `duplication` - Duplicate payment\n* `fraud_suspected` - Fraud suspected\n* `technical_problem` - Technical problem\n* `undue_payment` - Unduly paid",
        "example": "duplication",
        "enum": [
          "creditor_account_number_invalid",
          "wrong_amount",
          "customer_requested",
          "duplication",
          "fraud_suspected",
          "technical_problem",
          "undue_payment"
        ]
      },
      "OutgoingInstantPaymentReturnRequestRejectionReason": {
        "type": "string",
        "description": "The reason for rejecting an incoming return request.\n* `account_closed` - Account closed\n* `non_sufficient_funds` - Insufficient funds\n* `customer_requested` - Customer decision\n* `legal_decision` - Legal decision\n* `customer_no_response` - No answer from customer\n* `returned_previously` - Already returned",
        "example": "customer_requested",
        "enum": [
          "account_closed",
          "non_sufficient_funds",
          "customer_requested",
          "legal_decision",
          "customer_no_response",
          "returned_previously"
        ]
      },
      "InstantPaymentAvailability": {
        "type": "object",
        "description": "Result of an instant payment availability check.",
        "required": [
          "available",
          "routing_number"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Whether the financial institution is available to receive instant payments.",
            "example": true
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number that was checked.",
            "minLength": 9,
            "maxLength": 9,
            "example": "111000111"
          }
        }
      },
      "ApplicationID": {
        "type": "string",
        "description": "Unique identifier for the application. Prefixed with `application_`.",
        "example": "application_xyz123",
        "pattern": "^application_\\w+$"
      },
      "ApplicationStatus": {
        "type": "string",
        "description": "Terminal state of the application. Possible values: `approved`, `declined`, `canceled`.",
        "enum": [
          "approved",
          "declined",
          "canceled"
        ]
      },
      "ApplicationEntities": {
        "type": "object",
        "readOnly": true,
        "description": "Entity relationships associated with the application (response only)",
        "properties": {
          "account_holder_type": {
            "type": "string",
            "description": "Denotes whether the application is for a consumer or commercial account. `consumer` if all account holders are individuals; `commercial` if all account holders are businesses or sole proprietors.",
            "enum": [
              "consumer",
              "commercial"
            ],
            "example": "commercial"
          },
          "account_holders": {
            "type": "array",
            "description": "List of entity IDs that are account holders",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            }
          },
          "authorized_signers": {
            "type": "array",
            "description": "List of entity IDs that are authorized signers",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            }
          }
        }
      },
      "ComplianceCurrencyCode": {
        "type": "string",
        "description": "A three-letter currency code as defined in ISO 4217",
        "enum": [
          "AED",
          "AFN",
          "ALL",
          "AMD",
          "AOA",
          "ARS",
          "AUD",
          "AWG",
          "AZN",
          "BAM",
          "BBD",
          "BDT",
          "BGN",
          "BHD",
          "BIF",
          "BMD",
          "BND",
          "BOB",
          "BRL",
          "BSD",
          "BTN",
          "BWP",
          "BYN",
          "BZD",
          "CAD",
          "CDF",
          "CHF",
          "CLP",
          "CNH",
          "CNY",
          "COP",
          "CRC",
          "CUC",
          "CUP",
          "CVE",
          "CZK",
          "DJF",
          "DKK",
          "DOP",
          "DZD",
          "EGP",
          "ERN",
          "ETB",
          "EUR",
          "FJD",
          "FKP",
          "GBP",
          "GEL",
          "GGP",
          "GHS",
          "GIP",
          "GMD",
          "GNF",
          "GTQ",
          "GYD",
          "HKD",
          "HNL",
          "HTG",
          "HUF",
          "IDR",
          "ILS",
          "IMP",
          "INR",
          "IQD",
          "IRR",
          "ISK",
          "JEP",
          "JMD",
          "JOD",
          "JPY",
          "KES",
          "KGS",
          "KHR",
          "KMF",
          "KPW",
          "KRW",
          "KWD",
          "KYD",
          "KZT",
          "LAK",
          "LBP",
          "LKR",
          "LRD",
          "LSL",
          "LYD",
          "MAD",
          "MDL",
          "MGA",
          "MKD",
          "MMK",
          "MNT",
          "MOP",
          "MRU",
          "MUR",
          "MVR",
          "MWK",
          "MXN",
          "MYR",
          "MZN",
          "NAD",
          "NGN",
          "NIO",
          "NOK",
          "NPR",
          "NZD",
          "OMR",
          "PAB",
          "PEN",
          "PGK",
          "PHP",
          "PKR",
          "PLN",
          "PYG",
          "QAR",
          "RON",
          "RSD",
          "RUB",
          "RWF",
          "SAR",
          "SBD",
          "SCR",
          "SDG",
          "SEK",
          "SGD",
          "SHP",
          "SLE",
          "SOS",
          "SRD",
          "SSP",
          "STD",
          "STN",
          "SVC",
          "SYP",
          "SZL",
          "THB",
          "TJS",
          "TMT",
          "TND",
          "TOP",
          "TRY",
          "TTD",
          "TWD",
          "TZS",
          "UAH",
          "UGX",
          "USD",
          "UYU",
          "UYW",
          "UZS",
          "VES",
          "VND",
          "VUV",
          "WST",
          "XAF",
          "XCD",
          "XCG",
          "XMW",
          "XOF",
          "XPF",
          "YER",
          "ZAR",
          "ZMW",
          "ZWG"
        ]
      },
      "ApplicationCreditReport": {
        "type": "object",
        "readOnly": true,
        "description": "Credit report information (response, all properties optional)",
        "properties": {
          "score": {
            "type": "integer",
            "description": "Credit score returned by the bureau. Supported range is 300-850. Mutually exclusive with `non_score_value`.",
            "minimum": 300,
            "maximum": 850
          },
          "non_score_value": {
            "type": "string",
            "description": "Indicates the state of a credit file when a numeric score is not available. Mutually exclusive with `score`.",
            "enum": [
              "unestablished",
              "frozen"
            ]
          },
          "pulled_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the credit report was pulled."
          },
          "source": {
            "type": "string",
            "description": "Credit bureau that issued the report. Possible values: `equifax`, `experian`, `transunion`.",
            "enum": [
              "equifax",
              "transunion",
              "experian"
            ]
          }
        }
      },
      "ApplicationCredit": {
        "type": "object",
        "readOnly": true,
        "description": "Credit details for an application (response, all properties optional)",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product. `true` if the product is secured (collateral attached); `false` otherwise."
          },
          "is_mla": {
            "type": "boolean",
            "description": "`true` if the applicant is subject to the Military Lending Act; `false` otherwise."
          },
          "currency": {
            "$ref": "#/components/schemas/ComplianceCurrencyCode"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Your internal underwriting grade for the applicant. Accepts any string mapped to your specific scoring framework.",
            "example": "99"
          },
          "limit": {
            "type": "integer",
            "description": "The credit limit assigned to the applicant, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 5000000
          },
          "max_limit": {
            "type": "integer",
            "description": "The maximum credit limit the applicant was approved for based on original underwriting, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 10000000
          },
          "report": {
            "$ref": "#/components/schemas/ApplicationCreditReport"
          }
        }
      },
      "ApplicationAdverseActionNotice": {
        "type": "object",
        "readOnly": true,
        "description": "Adverse action notice information (response, all properties optional)",
        "properties": {
          "delivered_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the adverse action notice was sent to the applicant."
          },
          "reason": {
            "type": "string",
            "description": "The reason stated in the adverse action notice."
          },
          "delivery_method": {
            "type": "string",
            "description": "How the notice was delivered to the applicant. Possible values: `email`, `text`, `other`.",
            "enum": [
              "email",
              "text",
              "other"
            ]
          }
        }
      },
      "ApplicationDetails": {
        "type": "object",
        "readOnly": true,
        "description": "Application details (response, all properties optional)",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Your internal product name. This tells Lead's Due Diligence team which product this application, if approved, would open an account for.",
            "example": "Growth Business Credit Line"
          },
          "credit": {
            "$ref": "#/components/schemas/ApplicationCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/ApplicationAdverseActionNotice"
          }
        }
      },
      "ApplicationDecision": {
        "type": "object",
        "readOnly": true,
        "description": "Decision-related information (response, all properties optional)",
        "properties": {
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the underwriting decision was made."
          },
          "reason": {
            "type": "string",
            "description": "The reason for the decision."
          },
          "exception_approval_reason": {
            "type": "string",
            "description": "This should only be provided if the decision was made as an exception to underwriting criteria. Reason for exception approval, if this decision was made as an exception to the traditional underwriting process."
          }
        }
      },
      "ComplianceDocumentType": {
        "type": "string",
        "description": "Type of document associated with an application",
        "enum": [
          "aan",
          "loan_agreement",
          "loc_agreement",
          "truth_in_lending_document",
          "ach_authorization",
          "notice_of_incompleteness",
          "credit_score_notice",
          "offer_summary",
          "personal_guarantee",
          "consumer_credit_auth",
          "partner_privacy_policy",
          "lead_privacy_policy",
          "terms_of_use",
          "esign_agreement",
          "credit_pull_consent",
          "fcra_notice",
          "tcpa_consent",
          "patriot_act_notice",
          "mla_notice",
          "pre_approval_terms",
          "eft_authorization",
          "prohibited_industry_certification",
          "decision_maker_document",
          "bo_certification",
          "missed_payments_policy",
          "consent_to_link_account",
          "consent_to_link_hsa",
          "negative_option_consent",
          "lead_funds_transfer_agreement",
          "deposit_agreement",
          "cardholder_agreement",
          "periodic_statement",
          "autopay_authorization"
        ]
      },
      "ApplicationComplianceDocument": {
        "type": "object",
        "readOnly": true,
        "description": "Document reference associated with an application (response, all properties optional)",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "Unique identifier for the document being referenced. Please use the file name of the file delivered to Lead's `/documents` SFTP directory.",
            "example": "document_2N5Hk8xYmQpL9rBvC3jD"
          },
          "type": {
            "$ref": "#/components/schemas/ComplianceDocumentType"
          },
          "displayed_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the document was displayed to the applicant. Present on disclosure documents."
          },
          "consented_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the applicant consented to the document. Present on consent documents."
          },
          "version": {
            "type": "string",
            "description": "It is recommended to use this for static documents uploaded once and uploaded for many users. Uploads with a new version should have a different document_id as well.",
            "example": "v1"
          }
        }
      },
      "Application": {
        "type": "object",
        "description": "An application object representing a credit application",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "client_application_id": {
            "type": "string",
            "readOnly": true,
            "description": "Client-provided identifier for the application. Optional: present only for\napplications created via file upload, and omitted for applications created\nthrough the API, which are identified solely by their server-generated ID.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Lead server-generated ISO 8601 timestamp when the application was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Lead server-generated ISO 8601 timestamp when the application was last updated."
          },
          "status": {
            "$ref": "#/components/schemas/ApplicationStatus"
          },
          "entities": {
            "$ref": "#/components/schemas/ApplicationEntities"
          },
          "details": {
            "$ref": "#/components/schemas/ApplicationDetails"
          },
          "decision": {
            "$ref": "#/components/schemas/ApplicationDecision"
          },
          "documents": {
            "type": "array",
            "description": "Documents associated with the application",
            "items": {
              "$ref": "#/components/schemas/ApplicationComplianceDocument"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary metadata associated with the application",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "CreateApplicationEntities": {
        "type": "object",
        "description": "Entity relationships for the application.\nMaximum 20 entities per relationship type.\nAuthorized signers required for commercial account holders.\n",
        "properties": {
          "account_holders": {
            "type": "array",
            "description": "List of entity IDs that are account holders",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "authorized_signers": {
            "type": "array",
            "description": "List of entity IDs that are authorized signers (required for commercial)",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          },
          "authorized_users": {
            "type": "array",
            "description": "List of entity IDs that are authorized users",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          }
        },
        "required": [
          "account_holders"
        ]
      },
      "CreditReport": {
        "type": "object",
        "description": "Credit report information. Exactly one of `score` or `non_score_value` must be provided; `pulled_at` and `source` are always required when a credit report is supplied.\n",
        "required": [
          "pulled_at",
          "source"
        ],
        "properties": {
          "score": {
            "type": "integer",
            "description": "Credit score returned by the bureau. Supported range is 300-850. Mutually exclusive with `non_score_value`.",
            "minimum": 300,
            "maximum": 850
          },
          "non_score_value": {
            "type": "string",
            "description": "Indicates the state of a credit file when a numeric score is not available. Mutually exclusive with `score`.",
            "enum": [
              "unestablished",
              "frozen"
            ]
          },
          "pulled_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the credit report was pulled."
          },
          "source": {
            "type": "string",
            "description": "Credit bureau that issued the report. Possible values: `equifax`, `experian`, `transunion`.",
            "enum": [
              "equifax",
              "transunion",
              "experian"
            ]
          }
        }
      },
      "CreateApplicationCredit": {
        "type": "object",
        "description": "Credit details for creating an application",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product. `true` if the product is secured (collateral attached); `false` otherwise."
          },
          "is_mla": {
            "type": "boolean",
            "description": "`true` if the applicant is subject to the Military Lending Act; `false` otherwise."
          },
          "currency": {
            "$ref": "#/components/schemas/ComplianceCurrencyCode"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Your internal underwriting grade for the applicant. Accepts any string mapped to your specific scoring framework.",
            "example": "99"
          },
          "limit": {
            "type": "integer",
            "description": "The credit limit assigned to the applicant, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 5000000
          },
          "max_limit": {
            "type": "integer",
            "description": "The maximum credit limit the applicant was approved for based on original underwriting, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 10000000
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        },
        "required": [
          "is_secured",
          "is_mla",
          "currency"
        ]
      },
      "AdverseActionNotice": {
        "type": "object",
        "description": "Adverse action notice information",
        "properties": {
          "delivered_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the adverse action notice was sent to the applicant."
          },
          "reason": {
            "type": "string",
            "description": "The reason stated in the adverse action notice."
          },
          "delivery_method": {
            "type": "string",
            "description": "How the notice was delivered to the applicant. Possible values: `email`, `text`, `other`.",
            "enum": [
              "email",
              "text",
              "other"
            ]
          }
        },
        "required": [
          "delivered_at",
          "reason",
          "delivery_method"
        ]
      },
      "CreateApplicationDetails": {
        "type": "object",
        "description": "Details for creating an application",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Your internal product name. This tells Lead's Due Diligence team which product this application, if approved, would open an account for.",
            "example": "Growth Business Credit Line"
          },
          "credit": {
            "$ref": "#/components/schemas/CreateApplicationCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        },
        "required": [
          "product_name",
          "credit"
        ]
      },
      "Decision": {
        "type": "object",
        "description": "Decision-related information for the application",
        "properties": {
          "decided_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the underwriting decision was made."
          },
          "reason": {
            "type": "string",
            "description": "The reason for the decision."
          },
          "exception_approval_reason": {
            "type": "string",
            "description": "This should only be provided if the decision was made as an exception to underwriting criteria. Reason for exception approval, if this decision was made as an exception to the traditional underwriting process."
          }
        },
        "required": [
          "decided_at",
          "reason"
        ]
      },
      "CreateComplianceDocument": {
        "type": "object",
        "description": "Document reference for creating applications and accounts.\n\nOne of `displayed_at` or `consented_at` is required depending on document type:\n- `displayed_at`: Required for aan, loan_agreement, loc_agreement, truth_in_lending_document,\n  ach_authorization, notice_of_incompleteness, credit_score_notice, offer_summary, personal_guarantee,\n  consumer_credit_auth, partner_privacy_policy, lead_privacy_policy, terms_of_use, fcra_notice,\n  tcpa_consent, patriot_act_notice, mla_notice, pre_approval_terms, eft_authorization,\n  prohibited_industry_certification, decision_maker_document, bo_certification, missed_payments_policy,\n  lead_funds_transfer_agreement, periodic_statement\n- `consented_at`: Required for esign_agreement, credit_pull_consent, consent_to_link_account,\n  consent_to_link_hsa, negative_option_consent, deposit_agreement, cardholder_agreement,\n  autopay_authorization\n",
        "properties": {
          "document_id": {
            "type": "string",
            "description": "Unique identifier for the document being referenced. Please use the file name of the file delivered to Lead's `/documents` SFTP directory.",
            "example": "document_2N5Hk8xYmQpL9rBvC3jD"
          },
          "type": {
            "$ref": "#/components/schemas/ComplianceDocumentType"
          },
          "displayed_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the document was displayed to the applicant. Present on disclosure documents."
          },
          "consented_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the applicant consented to the document. Present on consent documents."
          },
          "version": {
            "type": "string",
            "description": "It is recommended to use this for static documents uploaded once and uploaded for many users. Uploads with a new version should have a different document_id as well.",
            "example": "v1"
          }
        },
        "required": [
          "document_id",
          "type"
        ],
        "oneOf": [
          {
            "title": "Disclosure",
            "description": "Disclosure document — `displayed_at` is required.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "aan",
                  "loan_agreement",
                  "loc_agreement",
                  "truth_in_lending_document",
                  "ach_authorization",
                  "notice_of_incompleteness",
                  "credit_score_notice",
                  "offer_summary",
                  "personal_guarantee",
                  "consumer_credit_auth",
                  "partner_privacy_policy",
                  "lead_privacy_policy",
                  "terms_of_use",
                  "fcra_notice",
                  "tcpa_consent",
                  "patriot_act_notice",
                  "mla_notice",
                  "pre_approval_terms",
                  "eft_authorization",
                  "prohibited_industry_certification",
                  "decision_maker_document",
                  "bo_certification",
                  "missed_payments_policy",
                  "lead_funds_transfer_agreement",
                  "periodic_statement"
                ]
              }
            },
            "required": [
              "displayed_at"
            ]
          },
          {
            "title": "Consent",
            "description": "Consent document — `consented_at` is required.",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "esign_agreement",
                  "credit_pull_consent",
                  "consent_to_link_account",
                  "consent_to_link_hsa",
                  "negative_option_consent",
                  "deposit_agreement",
                  "cardholder_agreement",
                  "autopay_authorization"
                ]
              }
            },
            "required": [
              "consented_at"
            ]
          }
        ]
      },
      "CreateApplicationRequest": {
        "type": "object",
        "description": "Request body for creating a new application in terminal status",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ApplicationStatus"
          },
          "entities": {
            "$ref": "#/components/schemas/CreateApplicationEntities"
          },
          "details": {
            "$ref": "#/components/schemas/CreateApplicationDetails"
          },
          "decision": {
            "$ref": "#/components/schemas/Decision"
          },
          "documents": {
            "type": "array",
            "description": "Documents associated with the application",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary metadata associated with the application",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "status",
          "entities",
          "details",
          "decision",
          "documents"
        ]
      },
      "PatchApplicationCredit": {
        "type": "object",
        "description": "Credit details for updating an application (all fields optional)",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product. `true` if the product is secured (collateral attached); `false` otherwise."
          },
          "is_mla": {
            "type": "boolean",
            "description": "`true` if the applicant is subject to the Military Lending Act; `false` otherwise."
          },
          "currency": {
            "$ref": "#/components/schemas/ComplianceCurrencyCode"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Your internal underwriting grade for the applicant. Accepts any string mapped to your specific scoring framework.",
            "example": "99"
          },
          "limit": {
            "type": "integer",
            "description": "The credit limit assigned to the applicant, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 5000000
          },
          "max_limit": {
            "type": "integer",
            "description": "The maximum credit limit the applicant was approved for based on original underwriting, in minor units (e.g., cents).",
            "minimum": 0,
            "example": 10000000
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        }
      },
      "PatchApplicationDetails": {
        "type": "object",
        "description": "Details for updating an application (all fields optional)",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Your internal product name. This tells Lead's Due Diligence team which product this application, if approved, would open an account for.",
            "example": "Growth Business Credit Line"
          },
          "credit": {
            "$ref": "#/components/schemas/PatchApplicationCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        }
      },
      "PatchApplicationRequest": {
        "type": "object",
        "description": "Request body for updating an existing application",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/ApplicationStatus"
          },
          "details": {
            "$ref": "#/components/schemas/PatchApplicationDetails"
          },
          "decision": {
            "$ref": "#/components/schemas/Decision"
          },
          "documents": {
            "type": "array",
            "description": "Documents associated with the application",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          },
          "metadata": {
            "type": "object",
            "description": "Arbitrary metadata associated with the application",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "EntityRelationshipType": {
        "type": "string",
        "description": "Indicates the type of Entity",
        "enum": [
          "account_holder",
          "authorized_signer",
          "authorized_user"
        ],
        "example": "account_holder"
      },
      "EntityRelationship": {
        "type": "object",
        "description": "Common fields for entity relationships",
        "properties": {
          "entity_id": {
            "$ref": "#/components/schemas/EntityID"
          },
          "relationship_type": {
            "$ref": "#/components/schemas/EntityRelationshipType"
          }
        },
        "required": [
          "entity_id",
          "relationship_type"
        ]
      },
      "AccountStatus": {
        "type": "string",
        "description": "Current state of the account",
        "enum": [
          "active",
          "inactive",
          "closed"
        ]
      },
      "AccountStatusReason": {
        "type": "string",
        "description": "Machine-readable reason for the current status",
        "enum": [
          "client_closed",
          "entity_closed",
          "frozen",
          "dormant",
          "active",
          "paid_off",
          "charged_off",
          "canceled",
          "other"
        ]
      },
      "AccountCapability": {
        "type": "string",
        "description": "Capability that informs Lead how the Account will be used",
        "enum": [
          "deposit",
          "credit_with_underwriting",
          "credit_without_underwriting"
        ]
      },
      "AccountEntities": {
        "type": "object",
        "readOnly": true,
        "description": "Entity relationships associated with the account (response only)",
        "properties": {
          "account_holder_type": {
            "type": "string",
            "description": "Derived from the type of the entity referenced in account_holders",
            "enum": [
              "consumer",
              "commercial"
            ]
          }
        }
      },
      "Scra": {
        "type": "object",
        "description": "SCRA (Servicemembers Civil Relief Act) details",
        "properties": {
          "start_date": {
            "type": "string",
            "format": "date",
            "description": "Start date for SCRA protections"
          },
          "end_date": {
            "type": "string",
            "format": "date",
            "description": "End date for SCRA protections"
          }
        },
        "required": [
          "start_date"
        ]
      },
      "AccountCredit": {
        "type": "object",
        "description": "Details specific to credit-based accounts",
        "additionalProperties": false,
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product"
          },
          "is_mla": {
            "type": "boolean",
            "description": "Indicates if this account is considered a Military Lending Act account"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Grade given to the customer based on underwriting"
          },
          "currency": {
            "type": "string",
            "description": "The currency for the account (3-letter ISO code)",
            "example": "USD"
          },
          "available_credit": {
            "type": "integer",
            "description": "Available credit for the customer to draw (in minor units)"
          },
          "limit": {
            "type": "integer",
            "description": "Current credit limit (in minor units)"
          },
          "max_limit": {
            "type": "integer",
            "description": "Maximum credit limit approved in underwriting (in minor units)"
          },
          "scra": {
            "$ref": "#/components/schemas/Scra"
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        }
      },
      "AccountDetails": {
        "type": "object",
        "description": "Core details of the account",
        "readOnly": true,
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the account was closed. Updated by /close endpoint.",
            "readOnly": true
          },
          "credit": {
            "$ref": "#/components/schemas/AccountCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        }
      },
      "ComplianceDocument": {
        "type": "object",
        "description": "Document reference associated with an application (response schema - all fields optional)",
        "readOnly": true,
        "properties": {
          "document_id": {
            "type": "string",
            "description": "Unique identifier for the document being referenced. Please use the file name of the file delivered to Lead's `/documents` SFTP directory.",
            "example": "document_2N5Hk8xYmQpL9rBvC3jD"
          },
          "type": {
            "$ref": "#/components/schemas/ComplianceDocumentType"
          },
          "displayed_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the document was displayed to the applicant. Present on disclosure documents."
          },
          "consented_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp when the applicant consented to the document. Present on consent documents."
          },
          "version": {
            "type": "string",
            "description": "It is recommended to use this for static documents uploaded once and uploaded for many users. Uploads with a new version should have a different document_id as well.",
            "example": "v1"
          }
        }
      },
      "Account": {
        "type": "object",
        "description": "An account object",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp",
            "readOnly": true
          },
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "status": {
            "$ref": "#/components/schemas/AccountStatus"
          },
          "status_reason": {
            "$ref": "#/components/schemas/AccountStatusReason"
          },
          "capabilities": {
            "type": "array",
            "description": "List of items that inform Lead how the Account will be used",
            "items": {
              "$ref": "#/components/schemas/AccountCapability"
            }
          },
          "entities": {
            "$ref": "#/components/schemas/AccountEntities"
          },
          "details": {
            "$ref": "#/components/schemas/AccountDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/ComplianceDocument"
            }
          },
          "client_account_id": {
            "type": "string",
            "readOnly": true,
            "description": "Client-provided identifier for the account. Optional: present only for\naccounts created via file upload, and omitted for accounts created through\nthe API, which are identified solely by their server-generated ID.\n"
          }
        }
      },
      "CreateAccountEntities": {
        "type": "object",
        "description": "Entity relationships for the account (POST request only).\nMaximum 20 entities per relationship type.\nCannot mix individual and business/sole_prop entities in account_holders.\nAuthorized signers required for business/sole_prop account holders.\n",
        "properties": {
          "account_holders": {
            "type": "array",
            "description": "Account holders (min 1, max 20)",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "authorized_signers": {
            "type": "array",
            "description": "Authorized signers on the account (required with min 1 if business/sole_prop account holders)",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          },
          "authorized_users": {
            "type": "array",
            "description": "Authorized users on the account",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          }
        },
        "required": [
          "account_holders"
        ]
      },
      "CreateAccountCredit": {
        "type": "object",
        "description": "Details specific to credit-based accounts (for POST - all fields required)",
        "additionalProperties": false,
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product"
          },
          "is_mla": {
            "type": "boolean",
            "description": "Indicates if this account is considered a Military Lending Act account"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Grade given to the customer based on underwriting"
          },
          "currency": {
            "type": "string",
            "description": "The currency for the account (3-letter ISO code)",
            "example": "USD"
          },
          "available_credit": {
            "type": "integer",
            "description": "Available credit for the customer to draw (in minor units)"
          },
          "limit": {
            "type": "integer",
            "description": "Current credit limit (in minor units)"
          },
          "max_limit": {
            "type": "integer",
            "description": "Maximum credit limit approved in underwriting (in minor units)"
          },
          "scra": {
            "$ref": "#/components/schemas/Scra"
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        },
        "required": [
          "is_secured",
          "is_mla",
          "underwriting_grade",
          "currency",
          "available_credit",
          "limit",
          "max_limit"
        ]
      },
      "CreateAccountDetails": {
        "type": "object",
        "description": "Details for creating an account",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "credit": {
            "$ref": "#/components/schemas/CreateAccountCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        },
        "required": [
          "product_name"
        ]
      },
      "CreateAccountRequest": {
        "type": "object",
        "description": "Request body for creating a new account",
        "properties": {
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "capabilities": {
            "type": "array",
            "description": "List of items that inform Lead how the Account will be used",
            "items": {
              "$ref": "#/components/schemas/AccountCapability"
            },
            "minItems": 1
          },
          "entities": {
            "$ref": "#/components/schemas/CreateAccountEntities"
          },
          "details": {
            "$ref": "#/components/schemas/CreateAccountDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          }
        },
        "required": [
          "capabilities",
          "entities",
          "details",
          "documents"
        ]
      },
      "PatchAccountCredit": {
        "type": "object",
        "description": "Details specific to credit-based accounts (for PATCH - all fields optional)",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product"
          },
          "is_mla": {
            "type": "boolean",
            "description": "Indicates if this account is considered a Military Lending Act account"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Grade given to the customer based on underwriting"
          },
          "currency": {
            "type": "string",
            "description": "The currency for the account (3-letter ISO code)",
            "example": "USD"
          },
          "available_credit": {
            "type": "integer",
            "description": "Available credit for the customer to draw (in minor units)"
          },
          "limit": {
            "type": "integer",
            "description": "Current credit limit (in minor units)"
          },
          "max_limit": {
            "type": "integer",
            "description": "Maximum credit limit approved in underwriting (in minor units)"
          },
          "scra": {
            "$ref": "#/components/schemas/Scra"
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        }
      },
      "PatchAccountDetails": {
        "type": "object",
        "description": "Details for updating an account",
        "properties": {
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "credit": {
            "$ref": "#/components/schemas/PatchAccountCredit"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        }
      },
      "PatchAccountRequest": {
        "type": "object",
        "description": "Request body for updating an existing account",
        "properties": {
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "capabilities": {
            "type": "array",
            "description": "List of items that inform Lead how the Account will be used",
            "items": {
              "$ref": "#/components/schemas/AccountCapability"
            }
          },
          "details": {
            "$ref": "#/components/schemas/PatchAccountDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          }
        }
      },
      "AccountDeactivateStatusReason": {
        "type": "string",
        "description": "Valid reasons for deactivating an account",
        "enum": [
          "dormant",
          "frozen",
          "other"
        ]
      },
      "AccountDeactivateRequest": {
        "type": "object",
        "description": "Request body for deactivating an account",
        "properties": {
          "status_reason": {
            "$ref": "#/components/schemas/AccountDeactivateStatusReason"
          }
        },
        "required": [
          "status_reason"
        ]
      },
      "AccountCloseStatusReason": {
        "type": "string",
        "description": "Valid reasons for closing an account",
        "enum": [
          "entity_closed",
          "client_closed",
          "paid_off",
          "charged_off",
          "canceled"
        ]
      },
      "AccountCloseRequest": {
        "type": "object",
        "description": "Request body for closing an account",
        "properties": {
          "status_reason": {
            "$ref": "#/components/schemas/AccountCloseStatusReason"
          }
        },
        "required": [
          "status_reason"
        ]
      },
      "BatchCreateEntityRelationshipsRequest": {
        "type": "object",
        "description": "Request body for batch creating entity relationships on an account.",
        "properties": {
          "entity_ids": {
            "type": "array",
            "description": "List of entity IDs to associate with the account under the specified relationship type.",
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/EntityID"
            }
          },
          "relationship_type": {
            "$ref": "#/components/schemas/EntityRelationshipType"
          }
        },
        "required": [
          "entity_ids",
          "relationship_type"
        ]
      },
      "CardID": {
        "type": "string",
        "description": "The server-generated ID of the Card object.",
        "example": "card_xyz123",
        "pattern": "^card_\\w+$"
      },
      "CardStatus": {
        "type": "string",
        "description": "Status is system-managed and cannot be set on create; status changes go through the status-transition endpoints.\n",
        "enum": [
          "active",
          "inactive",
          "closed"
        ]
      },
      "CardType": {
        "type": "string",
        "description": "The product category the card belongs to.",
        "enum": [
          "hsa",
          "fsa",
          "consumer",
          "commercial"
        ]
      },
      "CardDetails": {
        "type": "object",
        "description": "Physical and product attributes of the card.",
        "properties": {
          "card_product_name": {
            "type": "string",
            "description": "The name of the card product in the partner's system."
          },
          "is_virtual": {
            "type": "boolean",
            "description": "True if the card exists as a virtual card; false if a physical representation of the card exists."
          },
          "card_type": {
            "$ref": "#/components/schemas/CardType"
          },
          "expiry_date": {
            "type": "string",
            "format": "date",
            "description": "ISO 8601 calendar date (YYYY-MM-DD) when the card expires. Always the last day of the\nexpiration month (e.g. an expiration of 01/29 is `2029-01-31`).\n"
          },
          "last_four": {
            "type": "string",
            "description": "Last four digits of the card's PAN. Required when creating a card via\nthe API; on responses it is omitted for cards that have no PAN on file\n(e.g. some file-ingested cards).\n",
            "pattern": "^[0-9]{4}$",
            "example": "1234"
          },
          "replacement_for": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CardID"
              }
            ],
            "description": "Optional. The server-generated ID (`card_*`) of the card this new card\nreplaces. The referenced card must exist, must be in `closed` status at\nthe time of the write, and must not already be referenced by another\ncard. The system atomically sets `replaced_by` on the referenced card.\n"
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the card was closed. Present only when status is `closed`.",
            "readOnly": true
          }
        },
        "required": [
          "card_product_name",
          "is_virtual",
          "card_type",
          "expiry_date"
        ]
      },
      "Card": {
        "type": "object",
        "description": "A card object",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/CardID"
          },
          "client_card_id": {
            "type": "string",
            "readOnly": true,
            "description": "Client-provided identifier for the card. Optional: present only for\ncards created via file upload, and omitted for cards created through\nthe API, which are identified solely by their server-generated ID.\n"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "entity_id": {
            "$ref": "#/components/schemas/EntityID"
          },
          "status": {
            "$ref": "#/components/schemas/CardStatus"
          },
          "status_reason": {
            "type": "string",
            "readOnly": true,
            "description": "The reason for the card's current status. Empty when the card is `active`; otherwise\npopulated. Set via the status-transition endpoints.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp.",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp.",
            "readOnly": true
          },
          "details": {
            "$ref": "#/components/schemas/CardDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CreateCardDetails": {
        "description": "Card details for a create request. Extends CardDetails, additionally\nrequiring last_four (the API only creates cards that carry a PAN; the\noptional last_four on CardDetails is for responses, where file-ingested\ncards may have none).\n",
        "allOf": [
          {
            "$ref": "#/components/schemas/CardDetails"
          },
          {
            "type": "object",
            "required": [
              "last_four"
            ]
          }
        ]
      },
      "CreateCardRequest": {
        "type": "object",
        "description": "Request body for creating a new card.",
        "properties": {
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "entity_id": {
            "$ref": "#/components/schemas/EntityID"
          },
          "details": {
            "$ref": "#/components/schemas/CreateCardDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "required": [
          "account_id",
          "entity_id",
          "details"
        ]
      },
      "PatchCardDetails": {
        "type": "object",
        "description": "The mutable subset of a card's details. Only the fields present are updated;\nphysical attributes (card_type, last_four, is_virtual) and expiry_date are\nimmutable and cannot be changed through this endpoint.\n",
        "properties": {
          "card_product_name": {
            "type": "string",
            "description": "The name of the card product in the partner's system."
          }
        }
      },
      "PatchCardRequest": {
        "type": "object",
        "description": "Request body for updating a card. This is a partial update: every field is\noptional and only the fields present are changed. Card `status` is\nsystem-managed (see the status-transition endpoints) and cannot be set here.\n",
        "properties": {
          "details": {
            "$ref": "#/components/schemas/PatchCardDetails"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "CardDeactivateStatusReason": {
        "type": "string",
        "description": "Valid reasons for deactivating a card.",
        "enum": [
          "dormant",
          "frozen",
          "other"
        ]
      },
      "CardDeactivateRequest": {
        "type": "object",
        "description": "Request body for deactivating a card.",
        "properties": {
          "status_reason": {
            "$ref": "#/components/schemas/CardDeactivateStatusReason"
          }
        },
        "required": [
          "status_reason"
        ]
      },
      "CardCloseStatusReason": {
        "type": "string",
        "description": "Valid reasons for closing a card.",
        "enum": [
          "entity_closed",
          "client_closed",
          "paid_off",
          "charged_off",
          "canceled"
        ]
      },
      "CardCloseRequest": {
        "type": "object",
        "description": "Request body for closing a card.",
        "properties": {
          "status_reason": {
            "$ref": "#/components/schemas/CardCloseStatusReason"
          }
        },
        "required": [
          "status_reason"
        ]
      },
      "BlockchainPaymentStatus": {
        "description": "The current status of the blockchain payment.",
        "type": "string",
        "example": "created",
        "enum": [
          "created",
          "under_review",
          "submitted",
          "posted",
          "rejected",
          "canceled"
        ]
      },
      "BlockchainPaymentID": {
        "type": "string",
        "description": "The ID of the Blockchain Payment object.",
        "example": "blockchain_payment_xyz123",
        "pattern": "^blockchain_payment_\\w+$"
      },
      "BlockchainPaymentAccountIdentifierType": {
        "description": "The type of account identifier.",
        "type": "string",
        "example": "account_number_id",
        "enum": [
          "account_number_id"
        ]
      },
      "BlockchainPaymentAccountIdentifier": {
        "type": "object",
        "description": "Identifies an account.",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/BlockchainPaymentAccountIdentifierType"
          },
          "value": {
            "type": "string",
            "description": "The account identifier value.",
            "example": "account_number_xyz123"
          }
        }
      },
      "BlockchainPaymentDebtorResponse": {
        "type": "object",
        "description": "The source of funds for the transfer, with enriched entity data.",
        "properties": {
          "account_identifier": {
            "$ref": "#/components/schemas/BlockchainPaymentAccountIdentifier"
          },
          "entity_id": {
            "type": "string",
            "description": "The entity ID associated with the debtor.",
            "example": "entity_xyz123"
          }
        }
      },
      "BlockchainPaymentPaymentRail": {
        "description": "The payment rail used for the creditor payout.\n",
        "type": "string",
        "example": "wire",
        "enum": [
          "ach",
          "wire",
          "sepa",
          "spei",
          "pix",
          "faster_payments",
          "bre_b",
          "swift",
          "co_bank_transfer",
          "solana",
          "base",
          "ethereum"
        ]
      },
      "BlockchainPaymentCreditorAchWire": {
        "type": "object",
        "deprecated": true,
        "description": "Deprecated: use `ach` or `wire` instead. ACH/Wire payment details.",
        "required": [
          "account_number",
          "routing_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 17,
            "pattern": "^[0-9A-Za-z]+$",
            "description": "The bank account number. 1–17 alphanumeric characters.",
            "example": "123456789"
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number. For US-address creditors it is checked against the\nFedACH directory when that directory is available; a well-formed but\nunknown routing number is rejected.\n",
            "example": "021000021"
          }
        }
      },
      "BlockchainPaymentCreditorAch": {
        "type": "object",
        "description": "ACH payment details.",
        "required": [
          "account_number",
          "routing_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 17,
            "pattern": "^[0-9A-Za-z]+$",
            "description": "The bank account number. 1–17 alphanumeric characters.",
            "example": "123456789"
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number. For US-address creditors it is checked against the\nFedACH directory when that directory is available; a well-formed but\nunknown routing number is rejected.\n",
            "example": "021000021"
          }
        }
      },
      "BlockchainPaymentCreditorWire": {
        "type": "object",
        "description": "Wire payment details.",
        "required": [
          "account_number",
          "routing_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 17,
            "pattern": "^[0-9A-Za-z]+$",
            "description": "The bank account number. 1–17 alphanumeric characters.",
            "example": "123456789"
          },
          "routing_number": {
            "type": "string",
            "description": "The routing number. For US-address creditors it is checked against the\nFedACH directory when that directory is available; a well-formed but\nunknown routing number is rejected.\n",
            "example": "021000021"
          }
        }
      },
      "BlockchainPaymentCreditorBreB": {
        "type": "object",
        "description": "BRE-B payment details.",
        "required": [
          "bre_b_key"
        ],
        "properties": {
          "bre_b_key": {
            "type": "string",
            "description": "The BRE-B key.",
            "example": "1234567890"
          }
        }
      },
      "BlockchainPaymentCreditorFps": {
        "type": "object",
        "description": "Faster Payments Service (FPS) payment details.",
        "required": [
          "account_number",
          "sort_code"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The bank account number.",
            "example": "12345678"
          },
          "sort_code": {
            "type": "string",
            "description": "The sort code.",
            "example": "123456"
          }
        }
      },
      "BlockchainPaymentCreditorIban": {
        "type": "object",
        "description": "IBAN payment details.",
        "required": [
          "account_number",
          "country"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The IBAN account number. Validated for the country's IBAN length and\nthe ISO 7064 MOD-97 check digits; a malformed or bad-checksum IBAN is\nrejected.\n",
            "example": "DE89370400440532013000"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code. Must be a real, assigned country code\n(unassigned or grouping codes such as `EU`/`ZZ` are rejected — stricter\nthan the `^[A-Z]{2}$` pattern). Sanctioned countries are not accepted.\n",
            "example": "DE",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          },
          "business_identifier_code": {
            "type": "string",
            "description": "The BIC/SWIFT code (optional). When provided, must be a valid ISO 9362\nBIC (8 or 11 characters).\n",
            "example": "COBADEFFXXX"
          }
        }
      },
      "BlockchainPaymentSwiftRole": {
        "description": "The role of the creditor in a SWIFT transfer.",
        "type": "string",
        "example": "client",
        "enum": [
          "client",
          "parent_company",
          "subsidiary",
          "supplier"
        ]
      },
      "BlockchainPaymentSwiftPurposeOfFunds": {
        "description": "The purpose of funds for a SWIFT transfer.",
        "type": "string",
        "example": "invoice_for_goods_and_services",
        "enum": [
          "intra_group_transfer",
          "invoice_for_goods_and_services"
        ]
      },
      "BlockchainPaymentCreditorSwift": {
        "type": "object",
        "description": "SWIFT payment details.",
        "required": [
          "account_number",
          "country",
          "business_identifier_code",
          "role",
          "purpose_of_funds",
          "short_business_desc"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The account number.",
            "example": "123456789"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code. Must be a real, assigned country code\n(unassigned or grouping codes such as `EU`/`ZZ` are rejected — stricter\nthan the `^[A-Z]{2}$` pattern). Sanctioned countries are not accepted.\n",
            "example": "GB",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          },
          "business_identifier_code": {
            "type": "string",
            "description": "The BIC/SWIFT code. Must be a valid ISO 9362 BIC (8 or 11 characters).",
            "example": "BARCGB22XXX"
          },
          "role": {
            "$ref": "#/components/schemas/BlockchainPaymentSwiftRole"
          },
          "purpose_of_funds": {
            "$ref": "#/components/schemas/BlockchainPaymentSwiftPurposeOfFunds"
          },
          "short_business_desc": {
            "type": "string",
            "description": "A short description of the business.",
            "example": "Software development services"
          }
        }
      },
      "BlockchainPaymentCreditorClabe": {
        "type": "object",
        "description": "CLABE payment details.",
        "required": [
          "account_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The CLABE account number (18 digits). Validated for length and the\nBanco de México control-digit checksum; a bad-checksum CLABE is\nrejected.\n",
            "example": "032180000118359719"
          }
        }
      },
      "BlockchainPaymentCreditorPixKey": {
        "type": "object",
        "description": "PIX key payment details.",
        "required": [
          "pix_key"
        ],
        "properties": {
          "pix_key": {
            "type": "string",
            "description": "PIX key. For CPF (11 digits) and CNPJ (14 digits), send digits only — strip periods and hyphens (e.g. \"12345678909\", not \"123.456.789-09\"). Phone keys use E.164 (+55, a 2-digit area code, then an 8- or 9-digit number), email keys are plain addresses, EVP/random keys are lowercase UUID v4. CPF and CNPJ keys are validated for their check digits; a bad-checksum document is rejected.",
            "example": "12345678909"
          },
          "document_number": {
            "type": "string",
            "nullable": true,
            "description": "Optional payer/payee tax document (CPF or CNPJ), digits only. Forwarded to the PIX network; not validated by this API.",
            "example": "12345678901"
          }
        }
      },
      "BlockchainPaymentCreditorPixBrCode": {
        "type": "object",
        "description": "PIX BR Code payment details.",
        "required": [
          "br_code"
        ],
        "properties": {
          "br_code": {
            "type": "string",
            "description": "PIX BR Code (EMV QR Code payload). Must be a dynamic code — static codes (Point of Initiation Method = 11) are rejected. The payload's CRC-16 checksum is validated; a bad-checksum code is rejected.",
            "example": "00020126580014br.gov.bcb.pix..."
          },
          "document_number": {
            "type": "string",
            "nullable": true,
            "description": "Optional payer/payee tax document (CPF or CNPJ), digits only. Forwarded to the PIX network; not validated by this API.",
            "example": "12345678901"
          }
        }
      },
      "BlockchainPaymentCreditorCoBankTransfer": {
        "type": "object",
        "description": "Colombian COP bank-transfer payment details. For this rail the creditor\naddress country and the creditor agent `country_code` must both be `CO`.\n",
        "required": [
          "account_number",
          "bank_code",
          "account_type",
          "document_type",
          "document_number",
          "phone_number"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The bank account number.",
            "example": "1234567890"
          },
          "bank_code": {
            "type": "string",
            "description": "The receiving bank code (Colombian financial-institution code).",
            "example": "1007",
            "enum": [
              "1001",
              "1002",
              "1006",
              "1007",
              "1009",
              "1012",
              "1013",
              "1019",
              "1023",
              "1032",
              "1040",
              "1047",
              "1051",
              "1052",
              "1053",
              "1059",
              "1060",
              "1061",
              "1062",
              "1063",
              "1065",
              "1066",
              "1067",
              "1069",
              "1070",
              "1071",
              "1097",
              "1121",
              "1283",
              "1286",
              "1289",
              "1292",
              "1303",
              "1370",
              "1507",
              "1551",
              "1558",
              "1637",
              "1801",
              "1802",
              "1803",
              "1804",
              "1805",
              "1808",
              "1809",
              "1811",
              "1812",
              "1814",
              "1815",
              "1816"
            ]
          },
          "account_type": {
            "type": "string",
            "description": "The type of bank account.",
            "example": "savings",
            "enum": [
              "savings",
              "checking",
              "electronic_deposit"
            ]
          },
          "document_type": {
            "type": "string",
            "description": "The recipient's identification document type.",
            "example": "cc",
            "enum": [
              "cc",
              "ce",
              "nit",
              "rut",
              "pa",
              "ppt",
              "ti",
              "rc",
              "te",
              "die",
              "nd"
            ]
          },
          "document_number": {
            "type": "string",
            "description": "The recipient's identification document number.",
            "example": "12345678901"
          },
          "phone_number": {
            "type": "string",
            "description": "The recipient's phone number in E.164 format.",
            "example": "+573001234567",
            "pattern": "^\\+[1-9]\\d{1,14}$"
          }
        }
      },
      "BlockchainPaymentCreditorWallet": {
        "type": "object",
        "description": "Blockchain wallet payment details.",
        "required": [
          "wallet_address"
        ],
        "properties": {
          "wallet_address": {
            "type": "string",
            "description": "The destination wallet address.",
            "example": "0xdef456abc789"
          }
        }
      },
      "BlockchainPaymentCreditorType": {
        "description": "Whether the creditor is an individual or a business.",
        "type": "string",
        "example": "individual",
        "enum": [
          "individual",
          "business"
        ]
      },
      "BlockchainPaymentCreditorIndividual": {
        "type": "object",
        "description": "Individual creditor details.",
        "required": [
          "first_name",
          "last_name"
        ],
        "properties": {
          "first_name": {
            "type": "string",
            "description": "First name of the individual. On payment rails where the receiving\naccount is validated (currently `pix` and `spei`), the creditor's\nfirst and last name together must closely match the legal name\nregistered on the receiving account (an approximate match). If the\nnames do not match, the payment is rejected with\n`rejection_reason: \"name_mismatch\"`.\nOn other rails the creditor name is not matched against the account.\n",
            "example": "Maria"
          },
          "last_name": {
            "type": "string",
            "description": "Last name of the individual. See `first_name` for the name-matching\nrequirement that applies on account-validated rails (`pix`, `spei`).\n",
            "example": "Garcia"
          }
        }
      },
      "BlockchainPaymentCreditorBusiness": {
        "type": "object",
        "description": "Business creditor details.",
        "required": [
          "business_name"
        ],
        "properties": {
          "business_name": {
            "type": "string",
            "description": "Name of the business. On payment rails where the receiving account is\nvalidated (currently `pix` and `spei`), the business name must closely\nmatch the legal name or DBA registered on the receiving account (an\napproximate match). If the names do not match, the payment is rejected\nwith `rejection_reason: \"name_mismatch\"`.\nOn other rails the creditor name is not matched against the account.\n",
            "example": "Acme International LLC"
          }
        }
      },
      "BlockchainPaymentAddress": {
        "type": "object",
        "description": "A physical address.",
        "required": [
          "line_one",
          "city",
          "country"
        ],
        "properties": {
          "line_one": {
            "type": "string",
            "description": "First line of the address.",
            "example": "123 Main St"
          },
          "line_two": {
            "type": "string",
            "description": "Second line of the address (optional).",
            "example": "Suite 100"
          },
          "city": {
            "type": "string",
            "description": "City name.",
            "example": "San Francisco"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code. On the creditor address, the IBAN and\nSWIFT country, and the creditor agent `country_code`, the value must be\na real, assigned country code — unassigned or grouping codes such as\n`EU`/`ZZ` are rejected (stricter than the `^[A-Z]{2}$` pattern).\nSanctioned countries are not accepted.\n",
            "example": "US",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          },
          "state": {
            "type": "string",
            "description": "State or province. Required for US ach, wire, and swift addresses; optional otherwise.",
            "example": "CA"
          },
          "postal_code": {
            "type": "string",
            "description": "Postal or zip code. Required for ach, wire, and swift payments to countries that use postal codes; optional for other rails.",
            "example": "94105"
          }
        }
      },
      "BlockchainPaymentCreditorBase": {
        "type": "object",
        "description": "Common creditor fields shared by every payment rail. This is the base of\nthe rail-specific creditor variants; integrations reference\n`BlockchainPaymentCreditor`, which selects the correct variant from\n`payment_rail`.\n",
        "required": [
          "payment_rail",
          "type",
          "address"
        ],
        "properties": {
          "payment_rail": {
            "$ref": "#/components/schemas/BlockchainPaymentPaymentRail"
          },
          "ach_wire": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAchWire",
            "deprecated": true
          },
          "ach": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAch"
          },
          "wire": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorWire"
          },
          "bre_b": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBreB"
          },
          "fps": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorFps"
          },
          "iban": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorIban"
          },
          "swift": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorSwift"
          },
          "clabe": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorClabe"
          },
          "pix_key": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorPixKey"
          },
          "pix_br_code": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorPixBrCode"
          },
          "co_bank_transfer": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorCoBankTransfer"
          },
          "wallet": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorWallet"
          },
          "type": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorType"
          },
          "individual": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorIndividual"
          },
          "business": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBusiness"
          },
          "address": {
            "$ref": "#/components/schemas/BlockchainPaymentAddress"
          }
        }
      },
      "BlockchainPaymentCreditorAchVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "ach"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "ach"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorWireVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "wire"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "wire"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorIbanVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "iban"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "sepa"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorClabeVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "clabe"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "spei"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorPixVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "description": "Exactly one of `pix_key` or `pix_br_code` must be provided.",
            "oneOf": [
              {
                "required": [
                  "pix_key"
                ]
              },
              {
                "required": [
                  "pix_br_code"
                ]
              }
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "pix"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorFpsVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "fps"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "faster_payments"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorBreBVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "bre_b"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "bre_b"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorSwiftVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "swift"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "swift"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorCoBankTransferVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "co_bank_transfer"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "co_bank_transfer"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorWalletVariant": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "wallet"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "solana",
                  "base",
                  "ethereum"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditorAchWireVariant": {
        "deprecated": true,
        "allOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBase"
          },
          {
            "type": "object",
            "required": [
              "ach_wire"
            ],
            "properties": {
              "payment_rail": {
                "type": "string",
                "enum": [
                  "ach_wire"
                ]
              }
            }
          }
        ]
      },
      "BlockchainPaymentCreditor": {
        "type": "object",
        "description": "The destination of the transfer, including payment rail details and\nrecipient information.\n\nThe required detail object depends on `payment_rail`. Each rail requires\nits matching object and rejects detail objects that belong to a different\nrail:\n\n| `payment_rail` | Required detail object |\n| --- | --- |\n| `ach` | `ach` |\n| `wire` | `wire` |\n| `sepa` | `iban` |\n| `spei` | `clabe` |\n| `pix` | exactly one of `pix_key` or `pix_br_code` |\n| `faster_payments` | `fps` |\n| `bre_b` | `bre_b` |\n| `swift` | `swift` |\n| `co_bank_transfer` | `co_bank_transfer` |\n| `solana`, `base`, `ethereum` | `wallet` |\n\nProvide `individual` when `type` is `individual`, and `business` when\n`type` is `business`.\n\nOn payment rails where the receiving account is validated (currently\n`pix` and `spei`), the creditor name provided here must closely match the\nlegal name registered on the receiving account — for individuals, an\napproximate match on first + last name; for businesses, on the legal name\nor DBA. If the names do not match, the payment is rejected with\n`rejection_reason: \"name_mismatch\"`. On\nother rails the creditor name is not matched against the account.\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAchVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorWireVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorIbanVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorClabeVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorPixVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorFpsVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorBreBVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorSwiftVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorCoBankTransferVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorWalletVariant"
          },
          {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAchWireVariant"
          }
        ],
        "discriminator": {
          "propertyName": "payment_rail",
          "mapping": {
            "ach": "#/components/schemas/BlockchainPaymentCreditorAchVariant",
            "wire": "#/components/schemas/BlockchainPaymentCreditorWireVariant",
            "sepa": "#/components/schemas/BlockchainPaymentCreditorIbanVariant",
            "iban": "#/components/schemas/BlockchainPaymentCreditorIbanVariant",
            "spei": "#/components/schemas/BlockchainPaymentCreditorClabeVariant",
            "clabe": "#/components/schemas/BlockchainPaymentCreditorClabeVariant",
            "pix": "#/components/schemas/BlockchainPaymentCreditorPixVariant",
            "pix_key": "#/components/schemas/BlockchainPaymentCreditorPixVariant",
            "pix_br_code": "#/components/schemas/BlockchainPaymentCreditorPixVariant",
            "faster_payments": "#/components/schemas/BlockchainPaymentCreditorFpsVariant",
            "fps": "#/components/schemas/BlockchainPaymentCreditorFpsVariant",
            "bre_b": "#/components/schemas/BlockchainPaymentCreditorBreBVariant",
            "swift": "#/components/schemas/BlockchainPaymentCreditorSwiftVariant",
            "co_bank_transfer": "#/components/schemas/BlockchainPaymentCreditorCoBankTransferVariant",
            "solana": "#/components/schemas/BlockchainPaymentCreditorWalletVariant",
            "base": "#/components/schemas/BlockchainPaymentCreditorWalletVariant",
            "ethereum": "#/components/schemas/BlockchainPaymentCreditorWalletVariant",
            "ach_wire": "#/components/schemas/BlockchainPaymentCreditorAchWireVariant"
          }
        }
      },
      "BlockchainPaymentCreditorAgent": {
        "type": "object",
        "description": "Details of the receiving financial institution. Required when\n`creditor.payment_rail` is not a blockchain network (`solana`, `base`,\n`ethereum`). When `creditor.payment_rail` is `swift`, `address` is also\nrequired.\n",
        "required": [
          "bank_name",
          "country_code"
        ],
        "properties": {
          "bank_name": {
            "type": "string",
            "description": "Name of the receiving bank.",
            "example": "Banco Nacional de Mexico"
          },
          "country_code": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code of the receiving bank. Must be a real,\nassigned country code (unassigned or grouping codes such as `EU`/`ZZ`\nare rejected — stricter than the `^[A-Z]{2}$` pattern). Sanctioned\ncountries are not accepted.\n",
            "example": "MX",
            "minLength": 2,
            "maxLength": 2,
            "pattern": "^[A-Z]{2}$"
          },
          "address": {
            "$ref": "#/components/schemas/BlockchainPaymentAddress"
          }
        }
      },
      "BlockchainPaymentInstructedCurrencyCode": {
        "description": "The currency code for the instructed amount. The debtor is always a fiat\naccount, so `USD` is the only accepted value.\n",
        "type": "string",
        "example": "USD",
        "enum": [
          "USD"
        ]
      },
      "BlockchainPaymentSettlementCurrencyCode": {
        "description": "The currency code for the settlement amount. The value must match the\ncurrency the `creditor.payment_rail` settles in, otherwise the payment is\nrejected at creation:\n\n| Rail | Settlement currency |\n| --- | --- |\n| `ach`, `wire`, `swift` | `USD` |\n| `sepa` | `EUR` |\n| `spei` | `MXN` |\n| `pix` | `BRL` |\n| `faster_payments` | `GBP` |\n| `bre_b`, `co_bank_transfer` | `COP` |\n\n`USDB` is additionally not available when the creditor or creditor agent is\nlocated in an EEA country.\n",
        "type": "string",
        "example": "MXN",
        "enum": [
          "BRL",
          "COP",
          "EUR",
          "GBP",
          "MXN",
          "USD",
          "USDC",
          "USDB"
        ]
      },
      "BlockchainPaymentResponseAmounts": {
        "type": "object",
        "description": "The transfer amounts, currency codes, and settlement details.",
        "properties": {
          "instructed_amount": {
            "type": "integer",
            "format": "int64",
            "description": "The transfer amount represented in cents.",
            "example": 100000
          },
          "instructed_currency_code": {
            "$ref": "#/components/schemas/BlockchainPaymentInstructedCurrencyCode"
          },
          "settlement_currency_code": {
            "$ref": "#/components/schemas/BlockchainPaymentSettlementCurrencyCode"
          },
          "settlement_amount": {
            "type": "integer",
            "format": "int64",
            "description": "The settlement amount represented in cents.",
            "example": 100000
          },
          "settlement_exchange_rate": {
            "type": "string",
            "description": "The settlement exchange rate.",
            "example": "1.00"
          }
        }
      },
      "BlockchainPaymentPurposeTypeResponse": {
        "description": "The purpose of the transfer.",
        "type": "string",
        "example": "invoice_payment",
        "enum": [
          "salary_payment",
          "invoice_payment",
          "gift",
          "payment_for_goods",
          "payment_for_services",
          "insurance_premium_payment",
          "interest_payment",
          "loan",
          "loan_repayment",
          "account_management",
          "cash_management_transfer",
          "other",
          "tax_payment",
          "government_payment",
          "benefits_payment",
          "pension_payment",
          "rent_payment",
          "utilities_payment",
          "education_payment",
          "healthcare_payment",
          "charitable_payment",
          "refund",
          "fee_payment",
          "intercompany_transfer",
          "investment_payment",
          "fx_or_treasury",
          "derivatives_payment",
          "card_network_settlement",
          "return"
        ]
      },
      "BlockchainPaymentPurposeResponse": {
        "type": "object",
        "description": "The purpose of the transfer.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/BlockchainPaymentPurposeTypeResponse"
          },
          "other_details": {
            "type": "string",
            "description": "Additional details when purpose type is 'other'.",
            "example": "Monthly vendor payment"
          }
        }
      },
      "BlockchainPaymentStatusReasonCode": {
        "description": "Machine-readable code explaining why a blockchain payment was rejected.\nPresent only when `status` is `rejected`.\n\nClosed enum; new values may be added as non-breaking changes, so\nintegrations should tolerate unknown values. Each value is either\n**terminal** (resubmitting the same payment cannot succeed) or **retryable**\n(the same payment may be resubmitted once the transient condition clears):\n\n- `payment_could_not_be_processed` — **terminal**. Generic reason used when\n  no more specific customer-safe code applies.\n- `name_mismatch` — **terminal**. The creditor name did not match the legal\n  name on the validated receiving account. Correct the creditor name before\n  resubmitting.\n- `name_not_validated` — **retryable**. The receiving account's name was not\n  validated in time. Resubmit the same payment; it reuses the held account\n  and succeeds once validation completes.\n- `account_closed` — **terminal**. The receiving account is closed and a\n  resubmit cannot succeed.\n- `account_number_incorrect` — **terminal**. The receiving account number\n  is incorrect.\n",
        "type": "string",
        "example": "name_mismatch",
        "enum": [
          "payment_could_not_be_processed",
          "name_mismatch",
          "name_not_validated",
          "account_closed",
          "account_number_incorrect"
        ]
      },
      "BlockchainPaymentReturn": {
        "type": "object",
        "description": "Details of the return of a Blockchain Payment, set when funds are sent back rather than\ndelivered to the creditor. Absent for payments that were never returned.\n",
        "properties": {
          "code": {
            "type": "string",
            "description": "Machine-readable code for why the payment was returned.\n\nClosed set; new values may be added as non-breaking changes, so\nintegrations should tolerate unknown values. Every value is\n**terminal** — the returned payment settles at `posted` with the funds\nback in the debtor account, and resubmitting the same payment\nunchanged returns it again:\n\n- `account_closed` — The receiving account is closed. Correct the\n  creditor details before you send the payment again.\n- `account_number_incorrect` — The destination account number is\n  incorrect.\n- `payment_returned` — The receiving institution returned the payment\n  for a reason with no more specific customer-safe code. Contact the\n  creditor to confirm the account details before you send the payment\n  again.\n",
            "example": "account_closed"
          },
          "reason": {
            "type": "string",
            "description": "Human-readable description of the return, paired one-to-one with\n`code`. Read `code` to make integration decisions and use `reason` for\ndisplay.\n",
            "example": "The destination account has been closed.",
            "maxLength": 500
          }
        }
      },
      "BlockchainPaymentRelatedPayments": {
        "type": "object",
        "description": "Other Blockchain Payments linked to this one. Absent when the payment has no\nrelated payments.\n",
        "properties": {
          "original_blockchain_payment_id": {
            "description": "The Blockchain Payment this one returns funds for. Set only on a return\npayment.\n",
            "example": "blockchain_payment_2x7abc123def456ghi789jkl",
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockchainPaymentID"
              }
            ]
          },
          "return_blockchain_payment_ids": {
            "type": "array",
            "description": "The Blockchain Payments sending funds back for this payment. Set only on\na payment that was returned.\n",
            "example": [
              "blockchain_payment_9y4mno321pqr654stu987vwx"
            ],
            "items": {
              "$ref": "#/components/schemas/BlockchainPaymentID"
            }
          }
        }
      },
      "BlockchainPayment": {
        "type": "object",
        "description": "A blockchain payment object representing a fiat or cross-border payment.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/BlockchainPaymentID"
          },
          "debtor": {
            "$ref": "#/components/schemas/BlockchainPaymentDebtorResponse"
          },
          "creditor": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditor"
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAgent"
          },
          "amounts": {
            "$ref": "#/components/schemas/BlockchainPaymentResponseAmounts"
          },
          "payment_purpose": {
            "$ref": "#/components/schemas/BlockchainPaymentPurposeResponse"
          },
          "reference": {
            "type": "string",
            "description": "The reference message for the transfer. For `sepa` payments created\nwithout a reference, this is a value generated automatically at\ncreation, of the form `Payment via Lead <payment id>` (the payment's\npublic ID with underscores replaced by hyphens, e.g.\n`Payment via Lead blockchain-payment-2x7abc...`). See `reference` on the\ncreate request for the per-rail formatting rules.\n",
            "example": "INV2024001"
          },
          "status": {
            "$ref": "#/components/schemas/BlockchainPaymentStatus"
          },
          "rejection_reason": {
            "description": "Reason the transfer was rejected, as a closed machine-readable code\n(`BlockchainPaymentStatusReasonCode`). Present only when `status` is\n`rejected`. See that enum for the per-value **terminal**-vs-**retryable**\nsemantics you need to build the right resubmit logic.\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockchainPaymentStatusReasonCode"
              }
            ]
          },
          "cancelation_reason": {
            "type": "string",
            "description": "Reason the transfer was canceled. Present only if status is canceled.",
            "example": "Requested by customer"
          },
          "return": {
            "description": "Details of the return on this payment. Present only when the payment\nwas returned after being sent.\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockchainPaymentReturn"
              }
            ]
          },
          "related_blockchain_payments": {
            "description": "Other blockchain payments linked to this one. On a payment that was\nreturned, this holds the IDs of the return payments sending the funds\nback. On a return payment, it holds the ID of the original payment\nbeing returned. Absent when the payment has no related payments.\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/BlockchainPaymentRelatedPayments"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the blockchain payment was created.",
            "example": "2024-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the blockchain payment was last updated.",
            "example": "2024-06-27T11:22:33Z"
          }
        }
      },
      "BlockchainPaymentDebtor": {
        "type": "object",
        "description": "The source of funds for the transfer.",
        "required": [
          "account_identifier"
        ],
        "properties": {
          "account_identifier": {
            "$ref": "#/components/schemas/BlockchainPaymentAccountIdentifier"
          },
          "entity_id": {
            "type": "string",
            "description": "The entity ID associated with the debtor. Ignored on create — the entity\nis resolved from the referenced account record, which must belong to your\nauthorized program and client — and the resolved value is returned on\nthe created payment.\n",
            "example": "entity_xyz123"
          }
        }
      },
      "BlockchainPaymentAmounts": {
        "type": "object",
        "description": "The transfer amounts and currency codes.",
        "required": [
          "instructed_amount",
          "instructed_currency_code",
          "settlement_currency_code"
        ],
        "properties": {
          "instructed_amount": {
            "type": "integer",
            "format": "int64",
            "minimum": 300,
            "description": "The transfer amount represented in the currency's minor units (e.g.\ncents). The minimum accepted amount is `300` minor units on every\nsupported rail; smaller amounts are rejected at creation.\n",
            "example": 100000
          },
          "instructed_currency_code": {
            "$ref": "#/components/schemas/BlockchainPaymentInstructedCurrencyCode"
          },
          "settlement_currency_code": {
            "$ref": "#/components/schemas/BlockchainPaymentSettlementCurrencyCode"
          }
        }
      },
      "BlockchainPaymentPurposeTypeRequest": {
        "description": "The purpose of the transfer.",
        "type": "string",
        "example": "invoice_payment",
        "enum": [
          "salary_payment",
          "invoice_payment",
          "gift",
          "payment_for_goods",
          "payment_for_services",
          "insurance_premium_payment",
          "interest_payment",
          "loan",
          "loan_repayment",
          "account_management",
          "cash_management_transfer",
          "other",
          "tax_payment",
          "government_payment",
          "benefits_payment",
          "pension_payment",
          "rent_payment",
          "utilities_payment",
          "education_payment",
          "healthcare_payment",
          "charitable_payment",
          "refund",
          "fee_payment",
          "intercompany_transfer",
          "investment_payment",
          "fx_or_treasury",
          "derivatives_payment",
          "card_network_settlement"
        ]
      },
      "BlockchainPaymentPurposeRequest": {
        "type": "object",
        "description": "The purpose of the transfer.",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/BlockchainPaymentPurposeTypeRequest"
          },
          "other_details": {
            "type": "string",
            "description": "Additional details when purpose type is 'other'.",
            "example": "Monthly vendor payment"
          }
        }
      },
      "CreateBlockchainPaymentRequest": {
        "type": "object",
        "title": "CreateBlockchainPaymentRequest",
        "description": "Creates a payment to a fiat or cross-border creditor.\n\nThe blockchain creditor rails (`solana`, `base`, `ethereum`) are advertised\nin the `payment_rail` enum but rejected at creation; only fiat and\ncross-border creditor rails are currently accepted.\n\nThe debtor's available balance is checked at creation: insufficient funds\nare normally rejected synchronously with HTTP `400` and no payment is\ncreated. When the balance service is temporarily unavailable the check is\ndeferred to asynchronous processing, so a successful create response is not\nan absolute guarantee of settlement.\n",
        "required": [
          "debtor",
          "creditor",
          "amounts",
          "payment_purpose"
        ],
        "properties": {
          "debtor": {
            "$ref": "#/components/schemas/BlockchainPaymentDebtor"
          },
          "creditor": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditor"
          },
          "creditor_agent": {
            "$ref": "#/components/schemas/BlockchainPaymentCreditorAgent"
          },
          "amounts": {
            "$ref": "#/components/schemas/BlockchainPaymentAmounts"
          },
          "payment_purpose": {
            "$ref": "#/components/schemas/BlockchainPaymentPurposeRequest"
          },
          "reference": {
            "type": "string",
            "description": "An optional reference message for the transfer, passed on to the\nrecipient on rails that carry a reference.\n\nFormatting requirements depend on `creditor.payment_rail`. The reference\nis stored and delivered exactly as submitted — it is never shortened,\nstripped, or otherwise altered. A reference that does not meet its\nrail's requirements is rejected when the payment is created, with HTTP\n`422` and an `invalid_parameters` entry for `reference`.\n\n| `payment_rail` | Length | Allowed characters |\n| --- | --- | --- |\n| `ach` | 1–10 | letters, digits, spaces |\n| `wire` | 1–140 | any character (line-formatted, see below) |\n| `sepa` | 6–140 | letters, digits, spaces, and `& - . /` |\n| `spei` | 1–40 | letters, digits, spaces |\n| `swift` | 1–190 | letters, digits, spaces, and `/ - ? : ( ) . , ' +` (line-formatted, see below) |\n| `pix` | 1–100 | letters, digits, spaces |\n| `faster_payments` | 1–18 | letters, digits, spaces |\n\nAdditional rules:\n\n- **`wire` and `swift`** references are formatted into at most 4 lines of\n  35 characters. Words are kept whole and wrapped at spaces; include your\n  own line breaks (`\\n`) to control the layout. A single word longer than\n  35 characters, or text that cannot fit within 4 lines, is rejected.\n- **`sepa`** requires a minimum of 6 characters. If you omit the\n  reference on a `sepa` payment, one is generated for you and returned\n  on the created payment object.\n- **`bre_b`, `co_bank_transfer`, `ethereum`, `base`, and `solana`** do not\n  carry a reference; supplying one is rejected.\n- Omitting the field, or sending an empty string, is allowed on every\n  rail except `sepa` and results in no reference being sent.\n",
            "example": "INV2024001"
          }
        }
      },
      "WebhookSecret": {
        "type": "object",
        "description": "A signing secret for a webhook subscription. Lead generates secrets on subscription creation and\non rotation, and returns them only in those two responses — retrieve and list never include them,\nso store the value when you receive it.\n",
        "properties": {
          "value": {
            "type": "string",
            "description": "The secret used to verify the `Lead-Signature` header on webhook deliveries.\n",
            "example": "whsec_xyz123"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When this secret stops being valid. Set on the outgoing secret when you rotate with a\n24-hour grace period, and `null` for a secret with no scheduled expiration.\n",
            "example": "2025-09-25T15:00:00Z"
          }
        }
      },
      "EventSubscriptionID": {
        "type": "string",
        "description": "The server-generated ID of the Event Subscription object.",
        "example": "event_subscription_xyz123",
        "pattern": "^event_subscription_\\w+$"
      },
      "EventSubscriptionType": {
        "type": "string",
        "description": "The delivery channel for the subscription. `webhook` is the only supported channel today, and a\nsubscription has exactly one type.\n",
        "example": "webhook",
        "enum": [
          "webhook"
        ]
      },
      "EventSubscriptionStatus": {
        "type": "string",
        "description": "Controls delivery for the subscription. `active` delivers events; `inactive` pauses future\ndeliveries. New subscriptions start as `active`. Changing status leaves events already pending\ndelivery, and deliveries that already reached a terminal state, untouched.\n",
        "example": "active",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "EventSubscriptionDescription": {
        "type": "string",
        "maxLength": 255,
        "description": "Your human-readable description of the subscription. Lead stores it for your reference and does\nnot use it for delivery behavior.\n",
        "example": "Webhook for wire events"
      },
      "EventSubscriptionEvents": {
        "type": "array",
        "minItems": 1,
        "description": "The event types delivered to this subscription. Lead delivers only events matching one of these\ntypes. A subscription can carry many event types, and an event type can appear on many\nsubscriptions.\n",
        "items": {
          "$ref": "#/components/schemas/EventType"
        }
      },
      "EventSubscriptionWebhook": {
        "type": "object",
        "description": "Webhook configuration for the subscription. Present when `type` is `webhook`.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The HTTPS URL where Lead delivers events for this subscription. One URL per subscription,\nunique within your program.\n",
            "example": "https://example.com/webhook"
          },
          "secret": {
            "type": "array",
            "maxItems": 2,
            "description": "The active signing secrets for this webhook. Returned only in create and rotate responses;\nomitted on retrieve and list. At most two secrets are active at once, which happens during a\n24-hour rotation grace period.\n",
            "items": {
              "$ref": "#/components/schemas/WebhookSecret"
            }
          }
        }
      },
      "EventSubscription": {
        "type": "object",
        "description": "An Event Subscription object.",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/EventSubscriptionID"
          },
          "type": {
            "$ref": "#/components/schemas/EventSubscriptionType"
          },
          "status": {
            "$ref": "#/components/schemas/EventSubscriptionStatus"
          },
          "description": {
            "$ref": "#/components/schemas/EventSubscriptionDescription"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "events": {
            "$ref": "#/components/schemas/EventSubscriptionEvents"
          },
          "webhook": {
            "$ref": "#/components/schemas/EventSubscriptionWebhook"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the event subscription was created.",
            "example": "2025-09-14T15:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 format timestamp representing when the event subscription was last updated. Changes\nto status, events, webhook URL, metadata, description, and secret rotation all move it.\n",
            "example": "2025-09-14T15:00:00Z"
          }
        }
      },
      "CreateEventSubscriptionWebhook": {
        "type": "object",
        "description": "Webhook configuration for a create request.",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The HTTPS URL where Lead delivers events for this subscription. Must use HTTPS and must be\nunique within your program.\n",
            "example": "https://example.com/webhook"
          }
        },
        "required": [
          "url"
        ]
      },
      "PatchEventSubscriptionWebhook": {
        "type": "object",
        "description": "The mutable subset of a subscription's webhook configuration. A new URL applies only to events\nwhose first delivery attempt happens after the update.\n",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The HTTPS URL where Lead delivers events for this subscription. Must use HTTPS and must be\nunique within your program.\n",
            "example": "https://new-endpoint.example.com/webhook"
          }
        }
      },
      "WebhookSecretExpiration": {
        "type": "string",
        "description": "How long the previous webhook secret stays valid after a rotation. `now` retires it immediately.\n`24_hour` keeps it valid for another 24 hours so you can roll the new secret out without dropping\ndeliveries; during that window Lead signs each delivery with both secrets and the\n`Lead-Signature` header carries both signatures.\n",
        "example": "24_hour",
        "enum": [
          "now",
          "24_hour"
        ]
      },
      "CounterpartyFinancialInstitution": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "readOnly": true,
            "description": "Name of the counterparty financial institution.",
            "example": "Bank of America"
          },
          "routing_number": {
            "type": "string",
            "description": "Routing number of the counterparty financial institution.",
            "example": "021000021",
            "minLength": 9,
            "maxLength": 9,
            "pattern": "^[0-9]+$"
          }
        }
      },
      "WireIDType": {
        "type": "string",
        "description": "Identification types.",
        "nullable": true,
        "enum": [
          "account_number",
          "swift_bank_identifier_code",
          "chips_participant",
          "fed_routing_number",
          "swift_entity_identifer_account_number",
          "chips_identifier",
          "passport_number",
          "tax_identification_number",
          "driver_license_number",
          "alien_registration_number",
          "corporate_identification",
          "other_identification",
          "customer_identification_number",
          "employer_number",
          "national_identity_number",
          "social_security_number"
        ]
      },
      "WireOriginator": {
        "type": "object",
        "description": "Originator information.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the originator.",
            "example": "Alan Scott"
          },
          "address": {
            "type": "array",
            "description": "Address of the originator.",
            "items": {
              "type": "string"
            }
          },
          "identifier_type": {
            "$ref": "#/components/schemas/WireIDType"
          },
          "identifier_value_last_four": {
            "type": "string",
            "description": "Last four digits of the identifier value of the originator. Please contact Lead if you need the full value.",
            "example": 1234
          }
        }
      },
      "Beneficiary": {
        "type": "object",
        "description": "Beneficiary information.",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the beneficiary.",
            "example": "Kimaya Bajwa"
          },
          "address": {
            "type": "array",
            "description": "Address of the beneficiary.",
            "items": {
              "type": "string"
            }
          },
          "identifier_type": {
            "$ref": "#/components/schemas/WireIDType"
          },
          "identifier_value": {
            "type": "string",
            "description": "Full value of the identifier value of the beneficiary.",
            "example": 211234567890
          }
        }
      },
      "MessageToBeneficiary": {
        "type": "string",
        "description": "Message from the originator to the beneficiary. Lead will populate this field for outgoing returns based on the return reason.",
        "maxLength": 140,
        "example": "Payment for invoice #12345",
        "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
      },
      "WireTransferPurpose": {
        "type": "string",
        "minLength": 3,
        "maxLength": 140,
        "description": "Transfer purpose",
        "example": "Invoice payment",
        "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
      },
      "EndToEndIdentification": {
        "type": "string",
        "description": "Unique identification to unambiguously identify the transaction. Only effective after March 10, 2025 ISO migration.",
        "minLength": 1,
        "maxLength": 35,
        "example": "EndtoEnd12345"
      },
      "AdditionalNetworkData": {
        "type": "object",
        "description": "Additional network data for the wire.",
        "properties": {
          "sender_reference": {
            "type": "string",
            "description": "Used by Sender FI to provide its reference information."
          },
          "end_to_end_identification": {
            "$ref": "#/components/schemas/EndToEndIdentification"
          },
          "return_identification": {
            "type": "string",
            "description": "Reference to the payment return message."
          },
          "beneficiary_reference": {
            "type": "string",
            "description": "Reference information provided to the beneficiary to identify the transfer."
          },
          "message_to_receiving_fi": {
            "type": "string",
            "description": "Information intended specifically for the Recevier FI."
          },
          "fi_to_fi_message": {
            "type": "string",
            "description": "Financial institution to financial institution information, most often used by a FI to explain additional detail of a wire. Lead will populate this field for outgoing returns based on the return reason."
          },
          "previous_message_identifier": {
            "type": "string",
            "description": "IMAD of the previous wire. Used to identify the original wire transaction of a return wire."
          },
          "payment_notification": {
            "type": "string",
            "description": "Indicates a preference for payment notification."
          }
        }
      },
      "RelatedWires": {
        "type": "object",
        "description": "Related wire objects.",
        "properties": {
          "previous_wire_id": {
            "type": "string",
            "description": "The previous wire object.",
            "example": "wire_xyz001"
          },
          "return_wire_ids": {
            "type": "array",
            "description": "The return wire object(s) identifiers.",
            "items": {
              "type": "string",
              "example": "wire_xyz002"
            }
          }
        }
      },
      "WireRejectionReason": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "account_inactive",
              "account_closed",
              "address_invalid",
              "beneficiary_account_number_unrecognized",
              "beneficiary_name_mismatch",
              "beneficiary_request",
              "duplicate_payment",
              "honor_return_request",
              "limit_exceeded",
              "missing_data",
              "non_sufficient_funds",
              "ofac_rejection",
              "per_client_request",
              "processor_discretionary_decision",
              "unexpected_data",
              "unexpected_routing_number",
              "unexpected_transaction",
              "unmatched_customer_data",
              "unsupported_transaction",
              "account_blocked",
              "creditor_account_number_invalid",
              "creditor_account_number_closed",
              "account_number_incorrect",
              "amount_blocked",
              "prohibited_countries",
              "per_agent_request",
              "routing_number_format_incorrect",
              "debtor_address_invalid",
              "creditor_address_invalid"
            ]
          },
          "details": {
            "type": "string",
            "description": "Detailed explanation about the rejection"
          },
          "additional_information": {
            "type": "string",
            "description": "Additional information about the rejection"
          },
          "imad": {
            "$ref": "#/components/schemas/IMAD",
            "description": "IMAD of the returned wire this wire rejection is referring to."
          }
        }
      },
      "WireReturn": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "account_closed"
            ]
          },
          "details": {
            "type": "string",
            "description": "Detailed explanation about the return"
          },
          "additional_information": {
            "type": "string",
            "description": "Additional information about the return"
          }
        }
      },
      "Wire": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the wire object",
            "example": "wire_xyz123",
            "pattern": "^wire_\\w+$"
          },
          "type": {
            "type": "string",
            "description": "The type of the wire object.",
            "example": "transfer",
            "enum": [
              "transfer",
              "return"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the wire object was created.",
            "example": "2024-06-27T11:22:33Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "The ISO-8601 timestamp at which the wire object was last updated.",
            "example": "2024-06-27T11:22:33Z"
          },
          "direction": {
            "$ref": "#/components/schemas/WireDirection"
          },
          "status": {
            "$ref": "#/components/schemas/WireStatus"
          },
          "amount": {
            "$ref": "#/components/schemas/WireAmount"
          },
          "settlement_date": {
            "type": "string",
            "format": "date"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "account_id": {
            "$ref": "#/components/schemas/AccountID"
          },
          "account_number_id": {
            "$ref": "#/components/schemas/AccountNumberID"
          },
          "counterparty_financial_institution": {
            "$ref": "#/components/schemas/CounterpartyFinancialInstitution"
          },
          "originator": {
            "$ref": "#/components/schemas/WireOriginator"
          },
          "beneficiary": {
            "$ref": "#/components/schemas/Beneficiary"
          },
          "message_to_beneficiary": {
            "$ref": "#/components/schemas/MessageToBeneficiary"
          },
          "transfer_purpose": {
            "$ref": "#/components/schemas/WireTransferPurpose"
          },
          "imad": {
            "$ref": "#/components/schemas/IMAD"
          },
          "uetr": {
            "type": "string",
            "description": "Unique End-To-End Reference assigned by the sender."
          },
          "additional_network_data": {
            "$ref": "#/components/schemas/AdditionalNetworkData"
          },
          "was_returned": {
            "type": "boolean",
            "description": "Indicates if the wire was returned."
          },
          "related_wires": {
            "$ref": "#/components/schemas/RelatedWires"
          },
          "rejection": {
            "$ref": "#/components/schemas/WireRejectionReason"
          },
          "return": {
            "$ref": "#/components/schemas/WireReturn"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        }
      },
      "OutgoingWireReturnReason": {
        "type": "string",
        "description": "Reason to return a wire payment.",
        "example": "honor_return_request",
        "enum": [
          "beneficiary_request",
          "honor_return_request",
          "unmatched_customer_data",
          "unexpected_transaction",
          "account_inactive",
          "fraud_suspected"
        ]
      },
      "CoreBalance": {
        "type": "object",
        "required": [
          "amount",
          "amount_in_usd",
          "outstanding_principal",
          "outstanding_interest",
          "outstanding_fees"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total balance amount as an integer in minor units.",
            "example": 8944
          },
          "amount_in_usd": {
            "type": "integer",
            "description": "The total balance amount in USD as an integer in minor units.",
            "example": 8944
          },
          "outstanding_principal": {
            "type": "integer",
            "description": "The outstanding principal amount as an integer in minor units.",
            "example": 5000
          },
          "outstanding_interest": {
            "type": "integer",
            "description": "The outstanding interest amount as an integer in minor units.",
            "example": 2522
          },
          "outstanding_fees": {
            "type": "integer",
            "description": "The outstanding fees amount as an integer in minor units.",
            "example": 1422
          }
        }
      },
      "RewardsBalance": {
        "type": "object",
        "required": [
          "amount",
          "unit"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The rewards balance amount as an integer in minor units.",
            "example": 10
          },
          "unit": {
            "type": "string",
            "description": "The unit of measurement for the rewards balance amount.",
            "example": "points",
            "enum": [
              "usd",
              "points"
            ]
          }
        }
      },
      "DisputeBalance": {
        "type": "object",
        "required": [
          "amount",
          "principal",
          "interest",
          "fees"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total amount that is currently under dispute as an integer in minor units.",
            "example": 0
          },
          "principal": {
            "type": "integer",
            "description": "The amount of principal currently under dispute as an integer in minor units.",
            "example": 0
          },
          "interest": {
            "type": "integer",
            "description": "The amount of interest currently under dispute as an integer in minor units.",
            "example": 0
          },
          "fees": {
            "type": "integer",
            "description": "The amount of fees currently under dispute as an integer in minor units.",
            "example": 0
          }
        }
      },
      "ChargeOffBalance": {
        "type": "object",
        "required": [
          "amount",
          "principal",
          "interest",
          "fees"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The charged-off amount as an integer in minor units.",
            "example": 0
          },
          "principal": {
            "type": "integer",
            "description": "The charged-off principal amount as an integer in minor units.",
            "example": 0
          },
          "interest": {
            "type": "integer",
            "description": "The charged-off interest amount as an integer in minor units.",
            "example": 0
          },
          "fees": {
            "type": "integer",
            "description": "The charged-off fees amount as an integer in minor units.",
            "example": 0
          }
        }
      },
      "PastDueBalance": {
        "type": "object",
        "required": [
          "amount",
          "past_due_days",
          "principal",
          "interest",
          "fees"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "The total past due amount as an integer in minor units.",
            "example": 15
          },
          "past_due_days": {
            "type": "integer",
            "description": "The number of days that the balance is past due.",
            "example": 15
          },
          "principal": {
            "type": "integer",
            "description": "The past due principal amount as an integer in minor units.",
            "example": 15
          },
          "interest": {
            "type": "integer",
            "description": "The past due interest amount as an integer in minor units.",
            "example": 15
          },
          "fees": {
            "type": "integer",
            "description": "The past due fees amount as an integer in minor units.",
            "example": 15
          }
        }
      },
      "BalanceAmounts": {
        "type": "object",
        "required": [
          "core"
        ],
        "properties": {
          "core": {
            "$ref": "#/components/schemas/CoreBalance"
          },
          "rewards": {
            "$ref": "#/components/schemas/RewardsBalance"
          },
          "dispute": {
            "$ref": "#/components/schemas/DisputeBalance"
          },
          "charge_off": {
            "$ref": "#/components/schemas/ChargeOffBalance"
          },
          "past_due": {
            "$ref": "#/components/schemas/PastDueBalance"
          }
        }
      },
      "CreditDetailsResponseBase": {
        "type": "object",
        "required": [
          "structure",
          "balances"
        ],
        "properties": {
          "structure": {
            "type": "string"
          },
          "balances": {
            "$ref": "#/components/schemas/BalanceAmounts"
          },
          "autopay_method": {
            "type": "string",
            "description": "The autopay method. Required if `type` is `credit`.",
            "example": "ach",
            "enum": [
              "ach",
              "debit_card",
              "wire",
              "virtual_wallet",
              "credit_card",
              "none"
            ]
          },
          "is_interest_based": {
            "type": "boolean",
            "nullable": true,
            "description": "Indicates whether the Subledger Balance is interest-based. Required if `type` is `credit`.",
            "example": true
          },
          "effective_apr": {
            "type": "string",
            "description": "The APR as disclosed to the borrower. Required if `type` is `credit`.",
            "example": "10.250"
          },
          "effective_interest_rate": {
            "type": "string",
            "description": "The true annualized cost of borrowing, taking into account the interest rate and impact of compounding. Required if `type` is `credit`.",
            "example": "9.500000"
          },
          "interest_rate": {
            "type": "string",
            "description": "For deposit products, the annualized interest rate offered to customers on this Subledger Balance. For credit products, the contractual annual rate of interest charged on the loan’s outstanding principal, without taking into account compounding frequency or additional fees. Also known as the stated interest rate or nominal interest rate.",
            "example": "9.990000"
          }
        }
      },
      "NonRevolvingCreditDetails": {
        "title": "Non-Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsResponseBase"
          },
          {
            "type": "object",
            "required": [
              "expected_maturity_date",
              "repayment_details",
              "max_funding_amount",
              "term",
              "expected_finance_charge_amount"
            ],
            "properties": {
              "expected_maturity_date": {
                "type": "string",
                "format": "date",
                "description": "The expected maturity date of the loan.",
                "example": "2027-09-01"
              },
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RepaymentDetails"
                }
              },
              "max_funding_amount": {
                "type": "integer",
                "description": "The maximum funding amount expressed as an integer in minor units. For a term loan, this would be equivalent to the total loan amount.",
                "example": 10000000
              },
              "term": {
                "$ref": "#/components/schemas/Term"
              },
              "expected_finance_charge_amount": {
                "type": "integer",
                "description": "The expected finance charge amount expressed as an integer in minor units.",
                "example": 100000
              }
            }
          }
        ]
      },
      "RevolvingCreditDetails": {
        "title": "Revolving",
        "allOf": [
          {
            "$ref": "#/components/schemas/CreditDetailsResponseBase"
          },
          {
            "type": "object",
            "required": [
              "repayment_details"
            ],
            "properties": {
              "repayment_details": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RevolvingRepaymentDetails"
                }
              }
            }
          }
        ]
      },
      "SubledgerBalanceCreditDetails": {
        "type": "object",
        "required": [
          "structure"
        ],
        "properties": {
          "structure": {
            "type": "string",
            "enum": [
              "non_revolving",
              "revolving"
            ]
          }
        },
        "discriminator": {
          "propertyName": "structure",
          "mapping": {
            "non_revolving": "#/components/schemas/NonRevolvingCreditDetails",
            "revolving": "#/components/schemas/RevolvingCreditDetails"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/NonRevolvingCreditDetails"
          },
          {
            "$ref": "#/components/schemas/RevolvingCreditDetails"
          }
        ]
      },
      "UserAccountAllowedBalance": {
        "type": "string",
        "description": "The type of balance allowed on the user account",
        "enum": [
          "deposit",
          "credit"
        ]
      },
      "UserAccountUnderwriting": {
        "type": "object",
        "description": "Underwriting details for the user account",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product"
          },
          "is_mla": {
            "type": "boolean",
            "description": "Indicates if this account is considered a Military Lending Act account"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Grade given to the customer based on underwriting"
          },
          "currency_code": {
            "type": "string",
            "description": "The currency for the account (3-letter ISO code)",
            "example": "USD"
          },
          "available_credit": {
            "type": "integer",
            "description": "Available credit for the customer to draw (in minor units)"
          },
          "limit": {
            "type": "integer",
            "description": "Current credit limit (in minor units)"
          },
          "max_limit": {
            "type": "integer",
            "description": "Maximum credit limit approved in underwriting (in minor units)"
          },
          "scra": {
            "$ref": "#/components/schemas/Scra"
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        }
      },
      "UserAccountID": {
        "type": "string",
        "description": "The ID of the User Account object.",
        "example": "user_account_xyz123",
        "pattern": "^(user_)?account_\\w+$"
      },
      "UserAccountPermissions": {
        "type": "object",
        "description": "Permissions that define what the user account can do",
        "properties": {
          "allowed_balances": {
            "type": "array",
            "description": "List of balance types allowed on this account",
            "items": {
              "$ref": "#/components/schemas/UserAccountAllowedBalance"
            },
            "minItems": 1
          }
        },
        "required": [
          "allowed_balances"
        ]
      },
      "UserAccountEntities": {
        "type": "object",
        "readOnly": true,
        "description": "Entity relationships associated with the user account (response only)",
        "properties": {
          "account_holder_type": {
            "type": "string",
            "description": "Derived from the type of the entity referenced in account_holders",
            "enum": [
              "consumer",
              "commercial"
            ]
          }
        }
      },
      "UserAccountDetails": {
        "type": "object",
        "description": "Core details of the user account",
        "readOnly": true,
        "properties": {
          "underwriting": {
            "$ref": "#/components/schemas/UserAccountUnderwriting"
          },
          "adverse_action_notice": {
            "$ref": "#/components/schemas/AdverseActionNotice"
          }
        }
      },
      "UserAccountBalanceSheetModel": {
        "type": "string",
        "description": "How the account is treated on the balance sheet",
        "enum": [
          "on_balance_sheet",
          "originate_to_sell"
        ]
      },
      "CreateUserAccountEntities": {
        "type": "object",
        "description": "Entity relationships for the user account (POST request only).\nMaximum 20 entities per relationship type.\nCannot mix individual and business/sole_prop entities in account_holders.\nAuthorized signers required for business/sole_prop account holders.\n",
        "properties": {
          "account_holders": {
            "type": "array",
            "description": "Account holders (min 1, max 20)",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "authorized_signers": {
            "type": "array",
            "description": "Authorized signers on the account (required with min 1 if business/sole_prop account holders)",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          },
          "authorized_users": {
            "type": "array",
            "description": "Authorized users on the account",
            "items": {
              "$ref": "#/components/schemas/EntityID"
            },
            "maxItems": 20
          }
        },
        "required": [
          "account_holders"
        ]
      },
      "PatchUserAccountUnderwriting": {
        "type": "object",
        "description": "Underwriting details for updating a user account (all fields optional)",
        "properties": {
          "is_secured": {
            "type": "boolean",
            "description": "Indicates if this is a secured credit/deposit product"
          },
          "is_mla": {
            "type": "boolean",
            "description": "Indicates if this account is considered a Military Lending Act account"
          },
          "underwriting_grade": {
            "type": "string",
            "description": "Grade given to the customer based on underwriting"
          },
          "currency_code": {
            "type": "string",
            "description": "The currency for the account (3-letter ISO code)",
            "example": "USD"
          },
          "available_credit": {
            "type": "integer",
            "description": "Available credit for the customer to draw (in minor units)"
          },
          "limit": {
            "type": "integer",
            "description": "Current credit limit (in minor units)"
          },
          "max_limit": {
            "type": "integer",
            "description": "Maximum credit limit approved in underwriting (in minor units)"
          },
          "scra": {
            "$ref": "#/components/schemas/Scra"
          },
          "report": {
            "$ref": "#/components/schemas/CreditReport"
          }
        }
      },
      "ListEventSubscription": {
        "type": "object",
        "required": [
          "objects",
          "has_more"
        ],
        "properties": {
          "objects": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventSubscription"
            }
          },
          "has_more": {
            "type": "boolean",
            "description": "Indicates if there are more event subscriptions to retrieve."
          }
        }
      },
      "CreateEventSubscriptionRequest": {
        "type": "object",
        "description": "Request body for creating an event subscription. The new subscription starts as `active`, and\nthe response carries its first signing secret. Your program is capped at 10 event subscriptions,\ncounting both active and inactive ones.\n",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/EventSubscriptionType"
          },
          "description": {
            "$ref": "#/components/schemas/EventSubscriptionDescription"
          },
          "events": {
            "$ref": "#/components/schemas/EventSubscriptionEvents"
          },
          "webhook": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CreateEventSubscriptionWebhook"
              }
            ],
            "description": "Webhook configuration. Required when `type` is `webhook`."
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "required": [
          "type",
          "events",
          "webhook"
        ]
      },
      "PatchEventSubscriptionRequest": {
        "type": "object",
        "description": "Request body for updating an event subscription. This is a partial update: every field is\noptional and only the fields you send change. Changes to `status`, `events`, and `webhook.url`\napply only to events whose first delivery attempt happens after the update, so an event already\npending delivery still goes to the old configuration.\n",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/EventSubscriptionStatus"
          },
          "description": {
            "$ref": "#/components/schemas/EventSubscriptionDescription"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "events": {
            "$ref": "#/components/schemas/EventSubscriptionEvents"
          },
          "webhook": {
            "$ref": "#/components/schemas/PatchEventSubscriptionWebhook"
          }
        }
      },
      "RotateWebhookSecretRequest": {
        "type": "object",
        "description": "Request body for rotating a webhook signing secret. At most two secrets are active at a time, so\na `24_hour` rotation is rejected when the subscription already has two active secrets — request\nan immediate rotation instead.\n",
        "properties": {
          "expires_at": {
            "$ref": "#/components/schemas/WebhookSecretExpiration"
          }
        },
        "required": [
          "expires_at"
        ]
      },
      "LendingLoan": {
        "type": "object",
        "required": [
          "loan_amount",
          "loan_currency",
          "annual_percentage_rate",
          "customer_state",
          "customer_date_of_birth",
          "customer_is_mla",
          "customer_ofac_result",
          "customer_id"
        ],
        "properties": {
          "loan_amount": {
            "type": "number",
            "description": "The underwritten loan amount that gets approved."
          },
          "loan_currency": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "annual_percentage_rate": {
            "type": "number",
            "description": "The APR disclosed to the borrower at the time of signing loan documents."
          },
          "customer_state": {
            "type": "string",
            "enum": [
              "AL",
              "AK",
              "AZ",
              "AR",
              "CA",
              "CO",
              "CT",
              "DE",
              "FL",
              "GA",
              "HI",
              "ID",
              "IL",
              "IN",
              "IA",
              "KS",
              "KY",
              "LA",
              "ME",
              "MD",
              "MA",
              "MI",
              "MN",
              "MS",
              "MO",
              "MT",
              "NE",
              "NV",
              "NH",
              "NJ",
              "NM",
              "NY",
              "NC",
              "ND",
              "OH",
              "OK",
              "OR",
              "PA",
              "RI",
              "SC",
              "SD",
              "TN",
              "TX",
              "UT",
              "VT",
              "VA",
              "WA",
              "WV",
              "WI",
              "WY"
            ],
            "description": "Customer’s state"
          },
          "customer_date_of_birth": {
            "type": "string",
            "description": "Customer’s date of birth, in YYYY-MM-DD format.",
            "example": "2002-02-15"
          },
          "customer_is_mla": {
            "type": "boolean",
            "description": "Is the user is subject to the Military Lending Act?"
          },
          "customer_ofac_result": {
            "type": "string",
            "enum": [
              "passed",
              "failed"
            ],
            "description": "Did the user pass OFAC at the time of loan validation."
          },
          "customer_id": {
            "type": "string",
            "description": "Cash App’s user or customer ID"
          },
          "metadata": {
            "type": "object",
            "properties": {
              "client_loan_id": {
                "type": "string",
                "description": "Cash App’s loan ID"
              }
            }
          }
        }
      },
      "WireBeneficiary": {
        "type": "object",
        "description": "Wire beneficiary information.",
        "required": [
          "account_number",
          "name",
          "address_line_1"
        ],
        "properties": {
          "account_number": {
            "type": "string",
            "description": "The account number for the bank account.",
            "example": "1032345678",
            "maxLength": 17,
            "pattern": "^[a-zA-Z0-9 ]*[a-zA-Z0-9]+$"
          },
          "name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
          },
          "address_line_1": {
            "type": "string",
            "minLength": 3,
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
          },
          "address_line_2": {
            "type": "string",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
          },
          "address_line_3": {
            "type": "string",
            "maxLength": 35,
            "pattern": "^[ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*[\\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]][ \\w/\\-\\?:\\(\\)\\.,'\\+!@#$%^&\\*=`\\{\\|\\}~\";<>\\[\\\\\\]]*$"
          }
        }
      },
      "WireRefundType": {
        "type": "string",
        "description": "Type of refund for a wire payment.",
        "example": "full_refund",
        "enum": [
          "full_refund",
          "partial_refund"
        ]
      },
      "SubledgerBalance": {
        "type": "object",
        "required": [
          "account_id",
          "id",
          "client_subledger_balance_name",
          "currency_code",
          "created_at",
          "updated_at",
          "status",
          "status_reason",
          "type",
          "metadata",
          "details"
        ],
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Unique identifier for the account that the Subledger Balance belongs to.",
            "example": "account_v9K4p2M7nL1wQ8xR5zB6tY3jH0gA"
          },
          "id": {
            "type": "string",
            "description": "Lead-generated unique identifier for the Subledger Balance. This ID should subsequently be used when reporting on this object in the Balance file.",
            "example": "subledger_balance_k8L2n9QpW3xR5vT7mZ4jS1bA6cG"
          },
          "client_subledger_balance_name": {
            "type": "string",
            "description": "A name for the product or Subledger Balance being offered to the end-user (e.g., Rainy Day Fund, BNPL loan).",
            "example": "Personal Loan - Home Improvement"
          },
          "client_settlement_bank_account_id": {
            "type": "string",
            "description": "ID of the underlying settlement bank account where funds for the Subledger Balance are held. Only applicable for certain use cases.",
            "example": "12345"
          },
          "currency_code": {
            "$ref": "#/components/schemas/CurrencyCode"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "An ISO-8601 timestamp at which the Subledger Balance was created in Lead's system.",
            "example": "2025-09-02T11:01:36Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "An ISO-8601 timestamp at which the Subledger Balance was last updated in Lead's system.",
            "example": "2025-09-02T11:05:00Z"
          },
          "status": {
            "$ref": "#/components/schemas/SubledgerBalanceStatus"
          },
          "status_reason": {
            "type": "string",
            "description": "Reason associated with the status of the Subledger Balance.",
            "example": "active"
          },
          "type": {
            "$ref": "#/components/schemas/SubledgerBalanceType"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "details": {
            "$ref": "#/components/schemas/SubledgerBalanceCreditDetails"
          }
        }
      },
      "UserAccount": {
        "type": "object",
        "description": "A user account object",
        "readOnly": true,
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UserAccountID"
          },
          "status": {
            "$ref": "#/components/schemas/AccountStatus"
          },
          "status_reason": {
            "$ref": "#/components/schemas/AccountStatusReason"
          },
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "permissions": {
            "$ref": "#/components/schemas/UserAccountPermissions"
          },
          "entities": {
            "$ref": "#/components/schemas/UserAccountEntities"
          },
          "details": {
            "$ref": "#/components/schemas/UserAccountDetails"
          },
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/ComplianceDocument"
            }
          },
          "client_account_id": {
            "type": "string",
            "description": "Client-provided identifier for the account.\nOnly populated in GET /v1/user_accounts/{account_id} response.\n",
            "readOnly": true
          },
          "balance_sheet_model": {
            "$ref": "#/components/schemas/UserAccountBalanceSheetModel"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Creation timestamp",
            "readOnly": true
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last update timestamp",
            "readOnly": true
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the account was closed. Updated by /close endpoint.",
            "readOnly": true,
            "nullable": true
          }
        }
      },
      "CreateUserAccountRequest": {
        "type": "object",
        "description": "Request body for creating a new user account",
        "properties": {
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "permissions": {
            "$ref": "#/components/schemas/UserAccountPermissions"
          },
          "validate_underwriting_data": {
            "type": "boolean",
            "description": "Whether to validate underwriting data on creation. Required for POST."
          },
          "entities": {
            "$ref": "#/components/schemas/CreateUserAccountEntities"
          },
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "balance_sheet_model": {
            "$ref": "#/components/schemas/UserAccountBalanceSheetModel"
          },
          "details": {
            "type": "object",
            "description": "Additional details for the user account",
            "properties": {
              "underwriting": {
                "$ref": "#/components/schemas/UserAccountUnderwriting"
              },
              "adverse_action_notice": {
                "$ref": "#/components/schemas/AdverseActionNotice"
              }
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          }
        },
        "required": [
          "permissions",
          "validate_underwriting_data",
          "entities",
          "documents"
        ]
      },
      "PatchUserAccountRequest": {
        "type": "object",
        "description": "Request body for updating an existing user account",
        "properties": {
          "application_id": {
            "$ref": "#/components/schemas/ApplicationID"
          },
          "permissions": {
            "$ref": "#/components/schemas/UserAccountPermissions"
          },
          "product_name": {
            "type": "string",
            "description": "Partner's name for their product"
          },
          "balance_sheet_model": {
            "$ref": "#/components/schemas/UserAccountBalanceSheetModel"
          },
          "details": {
            "type": "object",
            "description": "Additional details for the user account",
            "properties": {
              "underwriting": {
                "$ref": "#/components/schemas/PatchUserAccountUnderwriting"
              },
              "adverse_action_notice": {
                "$ref": "#/components/schemas/AdverseActionNotice"
              }
            }
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "documents": {
            "type": "array",
            "description": "Array of associated legal or informational documents",
            "items": {
              "$ref": "#/components/schemas/CreateComplianceDocument"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
