{
  "openapi": "3.1.0",
  "info": {
    "title": "Stableyard Partner API",
    "version": "2.0.0",
    "x-stableyard-api-version": "2026-09-09",
    "x-stableyard-supported-api-versions": ["2026-09-09"],
    "summary": "Backend API for UPAs, Payments, activity, and optional financial products.",
    "description": "\nUse this API from a trusted partner backend with an app ID and app secret.\n\n## Recommended integration\n\n1. Call `GET /v2/partners/config` to verify credentials and discover enabled capabilities.\n2. Create a UPA only when your product needs a persistent Stableyard account.\n3. Create a receive or send Payment with `POST /v2/payments`.\n4. Redirect a payer to the returned `paymentUrl` or pass the Payment credentials to an official Stableyard interface SDK.\n5. Process signed webhooks and fetch the Payment by ID for reconciliation.\n\nCheckout execution and account-bound browser endpoints are documented in the separate Interfaces & SDKs reference.\n",
    "x-stableyard-documentation-surface": "partner"
  },
  "servers": [
    {
      "url": "https://prod-api.stableyard.fi",
      "description": "Production"
    },
    {
      "url": "https://staging-api-v2.stableyard.fi",
      "description": "Sandbox"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "x-displayName": "API authentication",
      "description": "Verify your app ID and app secret before calling UPA APIs."
    },
    {
      "name": "Accounts",
      "x-displayName": "UPA Accounts",
      "description": "Create Universal Payment Accounts and manage account settings."
    },
    {
      "name": "Deposit Addresses",
      "description": "Create reusable receive addresses and verify inbound deposits."
    },
    {
      "name": "Identity & KYC",
      "description": "Verify the UPA email and run identity verification. Managed vaults and fiat payment rails use this same verified UPA identity."
    },
    {
      "name": "Vaults",
      "description": "Create policy-controlled stablecoin vaults and manage policy updates for accounts."
    },
    {
      "name": "Payments",
      "description": "Create escrow-first payments, issue partner-authenticated send instructions or executions, power public checkout, and reconcile collection through final account settlement."
    },
    {
      "name": "Balances & Transactions",
      "description": "Read Stableyard-posted financial activity. Balances are ledger projections of activity Stableyard processed; they are not live balances of externally controlled wallets."
    }
  ],
  "paths": {
    "/v2/accounts/{accountId}/beneficiaries": {
      "get": {
        "tags": ["Accounts"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "listBankBeneficiaries",
        "summary": "List saved third-party bank beneficiaries",
        "description": "Requires v2:accounts. Tenant and sending-UPA scoped. Includes disabled entries; bank details are masked.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Beneficiaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["beneficiaries", "nextCursor"],
                  "properties": {
                    "beneficiaries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedBankBeneficiary"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$",
                      "nullable": true
                    }
                  }
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 200 response",
                    "value": {
                      "beneficiaries": [
                        {
                          "id": "beneficiary_123",
                          "accountId": "acct_123",
                          "label": "example",
                          "country": "example",
                          "currency": "USD",
                          "bankCode": "example",
                          "beneficiaryName": "Example account",
                          "accountNumberLast4": "exam",
                          "status": "active",
                          "verificationStatus": "verify_on_payment",
                          "version": 1,
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "disabledAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": "beneficiary_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Accounts"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "createBankBeneficiary",
        "summary": "Save a third-party bank beneficiary",
        "description": "Requires v2:accounts and app external-bank capability. Supports Individual UPAs in PH/PHP and VN/VND. Saves encrypted immutable details without provider side effects; verification happens on each Payment. Retrying changed input, including sender UPA, conflicts. Disable and create a replacement to change details.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[!-~]+$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBankBeneficiaryRequest"
              },
              "examples": {
                "example": {
                  "summary": "Save a third-party bank beneficiary request",
                  "value": {
                    "label": "example",
                    "country": "PH",
                    "currency": "PHP",
                    "bankCode": "example",
                    "accountNumber": "example",
                    "beneficiaryName": "Example account"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved beneficiary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["beneficiary"],
                  "properties": {
                    "beneficiary": {
                      "$ref": "#/components/schemas/SavedBankBeneficiary"
                    }
                  }
                },
                "examples": {
                  "example": {
                    "summary": "Save a third-party bank beneficiary 201 response",
                    "value": {
                      "beneficiary": {
                        "id": "beneficiary_123",
                        "accountId": "acct_123",
                        "label": "example",
                        "country": "example",
                        "currency": "USD",
                        "bankCode": "example",
                        "beneficiaryName": "Example account",
                        "accountNumberLast4": "exam",
                        "status": "active",
                        "verificationStatus": "verify_on_payment",
                        "version": 1,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "disabledAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/beneficiaries/{beneficiaryId}": {
      "get": {
        "tags": ["Accounts"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "getBankBeneficiary",
        "summary": "Get a masked bank beneficiary",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beneficiaryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Beneficiary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["beneficiary"],
                  "properties": {
                    "beneficiary": {
                      "$ref": "#/components/schemas/SavedBankBeneficiary"
                    }
                  }
                },
                "examples": {
                  "example": {
                    "summary": "Get a masked bank beneficiary 200 response",
                    "value": {
                      "beneficiary": {
                        "id": "beneficiary_123",
                        "accountId": "acct_123",
                        "label": "example",
                        "country": "example",
                        "currency": "USD",
                        "bankCode": "example",
                        "beneficiaryName": "Example account",
                        "accountNumberLast4": "exam",
                        "status": "active",
                        "verificationStatus": "verify_on_payment",
                        "version": 1,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "disabledAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Accounts"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "disableBankBeneficiary",
        "summary": "Disable a saved bank beneficiary",
        "description": "Requires v2:accounts. Idempotently disables future use and purges encrypted details. Existing prepared Payments retain their frozen destination. The masked record remains for history and create-idempotency replay.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "beneficiaryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled beneficiary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["beneficiary"],
                  "properties": {
                    "beneficiary": {
                      "$ref": "#/components/schemas/SavedBankBeneficiary"
                    }
                  }
                },
                "examples": {
                  "example": {
                    "summary": "Disable a saved bank beneficiary 200 response",
                    "value": {
                      "beneficiary": {
                        "id": "beneficiary_123",
                        "accountId": "acct_123",
                        "label": "example",
                        "country": "example",
                        "currency": "USD",
                        "bankCode": "example",
                        "beneficiaryName": "Example account",
                        "accountNumberLast4": "exam",
                        "status": "active",
                        "verificationStatus": "verify_on_payment",
                        "version": 1,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "disabledAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, authorization, conflict, or runtime error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List saved third-party bank beneficiaries 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/partners/kyc-reuse-policy": {
      "get": {
        "tags": ["Identity & KYC"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "getIdentityReusePolicy",
        "summary": "Read this app's identity reuse policy",
        "description": "Requires v2:kyc and app-secret authentication. Disabled until Stableyard configures the source and receiving identity applications, workflow and consent version. These are identity-provider application UUIDs, not Stableyard app IDs.",
        "responses": {
          "200": {
            "description": "Policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityReusePolicy"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 200 response",
                    "value": {
                      "enabled": true,
                      "version": 0,
                      "trustReview": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 502 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ]
      }
    },
    "/v2/accounts/{accountId}/kyc/imports": {
      "post": {
        "tags": ["Identity & KYC"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "importAccountIdentity",
        "summary": "Import an existing shared identity verification",
        "description": "Server-to-server, Individual UPA only. Requires v2:kyc, active app policy, verified UPA email and explicit consent. Review-first by default; caller cannot select trust mode. The share token is write-only and never stored. Identical Idempotency-Key/input returns the same operation; changed inputs conflict. Ambiguous outcomes are held for operator reconciliation and never blindly resubmitted. Approval requires approved person-bound AML checks, explicit compliance evidence/consent review and policy freshness limits. Missing checks remain blocked even when the source decision was approved. Consume verification.eligibility before using fiat rails; import success alone is not payment readiness.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportAccountIdentityRequest"
              },
              "examples": {
                "example": {
                  "summary": "Import an existing shared identity verification request",
                  "value": {
                    "shareToken": "eyJhbGciOiJIUzI1NiJ9.eyJzZXNzaW9uX2lkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwic2Vzc2lvbl9raW5kIjoidXNlciIsImZyb21fYXBwbGljYXRpb25faWQiOiIyMjIyMjIyMi0yMjIyLTQyMjItODIyMi0yMjIyMjIyMjIyMjIiLCJmb3JfYXBwbGljYXRpb25faWQiOiIzMzMzMzMzMy0zMzMzLTQzMzMtODMzMy0zMzMzMzMzMzMzMzMiLCJpYXQiOjAsImV4cCI6MX0.synthetic_invalid_signature",
                    "consent": {
                      "accepted": true,
                      "version": "v1",
                      "reference": "consent_receipt_123"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Durable import and current verification state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityImportResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Import an existing shared identity verification 200 response",
                    "value": {
                      "import": {
                        "id": "kyc_import_123",
                        "status": "submitting",
                        "nextAction": {
                          "type": "none"
                        }
                      },
                      "verification": {
                        "id": "kyc_123",
                        "accountId": "acct_123",
                        "status": "not_started",
                        "verificationUrl": "https://example.com",
                        "eligibility": {
                          "status": "eligible",
                          "verifiedAt": "2026-08-28T10:00:00.000Z",
                          "validUntil": "2026-08-28T10:00:00.000Z",
                          "revokedAt": "2026-08-28T10:00:00.000Z",
                          "reasonCode": "identity_eligibility_invalid"
                        },
                        "nextAction": {
                          "type": "none"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 502 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/kyc/imports/{importId}": {
      "get": {
        "tags": ["Identity & KYC"],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "operationId": "getAccountIdentityImport",
        "summary": "Read a tenant-bound identity import",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "importId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^kyc_import_[a-zA-Z0-9_-]+$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Import state without provider IDs, documents or credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityImportResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read a tenant-bound identity import 200 response",
                    "value": {
                      "import": {
                        "id": "kyc_import_123",
                        "status": "submitting",
                        "nextAction": {
                          "type": "none"
                        }
                      },
                      "verification": {
                        "id": "kyc_123",
                        "accountId": "acct_123",
                        "status": "not_started",
                        "verificationUrl": "https://example.com",
                        "eligibility": {
                          "status": "eligible",
                          "verifiedAt": "2026-08-28T10:00:00.000Z",
                          "validUntil": "2026-08-28T10:00:00.000Z",
                          "revokedAt": "2026-08-28T10:00:00.000Z",
                          "reasonCode": "identity_eligibility_invalid"
                        },
                        "nextAction": {
                          "type": "none"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 400 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 401 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 403 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 404 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 409 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 422 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 502 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Validation, access, consent, conflict, or provider failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Read this app's identity reuse policy 503 response",
                    "value": {
                      "error": {
                        "code": "bad_request",
                        "message": "The request is invalid",
                        "details": "example"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/partners/config": {
      "get": {
        "tags": ["Authentication"],
        "operationId": "getPartnerConfig",
        "x-displayName": "Get config",
        "summary": "Get partner configuration",
        "description": "\nUse this as your first call in each environment. It verifies the app ID/app secret and returns the partner's enabled modules, fee configuration, supported networks/assets, payment-method capability surface, webhook event catalog, and Vault settings.\n\nThis endpoint is read-only and returns no secrets. Payment methods are Payment-specific: create the Payment, then use its payment-methods endpoint for the exact methods available for that amount, destination, settlement, and capability snapshot.\n",
        "x-codeSamples": [
          {
            "lang": "curl",
            "label": "Get partner configuration",
            "source": "curl --request GET \"https://prod-api.stableyard.fi/v2/partners/config\" \\\n  --header \"Authorization: Basic <BASE64_APP_ID_COLON_APP_SECRET>\""
          }
        ],
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Partner configuration",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerConfig"
                },
                "examples": {
                  "example": {
                    "summary": "Get partner configuration 200 response",
                    "value": {
                      "id": "app_123",
                      "appId": "app_123",
                      "organizationId": "org_123",
                      "environmentId": "env_123",
                      "apiVersion": "2026-09-09",
                      "supportedApiVersions": ["2026-09-09"],
                      "namespace": "partner",
                      "scopes": [
                        "v2:accounts",
                        "v2:deposit_addresses",
                        "v2:payments"
                      ],
                      "credentialType": "standard",
                      "credentialMode": "app_secret",
                      "status": "active",
                      "modules": [
                        {
                          "id": "deposit_addresses",
                          "name": "Deposit Addresses",
                          "description": "Issue reusable receive addresses and track inbound deposits.",
                          "scopes": ["v2:deposit_addresses"],
                          "defaultEnabled": true,
                          "optional": true,
                          "entitled": true,
                          "credentialAllowed": true,
                          "operational": true,
                          "available": true,
                          "disabledReason": null
                        }
                      ],
                      "compliance": {
                        "partnerKyb": {
                          "status": "not_started",
                          "updatedAt": null
                        },
                        "requirements": {
                          "partnerFiatAccess": "kyb",
                          "individualUpaFiatAccess": "kyc",
                          "businessUpaFiatAccess": "kyb"
                        }
                      },
                      "fees": {
                        "partnerFeeBps": 25,
                        "partnerFeePercent": 0.25,
                        "platformFeeBps": 50,
                        "platformFeePercent": 0.5,
                        "totalFeeBps": 75,
                        "totalFeePercent": 0.75,
                        "model": "deducted_at_final_settlement",
                        "currency": "USD"
                      },
                      "networks": [
                        {
                          "code": "base",
                          "aliases": ["base", "base-mainnet", "8453"],
                          "chainFamily": "evm",
                          "chainId": 8453,
                          "depositAddresses": {
                            "supported": true,
                            "provider": null,
                            "operational": true,
                            "disabledReason": null
                          },
                          "connectedWallets": {
                            "supported": true
                          },
                          "settlement": {
                            "supported": true
                          },
                          "paymentCollection": {
                            "supported": true,
                            "provider": null,
                            "network": "base",
                            "configured": true,
                            "detectionMode": null,
                            "disabledReason": null
                          },
                          "defaultAsset": {
                            "symbol": "USDC",
                            "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                            "decimals": 6,
                            "kind": "token",
                            "minimumDeposit": {
                              "amount": "0.5",
                              "amountAtomic": "500000",
                              "inclusive": true
                            }
                          },
                          "supportedAssets": [
                            {
                              "symbol": "USDC",
                              "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                              "decimals": 6,
                              "kind": "token",
                              "minimumDeposit": {
                                "amount": "0.5",
                                "amountAtomic": "500000",
                                "inclusive": true
                              }
                            }
                          ]
                        }
                      ],
                      "capabilities": {
                        "accounts": {
                          "entitled": true,
                          "credentialAllowed": true,
                          "operational": true,
                          "available": true,
                          "disabledReason": null,
                          "availableToCredential": true,
                          "accountIdLookup": true,
                          "externalUserIdLookup": true,
                          "handles": true,
                          "connectedWallets": true,
                          "emailVerification": {
                            "mode": "stableyard_email_otp",
                            "partnerAssertionAllowed": true,
                            "version": 0
                          }
                        },
                        "depositAddresses": {
                          "entitled": true,
                          "credentialAllowed": true,
                          "operational": true,
                          "available": true,
                          "disabledReason": null,
                          "availableToCredential": true,
                          "supportedChainIds": [
                            42161,
                            1,
                            8453,
                            137,
                            56,
                            43114,
                            4663,
                            4217,
                            10103,
                            10002,
                            728126428,
                            10001
                          ],
                          "availableChainIds": [
                            42161,
                            1,
                            8453,
                            137,
                            56,
                            43114,
                            4663,
                            4217,
                            10103,
                            10002,
                            728126428,
                            10001
                          ],
                          "supportedNetworks": [
                            {
                              "code": "base",
                              "chainId": 8453,
                              "chainFamily": "evm",
                              "operational": true,
                              "disabledReason": null,
                              "assets": [
                                {
                                  "symbol": "USDC",
                                  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                                  "decimals": 6,
                                  "kind": "token",
                                  "minimumDeposit": {
                                    "amount": "0.5",
                                    "amountAtomic": "500000",
                                    "inclusive": true
                                  }
                                }
                              ]
                            }
                          ]
                        },
                        "payments": {
                          "entitled": true,
                          "credentialAllowed": true,
                          "operational": true,
                          "available": true,
                          "disabledReason": null,
                          "availableToCredential": true,
                          "capabilities": {
                            "crypto": true,
                            "onramp": {},
                            "externalQr": true,
                            "externalBank": true,
                            "card": true
                          },
                          "methods": {
                            "direct": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null
                            },
                            "routing": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null
                            },
                            "onramp": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null
                            },
                            "externalQr": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null,
                              "sourceChainIds": [1],
                              "destinationType": "external_qr",
                              "standaloneApi": false,
                              "countries": [
                                {
                                  "country": "PH",
                                  "countryName": "Philippines",
                                  "currency": "PHP",
                                  "currencyDecimals": 2,
                                  "rails": ["qr"],
                                  "minimumAmountAtomic": "1000000",
                                  "maximumAmountAtomic": "1000000",
                                  "enabled": true
                                }
                              ],
                              "preparationAvailable": true,
                              "paymentExecutionAvailable": true
                            },
                            "externalBank": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null,
                              "destinationType": "external_bank",
                              "standaloneApi": false,
                              "directoryEndpoint": "/v2/payments/external-bank/banks?country={country}",
                              "paymentSourceAssets": [
                                {
                                  "chainId": 8453,
                                  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                                  "assetSymbol": "USDC"
                                }
                              ],
                              "countries": [
                                {
                                  "country": "VN",
                                  "countryName": "Vietnam",
                                  "currency": "VND",
                                  "currencyDecimals": 0,
                                  "rails": ["bank_transfer"],
                                  "minimumAmountAtomic": "1000000",
                                  "maximumAmountAtomic": "1000000",
                                  "enabled": true
                                }
                              ],
                              "preparationAvailable": true,
                              "paymentExecutionAvailable": true
                            },
                            "card": {
                              "entitled": true,
                              "credentialAllowed": true,
                              "operational": true,
                              "available": true,
                              "disabledReason": null
                            }
                          },
                          "publicPaymentCreation": {
                            "enabled": true,
                            "authentication": "none",
                            "purpose": "fund_wallet_or_pay_enabled_upa",
                            "methods": ["crypto"],
                            "destinations": [
                              {
                                "chainId": 8453,
                                "networkCode": "base",
                                "chainName": "Base",
                                "chainFamily": "evm",
                                "assetSymbol": "USDC",
                                "tokenAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
                                "decimals": 6,
                                "assetKind": "token",
                                "logoUrl": null,
                                "minimumAmount": "10",
                                "maximumAmount": "1000",
                                "available": true,
                                "disabledReason": null
                              }
                            ],
                            "allowedFiatCurrencies": ["USD"],
                            "paymentTtlSeconds": 120,
                            "configureEndpoint": "example",
                            "createEndpoint": "/v2/public/apps/app_123/payments"
                          }
                        },
                        "balancesAndTransactions": {
                          "enabled": true,
                          "availableToCredential": true,
                          "balances": {
                            "enabled": true,
                            "availableToCredential": true
                          },
                          "transactions": {
                            "enabled": true,
                            "availableToCredential": true
                          }
                        },
                        "webhooks": {
                          "supportedEvents": [
                            "account.created",
                            "account.updated",
                            "bank_funding.completed",
                            "bank_funding.failed",
                            "compliance.action_required",
                            "compliance.submitted",
                            "compliance.approved",
                            "compliance.rejected",
                            "compliance.requires_intervention",
                            "deposit.detected",
                            "deposit.settled",
                            "deposit.failed",
                            "deposit.requires_intervention",
                            "deposit.reversed",
                            "kyc.session_created",
                            "kyc.updated",
                            "partner_kyc.requires_information",
                            "partner_kyc.information_submitted",
                            "partner_kyc.ready_to_submit",
                            "partner_kyc.submitted",
                            "partner_kyc.approved",
                            "partner_kyc.rejected",
                            "offramp_partner_account.linked",
                            "smart_wallet.active",
                            "smart_wallet.deployment_failed",
                            "smart_wallet.requires_intervention",
                            "vault.policy_active",
                            "vault.failed",
                            "vault.funding_posted",
                            "vault.funding_requires_intervention",
                            "vault.yield_supply_settled",
                            "vault.yield_supply_failed",
                            "payment.created",
                            "payment.requires_action",
                            "payment.processing",
                            "payment.accepted",
                            "payment.refund_pending",
                            "payment.partially_refunded",
                            "payment.refunded",
                            "payment.succeeded",
                            "payment.failed",
                            "payment.cancelled",
                            "payment.expired",
                            "payment.requires_intervention",
                            "payment.duplicate_received",
                            "payment.late_received",
                            "payment.settlement_returned"
                          ],
                          "recommendedEvents": [
                            "account.created",
                            "account.updated",
                            "bank_funding.completed",
                            "bank_funding.failed",
                            "compliance.action_required",
                            "compliance.approved",
                            "compliance.rejected",
                            "compliance.requires_intervention",
                            "deposit.detected",
                            "deposit.settled",
                            "deposit.reversed",
                            "deposit.requires_intervention",
                            "payment.processing",
                            "payment.accepted",
                            "payment.refund_pending",
                            "payment.partially_refunded",
                            "payment.refunded",
                            "payment.succeeded",
                            "payment.failed",
                            "payment.cancelled",
                            "payment.expired",
                            "payment.requires_intervention",
                            "payment.duplicate_received",
                            "payment.late_received",
                            "payment.settlement_returned"
                          ],
                          "eventGroups": [
                            {
                              "id": "accounts",
                              "label": "Accounts",
                              "events": ["account.created", "account.updated"]
                            },
                            {
                              "id": "deposits",
                              "label": "Deposits",
                              "events": [
                                "deposit.detected",
                                "deposit.settled",
                                "deposit.requires_intervention",
                                "deposit.reversed",
                                "deposit.failed"
                              ]
                            },
                            {
                              "id": "bank_funding",
                              "label": "Bank funding",
                              "events": [
                                "bank_funding.completed",
                                "bank_funding.failed"
                              ]
                            },
                            {
                              "id": "payments",
                              "label": "Payments",
                              "events": [
                                "payment.created",
                                "payment.requires_action",
                                "payment.processing",
                                "payment.accepted",
                                "payment.refund_pending",
                                "payment.partially_refunded",
                                "payment.refunded",
                                "payment.succeeded",
                                "payment.failed",
                                "payment.cancelled",
                                "payment.expired",
                                "payment.requires_intervention",
                                "payment.duplicate_received",
                                "payment.late_received",
                                "payment.settlement_returned"
                              ]
                            },
                            {
                              "id": "kyc",
                              "label": "KYC",
                              "events": [
                                "kyc.session_created",
                                "kyc.updated",
                                "partner_kyc.requires_information",
                                "partner_kyc.information_submitted",
                                "partner_kyc.ready_to_submit",
                                "partner_kyc.submitted",
                                "partner_kyc.approved",
                                "partner_kyc.rejected",
                                "offramp_partner_account.linked"
                              ]
                            },
                            {
                              "id": "compliance",
                              "label": "Compliance",
                              "events": [
                                "compliance.action_required",
                                "compliance.submitted",
                                "compliance.approved",
                                "compliance.rejected",
                                "compliance.requires_intervention"
                              ]
                            },
                            {
                              "id": "vaults",
                              "label": "Vaults",
                              "events": [
                                "vault.policy_active",
                                "vault.failed",
                                "vault.funding_posted",
                                "vault.funding_requires_intervention",
                                "vault.yield_supply_settled",
                                "vault.yield_supply_failed"
                              ]
                            },
                            {
                              "id": "smart_wallets",
                              "label": "Smart Wallets",
                              "events": [
                                "smart_wallet.active",
                                "smart_wallet.deployment_failed",
                                "smart_wallet.requires_intervention"
                              ]
                            }
                          ],
                          "signatures": {
                            "header": "x-stableyard-signature",
                            "timestampHeader": "x-stableyard-timestamp",
                            "deliveryHeader": "x-stableyard-delivery",
                            "eventHeader": "x-stableyard-event",
                            "scheme": "hmac-sha256",
                            "signedPayload": "<timestamp>.<deliveryId>.<eventId>.<rawBody>"
                          },
                          "deliveryPolicy": {
                            "guarantee": "at_least_once",
                            "retryableStatuses": [
                              408,
                              425,
                              429,
                              500,
                              502,
                              503,
                              504
                            ],
                            "maxAttempts": 3,
                            "localPrivateDestinationsAllowed": false,
                            "dedupe": {
                              "deliveryRetryHeader": "x-stableyard-delivery",
                              "eventHeader": "x-stableyard-event-id",
                              "resourceStrategy": "Use the event name plus the public resource id in the payload, such as depositId or paymentId, for business-level idempotency."
                            }
                          }
                        },
                        "vaults": {
                          "entitled": true,
                          "credentialAllowed": true,
                          "operational": true,
                          "available": true,
                          "scope": "v2:vaults",
                          "runtime": "enabled",
                          "disabledReason": null,
                          "ownershipModes": {
                            "external": true,
                            "stableyard": true
                          },
                          "managedApproval": {
                            "method": "email_otp",
                            "ready": true,
                            "disabledReason": null
                          },
                          "spendLimit": {
                            "defaultAmountAtomic": "500000000",
                            "maxAmountAtomic": "5000000000",
                            "currency": "USD",
                            "decimals": 6,
                            "period": "fixed_30_day"
                          },
                          "yieldProviders": ["none"],
                          "tokens": [
                            {
                              "symbol": "USDC",
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "decimals": 6
                            }
                          ],
                          "resourceVersion": null
                        }
                      },
                      "integrations": {
                        "clientApi": {
                          "enabled": true,
                          "availableToCredential": true
                        },
                        "webhooks": {
                          "enabled": true,
                          "availableToCredential": true
                        },
                        "partnerConsole": {
                          "enabled": true,
                          "availableToCredential": true
                        }
                      },
                      "links": {
                        "docs": "https://docs.stableyard.fi",
                        "openapi": "/v2/openapi/partners.json",
                        "dashboard": "https://dashboard.stableyard.fi"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts": {
      "post": {
        "tags": ["Accounts"],
        "operationId": "createAccount",
        "summary": "Create UPA",
        "description": "\nCreate a new Stableyard UPA for an individual or business. Pass your own stable `externalUserId` and the subject's legal classification in `subjectType`; Stableyard returns the canonical `account.id` used by account-scoped APIs. Choose the real subject represented by the UPA, not the owner of a connected wallet.\n\nYou may also pass initial wallets and an optional handle. If wallets are provided and none is marked preferred, the first settlement-supported wallet becomes the settlement wallet.\n\nYou may also pass `email` with `emailVerified`, equivalent to immediately calling `POST /accounts/{id}/email/verification-challenges` after creation. `emailVerified: true` asserts you already verified the address yourself and requires partner-asserted verification to be enabled for this app environment; `false` or omitted starts Stableyard's own OTP flow. A verified email belongs to one UPA per app environment: if another UPA already holds it, the request returns `409 account_email_already_registered` and no UPA is created.\n\nThis endpoint is create-only. An existing `externalUserId` returns `409 account_already_exists`. Retry an uncertain creation with the same `Idempotency-Key`; identical input returns the original result, while different input returns `409 idempotency_conflict`. Use the dedicated wallet, settlement, and handle endpoints for later mutations.\n",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[ -~]+$",
              "example": "account-user-123-v1"
            },
            "description": "Required retry key for account creation. Reusing the same key with identical input returns the original account; reusing it with different input returns `409 idempotency_conflict`."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExternalAccountRequest"
              },
              "examples": {
                "partnerUser": {
                  "summary": "Partner user",
                  "value": {
                    "externalUserId": "user_123",
                    "subjectType": "individual",
                    "handle": "alice",
                    "wallets": [
                      {
                        "address": "0x1111111111111111111111111111111111111111",
                        "chainId": 8453,
                        "label": "User wallet on Base"
                      },
                      {
                        "address": "0x2222222222222222222222222222222222222222",
                        "chainId": 42161,
                        "label": "User wallet on Arbitrum",
                        "isPreferredSettlement": true
                      }
                    ]
                  }
                },
                "businessAccount": {
                  "summary": "Business account",
                  "value": {
                    "externalUserId": "merchant_primary",
                    "subjectType": "business",
                    "handle": "merchant",
                    "wallets": [
                      {
                        "address": "0x2222222222222222222222222222222222222222",
                        "chainId": 42161,
                        "label": "Business treasury",
                        "isPreferredSettlement": true
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "UPA created, or the original result of an identical idempotent retry",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBundle"
                },
                "examples": {
                  "example": {
                    "summary": "Create UPA 201 response",
                    "value": {
                      "account": {
                        "id": "acct_123",
                        "externalUserId": "user_123",
                        "subjectType": "individual",
                        "status": "active",
                        "paymentAcceptance": {
                          "publicReceiveEnabled": false,
                          "version": 1
                        },
                        "metadata": {},
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "connectedWallets": [
                        {
                          "id": "wallet_123",
                          "accountId": "acct_123",
                          "kind": "evm",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": "Connected wallet",
                          "status": "active",
                          "ownershipVerificationStatus": "unverified",
                          "ownershipVerificationMethod": "eip712_signature",
                          "settlementProfileId": "settle_123",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The externalUserId already belongs to an account, the email is already registered with a different account, or the Idempotency-Key was previously used with different input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "accountAlreadyExists": {
                    "summary": "The external user already has a UPA",
                    "value": {
                      "error": {
                        "code": "account_already_exists",
                        "message": "An account already exists for this externalUserId",
                        "details": {
                          "externalUserId": "user_123"
                        }
                      }
                    }
                  },
                  "emailAlreadyRegistered": {
                    "summary": "The email is verified on a different UPA in this app environment",
                    "value": {
                      "error": {
                        "code": "account_email_already_registered",
                        "message": "This email is already registered with a different account",
                        "details": {
                          "accountId": "acct_123",
                          "email": "al***@example.com",
                          "nextAction": {
                            "type": "use_different_email"
                          }
                        }
                      }
                    }
                  },
                  "idempotencyConflict": {
                    "summary": "The retry key was reused with different input",
                    "value": {
                      "error": {
                        "code": "idempotency_conflict",
                        "message": "Idempotency key was reused with different input",
                        "details": {
                          "key": "account-user-123-v1"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/external/{externalUserId}": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getAccountByExternalUserId",
        "summary": "Get UPA by external user ID",
        "description": "Fetch the UPA using the partner-owned externalUserId supplied at creation. The lookup is scoped to the authenticated app and environment.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "externalUserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128,
              "example": "user_123"
            },
            "description": "Partner-owned external user id supplied when the UPA was created."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Account bundle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBundle"
                },
                "examples": {
                  "example": {
                    "summary": "Get UPA by external user ID 200 response",
                    "value": {
                      "account": {
                        "id": "acct_123",
                        "externalUserId": "user_123",
                        "subjectType": "individual",
                        "status": "active",
                        "paymentAcceptance": {
                          "publicReceiveEnabled": false,
                          "version": 1
                        },
                        "metadata": {},
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "connectedWallets": [
                        {
                          "id": "wallet_123",
                          "accountId": "acct_123",
                          "kind": "evm",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": "Connected wallet",
                          "status": "active",
                          "ownershipVerificationStatus": "unverified",
                          "ownershipVerificationMethod": "eip712_signature",
                          "settlementProfileId": "settle_123",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getAccountById",
        "summary": "Get UPA",
        "description": "Fetch the UPA, linked wallets, handle, settlement profile, and account settings.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Account bundle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBundle"
                },
                "examples": {
                  "example": {
                    "summary": "Get UPA 200 response",
                    "value": {
                      "account": {
                        "id": "acct_123",
                        "externalUserId": "user_123",
                        "subjectType": "individual",
                        "status": "active",
                        "paymentAcceptance": {
                          "publicReceiveEnabled": false,
                          "version": 1
                        },
                        "metadata": {},
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "connectedWallets": [
                        {
                          "id": "wallet_123",
                          "accountId": "acct_123",
                          "kind": "evm",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": "Connected wallet",
                          "status": "active",
                          "ownershipVerificationStatus": "unverified",
                          "ownershipVerificationMethod": "eip712_signature",
                          "settlementProfileId": "settle_123",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/display-profile": {
      "put": {
        "tags": ["Accounts"],
        "operationId": "updateAccountDisplayProfile",
        "summary": "Update UPA display profile",
        "description": "Set the name and logo payers see for this UPA. Updates use optimistic concurrency and apply only to future Payments; existing Payments keep the display captured when they were created. App branding continues to identify the integrating platform.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountDisplayProfileRequest"
              },
              "examples": {
                "example": {
                  "summary": "Update UPA display profile request",
                  "value": {
                    "displayName": "Acme Downtown",
                    "logoUrl": "https://cdn.example.com/acme-downtown.png",
                    "expectedVersion": 0,
                    "reason": "Update the payer-facing store identity."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account bundle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBundle"
                },
                "examples": {
                  "example": {
                    "summary": "Update UPA display profile 200 response",
                    "value": {
                      "account": {
                        "id": "acct_123",
                        "externalUserId": "user_123",
                        "subjectType": "individual",
                        "status": "active",
                        "paymentAcceptance": {
                          "publicReceiveEnabled": false,
                          "version": 1
                        },
                        "metadata": {},
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "connectedWallets": [
                        {
                          "id": "wallet_123",
                          "accountId": "acct_123",
                          "kind": "evm",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": "Connected wallet",
                          "status": "active",
                          "ownershipVerificationStatus": "unverified",
                          "ownershipVerificationMethod": "eip712_signature",
                          "settlementProfileId": "settle_123",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/payment-acceptance": {
      "put": {
        "tags": ["Accounts"],
        "operationId": "updateAccountPaymentAcceptance",
        "summary": "Manage public payment acceptance",
        "description": "Enable or disable the UPA's reusable public payment page. Enabling requires an active qualified payment handle, an eligible preferred settlement destination, and an enabled app-level public Payment policy. Public crypto receiving does not require KYC by default. Existing Payments remain immutable when this setting changes.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccountPaymentAcceptanceRequest"
              },
              "examples": {
                "example": {
                  "summary": "Manage public payment acceptance request",
                  "value": {
                    "publicReceiveEnabled": true,
                    "expectedVersion": 0,
                    "reason": "Requested by partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account bundle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBundle"
                },
                "examples": {
                  "example": {
                    "summary": "Manage public payment acceptance 200 response",
                    "value": {
                      "account": {
                        "id": "acct_123",
                        "externalUserId": "user_123",
                        "subjectType": "individual",
                        "status": "active",
                        "paymentAcceptance": {
                          "publicReceiveEnabled": false,
                          "version": 1
                        },
                        "metadata": {},
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "connectedWallets": [
                        {
                          "id": "wallet_123",
                          "accountId": "acct_123",
                          "kind": "evm",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": "Connected wallet",
                          "status": "active",
                          "ownershipVerificationStatus": "unverified",
                          "ownershipVerificationMethod": "eip712_signature",
                          "settlementProfileId": "settle_123",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/payment-handle": {
      "put": {
        "tags": ["Accounts"],
        "operationId": "setPaymentHandleByAccountId",
        "summary": "Set payment handle",
        "description": "Assign the account's payment handle once. Replaying the same handle is idempotent; assigning a different handle returns `409 payment_handle_immutable`. Handles are never released for reuse. A bare handle uses the authenticated app namespace, and a qualified namespace must match the authenticated app.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPaymentHandleRequest"
              },
              "examples": {
                "example": {
                  "summary": "Set payment handle request",
                  "value": {
                    "handle": "alice"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment handle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentHandle"
                },
                "examples": {
                  "example": {
                    "summary": "Set payment handle 200 response",
                    "value": {
                      "id": "handle_123",
                      "accountId": "acct_123",
                      "namespace": "partner",
                      "handle": "alice",
                      "status": "active",
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/wallets": {
      "post": {
        "tags": ["Accounts"],
        "operationId": "connectWalletsByAccountId",
        "summary": "Link wallet to UPA",
        "description": "Link one or more wallets. The first settlement-supported wallet becomes preferred settlement when the account has no settlement wallet yet; otherwise pass `isPreferredSettlement: true` to change it.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectWalletRequest"
              },
              "examples": {
                "example": {
                  "summary": "Link wallet to UPA request",
                  "value": {
                    "wallets": [
                      {
                        "address": "0x1111111111111111111111111111111111111111",
                        "chainId": 42161,
                        "label": "User wallet on Arbitrum",
                        "isPreferredSettlement": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Connected wallets",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConnectedWallet"
                  }
                },
                "examples": {
                  "example": {
                    "summary": "Link wallet to UPA 200 response",
                    "value": [
                      {
                        "id": "wallet_123",
                        "accountId": "acct_123",
                        "kind": "evm",
                        "chainId": 42161,
                        "address": "0x1111111111111111111111111111111111111111",
                        "label": "Connected wallet",
                        "status": "active",
                        "ownershipVerificationStatus": "unverified",
                        "ownershipVerificationMethod": "eip712_signature",
                        "settlementProfileId": "settle_123",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/settlement-destinations": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "listSettlementDestinationsByAccountId",
        "summary": "List settlement destinations",
        "description": "List typed destinations owned by the UPA. Each linked wallet appears as a `crypto_wallet` destination. A bank account or rail identifier can be selected once `capabilities.settlementSupported` is true.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "crypto_wallet",
                "bank_account",
                "payment_rail_identifier"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending_verification",
                "active",
                "restricted",
                "disabled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Settlement destinations",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementDestinationsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List settlement destinations 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "destinations": [
                        {
                          "id": "destination_123",
                          "accountId": "acct_123",
                          "type": "crypto_wallet",
                          "status": "active",
                          "preferred": true,
                          "capabilities": {
                            "directions": ["receive"],
                            "settlementSupported": true,
                            "unavailableReason": null,
                            "network": {
                              "code": "base",
                              "chainId": 8453,
                              "chainFamily": "evm"
                            },
                            "assets": [
                              {
                                "symbol": "USDC",
                                "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                                "decimals": 6
                              }
                            ]
                          },
                          "resource": {
                            "type": "crypto_wallet",
                            "connectedWalletId": "wallet_123",
                            "chainId": 8453,
                            "address": "0x1111111111111111111111111111111111111111",
                            "walletKind": "external",
                            "label": "Primary wallet",
                            "ownershipVerificationStatus": "unverified"
                          },
                          "disabledAt": null,
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/bank-account-requirements": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getBankAccountRequirements",
        "summary": "Get country-specific bank fields and linking availability",
        "description": "Validate input against each country's `schema` before linking. `available` is true when bank linking is enabled for your app in that country; a country with `available: false` cannot be linked, and `unavailableReason` says why. Availability can change between calls, so handle a failed link even when `available` was true. Use the bank's ISO country code (for example `DE`), not a regional code such as `EU`.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Bank field requirements",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountRequirementsResponse"
                },
                "examples": {
                  "requirements": {
                    "value": {
                      "version": 1,
                      "accountId": "acct_123",
                      "countries": [
                        {
                          "country": "VN",
                          "name": "Vietnam",
                          "currency": "VND",
                          "implementation": "supported",
                          "schema": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "country": {
                                "type": "string",
                                "const": "VN"
                              },
                              "currency": {
                                "type": "string",
                                "const": "VND"
                              },
                              "accountHolderName": {
                                "type": "string",
                                "title": "Recipient name",
                                "minLength": 1,
                                "maxLength": 160,
                                "x-normalize": "vietnam_name"
                              },
                              "beneficiaryType": {
                                "type": "string",
                                "title": "Beneficiary type",
                                "enum": ["individual", "business"],
                                "default": "individual"
                              },
                              "bankName": {
                                "type": "string",
                                "title": "Bank name",
                                "minLength": 1,
                                "maxLength": 160
                              },
                              "bankCode": {
                                "type": "string",
                                "title": "Bank code",
                                "minLength": 1,
                                "maxLength": 64,
                                "pattern": "^[A-Za-z0-9_-]+$",
                                "x-bank-directory": true
                              },
                              "accountNumber": {
                                "type": "string",
                                "title": "Account number",
                                "minLength": 4,
                                "maxLength": 34,
                                "pattern": "^[0-9]{4,34}$",
                                "writeOnly": true,
                                "x-normalize": "digits"
                              },
                              "rail": {
                                "type": "string",
                                "const": "bank_transfer",
                                "default": "bank_transfer"
                              }
                            },
                            "required": [
                              "country",
                              "currency",
                              "accountHolderName",
                              "bankName",
                              "bankCode",
                              "accountNumber"
                            ]
                          },
                          "alternatives": [],
                          "available": true,
                          "unavailableReason": null
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/bank-account-banks": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "listLinkedBankBanks",
        "summary": "List banks for linking an account",
        "description": "Requires the v2:accounts scope and bank linking enabled for your app. Available for countries with a bank directory: the Philippines and Vietnam. Returns bank codes and names only; this read does not verify ownership or create a payout.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{2}$",
              "example": "PH"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Bank directory",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedBankDirectoryResponse"
                },
                "examples": {
                  "directory": {
                    "value": {
                      "country": "PH",
                      "currency": "PHP",
                      "banks": [
                        {
                          "code": "directory_code",
                          "name": "Example Bank"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/bank-accounts": {
      "post": {
        "tags": ["Accounts"],
        "operationId": "createBankAccountByAccountId",
        "summary": "Link a bank account using its country-specific fields",
        "description": "Read bank-account-requirements for country-specific fields and availability. Linking is available for United States, Philippines and Vietnam bank accounts. An individual UPA needs approved KYC; a business UPA can link a US/USD bank after its hosted KYB is approved. Both require bank linking to be enabled for your app. A linked bank is a saved beneficiary, including a supplier, contractor or the UPA subject's own bank; linking does not prove ownership by the UPA subject. Bank details are stored encrypted. US bank accounts are also set up for payouts; the response's `provisioning` object reports progress and any `nextAction`. Philippines links stay pending verification; directory membership never verifies account ownership. Vietnam beneficiary details are verified during linking. To pay a linked bank, create a send Payment with its `bankAccountId`; received funds do not settle to a linked bank automatically. Full bank details are never returned; responses show `accountNumberLast4`. Reuse the same Idempotency-Key with identical normalized input; changed input conflicts.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "example": "bank-beneficiary-supplier-123"
            },
            "description": "Required retry key for linking a bank account or rail identifier: 1-256 characters after trimming surrounding whitespace. Retry the identical request with the same key; changed input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBankAccountRequest"
              },
              "examples": {
                "usdBankAccount": {
                  "summary": "US checking account",
                  "value": {
                    "accountHolderName": "Alice Doe",
                    "beneficiaryType": "individual",
                    "country": "US",
                    "currency": "USD",
                    "bankName": "Example Bank",
                    "accountNumber": "000123456789",
                    "accountType": "checking",
                    "routing": {
                      "type": "aba",
                      "routingNumber": "123456780"
                    },
                    "rail": "ach",
                    "beneficiaryAddress": {
                      "street1": "1 Market Street",
                      "city": "San Francisco",
                      "region": "CA",
                      "postalCode": "94105",
                      "country": "US"
                    },
                    "bankAddress": {
                      "street1": "1 Example Plaza",
                      "city": "Springfield",
                      "region": "IL",
                      "postalCode": "62701",
                      "country": "US"
                    }
                  }
                },
                "philippinesBankAccount": {
                  "summary": "Philippines account saved pending verification",
                  "description": "Synthetic bank values. Replace bankCode and bankName with a matching pair from the account-scoped linked-bank directory.",
                  "value": {
                    "country": "PH",
                    "currency": "PHP",
                    "accountHolderName": "Test Person",
                    "beneficiaryType": "individual",
                    "bankName": "Test Bank",
                    "bankCode": "directory_code",
                    "accountNumber": "0000123456",
                    "rail": "bank_transfer"
                  }
                },
                "vietnamBankAccount": {
                  "summary": "Vietnam account with standalone beneficiary verification",
                  "description": "Synthetic bank values. Use a Vietnam directory entry and the registered beneficiary name. Requires Vietnam bank linking to be enabled for your app.",
                  "value": {
                    "country": "VN",
                    "currency": "VND",
                    "accountHolderName": "TEST PERSON",
                    "beneficiaryType": "individual",
                    "bankName": "Test Bank",
                    "bankCode": "directory_code",
                    "accountNumber": "0000123456",
                    "rail": "bank_transfer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Linked bank account",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBankAccountResponse"
                },
                "examples": {
                  "linkedBankAccount": {
                    "summary": "Linked bank account",
                    "value": {
                      "bankAccount": {
                        "id": "bank_account_123",
                        "accountId": "acct_123",
                        "accountHolderName": "Alice Doe",
                        "country": "US",
                        "currency": "USD",
                        "bankName": "Example Bank",
                        "accountNumberLast4": "1234",
                        "rail": "ach",
                        "status": "active",
                        "verification": {
                          "version": 1,
                          "verifiedAt": "2026-09-01T10:00:00.000Z"
                        },
                        "disabledAt": null,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "settlementDestination": {
                        "id": "destination_123",
                        "accountId": "acct_123",
                        "type": "bank_account",
                        "status": "restricted",
                        "preferred": false,
                        "capabilities": {
                          "directions": ["receive"],
                          "settlementSupported": false,
                          "unavailableReason": "linked_bank_receive_settlement_not_enabled",
                          "country": "US",
                          "currency": "USD",
                          "rail": "ach"
                        },
                        "resource": {
                          "type": "bank_account",
                          "bankAccount": {
                            "id": "bank_account_123",
                            "accountId": "acct_123",
                            "accountHolderName": "Alice Doe",
                            "country": "US",
                            "currency": "USD",
                            "bankName": "Example Bank",
                            "accountNumberLast4": "1234",
                            "rail": "ach",
                            "status": "active",
                            "verification": {
                              "version": 1,
                              "verifiedAt": "2026-09-01T10:00:00.000Z"
                            },
                            "disabledAt": null,
                            "createdAt": "2026-08-28T10:00:00.000Z",
                            "updatedAt": "2026-08-28T10:00:00.000Z"
                          }
                        },
                        "disabledAt": null,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "provisioning": {
                        "providerProvisioningCompleted": true,
                        "settlementReady": false,
                        "nextAction": {
                          "type": "none"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Accounts"],
        "operationId": "listBankAccountsByAccountId",
        "summary": "List linked bank accounts",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending_verification",
                "active",
                "restricted",
                "disabled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Linked bank accounts",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List linked bank accounts 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "bankAccounts": [
                        {
                          "id": "bank_account_123",
                          "accountId": "acct_123",
                          "accountHolderName": "Alice Doe",
                          "country": "US",
                          "currency": "USD",
                          "bankName": "Example Bank",
                          "bankCode": "example",
                          "accountNumberLast4": "1234",
                          "rail": "ach",
                          "status": "pending_verification",
                          "verification": {
                            "version": 0,
                            "verifiedAt": null
                          },
                          "disabledAt": null,
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/bank-accounts/{bankAccountId}": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getBankAccountById",
        "summary": "Get linked bank account",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Linked bank account",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get linked bank account 200 response",
                    "value": {
                      "bankAccount": {
                        "id": "bank_account_123",
                        "accountId": "acct_123",
                        "accountHolderName": "Alice Doe",
                        "country": "US",
                        "currency": "USD",
                        "bankName": "Example Bank",
                        "bankCode": "example",
                        "accountNumberLast4": "1234",
                        "rail": "ach",
                        "status": "pending_verification",
                        "verification": {
                          "version": 0,
                          "verifiedAt": null
                        },
                        "disabledAt": null,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "tags": ["Accounts"],
        "operationId": "disableBankAccountById",
        "summary": "Disable linked bank account",
        "description": "Disable the bank account for future use. Financial history and masked identity are retained. Stableyard deletes the full bank details 30 days after you disable the account, or later if a payout to it is still settling. Repeated disables preserve the original disable date. A preferred destination must be changed first.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "bankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Disabled bank account",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BankAccountResponse"
                },
                "examples": {
                  "disabled": {
                    "summary": "Disabled bank account",
                    "value": {
                      "bankAccount": {
                        "id": "bank_account_123",
                        "accountId": "acct_123",
                        "accountHolderName": "Alice Doe",
                        "country": "US",
                        "currency": "USD",
                        "bankName": "Example Bank",
                        "accountNumberLast4": "1234",
                        "rail": "ach",
                        "status": "disabled",
                        "verification": {
                          "version": 1,
                          "verifiedAt": "2026-09-01T10:00:00.000Z"
                        },
                        "disabledAt": "2026-09-20T10:00:00.000Z",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-09-20T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/onramp-bank-account-requirements": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getOnrampBankAccountRequirements",
        "summary": "Discover on-ramp bank account options",
        "description": "Returns the USD funding-account rails enabled for this app and environment, and the UPA's connected wallets on supported destination chains with their supported assets. Call this before rendering the creation form and disclose developerFeeBps: new USD funding accounts use 25 bps (0.25%), deducted from incoming deposits before conversion. Existing facilities retain their stored pricing; null means not confirmed. The current delivery allowlist is Arbitrum One USDC in production and Arbitrum Sepolia USDC in sandbox; read supportedDestinations and destinations for this environment rather than using the general network catalog. Availability also depends on your app's enabled products and markets. When no rail, access, or eligible destination is available, the response returns available: false with a reason; other failures return a normal HTTP error. Issuing an account also requires the UPA's `bank_onramp` capability to be active, and rejects unsupported destination chain/asset pairs with payment_method_not_supported.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "On-ramp bank account requirements",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnrampBankAccountRequirements"
                },
                "examples": {
                  "example": {
                    "summary": "Discover on-ramp bank account options 200 response",
                    "value": {
                      "developerFeeBps": 25,
                      "accountId": "acct_123",
                      "recipientOnFile": true,
                      "available": true,
                      "unavailableReason": null,
                      "supportedDestinations": [
                        {
                          "chainId": 42161,
                          "networkName": "Arbitrum One",
                          "assetCodes": ["USDC"]
                        }
                      ],
                      "recipientTypes": ["individual"],
                      "rails": [
                        {
                          "rail": "ach",
                          "country": "US",
                          "currency": "USD"
                        }
                      ],
                      "destinations": [
                        {
                          "connectedWalletId": "wallet_123",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "label": null,
                          "assetCodes": ["USDC"]
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/onramp-bank-accounts": {
      "post": {
        "tags": ["Accounts"],
        "operationId": "createOnrampBankAccountByAccountId",
        "summary": "Issue a persistent on-ramp bank account (US)",
        "description": "Issues a persistent US bank account (ACH, FedWire, or FedNow) for this UPA. Any inbound wire to the returned account automatically converts to the chosen crypto asset and delivers on-chain to the UPA's connected wallet -- there is no separate settlement step, and the account is reusable indefinitely for repeated deposits. Requires the UPA's `bank_onramp` capability to be active and an active connected wallet on a supported destination chain/asset pair; unsupported chain/asset combinations are rejected with `payment_method_not_supported`. A UPA holds one on-ramp bank account. Repeating the request for the account that already exists returns it rather than issuing a second set of banking coordinates for the same person -- this is a standing facility, not a bounded Payment. Its delivery wallet, chain and asset are fixed at issuance: a request naming a different connected wallet, chain or destination asset is rejected with `409`, and an existing account cannot be re-pointed. New USD funding accounts carry a server-owned 25 bps (0.25%) developer fee on each incoming deposit before conversion; callers cannot override it. The rate is frozen at issuance. Returning an existing account preserves its pricing, including null for unconfirmed legacy pricing. Banking provider costs are separate, and this does not change Payment fees. This response exposes only the bank name and the last 4 account digits; call the deposit-instructions endpoint to get the full details to show the account holder.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 256,
              "pattern": "^[^\\u0000-\\u001f\\u007f]+$",
              "example": "bank-funding-account-123-v1"
            },
            "description": "Required retry key for funding-account issuance: 8-256 printable characters after trimming surrounding whitespace. Retry the identical request with the same key after a timeout or provisioning response; changed input returns `409 idempotency_conflict`."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOnrampBankAccountRequest"
              },
              "examples": {
                "example": {
                  "summary": "Issue a persistent on-ramp bank account (US) request",
                  "value": {
                    "connectedWalletId": "wallet_abc123",
                    "destinationAssetCode": "USDC",
                    "rail": "ach",
                    "recipientType": "individual",
                    "recipientName": "Example account",
                    "recipientAddress": {
                      "street1": "example",
                      "street2": "example",
                      "street3": "example",
                      "city": "example",
                      "region": "example",
                      "postalCode": "example",
                      "country": "US"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "On-ramp bank account",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnrampBankAccount"
                },
                "examples": {
                  "example": {
                    "summary": "Issue a persistent on-ramp bank account (US) 200 response",
                    "value": {
                      "id": "onramp_acct_123",
                      "accountId": "acct_123",
                      "status": "provisioning",
                      "rail": null,
                      "sourceAsset": "USD",
                      "destinationAssetCode": "USDC",
                      "destinationChainId": 42161,
                      "connectedWalletId": "connectedwallet_123",
                      "developerFeeBps": 25,
                      "bankName": null,
                      "accountNumberLast4": null,
                      "createdAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Accounts"],
        "operationId": "listOnrampBankAccountsByAccountId",
        "summary": "List on-ramp bank accounts",
        "description": "List the persistent on-ramp bank accounts issued for this UPA. A UPA has at most one active on-ramp bank account, with its delivery wallet, chain and asset fixed at issuance.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "On-ramp bank accounts",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnrampBankAccountsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List on-ramp bank accounts 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "onrampBankAccounts": [
                        {
                          "id": "onramp_acct_123",
                          "accountId": "acct_123",
                          "status": "provisioning",
                          "rail": null,
                          "sourceAsset": "USD",
                          "destinationAssetCode": "USDC",
                          "destinationChainId": 42161,
                          "connectedWalletId": "connectedwallet_123",
                          "developerFeeBps": 25,
                          "bankName": null,
                          "accountNumberLast4": null,
                          "createdAt": "2026-08-28T10:00:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/onramp-bank-accounts/{onrampBankAccountId}/deposit-instructions": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getOnrampDepositInstructions",
        "summary": "Get deposit instructions for an on-ramp bank account",
        "description": "Returns the full bank details (beneficiary name, bank, ABA routing number, account number) the account holder should send funds to. This is the only endpoint that returns the full account number: call it from your backend, show the details to the account holder, and never log or store them. Responses are marked `Cache-Control: no-store, private`. The requested rail is returned as rail; acceptedRails lists the rails issued on the facility and currently enabled for the app. Only an `active` bank account has instructions; any other status returns `409`.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "onrampBankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "onramp_acct_123"
            },
            "description": "Id returned when the on-ramp bank account was issued."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit instructions",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnrampDepositInstructions"
                },
                "examples": {
                  "example": {
                    "summary": "Get deposit instructions for an on-ramp bank account 200 response",
                    "value": {
                      "id": "onramp_acct_123",
                      "accountId": "acct_123",
                      "rail": null,
                      "acceptedRails": ["ach", "fedwire", "fednow"],
                      "currency": "USD",
                      "developerFeeBps": 25,
                      "destination": {
                        "assetCode": "USDC",
                        "chainId": 42161
                      },
                      "beneficiary": {
                        "name": "Jane Customer"
                      },
                      "bank": {
                        "name": "Example Bank",
                        "phone": "example",
                        "abaRoutingNumber": "000000000",
                        "accountNumber": "9990005543",
                        "accountType": "checking"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/onramp-bank-accounts/{onrampBankAccountId}/transactions": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "listOnrampBankFundingTransactions",
        "summary": "List bank funding transactions",
        "description": "Lists the conversions for one on-ramp bank account, newest first: each incoming USD transfer, its status, the stablecoin amount delivered, and the on-chain transaction hash once known. The hash can appear a short time after `succeeded`. developerFee reports the actual fee confirmed by the banking provider, as an exact decimal amount and currency, or null when unconfirmed. It is not calculated from the facility rate and does not prove a fee payout to Stableyard. This is the source of truth behind the `bank_funding.completed` and `bank_funding.failed` webhooks.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "onrampBankAccountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "onramp_acct_123"
            },
            "description": "Id returned when the on-ramp bank account was issued."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Bank funding transactions",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnrampBankFundingTransactionsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List bank funding transactions 200 response",
                    "value": {
                      "onrampBankAccountId": "acct_123",
                      "transactions": [
                        {
                          "id": "onramp_txn_123",
                          "onrampBankAccountId": "acct_123",
                          "status": "pending",
                          "sourceAmount": "100.00",
                          "sourceAsset": "USD",
                          "destinationAmount": "99.50",
                          "destinationAssetCode": "USDC",
                          "developerFee": null,
                          "destinationTxHash": null,
                          "createdAt": "2026-08-28T10:00:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/settlement-profile": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getSettlementProfileByAccountId",
        "summary": "Get settlement preference",
        "description": "Return the UPA's current preferred settlement profile, or `null` when no eligible destination has been selected.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Current settlement profile",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementProfileResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get settlement preference 200 response",
                    "value": {
                      "settlementProfile": {
                        "id": "settle_123",
                        "accountId": "acct_123",
                        "version": 2,
                        "connectedWalletId": "wallet_123",
                        "settlementDestinationId": "destination_123",
                        "status": "active",
                        "destinationType": "connected_wallet",
                        "chainId": 42161,
                        "destinationAddress": "0x1111111111111111111111111111111111111111",
                        "assetSymbol": "USDC",
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "snapshot": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "tags": ["Accounts"],
        "operationId": "setSettlementProfileByAccountId",
        "summary": "Set account settlement preference",
        "description": "Choose an active typed settlement destination returned by `GET /v2/accounts/{accountId}/settlement-destinations`. Unverified bank and rail destinations are rejected. Repeating the same preference returns the existing profile. Existing deposits and Payments keep their immutable snapshot.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSettlementProfileRequest"
              },
              "examples": {
                "example": {
                  "summary": "Set account settlement preference request",
                  "value": {
                    "settlementDestinationId": "destination_123",
                    "assetSymbol": "USDC"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Settlement profile",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementProfile"
                },
                "examples": {
                  "example": {
                    "summary": "Set account settlement preference 200 response",
                    "value": {
                      "id": "settle_123",
                      "accountId": "acct_123",
                      "version": 2,
                      "connectedWalletId": "wallet_123",
                      "settlementDestinationId": "destination_123",
                      "status": "active",
                      "destinationType": "connected_wallet",
                      "chainId": 42161,
                      "destinationAddress": "0x1111111111111111111111111111111111111111",
                      "assetSymbol": "USDC",
                      "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                      "snapshot": {}
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/payment-source": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getPaymentSourceByAccountId",
        "summary": "Get payment source",
        "description": "Return the UPA's current source for outgoing Payments, or `null` when no source is configured.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Current payment source",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSourceResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get payment source 200 response",
                    "value": {
                      "paymentSource": {
                        "id": "source_123",
                        "accountId": "acct_123",
                        "version": 1,
                        "type": "connected_wallet",
                        "chainId": 42161,
                        "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                        "sourceAddress": "0x3333333333333333333333333333333333333333",
                        "sourceRef": "wallet_123",
                        "assetSymbol": "USDC",
                        "status": "active"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "tags": ["Accounts"],
        "operationId": "setPaymentSourceByAccountId",
        "summary": "Set account payment source",
        "description": "Choose the already linked connected wallet or active account Vault that funds outgoing account payments. This is separate from settlement preference: settlement controls where incoming money lands, while payment source controls where outgoing payments spend from. A Vault source must be active with an active policy; Vault sends do not require a per-send wallet signature, but every execution still passes policy, token, spend-window, and mandate checks. Repeating the same source returns the existing active preference.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPaymentSourceRequest"
              },
              "examples": {
                "connected-wallet-source": {
                  "summary": "Connected wallet source",
                  "value": {
                    "type": "connected_wallet",
                    "connectedWalletId": "wallet_123",
                    "assetSymbol": "USDC"
                  }
                },
                "vault-source": {
                  "summary": "Vault source",
                  "value": {
                    "type": "vault",
                    "vaultId": "vault_123",
                    "assetSymbol": "USDC"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment source",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentSourcePreference"
                },
                "examples": {
                  "example": {
                    "summary": "Set account payment source 200 response",
                    "value": {
                      "id": "source_123",
                      "accountId": "acct_123",
                      "version": 1,
                      "type": "connected_wallet",
                      "chainId": 42161,
                      "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                      "sourceAddress": "0x3333333333333333333333333333333333333333",
                      "sourceRef": "wallet_123",
                      "assetSymbol": "USDC",
                      "status": "active"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/deposit-networks": {
      "get": {
        "tags": ["Deposit Addresses"],
        "operationId": "listDepositNetworks",
        "summary": "List deposit networks",
        "description": "\nLists supported reusable-deposit networks, each asset's minimum and configured cap, current commercial rates, and indicative Routing liquidity.\n\n- `live` reports whether this network's deposit-address rail is operational; a particular cross-chain route can still be unavailable.\n- A catalogued network with `live: false` cannot issue a new address. Existing addresses and deposits remain visible and continue through reconciliation; inspect `depositAddresses.disabledReason`.\n- `minimumDeposit` is the smallest accepted source amount. Smaller transfers are detected but ignored and remain on the address.\n- Native BNB deposits are paused by default and omitted from supported assets. Unexpected native BNB arrivals are recorded as ignored with reason `native_bnb_deposits_paused`; BNB-chain USDC/USDT and historical deposits remain supported.\n- `configuredMaximumDeposit` is the enforced per-deposit cap, or `null` when no cap is set. Larger confirmed deposits require manual review.\n- `maximumDeposit` is the largest amount currently expected to settle, not a guarantee. Use `configuredMaximumDeposit` for the enforced cap.\n- `liquidity.available` is a read-only sample of Routing quotes, or `null` when not measured. Check `checkedAt` for freshness; do not use it as payment acceptance evidence.\n- `fees` gives the authenticated organization's current platform and partner basis-point rates and fee basis. Rates freeze on deposit detection. Network and Routing costs can change the eventual settlement amount.\n\nRead-only and safe to cache for a minute.\n",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit networks",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositNetworksResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List deposit networks 200 response",
                    "value": {
                      "networks": [
                        {
                          "code": "ethereum",
                          "aliases": ["example"],
                          "chainFamily": "evm",
                          "chainId": 1,
                          "live": true,
                          "depositAddresses": {
                            "operational": true,
                            "disabledReason": null
                          },
                          "supportedAssets": [
                            {
                              "symbol": "USDT",
                              "tokenAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                              "decimals": 6,
                              "kind": "token",
                              "feeModel": {
                                "version": 3,
                                "basis": "verified_destination_receipt"
                              },
                              "minimumDeposit": {
                                "amount": "0.5",
                                "amountAtomic": "500000",
                                "inclusive": true
                              },
                              "maximumDeposit": {
                                "amount": "10240",
                                "amountAtomic": "10240000000",
                                "inclusive": true,
                                "basis": "liquidity"
                              },
                              "configuredMaximumDeposit": {
                                "amount": "1000",
                                "amountAtomic": "1000000000",
                                "inclusive": true
                              },
                              "liquidity": {
                                "available": null,
                                "checkedAt": null
                              },
                              "sourceDeduction": {
                                "amount": "2",
                                "amountAtomic": "2000000",
                                "reason": "btc_fee_reserve"
                              },
                              "sourceSetupCharge": {
                                "amount": "2",
                                "amountAtomic": "2000000",
                                "reason": "tron_address_setup",
                                "frequency": "once_per_address"
                              }
                            }
                          ]
                        }
                      ],
                      "fees": {
                        "version": 3,
                        "basis": "verified_destination_receipt",
                        "partnerFeeBps": 0,
                        "platformFeeBps": 0,
                        "totalFeeBps": 0
                      },
                      "refreshedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ]
      }
    },
    "/v2/accounts/{accountId}/deposit-addresses": {
      "post": {
        "tags": ["Deposit Addresses"],
        "operationId": "createDepositAddressByAccountId",
        "summary": "Create deposit addresses",
        "description": "Create or reuse receive addresses for one or more currently live chains. Send `chainIds` as an array after discovering availability through GET /v2/deposit-networks. The response lists the supported assets for each address. If any requested chain is paused, the entire batch fails before an address is provisioned.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "example": "deposit-address-user-123"
            },
            "description": "Optional retry key for create/generate calls. Reusing the same key with different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDepositAddressRequest"
              },
              "examples": {
                "example": {
                  "summary": "Create deposit addresses request",
                  "value": {
                    "chainIds": [42161, 8453]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deposit addresses",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositAddressesResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Create deposit addresses 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "depositAddresses": [
                        {
                          "id": "deposit_addr_123",
                          "accountId": "acct_123",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "supportedAssets": [
                            {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            }
                          ],
                          "metadata": {
                            "networkCode": "arbitrum",
                            "chainFamily": "evm"
                          },
                          "status": "active"
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Deposit Addresses"],
        "operationId": "listDepositAddressesByAccountId",
        "summary": "List deposit addresses",
        "description": "List reusable receive addresses created for the account.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["active", "disabled"]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit addresses",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositAddressesResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List deposit addresses 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "depositAddresses": [
                        {
                          "id": "deposit_addr_123",
                          "accountId": "acct_123",
                          "chainId": 42161,
                          "address": "0x1111111111111111111111111111111111111111",
                          "supportedAssets": [
                            {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            }
                          ],
                          "metadata": {
                            "networkCode": "arbitrum",
                            "chainFamily": "evm"
                          },
                          "status": "active"
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/deposit-addresses/check": {
      "post": {
        "tags": ["Deposit Addresses"],
        "operationId": "checkDepositTransactionByAccountId",
        "summary": "Verify and record deposit transaction",
        "description": "Check a transaction hash/signature and record it when it is a supported deposit to the account receive address. Manual verification is implemented for Arbitrum, Ethereum, Base, Polygon, and BNB Chain EVM transactions; Solana signatures; Movement transaction hashes; and Bitcoin transaction IDs. Tron deposits are webhook-detected and cannot use this manual check endpoint. This endpoint verifies evidence independently and does not replace automatic deposit detection.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckDepositTransactionRequest"
              },
              "examples": {
                "example": {
                  "summary": "Verify and record deposit transaction request",
                  "value": {
                    "transactionHash": "0xabc1230000000000000000000000000000000000000000000000000000000000",
                    "chainId": 42161,
                    "depositAddress": "0x1111111111111111111111111111111111111111",
                    "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                    "logIndex": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deposit check result",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositCheckResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Verify and record deposit transaction 200 response",
                    "value": {
                      "checked": true,
                      "detected": true,
                      "isTransferDone": true,
                      "verified": true,
                      "supported": true,
                      "chainId": 42161,
                      "depositAddress": "0x1111111111111111111111111111111111111111",
                      "transactionHash": "0xabc1230000000000000000000000000000000000000000000000000000000000",
                      "hashExists": false,
                      "depositAddressExists": true,
                      "addressMatched": true,
                      "reason": "unsupported_deposit_transaction",
                      "minimumTransactionAmountAtomic": "10000",
                      "minimumTransactionAmount": "0.0001",
                      "error": {
                        "code": "not_found",
                        "message": "transaction not found"
                      },
                      "idempotent": false,
                      "ignored": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/deposits": {
      "get": {
        "tags": ["Deposit Addresses"],
        "operationId": "listDepositsByAccountId",
        "summary": "List deposits and settlement status",
        "description": "List detected deposits for an account. Use this endpoint to follow confirmation, settlement, retry/intervention, and completion states without re-checking the source transaction.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "detected",
                "confirming",
                "settling",
                "settled",
                "reversed",
                "failed",
                "ignored",
                "requires_intervention"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Deposits",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List deposits and settlement status 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "deposits": [
                        {
                          "id": "deposit_123",
                          "accountId": "acct_123",
                          "depositAddressId": "deposit_addr_123",
                          "status": "detected",
                          "amount": {
                            "asset": {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            },
                            "amount": "1250000"
                          },
                          "sourceTransfer": {
                            "amount": {
                              "asset": {
                                "chainId": 42161,
                                "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                                "symbol": "USDC",
                                "decimals": 6,
                                "kind": "token"
                              },
                              "amount": "1250000"
                            },
                            "txHash": null,
                            "logIndex": null,
                            "fromAddress": null
                          },
                          "fees": {
                            "partnerAmountAtomic": "1000000",
                            "platformAmountAtomic": "1000000",
                            "networkAmountAtomic": "1000000",
                            "setupAmountAtomic": "1000000",
                            "denomination": {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            },
                            "basis": "source_amount",
                            "actualReceivedAmountAtomic": null
                          },
                          "settlement": {
                            "status": "pending",
                            "txHash": null,
                            "settledAt": null,
                            "reasonCode": "Requested by partner"
                          },
                          "settlementProfileSnapshot": {},
                          "txHash": "0xabc123..."
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/email": {
      "get": {
        "tags": ["Identity & KYC"],
        "operationId": "getAccountEmail",
        "summary": "Get UPA email status",
        "description": "Returns the canonical UPA email contact and verification status. The email is masked in API responses. If the account holder verified their email while approving a managed Vault policy, it shows as verified here.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "UPA email status",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountEmailResponse"
                },
                "examples": {
                  "verified": {
                    "summary": "Verified UPA email",
                    "value": {
                      "accountId": "acct_123",
                      "contact": {
                        "id": "account_contact_123",
                        "type": "email",
                        "email": "al***@example.com",
                        "status": "verified",
                        "verifiedAt": "2026-08-28T10:02:00.000Z",
                        "verificationMethod": "stableyard_email_otp",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:02:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/email/verification-challenges": {
      "post": {
        "tags": ["Identity & KYC"],
        "operationId": "requestAccountEmailVerification",
        "summary": "Verify or link UPA email",
        "description": "Creates a ten-minute, single-use email OTP challenge for an unverified UPA by default. If the app environment's account email policy is `partner_asserted`, include `verification.method = partner_asserted` to link an email the partner already verified; Stableyard marks the canonical UPA email verified without sending the account email OTP. Once verified, the UPA email is immutable through partner APIs: requesting the same email is an idempotent no-op and requesting a different email returns `409 conflict`. To correct a verified email, contact Stableyard support. A verified email belongs to one UPA per app environment, whether Stableyard or the partner verified it: an email already verified on a different UPA returns `409 account_email_already_registered` before any OTP is sent or partner assertion is recorded. Reuse the same Idempotency-Key only with the identical email and assertion fields.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["email"],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 320,
                    "example": "alice@example.com"
                  },
                  "verification": {
                    "$ref": "#/components/schemas/AccountEmailVerificationAssertion"
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Verify or link UPA email request",
                  "value": {
                    "email": "alice@example.com",
                    "verification": {
                      "method": "partner_asserted",
                      "verifiedAt": "2026-08-28T10:00:00.000Z",
                      "reference": "example"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Email verification challenge",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountEmailVerificationResponse"
                },
                "examples": {
                  "challenge": {
                    "summary": "Verification code sent",
                    "value": {
                      "contact": {
                        "id": "account_contact_123",
                        "type": "email",
                        "email": "al***@example.com",
                        "status": "pending_verification",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "challenge": {
                        "id": "account_email_123",
                        "email": "al***@example.com",
                        "status": "pending",
                        "verificationMethod": "stableyard_email_otp",
                        "attemptsRemaining": 5,
                        "expiresAt": "2026-08-28T10:10:00.000Z"
                      },
                      "nextAction": {
                        "type": "enter_email_verification_code"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The email is already registered with a different account, the verified UPA email cannot be changed, the challenge is no longer active, or the Idempotency-Key was reused with different input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "emailAlreadyRegistered": {
                    "summary": "The email is verified on a different UPA in this app environment",
                    "value": {
                      "error": {
                        "code": "account_email_already_registered",
                        "message": "This email is already registered with a different account",
                        "details": {
                          "accountId": "acct_123",
                          "email": "al***@example.com",
                          "nextAction": {
                            "type": "use_different_email"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/email/verification-challenges/{challengeId}/confirm": {
      "post": {
        "tags": ["Identity & KYC"],
        "operationId": "confirmAccountEmailVerification",
        "summary": "Confirm UPA email verification",
        "description": "Consumes the six-digit OTP and atomically marks the canonical UPA email verified. Failed challenges cannot be reused. If a different UPA in the same app environment verified this email first, the challenge fails and the request returns `409 account_email_already_registered`. After verification, the UPA can start KYC and use entitled fiat payment rails.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "challengeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^account_email_[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["code"],
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$",
                    "example": "123456"
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Confirm UPA email verification request",
                  "value": {
                    "code": "123456"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified UPA email",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountEmailVerificationResponse"
                },
                "examples": {
                  "verified": {
                    "summary": "Email verified",
                    "value": {
                      "contact": {
                        "id": "account_contact_123",
                        "type": "email",
                        "email": "al***@example.com",
                        "status": "verified",
                        "verifiedAt": "2026-08-28T10:02:00.000Z",
                        "verificationMethod": "stableyard_email_otp",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:02:00.000Z"
                      },
                      "challenge": {
                        "id": "account_email_123",
                        "email": "al***@example.com",
                        "status": "verified",
                        "verificationMethod": "stableyard_email_otp",
                        "attemptsRemaining": 4,
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "verifiedAt": "2026-08-28T10:02:00.000Z"
                      },
                      "nextAction": {
                        "type": "start_kyc_session"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "The email is already registered with a different account, the verified UPA email cannot be changed, the challenge is no longer active, or the Idempotency-Key was reused with different input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "emailAlreadyRegistered": {
                    "summary": "The email is verified on a different UPA in this app environment",
                    "value": {
                      "error": {
                        "code": "account_email_already_registered",
                        "message": "This email is already registered with a different account",
                        "details": {
                          "accountId": "acct_123",
                          "email": "al***@example.com",
                          "nextAction": {
                            "type": "use_different_email"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/kyc/session": {
      "post": {
        "tags": ["Identity & KYC"],
        "operationId": "createAccountKycSession",
        "summary": "Create or resume KYC session",
        "description": "Creates or returns the one active identity-verification session for this UPA. A verified UPA email is required first; use the email verification endpoints or complete the initial managed-vault policy OTP. Repeated calls reuse the same active verification link. Once verification is approved, the approved record is returned without a reusable link. Rejected or expired sessions may be retried, but a UPA gets at most three verification attempts; further attempts return `409 conflict` and the account needs review by Stableyard support. The request has no body because the account path fixes the subject.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "201": {
            "description": "KYC verification session",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KycVerification"
                },
                "examples": {
                  "pending": {
                    "summary": "Verification link ready",
                    "value": {
                      "id": "kyc_123",
                      "accountId": "acct_123",
                      "status": "pending",
                      "verificationUrl": "https://verification.example.com/session/kyc_session_123",
                      "eligibility": {
                        "status": "not_eligible"
                      },
                      "nextAction": {
                        "type": "complete_verification"
                      },
                      "createdAt": "2026-08-28T10:05:00.000Z",
                      "updatedAt": "2026-08-28T10:05:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/kyc": {
      "get": {
        "tags": ["Identity & KYC"],
        "operationId": "getAccountKyc",
        "summary": "Get account KYC",
        "description": "Returns the latest identity-verification state and recent verification history for this UPA. Verification decision details and identity documents are never returned.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Account KYC state",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountKycResponse"
                },
                "examples": {
                  "approved": {
                    "summary": "Approved verification",
                    "value": {
                      "accountId": "acct_123",
                      "current": {
                        "id": "kyc_123",
                        "accountId": "acct_123",
                        "status": "approved",
                        "eligibility": {
                          "status": "eligible",
                          "verifiedAt": "2026-08-28T10:20:00.000Z",
                          "validUntil": "2027-08-28T10:20:00.000Z"
                        },
                        "nextAction": {
                          "type": "none"
                        },
                        "completedAt": "2026-08-28T10:20:00.000Z",
                        "createdAt": "2026-08-28T10:05:00.000Z",
                        "updatedAt": "2026-08-28T10:20:00.000Z"
                      },
                      "verifications": [
                        {
                          "id": "kyc_123",
                          "accountId": "acct_123",
                          "status": "approved",
                          "eligibility": {
                            "status": "eligible",
                            "verifiedAt": "2026-08-28T10:20:00.000Z",
                            "validUntil": "2027-08-28T10:20:00.000Z"
                          },
                          "nextAction": {
                            "type": "none"
                          },
                          "completedAt": "2026-08-28T10:20:00.000Z",
                          "createdAt": "2026-08-28T10:05:00.000Z",
                          "updatedAt": "2026-08-28T10:20:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/capability-activations": {
      "post": {
        "tags": ["Identity & KYC"],
        "operationId": "activateAccountComplianceCapability",
        "summary": "Activate a regulated capability",
        "description": "Starts or resumes verification for one regulated account capability. Individual UPAs require verified email and current identity approval. Business UPAs need hosted business verification (KYB) enabled for your app; pass business.legalName on first activation. Stableyard checks that the capability is enabled for your app in that country, currency and rail before creating an action. If more information or consent is required, send the returned one-time `nextAction.url` to the account holder. Individuals use the Stableyard hosted form. When the business verification link is ready, `nextAction.url` carries a credential-bearing, third-party-hosted link; send it only to the authorized business representative and never log or cache it. The capability becomes ready once verification is approved. Replaying identical input with the same `Idempotency-Key` returns the original action, while changed input conflicts.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 256,
              "pattern": "^[ -~]+$",
              "example": "enable-linked-bank-user-123-v1"
            },
            "description": "Required retry key for this capability activation. Reuse the same key only with the identical account, capability, country, currency, rail, and amount. Changed input returns `409 idempotency_conflict`."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateComplianceCapabilityRequest"
              },
              "examples": {
                "linkedBank": {
                  "summary": "Enable a linked USD bank account",
                  "value": {
                    "capability": "linked_bank",
                    "country": "US",
                    "currency": "USD",
                    "rail": "ach"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current capability readiness and the next action, if any",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCapabilityActivationResponse"
                },
                "examples": {
                  "actionRequired": {
                    "summary": "The account holder must complete a Stableyard-hosted compliance action",
                    "value": {
                      "accountId": "acct_123",
                      "capability": {
                        "name": "linked_bank",
                        "status": "action_required",
                        "ready": false,
                        "nextAction": {
                          "type": "complete_compliance",
                          "url": "https://identity.stableyard.fi/identity/c/ca_example",
                          "expiresAt": "2026-09-10T12:15:00.000Z"
                        },
                        "updatedAt": "2026-09-10T12:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/capabilities": {
      "get": {
        "tags": ["Identity & KYC"],
        "operationId": "listAccountComplianceCapabilities",
        "summary": "List regulated capability readiness",
        "description": "Returns the latest readiness for each regulated capability previously activated on this UPA. Use `ready` and `nextAction`; do not retain an expired hosted-action URL. An empty `capabilities` array means no regulated capability has been activated for this account.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Regulated capability readiness",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCapabilitiesResponse"
                },
                "examples": {
                  "capabilities": {
                    "summary": "One capability is ready and another is under review",
                    "value": {
                      "accountId": "acct_123",
                      "capabilities": [
                        {
                          "name": "linked_bank",
                          "status": "active",
                          "ready": true,
                          "nextAction": {
                            "type": "none"
                          },
                          "updatedAt": "2026-09-10T12:00:00.000Z"
                        },
                        {
                          "name": "bank_payout",
                          "status": "provider_review",
                          "ready": false,
                          "nextAction": {
                            "type": "wait_for_compliance_review"
                          },
                          "updatedAt": "2026-09-10T12:05:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/compliance-claim-reuse/revocations": {
      "post": {
        "tags": ["Identity & KYC"],
        "operationId": "revokeAccountComplianceClaimReuse",
        "summary": "Withdraw reusable compliance-claim consent",
        "description": "Prevents every currently active self-attested compliance claim on this UPA from being reused in future regulated-capability actions. This operation is idempotent. Data already shared under an earlier consent is not recalled. Call it when the account holder withdraws permission for future reuse; a later hosted action may collect and freshly consent replacement claims.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeComplianceClaimReuseRequest"
              },
              "examples": {
                "example": {
                  "summary": "Withdraw reusable compliance-claim consent request",
                  "value": {
                    "reason": "The account holder withdrew consent for future claim reuse."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reusable-claim consent state",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeComplianceClaimReuseResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Withdraw reusable compliance-claim consent 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "claimReuse": {
                        "status": "revoked",
                        "revokedCount": 3,
                        "revokedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/balances": {
      "get": {
        "tags": ["Balances & Transactions"],
        "operationId": "getAccountBalancesByAccountId",
        "summary": "Get recorded activity totals",
        "description": "Totals of activity Stableyard has recorded for this account, and amounts reserved for pending Vault payments. These values are not spendable wallet, escrow, or Vault custody balances.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Balances",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalancesResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get recorded activity totals 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "balanceType": "recorded_activity_projection",
                      "custodyScope": "not_a_custody_balance",
                      "activityTotals": [
                        {
                          "asset": {
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "symbol": "USDC",
                            "decimals": 6,
                            "kind": "token"
                          },
                          "netRecordedFlowAtomic": "-600000",
                          "reservedForVaultPaymentsAtomic": "0",
                          "source": "ledger",
                          "observedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/transactions": {
      "get": {
        "tags": ["Balances & Transactions"],
        "operationId": "getAccountTransactionsByAccountId",
        "summary": "List account transactions",
        "description": "List deposits, Payments, settlements, and other recorded activity for this account. A single transaction row can appear as `sent` for the sender account and `received` for the receiver account; use `perspective.direction` to label it for the requested account.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            },
            "description": "Maximum transactions to return."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["pending", "completed", "failed", "reversed"]
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List account transactions 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "transactions": [
                        {
                          "id": "txn_123",
                          "accountId": "acct_123",
                          "senderAccountId": "acct_sender123",
                          "receiverAccountId": "acct_receiver123",
                          "direction": "sent",
                          "status": "pending",
                          "amount": {
                            "asset": {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            },
                            "amount": "1250000"
                          },
                          "description": "USDC payment",
                          "sourceType": "payment",
                          "sourceId": "payment_123",
                          "paymentId": "payment_123",
                          "financialLegKind": "collection"
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/transactions/{transactionId}": {
      "get": {
        "tags": ["Balances & Transactions"],
        "operationId": "getAccountTransactionByAccountId",
        "summary": "Get transaction detail",
        "description": "Fetch one transaction with reconciliation details.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "txn_123"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction detail",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionDetailResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get transaction detail 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "transaction": {
                        "id": "txn_123",
                        "accountId": "acct_123",
                        "senderAccountId": "acct_sender123",
                        "receiverAccountId": "acct_receiver123",
                        "direction": "sent",
                        "status": "pending",
                        "amount": {
                          "asset": {
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "symbol": "USDC",
                            "decimals": 6,
                            "kind": "token"
                          },
                          "amount": "1250000"
                        },
                        "description": "USDC payment",
                        "sourceType": "payment",
                        "sourceId": "payment_123",
                        "paymentId": "payment_123",
                        "financialLegKind": "collection"
                      },
                      "ledgerEntries": [
                        {
                          "id": "ledger_123",
                          "direction": "debit",
                          "amount": {
                            "asset": {
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "symbol": "USDC",
                              "decimals": 6,
                              "kind": "token"
                            },
                            "amount": "1250000"
                          },
                          "createdAt": "2026-08-28T10:00:00.000Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "createVault",
        "summary": "Create account vault",
        "description": "Creates the account's single Arbitrum stablecoin Vault. `stableyard` creation returns the allocated Vault address in `predictedSafeAddress` with status provisioning until the Vault is ready. The address confirms allocation only; wait for status active or vault.policy_active before funding or using the Vault. An already verified account email automatically authorizes the initial managed policy. Otherwise complete the returned contact-verification action. Use `external` when the account owner signs policy changes. The chain is configured by Stableyard and is not caller-selectable.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Required retry key. Reuse only with the identical vault request."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["ownershipMode"],
                "properties": {
                  "ownershipMode": {
                    "type": "string",
                    "enum": ["external", "stableyard"]
                  },
                  "owner": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["type", "addressType", "address"],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": ["external_owner", "partner_multisig"]
                      },
                      "addressType": {
                        "type": "string",
                        "enum": ["evm"]
                      },
                      "address": {
                        "type": "string",
                        "example": "0x3333333333333333333333333333333333333333"
                      }
                    }
                  },
                  "managedContact": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["email"],
                    "description": "Canonical UPA email used for managed policy authorization. The initial policy OTP also verifies this email for KYC and fiat services. If the UPA already has a verified email, this value must match it.",
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email",
                        "example": "alice@example.com"
                      }
                    }
                  },
                  "initialPolicy": {
                    "$ref": "#/components/schemas/VaultPolicyInput"
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Create account vault request",
                  "value": {
                    "ownershipMode": "external",
                    "owner": {
                      "type": "external_owner",
                      "addressType": "evm",
                      "address": "0x3333333333333333333333333333333333333333"
                    },
                    "managedContact": {
                      "email": "alice@example.com"
                    },
                    "initialPolicy": {
                      "spendLimit": {
                        "amountAtomic": "500000000"
                      },
                      "allowedTokens": ["USDC"],
                      "yield": {
                        "provider": "none"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vault",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultResource"
                },
                "examples": {
                  "example": {
                    "summary": "Create account vault 200 response",
                    "value": {
                      "id": "vault_123",
                      "accountId": "acct_123",
                      "chainId": 42161,
                      "ownershipMode": "external",
                      "status": "pending_authorization",
                      "safeAddress": null,
                      "predictedSafeAddress": null,
                      "rolesModuleAddress": null,
                      "monitoring": {
                        "provider": "example",
                        "status": "registered",
                        "registeredAt": null
                      },
                      "earning": {
                        "enabled": true,
                        "provider": "none",
                        "currentApyBps": null,
                        "earnedAmountRaw": null
                      },
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Vaults"],
        "operationId": "getVault",
        "summary": "Get account vault",
        "description": "Returns the account vault, active policy, current 30-day spend usage, pending actions, mandates, and audit-facing state.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultResource"
                },
                "examples": {
                  "example": {
                    "summary": "Get account vault 200 response",
                    "value": {
                      "id": "vault_123",
                      "accountId": "acct_123",
                      "chainId": 42161,
                      "ownershipMode": "external",
                      "status": "pending_authorization",
                      "safeAddress": null,
                      "predictedSafeAddress": null,
                      "rolesModuleAddress": null,
                      "monitoring": {
                        "provider": "example",
                        "status": "registered",
                        "registeredAt": null
                      },
                      "earning": {
                        "enabled": true,
                        "provider": "none",
                        "currentApyBps": null,
                        "earnedAmountRaw": null
                      },
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/spend-usage": {
      "get": {
        "tags": ["Vaults"],
        "operationId": "getVaultSpendUsage",
        "summary": "Get Vault spend usage",
        "description": "Returns the Vault's delegated payment limit, consumed amount, pending amount, currently available amount, exact reset time, and supported assets. Pending payments count against the limit. USDC and USDT consume the same limit. Transfers the Vault owner makes directly do not consume this delegated allowance.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault spend usage",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultSpendUsage"
                },
                "examples": {
                  "example": {
                    "summary": "Get Vault spend usage 200 response",
                    "value": {
                      "vaultId": "vault_123",
                      "status": "active",
                      "reason": "Requested by partner",
                      "period": "fixed_30_day",
                      "periodSeconds": 2592000,
                      "supportedAssets": [
                        {
                          "symbol": "USDC",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/policies": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "createVaultPolicy",
        "summary": "Propose vault policy update",
        "description": "Creates a pending vault policy update. External signer vaults return an EIP-712 signing action. Managed vaults send an email approval challenge to the verified managed contact.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["policy"],
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 280
                  },
                  "policy": {
                    "$ref": "#/components/schemas/VaultPolicyInput"
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Propose vault policy update request",
                  "value": {
                    "reason": "Requested by partner",
                    "policy": {
                      "spendLimit": {
                        "amountAtomic": "500000000"
                      },
                      "allowedTokens": ["USDC"],
                      "yield": {
                        "provider": "none"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pending policy",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultPolicyResource"
                },
                "examples": {
                  "example": {
                    "summary": "Propose vault policy update 200 response",
                    "value": {
                      "id": "vault_policy_123",
                      "vaultId": "vault_123",
                      "version": 1,
                      "policySchemaVersion": 1,
                      "status": "draft",
                      "ownershipMode": "external",
                      "allowedTokens": [
                        {
                          "symbol": "USDC",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        }
                      ],
                      "spendLimits": {
                        "spendLimitAtomic": "500000000",
                        "currency": "USD",
                        "decimals": 6,
                        "period": "fixed_30_day",
                        "periodSeconds": 2592000,
                        "enforcement": "example"
                      },
                      "yieldRules": {
                        "provider": "none",
                        "mode": "disabled"
                      },
                      "authorization": {},
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Vaults"],
        "operationId": "listVaultPolicies",
        "summary": "List vault policies",
        "description": "Lists active and historical policy versions for the account vault.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "Maximum Vault records to return."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault policies",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultPolicyListResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List vault policies 200 response",
                    "value": {
                      "data": [
                        {
                          "id": "vault_policy_123",
                          "vaultId": "vault_123",
                          "version": 1,
                          "policySchemaVersion": 1,
                          "status": "draft",
                          "ownershipMode": "external",
                          "allowedTokens": [
                            {
                              "symbol": "USDC",
                              "chainId": 42161,
                              "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                              "decimals": 6
                            }
                          ],
                          "spendLimits": {
                            "spendLimitAtomic": "500000000",
                            "currency": "USD",
                            "decimals": 6,
                            "period": "fixed_30_day",
                            "periodSeconds": 2592000,
                            "enforcement": "example"
                          },
                          "yieldRules": {
                            "provider": "none",
                            "mode": "disabled"
                          },
                          "authorization": {},
                          "resourceVersion": 1,
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/policies/{policyId}": {
      "get": {
        "tags": ["Vaults"],
        "operationId": "getVaultPolicy",
        "summary": "Get vault policy",
        "description": "Returns one policy version, its authorization state, and its current next action.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault policy",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultPolicyResource"
                },
                "examples": {
                  "example": {
                    "summary": "Get vault policy 200 response",
                    "value": {
                      "id": "vault_policy_123",
                      "vaultId": "vault_123",
                      "version": 1,
                      "policySchemaVersion": 1,
                      "status": "draft",
                      "ownershipMode": "external",
                      "allowedTokens": [
                        {
                          "symbol": "USDC",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        }
                      ],
                      "spendLimits": {
                        "spendLimitAtomic": "500000000",
                        "currency": "USD",
                        "decimals": 6,
                        "period": "fixed_30_day",
                        "periodSeconds": 2592000,
                        "enforcement": "example"
                      },
                      "yieldRules": {
                        "provider": "none",
                        "mode": "disabled"
                      },
                      "authorization": {},
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/policies/{policyId}/authorize": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "authorizeVaultPolicy",
        "summary": "Authorize vault policy",
        "description": "Authorizes a pending policy using either the external owner's EIP-712 signature or the managed-vault email OTP. For an external-signer Vault, authorization is followed by an `execute_safe_transaction` action returned by `GET /v2/accounts/{accountId}/vault`: an on-chain transaction the Vault owner or owner multisig must execute before Stableyard can verify it and mark the policy active. The off-chain EIP-712 signature alone does not change the Vault.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "title": "External signer signature",
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["method", "signerAddress", "signature"],
                    "properties": {
                      "method": {
                        "type": "string",
                        "enum": ["eip712_signature"]
                      },
                      "signerAddress": {
                        "type": "string",
                        "example": "0x3333333333333333333333333333333333333333"
                      },
                      "signature": {
                        "type": "string",
                        "example": "0x..."
                      }
                    }
                  },
                  {
                    "title": "Managed vault email code",
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["method", "code"],
                    "properties": {
                      "method": {
                        "type": "string",
                        "enum": ["managed_email_otp"]
                      },
                      "code": {
                        "type": "string",
                        "pattern": "^[0-9]{6}$",
                        "example": "123456"
                      }
                    }
                  }
                ]
              },
              "examples": {
                "external-signer-signature": {
                  "summary": "External signer signature",
                  "value": {
                    "method": "eip712_signature",
                    "signerAddress": "0x3333333333333333333333333333333333333333",
                    "signature": "0x..."
                  }
                },
                "managed-vault-email-code": {
                  "summary": "Managed vault email code",
                  "value": {
                    "method": "managed_email_otp",
                    "code": "123456"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authorized policy",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultPolicyResource"
                },
                "examples": {
                  "example": {
                    "summary": "Authorize vault policy 200 response",
                    "value": {
                      "id": "vault_policy_123",
                      "vaultId": "vault_123",
                      "version": 1,
                      "policySchemaVersion": 1,
                      "status": "draft",
                      "ownershipMode": "external",
                      "allowedTokens": [
                        {
                          "symbol": "USDC",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        }
                      ],
                      "spendLimits": {
                        "spendLimitAtomic": "500000000",
                        "currency": "USD",
                        "decimals": 6,
                        "period": "fixed_30_day",
                        "periodSeconds": 2592000,
                        "enforcement": "example"
                      },
                      "yieldRules": {
                        "provider": "none",
                        "mode": "disabled"
                      },
                      "authorization": {},
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/policies/{policyId}/resend-approval": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "resendVaultPolicyApproval",
        "summary": "Resend managed policy approval",
        "description": "Creates and emails a fresh six-digit approval challenge for a pending Stableyard-managed Vault policy. This operation intentionally has no JSON request body; the account and policy path identify the pending approval. External-signer Vaults do not use this endpoint.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Pending managed policy",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultPolicyResource"
                },
                "examples": {
                  "example": {
                    "summary": "Resend managed policy approval 200 response",
                    "value": {
                      "id": "vault_policy_123",
                      "vaultId": "vault_123",
                      "version": 1,
                      "policySchemaVersion": 1,
                      "status": "draft",
                      "ownershipMode": "external",
                      "allowedTokens": [
                        {
                          "symbol": "USDC",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        }
                      ],
                      "spendLimits": {
                        "spendLimitAtomic": "500000000",
                        "currency": "USD",
                        "decimals": 6,
                        "period": "fixed_30_day",
                        "periodSeconds": 2592000,
                        "enforcement": "example"
                      },
                      "yieldRules": {
                        "provider": "none",
                        "mode": "disabled"
                      },
                      "authorization": {},
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/actions/{actionId}": {
      "get": {
        "tags": ["Vaults"],
        "operationId": "getVaultAction",
        "summary": "Get vault action",
        "description": "Returns the latest state and public instruction for one asynchronous Vault action.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault action",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultAction"
                },
                "examples": {
                  "example": {
                    "summary": "Get vault action 200 response",
                    "value": {
                      "id": "vault_action_123",
                      "vaultId": "vault_123",
                      "policyId": "vault_policy_123",
                      "type": "sign_policy",
                      "status": "pending",
                      "nextAction": null,
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/actions/{actionId}/complete": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "completeVaultAction",
        "summary": "Submit external Vault action transaction",
        "description": "Records the transaction hash after the external Vault owner executes an `execute_safe_transaction` action. Stableyard verifies the transaction on-chain before activating the policy; the submitted hash alone does not activate it.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "actionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": ["transactionHash"],
                "properties": {
                  "transactionHash": {
                    "type": "string",
                    "pattern": "^0x[a-fA-F0-9]{64}$",
                    "example": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Submit external Vault action transaction request",
                  "value": {
                    "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Vault action",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultAction"
                },
                "examples": {
                  "example": {
                    "summary": "Submit external Vault action transaction 200 response",
                    "value": {
                      "id": "vault_action_123",
                      "vaultId": "vault_123",
                      "policyId": "vault_policy_123",
                      "type": "sign_policy",
                      "status": "pending",
                      "nextAction": null,
                      "resourceVersion": 1,
                      "createdAt": "2026-08-28T10:00:00.000Z",
                      "updatedAt": "2026-08-28T10:00:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/audit-events": {
      "get": {
        "tags": ["Vaults"],
        "operationId": "listVaultAuditEvents",
        "summary": "List vault audit events",
        "description": "Returns policy, authorization, and provisioning audit events for the account vault.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "Maximum Vault records to return."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Vault audit events",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultAuditEventsResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List vault audit events 200 response",
                    "value": {
                      "data": [
                        {
                          "id": "resource_123",
                          "vaultId": "vault_123",
                          "policyId": null,
                          "eventType": "vault.policy.created",
                          "actor": {
                            "type": "partner_app",
                            "id": null
                          },
                          "payload": {},
                          "createdAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": "cursor_123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/mandates": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "createVaultMandate",
        "summary": "Create vault mandate",
        "description": "Creates a mandate as a policy update. The mandate is not active until the owner authorizes and the policy is installed.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "recipient",
                  "token",
                  "amountLimit",
                  "period",
                  "startsAt",
                  "expiresAt"
                ],
                "properties": {
                  "recipient": {
                    "$ref": "#/components/schemas/VaultMandateRecipient"
                  },
                  "token": {
                    "$ref": "#/components/schemas/VaultMandateToken"
                  },
                  "amountLimit": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "period": {
                    "type": "string",
                    "enum": ["daily", "weekly", "monthly"]
                  },
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Mandate expiry. It must be after startsAt and no more than 366 days later."
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 280
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Create vault mandate request",
                  "value": {
                    "recipient": {
                      "chainId": 42161,
                      "address": "0x3333333333333333333333333333333333333333",
                      "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                    },
                    "token": {
                      "chainId": 42161,
                      "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                      "symbol": "USDC",
                      "decimals": 6
                    },
                    "amountLimit": "1000000",
                    "period": "daily",
                    "startsAt": "2026-08-28T10:00:00.000Z",
                    "expiresAt": "2026-08-28T10:00:00.000Z",
                    "reason": "Requested by partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pending mandate policy update",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultMandateMutationResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Create vault mandate 200 response",
                    "value": {
                      "id": "vault_mandate_123",
                      "mandateId": "vault_mandate_123",
                      "policyId": "vault_policy_123",
                      "status": "pending_authorization",
                      "nextAction": {
                        "id": "vault_action_123",
                        "vaultId": "vault_123",
                        "policyId": "vault_policy_123",
                        "type": "sign_policy",
                        "status": "pending",
                        "nextAction": null,
                        "resourceVersion": 1,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/accounts/{accountId}/vault/mandates/{mandateId}/revoke": {
      "post": {
        "tags": ["Vaults"],
        "operationId": "revokeVaultMandate",
        "summary": "Revoke vault mandate",
        "description": "Revokes a mandate through the same policy authorization flow. Owner approval is required before the revoke takes effect.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "acct_123"
            },
            "description": "Canonical account id returned by the Accounts API."
          },
          {
            "name": "mandateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Retry key. Reuse a key only with the identical request; different input returns a conflict."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reason": {
                    "type": "string",
                    "maxLength": 280
                  }
                }
              },
              "examples": {
                "example": {
                  "summary": "Revoke vault mandate request",
                  "value": {
                    "reason": "Requested by partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pending revoke policy update",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VaultMandateMutationResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Revoke vault mandate 200 response",
                    "value": {
                      "id": "vault_mandate_123",
                      "mandateId": "vault_mandate_123",
                      "policyId": "vault_policy_123",
                      "status": "pending_authorization",
                      "nextAction": {
                        "id": "vault_action_123",
                        "vaultId": "vault_123",
                        "policyId": "vault_policy_123",
                        "type": "sign_policy",
                        "status": "pending",
                        "nextAction": null,
                        "resourceVersion": 1,
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments": {
      "post": {
        "tags": ["Payments"],
        "operationId": "createPayment",
        "summary": "Create payment",
        "description": "Creates the canonical financial obligation for a **Receive payment** or **Send payment** flow. These are business intents, not payer payment methods. A receive Payment exposes Direct crypto, Cross-chain routing, and enabled onramp methods through the Public Checkout API after creation. Crypto Send supports direct transfers and, when enabled, Vault-funded cross-chain routing from Arbitrum. Call `/v2/payments/preview` first and proceed only when the selected source is available. A required route is executable when the Vault funding option reports `vault_routing`. Stableyard funds and verifies the route under the same Payment ID. Cross-chain Send from a connected wallet is not supported. Optional send rails such as External QR, one-time External Bank Transfer, and a verified Linked Bank Payout remain executions under this same Payment resource and have no standalone Offramp API; expose them only when `/v2/partners/config` reports the method available. Those external fiat rails use create-time destination verification and funding quotes rather than `/v2/payments/preview`; creating the Payment does not itself debit the Vault. For a linked bank, send only `bankAccountId`; Stableyard uses the verified bank details on file. Personal or peer-to-peer QR codes are rejected before quotation with `details.reasonCode=personal_qr_not_supported` and must be redirected to External Bank Transfer. A bank-lookup result marked `provider_state_uncertain` is not retryable because the external rail may already have created a pending transaction. The response always uses a `payment_*` ID. Receive Payments create an escrow-backed checkout execution; send Payments create an outgoing execution and its required next action. `paymentAmount` has one explicit asset and exactly one decimal or atomic representation. Commercial fees, destination, settlement, optional checkout return URL, and capability snapshots are frozen atomically with the Payment. A receive `returnUrl` must exactly match an app URL configured in Payment settings; hosted checkout appends only `stableyard_payment_id` and never treats the return as payment proof. The receive create response is the only Partner API response that returns `checkout.clientSecret`; store it securely or redirect with `checkout.paymentUrl`.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Required retry key. Reuse only with the identical payment request."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanonicalPaymentCreateRequest"
              },
              "examples": {
                "receive": {
                  "summary": "Receive into a UPA",
                  "value": {
                    "intent": "receive",
                    "recipient": {
                      "accountId": "acct_123"
                    },
                    "amountMode": "collect_exact",
                    "paymentAmount": {
                      "amount": "10.00",
                      "assetType": "crypto",
                      "assetCode": "USDC",
                      "chainId": 42161
                    },
                    "description": "Order #1001",
                    "returnUrl": "https://merchant.example/orders/complete",
                    "expiresInSeconds": 600
                  }
                },
                "directSend": {
                  "summary": "Direct outgoing send",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "crypto_wallet",
                      "chainId": 8453,
                      "address": "0x2222222222222222222222222222222222222222",
                      "assetCode": "USDC"
                    },
                    "amountMode": "deliver_exact",
                    "paymentAmount": {
                      "amountAtomic": "1000000",
                      "decimals": 6,
                      "assetType": "crypto",
                      "assetCode": "USDC",
                      "chainId": 8453
                    }
                  }
                },
                "externalQrSend": {
                  "summary": "Pay an external merchant QR",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "external_qr",
                      "country": "PH",
                      "qrPayload": "000201010212..."
                    },
                    "amountMode": "deliver_exact",
                    "paymentAmount": {
                      "amount": "500.00",
                      "assetType": "fiat",
                      "assetCode": "PHP"
                    },
                    "description": "Merchant QR payment",
                    "externalReference": "qr_payment_482"
                  }
                },
                "externalBankSend": {
                  "summary": "Pay a Vietnam bank beneficiary",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "external_bank",
                      "country": "VN",
                      "bankCode": "970436",
                      "accountNumber": "0123456789"
                    },
                    "amountMode": "deliver_exact",
                    "paymentAmount": {
                      "amount": "100000",
                      "assetType": "fiat",
                      "assetCode": "VND"
                    },
                    "description": "Supplier bank transfer",
                    "externalReference": "bank_payment_483"
                  }
                },
                "externalBankPhilippinesSend": {
                  "summary": "Pay a Philippines bank beneficiary",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "external_bank",
                      "country": "PH",
                      "bankCode": "BPI",
                      "accountNumber": "09171234567",
                      "beneficiaryName": "JUAN DELA CRUZ"
                    },
                    "amountMode": "deliver_exact",
                    "paymentAmount": {
                      "amount": "500.00",
                      "assetType": "fiat",
                      "assetCode": "PHP"
                    },
                    "description": "Beneficiary bank transfer",
                    "externalReference": "bank_payment_484"
                  }
                },
                "linkedBankSend": {
                  "summary": "Pay USD to a verified saved US bank beneficiary",
                  "description": "The linked-bank route has no rate lock, so the delivered USD amount is confirmed only at payout: the sender specifies collect_exact (an exact crypto amount to send), not a fixed USD amount.",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "bank_account",
                      "bankAccountId": "bank_123"
                    },
                    "amountMode": "collect_exact",
                    "paymentAmount": {
                      "amount": "100.00",
                      "assetType": "crypto",
                      "assetCode": "USDC",
                      "chainId": 42161
                    },
                    "description": "USD withdrawal",
                    "externalReference": "withdrawal_485"
                  }
                },
                "publicWalletReceive": {
                  "summary": "Receive into a raw wallet without creating a UPA",
                  "value": {
                    "intent": "receive",
                    "recipient": {
                      "wallet": {
                        "chainId": 8453,
                        "address": "0x2222222222222222222222222222222222222222",
                        "assetCode": "USDC"
                      }
                    },
                    "paymentAmount": {
                      "amount": "50.00",
                      "assetType": "crypto",
                      "assetCode": "USDC",
                      "chainId": 8453
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created payment",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentResponse"
                },
                "examples": {
                  "receivePayment": {
                    "summary": "Receive Payment ready for checkout",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "apiVersion": "2026-09-09",
                        "intent": "receive",
                        "amountMode": "collect_exact",
                        "status": "requires_payment_method",
                        "offrampStatus": null,
                        "stage": "awaiting_payment",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "25.00",
                          "amountAtomic": "25000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                        },
                        "participants": [
                          {
                            "role": "recipient",
                            "accountId": "acct_123"
                          }
                        ],
                        "destination": {
                          "type": "upa",
                          "accountId": "acct_123"
                        },
                        "settlement": {
                          "type": "settlement_destination",
                          "settlementDestinationId": "destination_123",
                          "destinationType": "connected_wallet",
                          "destinationAddress": "0x1111111111111111111111111111111111111111",
                          "chainId": 42161,
                          "assetCode": "USDC",
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        },
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "125000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "24875000"
                        },
                        "funding": null,
                        "externalReference": "order_1042",
                        "description": "Invoice #1042",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "checkout": {
                        "paymentUrl": "https://pay.stableyard.fi/pay/7Yf3KMpQ2xWa",
                        "clientSecret": "pay_client_secret_opaque_value_123",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "returnUrl": "https://merchant.example/orders/complete"
                      },
                      "nextAction": {
                        "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "type": "payment_method",
                        "expiresAt": "2026-08-28T10:10:00.000Z"
                      }
                    }
                  },
                  "sendPayment": {
                    "summary": "Send Payment requiring a wallet transaction",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5T7V8WXA",
                        "apiVersion": "2026-09-09",
                        "intent": "send",
                        "amountMode": "deliver_exact",
                        "status": "requires_action",
                        "offrampStatus": null,
                        "stage": "destination_verifying",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "10.00",
                          "amountAtomic": "10000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "sourceAmount": {
                          "amount": "10.05",
                          "amountAtomic": "10050000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "participants": [
                          {
                            "role": "sender",
                            "accountId": "acct_sender"
                          }
                        ],
                        "destination": {
                          "type": "crypto_wallet",
                          "chainId": 8453,
                          "address": "0x2222222222222222222222222222222222222222",
                          "assetCode": "USDC",
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "settlement": null,
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "50000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "10000000"
                        },
                        "funding": null,
                        "externalReference": "transfer_482",
                        "description": "Vendor payout",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "nextAction": {
                        "id": "action_01JY8M8F5N3S7T2V4W6X9ZABCD",
                        "type": "transaction",
                        "expiresAt": "2026-08-28T10:10:00.000Z"
                      }
                    }
                  },
                  "externalQrPayment": {
                    "summary": "External QR Payment ready to collect source funds",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5T7V8WQR",
                        "apiVersion": "2026-09-09",
                        "intent": "send",
                        "amountMode": "deliver_exact",
                        "status": "requires_payment_method",
                        "offrampStatus": "not_started",
                        "stage": "awaiting_payment",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "500.00",
                          "amountAtomic": "50000",
                          "assetType": "fiat",
                          "assetCode": "PHP",
                          "decimals": 2
                        },
                        "sourceAmount": {
                          "amount": "10.05",
                          "amountAtomic": "10050000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "participants": [
                          {
                            "role": "sender",
                            "accountId": "acct_sender"
                          }
                        ],
                        "destination": {
                          "type": "external_qr",
                          "country": "PH",
                          "currency": "PHP",
                          "dynamic": true,
                          "merchant": {
                            "name": "Example Merchant",
                            "city": "Manila"
                          }
                        },
                        "settlement": null,
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "50000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "10000000"
                        },
                        "funding": {
                          "required": {
                            "amount": "9.09",
                            "amountAtomic": "9090000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerPrincipal": {
                            "amount": "8.9",
                            "amountAtomic": "8900000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerFee": {
                            "amount": "0.1",
                            "amountAtomic": "100000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFee": {
                            "amount": "0.045",
                            "amountAtomic": "45000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFixedFee": {
                            "amount": "0",
                            "amountAtomic": "0",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "partnerFee": {
                            "amount": "0.045",
                            "amountAtomic": "45000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "totalFees": {
                            "amount": "0.19",
                            "amountAtomic": "190000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "exchangeRate": {
                            "rate": "0.0178",
                            "baseAssetCode": "PHP",
                            "quoteAssetCode": "USD"
                          },
                          "quoteExpiresAt": "2026-08-28T10:10:00.000Z",
                          "depositAddress": {
                            "address": "0x2222222222222222222222222222222222222222",
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "amount": "9.09",
                            "amountAtomic": "9090000"
                          }
                        },
                        "externalReference": "qr_payment_482",
                        "description": "Merchant QR payment",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "checkout": {
                        "paymentUrl": "https://pay.stableyard.fi/pay/8Qr3KMpQ2xWa",
                        "clientSecret": "pay_client_secret_opaque_value_qr_123",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "returnUrl": null
                      },
                      "nextAction": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5T7V8WQR",
                        "type": "transaction",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "depositInstructions": {
                          "address": "0x2222222222222222222222222222222222222222",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "amount": "9.09",
                          "amountAtomic": "9090000"
                        }
                      }
                    }
                  },
                  "externalBankPayment": {
                    "summary": "External bank Payment ready to collect source funds",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5BANK001",
                        "apiVersion": "2026-09-09",
                        "intent": "send",
                        "amountMode": "deliver_exact",
                        "status": "requires_payment_method",
                        "offrampStatus": "not_started",
                        "stage": "awaiting_payment",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "100000",
                          "amountAtomic": "100000",
                          "assetType": "fiat",
                          "assetCode": "VND",
                          "decimals": 0
                        },
                        "sourceAmount": {
                          "amount": "10.05",
                          "amountAtomic": "10050000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "participants": [
                          {
                            "role": "sender",
                            "accountId": "acct_sender"
                          }
                        ],
                        "destination": {
                          "type": "external_bank",
                          "country": "VN",
                          "currency": "VND",
                          "beneficiary": {
                            "accountHolderName": "NGUYEN VAN A",
                            "accountNumberLast4": "6789",
                            "bankCode": "970436",
                            "bankName": "Vietcombank",
                            "country": "VN"
                          }
                        },
                        "settlement": null,
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "50000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "10000000"
                        },
                        "funding": {
                          "required": {
                            "amount": "4.242",
                            "amountAtomic": "4242000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerPrincipal": {
                            "amount": "4.1",
                            "amountAtomic": "4100000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerFee": {
                            "amount": "0.1",
                            "amountAtomic": "100000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFee": {
                            "amount": "0.021",
                            "amountAtomic": "21000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFixedFee": {
                            "amount": "0",
                            "amountAtomic": "0",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "partnerFee": {
                            "amount": "0.021",
                            "amountAtomic": "21000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "totalFees": {
                            "amount": "0.142",
                            "amountAtomic": "142000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "exchangeRate": {
                            "rate": "24390.24",
                            "baseAssetCode": "USDC",
                            "quoteAssetCode": "VND"
                          },
                          "quoteExpiresAt": "2026-08-28T10:10:00.000Z",
                          "depositAddress": {
                            "address": "0x3333333333333333333333333333333333333333",
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "amount": "4.242",
                            "amountAtomic": "4242000"
                          }
                        },
                        "externalReference": "bank_payment_483",
                        "description": "Supplier bank transfer",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "checkout": {
                        "paymentUrl": "https://pay.stableyard.fi/pay/8Qr3KMpQ2xWa",
                        "clientSecret": "pay_client_secret_opaque_value_qr_123",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "returnUrl": null
                      },
                      "nextAction": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5BANK001",
                        "type": "transaction",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "depositInstructions": {
                          "address": "0x3333333333333333333333333333333333333333",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "amount": "4.242",
                          "amountAtomic": "4242000"
                        }
                      }
                    }
                  },
                  "linkedBankPayment": {
                    "summary": "Linked bank Payment ready to collect source funds",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5LNKB001",
                        "apiVersion": "2026-09-09",
                        "intent": "send",
                        "amountMode": "collect_exact",
                        "status": "requires_payment_method",
                        "offrampStatus": "not_started",
                        "stage": "awaiting_payment",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "100.00",
                          "amountAtomic": "100000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                        },
                        "sourceAmount": {
                          "amount": "10.05",
                          "amountAtomic": "10050000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "participants": [
                          {
                            "role": "sender",
                            "accountId": "acct_sender"
                          }
                        ],
                        "destination": {
                          "type": "bank_account",
                          "bankAccountId": "bank_123",
                          "country": "US",
                          "currency": "USD",
                          "bankName": "Example Bank",
                          "accountNumberLast4": "6789",
                          "rail": "ach"
                        },
                        "settlement": null,
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "50000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "10000000"
                        },
                        "funding": {
                          "required": {
                            "amount": "100.50",
                            "amountAtomic": "100500000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerPrincipal": {
                            "amount": "99.5",
                            "amountAtomic": "99500000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "providerFee": {
                            "amount": "0",
                            "amountAtomic": "0",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFee": {
                            "amount": "1.00",
                            "amountAtomic": "1000000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "platformFixedFee": {
                            "amount": "0.50",
                            "amountAtomic": "500000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "partnerFee": {
                            "amount": "0",
                            "amountAtomic": "0",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "totalFees": {
                            "amount": "1.00",
                            "amountAtomic": "1000000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "exchangeRate": null,
                          "quoteExpiresAt": "2026-08-28T10:10:00.000Z",
                          "depositAddress": {
                            "address": "0x4444444444444444444444444444444444444444",
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "amount": "100.50",
                            "amountAtomic": "100500000"
                          }
                        },
                        "externalReference": "withdrawal_485",
                        "description": "USD withdrawal",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "checkout": {
                        "paymentUrl": "https://pay.stableyard.fi/pay/9Lb4XQmN3zR7",
                        "clientSecret": "pay_client_secret_opaque_value_lnkb_001",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "returnUrl": null
                      },
                      "nextAction": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5LNKB001",
                        "type": "transaction",
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "depositInstructions": {
                          "address": "0x4444444444444444444444444444444444444444",
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "amount": "100.50",
                          "amountAtomic": "100500000"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "get": {
        "tags": ["Payments"],
        "operationId": "listPayments",
        "summary": "List payments",
        "description": "Lists canonical receive and send Payments visible to the authenticated app. Filter by either the Stableyard account ID or your external user ID; only Payments visible to your app are returned. List items are canonical Payment resources and intentionally omit checkout credentials and transient next actions. Fetch one Payment when you need its current action.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "acct_123"
            }
          },
          {
            "name": "externalUserId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "user_123"
            }
          },
          {
            "name": "externalReference",
            "in": "query",
            "required": false,
            "description": "Exact match against your order, invoice, or transfer reference.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "example": "invoice_1042"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "intent",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["receive", "send"]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "requires_payment_method",
                "requires_action",
                "processing",
                "accepted",
                "succeeded",
                "failed",
                "cancelled",
                "expired"
              ]
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Payments",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentListResponse"
                },
                "examples": {
                  "firstPage": {
                    "summary": "First page of Payments",
                    "value": {
                      "payments": [
                        {
                          "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                          "apiVersion": "2026-09-09",
                          "intent": "receive",
                          "amountMode": "collect_exact",
                          "status": "requires_payment_method",
                          "offrampStatus": null,
                          "stage": "awaiting_payment",
                          "operationalState": "normal",
                          "operationalReasonCode": null,
                          "operationalUpdatedAt": null,
                          "statusVersion": 1,
                          "paymentAmount": {
                            "amount": "25.00",
                            "amountAtomic": "25000000",
                            "assetType": "crypto",
                            "assetCode": "USDC",
                            "decimals": 6,
                            "chainId": 42161,
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                          },
                          "participants": [
                            {
                              "role": "recipient",
                              "accountId": "acct_123"
                            }
                          ],
                          "destination": {
                            "type": "upa",
                            "accountId": "acct_123"
                          },
                          "settlement": {
                            "type": "settlement_destination",
                            "settlementDestinationId": "destination_123",
                            "destinationType": "connected_wallet",
                            "destinationAddress": "0x1111111111111111111111111111111111111111",
                            "chainId": 42161,
                            "assetCode": "USDC",
                            "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                            "decimals": 6
                          },
                          "fees": {
                            "version": 1,
                            "pricingStatus": "quoted",
                            "platformFeeBps": 50,
                            "partnerFeeBps": 0,
                            "platformFeeAmountAtomic": "125000",
                            "partnerFeeAmountAtomic": "0",
                            "merchantNetAmountAtomic": "24875000"
                          },
                          "funding": null,
                          "externalReference": "order_1042",
                          "description": "Invoice #1042",
                          "metadata": {},
                          "expiresAt": "2026-08-28T10:10:00.000Z",
                          "acceptedAt": null,
                          "succeededAt": null,
                          "cancelledAt": null,
                          "failure": null,
                          "refundSummary": {
                            "status": "none",
                            "count": 0,
                            "requestedAmountAtomic": "0",
                            "confirmedAmountAtomic": "0"
                          },
                          "incidentRecoverySummary": {
                            "count": 0,
                            "pendingCount": 0,
                            "confirmedCount": 0,
                            "failedCount": 0,
                            "requiresInterventionCount": 0,
                            "requestedAmountAtomic": "0",
                            "confirmedAmountAtomic": "0"
                          },
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "updatedAt": "2026-08-28T10:00:00.000Z"
                        }
                      ],
                      "nextCursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments/external-bank/banks": {
      "get": {
        "tags": ["Payments"],
        "operationId": "listExternalBanks",
        "summary": "List supported beneficiary banks",
        "description": "Returns the bank codes accepted for an enabled external-bank Payment country. Use the selected code unchanged in `destination.bankCode`. Stableyard verifies the beneficiary account before collecting funds. Some countries are available in production only; check `GET /v2/partners/config`.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2,
              "pattern": "^[A-Za-z]{2}$",
              "example": "VN"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Supported banks",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["country", "currency", "banks"],
                  "properties": {
                    "country": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$",
                      "example": "VN"
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$",
                      "example": "VND"
                    },
                    "banks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": ["code", "name"],
                        "properties": {
                          "code": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "example": "970436"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200,
                            "example": "Vietcombank"
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "example": {
                    "summary": "List supported beneficiary banks 200 response",
                    "value": {
                      "country": "VN",
                      "currency": "VND",
                      "banks": [
                        {
                          "code": "970436",
                          "name": "Vietcombank"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/payments/preview": {
      "post": {
        "tags": ["Payments"],
        "operationId": "previewPayment",
        "summary": "Preview payment",
        "description": "Read-only preview for the canonical send Payment request. It resolves the sender, destination, fee, available funding options, and next action without creating a Payment. For crypto Send, proceed only when the selected payment source is available. When `route.required` is true, an enabled Vault source can fund a cross-chain send; confirm the same Payment with its returned managed authorization. Connected-wallet Send still requires a direct transfer. Receive Payment creation does not require a preview.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanonicalSendPaymentCreateRequest"
              },
              "examples": {
                "sendToHandle": {
                  "summary": "Preview send to Stableyard handle",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "payment_handle",
                      "paymentHandle": "alice@partner"
                    },
                    "paymentAmount": {
                      "amount": "1.00",
                      "assetCode": "USDC"
                    }
                  }
                },
                "sendToWallet": {
                  "summary": "Preview direct send to raw wallet",
                  "value": {
                    "intent": "send",
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "destination": {
                      "type": "crypto_wallet",
                      "chainId": 8453,
                      "address": "0x2222222222222222222222222222222222222222",
                      "assetCode": "USDC"
                    },
                    "paymentAmount": {
                      "amountAtomic": "1000000",
                      "decimals": 6,
                      "assetCode": "USDC"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Canonical Payment preview",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentPreviewResponse"
                },
                "examples": {
                  "directSend": {
                    "summary": "Connected-wallet send preview",
                    "value": {
                      "sender": {
                        "accountId": "acct_sender"
                      },
                      "paymentAmount": {
                        "amount": "10.00",
                        "amountAtomic": "10000000",
                        "assetType": "crypto",
                        "assetCode": "USDC",
                        "decimals": 6,
                        "chainId": 8453,
                        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                      },
                      "sourceAmount": {
                        "amount": "10.05",
                        "amountAtomic": "10050000",
                        "assetType": "crypto",
                        "assetCode": "USDC",
                        "decimals": 6,
                        "chainId": 8453,
                        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                      },
                      "destination": {
                        "type": "crypto_wallet",
                        "chainId": 8453,
                        "address": "0x2222222222222222222222222222222222222222",
                        "assetCode": "USDC",
                        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                      },
                      "estimatedSettlementAmount": {
                        "amount": "10.00",
                        "amountAtomic": "10000000",
                        "assetType": "crypto",
                        "assetCode": "USDC",
                        "decimals": 6,
                        "chainId": 8453,
                        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                      },
                      "estimatedFees": {
                        "totalFeeBps": 50,
                        "totalFeeAmountAtomic": "50000"
                      },
                      "paymentSource": {
                        "id": "wallet_123",
                        "type": "vault",
                        "chainId": 8453,
                        "assetCode": "USDC",
                        "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                        "address": "0x1111111111111111111111111111111111111111"
                      },
                      "route": {
                        "required": false,
                        "sourceChainId": 8453,
                        "destinationChainId": 8453,
                        "sourceAssetCode": "USDC",
                        "destinationAssetCode": "USDC"
                      },
                      "fundingOptions": [
                        {
                          "type": "vault",
                          "available": true,
                          "executionMode": "external_transaction"
                        },
                        {
                          "type": "vault",
                          "available": false,
                          "executionMode": "managed_authorization",
                          "unavailableReason": "vault_not_active"
                        }
                      ],
                      "nextAction": {
                        "type": "transaction",
                        "createPaymentEndpoint": "/v2/payments",
                        "confirmPaymentEndpoint": "/v2/payments/{paymentId}/confirm"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "parameters": [
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ]
      }
    },
    "/v2/payments/decode-qr": {
      "post": {
        "tags": ["Payments"],
        "operationId": "decodeQr",
        "summary": "Preview a QR code's decode and classification",
        "description": "Decode an External QR without creating a Payment, reserving a priced quote, or changing Stableyard financial state. Returns the same nullable qrInfo fields for all supported countries, including PH/PHP, VN/VND, ID/IDR, KE/KES, BR/BRL, CO/COP and PE/PEN when enabled for the app. QR amountUsd and fee are indicative decode values, not the binding payment quote or combined Stableyard fees; use POST /v2/payments for funding amounts and funding.totalFees. Missing decoded values are null, never assumed zero. A zero sentinel on a classified static/personal QR becomes null unless explicitly dynamic; actual Payments still require a positive amount. The request accepts only sender, country and qrPayload. QR rejection returns 400; an invalid upstream response returns 502; a temporary upstream failure returns 503. payable describes destination classification, not approval to move funds. The sender UPA must already be enabled for External QR payments. QR contents and decoded account numbers are sensitive; do not log or persist raw decode responses.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecodeQrRequest"
              },
              "examples": {
                "personalQr": {
                  "summary": "Preview a Philippines QR code",
                  "value": {
                    "sender": {
                      "accountId": "acct_sender"
                    },
                    "country": "PH",
                    "qrPayload": "00020101021127590012com.p2pqrpay..."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "QR decode preview",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecodeQrResponse"
                },
                "examples": {
                  "personalQr": {
                    "summary": "Personal QR -- not payable through this rail",
                    "description": "Fictional sample details for documentation only; do not use for real transfers.",
                    "value": {
                      "payable": false,
                      "merchant": {
                        "displayName": "Alex Sample",
                        "country": "PH",
                        "business": false
                      },
                      "accountNumber": "000000000001",
                      "qrInfo": {
                        "country": "PH",
                        "currency": "PHP",
                        "amount": null,
                        "txId": "scan_reference_123",
                        "merchant": "Alex Sample",
                        "beneficiaryName": "Alex Sample",
                        "bank": {
                          "code": "EXAMPLE_BANK_PH",
                          "name": "Example Bank"
                        },
                        "amountUsd": null,
                        "fee": null
                      },
                      "manualBankTransfer": {
                        "accountNumber": "000000000001",
                        "bankCode": "EXAMPLE_BANK_PH",
                        "accountHolderName": "Alex Sample"
                      }
                    }
                  },
                  "businessQr": {
                    "summary": "Business QR -- payable through this rail",
                    "value": {
                      "payable": true,
                      "merchant": {
                        "displayName": "Corner Store PH",
                        "country": "PH",
                        "business": true,
                        "dynamic": true
                      },
                      "accountNumber": null,
                      "qrInfo": {
                        "country": "PH",
                        "currency": "PHP",
                        "amount": "52.00",
                        "txId": "scan_reference_456",
                        "merchant": "Corner Store PH",
                        "beneficiaryName": null,
                        "bank": null,
                        "amountUsd": "0.912345",
                        "fee": "0.02"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ]
      }
    },
    "/v2/payments/{paymentId}": {
      "get": {
        "tags": ["Payments"],
        "operationId": "getPayment",
        "summary": "Get payment",
        "description": "Returns the canonical Payment and its current `nextAction`, if one exists. Only the `payment_*` identifier is accepted. Checkout client secrets are issued on receive Payment creation and are not returned by subsequent reads.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Payment details",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentResponse"
                },
                "examples": {
                  "receivePayment": {
                    "summary": "Current receive Payment state",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "apiVersion": "2026-09-09",
                        "intent": "receive",
                        "amountMode": "collect_exact",
                        "status": "requires_payment_method",
                        "offrampStatus": null,
                        "stage": "awaiting_payment",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 1,
                        "paymentAmount": {
                          "amount": "25.00",
                          "amountAtomic": "25000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                        },
                        "participants": [
                          {
                            "role": "recipient",
                            "accountId": "acct_123"
                          }
                        ],
                        "destination": {
                          "type": "upa",
                          "accountId": "acct_123"
                        },
                        "settlement": {
                          "type": "settlement_destination",
                          "settlementDestinationId": "destination_123",
                          "destinationType": "connected_wallet",
                          "destinationAddress": "0x1111111111111111111111111111111111111111",
                          "chainId": 42161,
                          "assetCode": "USDC",
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        },
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "125000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "24875000"
                        },
                        "funding": null,
                        "externalReference": "order_1042",
                        "description": "Invoice #1042",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      },
                      "nextAction": {
                        "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "type": "payment_method",
                        "expiresAt": "2026-08-28T10:10:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments/{paymentId}/checkout": {
      "get": {
        "tags": ["Payments"],
        "operationId": "getPaymentCheckoutLink",
        "summary": "Get a payment's hosted checkout link",
        "description": "Returns the shareable hosted checkout URL and snapshotted return URL for a Payment created by this app environment. This includes receive checkout and send Payments that must collect source funds before an external payout. It never returns the Payment client secret. Only the app that created the Payment can retrieve its link.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Hosted checkout link",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentCheckoutLinkResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get a payment's hosted checkout link 200 response",
                    "value": {
                      "paymentId": "payment_123",
                      "paymentUrl": "https://example.com",
                      "expiresAt": null,
                      "returnUrl": null,
                      "paymentStatus": "requires_payment_method",
                      "canAcceptPayment": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments/{paymentId}/confirm": {
      "post": {
        "tags": ["Payments"],
        "operationId": "confirmPayment",
        "summary": "Confirm outgoing send action",
        "description": "Confirms the pending action for an outgoing send execution. Connected-wallet sources submit a transaction hash after signing/sending from the wallet. Managed or Vault-backed sources submit the requested authorization proof. Escrow-funded Payments use their checkout funding method instead; this endpoint returns 409 with reasonCode payment_confirmation_not_supported when no outgoing execution exists. A transaction nextAction with depositInstructions describes escrow funding, not a confirm action. A successful response means the proof was accepted, not that settlement is final.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanonicalConfirmPaymentRequest"
              },
              "examples": {
                "example": {
                  "summary": "Confirm outgoing send action request",
                  "value": {
                    "actionId": "action_123",
                    "proof": {
                      "type": "transaction",
                      "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                    },
                    "metadata": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmed payment action",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentResponse"
                },
                "examples": {
                  "proofAccepted": {
                    "summary": "Proof accepted; confirmation is still processing",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8M7H3C6D9P2Q4R5T7V8WXA",
                        "apiVersion": "2026-09-09",
                        "intent": "send",
                        "amountMode": "deliver_exact",
                        "status": "processing",
                        "offrampStatus": null,
                        "stage": "receipt_verifying",
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 2,
                        "paymentAmount": {
                          "amount": "10.00",
                          "amountAtomic": "10000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "sourceAmount": {
                          "amount": "10.05",
                          "amountAtomic": "10050000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 8453,
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "participants": [
                          {
                            "role": "sender",
                            "accountId": "acct_sender"
                          }
                        ],
                        "destination": {
                          "type": "crypto_wallet",
                          "chainId": 8453,
                          "address": "0x2222222222222222222222222222222222222222",
                          "assetCode": "USDC",
                          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                        },
                        "settlement": null,
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "50000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "10000000"
                        },
                        "funding": null,
                        "externalReference": "transfer_482",
                        "description": "Vendor payout",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": null,
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:01:00.000Z"
                      },
                      "nextAction": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments/{paymentId}/cancel": {
      "post": {
        "tags": ["Payments"],
        "operationId": "cancelPayment",
        "summary": "Cancel unpaid payment",
        "description": "Cancels a receive Payment before a payment is detected or escrow funds are verified. Replaying an already-cancelled Payment returns the same canonical resource. Send Payments cannot be cancelled.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanonicalCancelPaymentRequest"
              },
              "examples": {
                "example": {
                  "summary": "Cancel unpaid payment request",
                  "value": {
                    "reasonCode": "customer_request",
                    "reason": "Requested by partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancelled payment",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalPaymentResponse"
                },
                "examples": {
                  "cancelled": {
                    "summary": "Unfunded receive Payment cancelled",
                    "value": {
                      "payment": {
                        "id": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "apiVersion": "2026-09-09",
                        "intent": "receive",
                        "amountMode": "collect_exact",
                        "status": "cancelled",
                        "offrampStatus": null,
                        "stage": null,
                        "operationalState": "normal",
                        "operationalReasonCode": null,
                        "operationalUpdatedAt": null,
                        "statusVersion": 2,
                        "paymentAmount": {
                          "amount": "25.00",
                          "amountAtomic": "25000000",
                          "assetType": "crypto",
                          "assetCode": "USDC",
                          "decimals": 6,
                          "chainId": 42161,
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                        },
                        "participants": [
                          {
                            "role": "recipient",
                            "accountId": "acct_123"
                          }
                        ],
                        "destination": {
                          "type": "upa",
                          "accountId": "acct_123"
                        },
                        "settlement": {
                          "type": "settlement_destination",
                          "settlementDestinationId": "destination_123",
                          "destinationType": "connected_wallet",
                          "destinationAddress": "0x1111111111111111111111111111111111111111",
                          "chainId": 42161,
                          "assetCode": "USDC",
                          "tokenAddress": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
                          "decimals": 6
                        },
                        "fees": {
                          "version": 1,
                          "pricingStatus": "quoted",
                          "platformFeeBps": 50,
                          "partnerFeeBps": 0,
                          "platformFeeAmountAtomic": "125000",
                          "partnerFeeAmountAtomic": "0",
                          "merchantNetAmountAtomic": "24875000"
                        },
                        "funding": null,
                        "externalReference": "order_1042",
                        "description": "Invoice #1042",
                        "metadata": {},
                        "expiresAt": "2026-08-28T10:10:00.000Z",
                        "acceptedAt": null,
                        "succeededAt": null,
                        "cancelledAt": "2026-08-28T10:02:00.000Z",
                        "failure": null,
                        "refundSummary": {
                          "status": "none",
                          "count": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "incidentRecoverySummary": {
                          "count": 0,
                          "pendingCount": 0,
                          "confirmedCount": 0,
                          "failedCount": 0,
                          "requiresInterventionCount": 0,
                          "requestedAmountAtomic": "0",
                          "confirmedAmountAtomic": "0"
                        },
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:02:00.000Z"
                      },
                      "nextAction": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payments/{paymentId}/refunds": {
      "post": {
        "tags": ["Payments"],
        "operationId": "createPaymentRefund",
        "summary": "Create refund",
        "description": "Creates a refund against a collected direct receive Payment. Stableyard derives the destination from independently verified payer evidence; callers cannot choose or override it. Refunds for on-ramp-funded or multi-payer Payments are handled by Stableyard support.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "request-key-001"
            },
            "description": "Required retry key. Reuse only with the identical refund request."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CanonicalCreateRefundRequest"
              },
              "examples": {
                "decimal-refund-amount": {
                  "summary": "Decimal refund amount",
                  "value": {
                    "amount": "5.00",
                    "reasonCode": "customer_request",
                    "reason": "Requested by partner"
                  }
                },
                "atomic-refund-amount": {
                  "summary": "Atomic refund amount",
                  "value": {
                    "amountAtomic": "5000000",
                    "reasonCode": "customer_request",
                    "reason": "Requested by partner"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Refund accepted",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRefundResponse"
                },
                "examples": {
                  "refundCreated": {
                    "summary": "Refund queued for verified payer destination",
                    "value": {
                      "refund": {
                        "id": "refund_01JY8Q3R5T7V9W2X4Z6AB8CDEF",
                        "paymentId": "payment_01JY8K4Q6P9A2M7T3W5X8Z1BCR",
                        "status": "created",
                        "amount": "5.00",
                        "amountAtomic": "5000000",
                        "assetCode": "USDC",
                        "chainId": 42161,
                        "transactionHash": null,
                        "reasonCode": "customer_request",
                        "reason": "Customer requested a partial refund",
                        "createdAt": "2026-08-28T11:00:00.000Z",
                        "broadcastAt": null,
                        "confirmedAt": null,
                        "failure": null
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "tags": ["Payments"],
        "operationId": "listPaymentRefunds",
        "summary": "List payment refunds",
        "description": "Lists refunds belonging to one canonical Payment in reverse chronological order.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^payment_[A-Za-z0-9_-]+$",
              "example": "payment_123"
            },
            "description": "The `payment_*` ID returned when the Payment was created."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque cursor returned as nextCursor by the previous page."
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Payment refunds",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRefundListResponse"
                },
                "examples": {
                  "example": {
                    "summary": "List payment refunds 200 response",
                    "value": {
                      "refunds": [
                        {
                          "id": "refund_123",
                          "paymentId": "payment_123",
                          "status": "created",
                          "amount": "10.00",
                          "amountAtomic": "1000000",
                          "assetCode": "USDC",
                          "chainId": 1,
                          "transactionHash": null,
                          "reasonCode": "duplicate_payment",
                          "reason": "Requested by partner",
                          "createdAt": "2026-08-28T10:00:00.000Z",
                          "broadcastAt": null,
                          "confirmedAt": null,
                          "failure": {
                            "code": null,
                            "message": null
                          }
                        }
                      ],
                      "nextCursor": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/refunds/{refundId}": {
      "get": {
        "tags": ["Payments"],
        "operationId": "getRefund",
        "summary": "Get refund",
        "description": "Returns one refund. The payer destination remains private; use status and transactionHash for reconciliation.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "refundId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^refund_"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Refund",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanonicalRefundResponse"
                },
                "examples": {
                  "example": {
                    "summary": "Get refund 200 response",
                    "value": {
                      "refund": {
                        "id": "refund_123",
                        "paymentId": "payment_123",
                        "status": "created",
                        "amount": "10.00",
                        "amountAtomic": "1000000",
                        "assetCode": "USDC",
                        "chainId": 1,
                        "transactionHash": null,
                        "reasonCode": "duplicate_payment",
                        "reason": "Requested by partner",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "broadcastAt": null,
                        "confirmedAt": null,
                        "failure": {
                          "code": null,
                          "message": null
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payment-handles/{handle}": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "resolvePaymentHandle",
        "summary": "Resolve payment handle",
        "description": "Resolve a payment handle to its canonical UPA account ID. A bare handle uses the authenticated app namespace; qualified handles must belong to the authenticated partner.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "alice@partner"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved payment handle",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedPaymentHandle"
                },
                "examples": {
                  "example": {
                    "summary": "Resolve payment handle 200 response",
                    "value": {
                      "accountId": "acct_123",
                      "paymentHandle": {
                        "id": "handle_123",
                        "accountId": "acct_123",
                        "namespace": "partner",
                        "handle": "alice",
                        "status": "active",
                        "createdAt": "2026-08-28T10:00:00.000Z",
                        "updatedAt": "2026-08-28T10:00:00.000Z"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/v2/payment-handles/{handle}/availability": {
      "get": {
        "tags": ["Accounts"],
        "operationId": "getPaymentHandleAvailability",
        "summary": "Check handle availability",
        "description": "Use this before setting a username or payment handle. A bare handle such as `alice` uses the authenticated app namespace. A qualified `alice@namespace` handle is also accepted when the namespace matches the authenticated app.",
        "security": [
          {
            "partnerBasicAuth": []
          }
        ],
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "example": "alice"
            }
          },
          {
            "name": "Stableyard-Version",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            },
            "description": "Optional contract-version assertion. Omit it to use the app environment's pinned version. A different supported version is accepted only after that environment is explicitly migrated."
          }
        ],
        "responses": {
          "200": {
            "description": "Handle availability",
            "headers": {
              "Stableyard-Version": {
                "description": "Effective date-based Stableyard API contract version for this response.",
                "schema": {
                  "type": "string",
                  "enum": ["2026-09-09"]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandleAvailability"
                },
                "examples": {
                  "example": {
                    "summary": "Check handle availability 200 response",
                    "value": {
                      "namespace": "partner",
                      "handle": "alice",
                      "available": true,
                      "status": "available"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "424": {
            "$ref": "#/components/responses/FailedDependency"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "partnerBasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "HTTP Basic auth. Username is the Stableyard app ID. Password is the app secret. The optional Stableyard-Version request header must match the environment pin."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "bad_request",
                "value": {
                  "error": {
                    "code": "bad_request",
                    "message": "The request is invalid"
                  }
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "unauthorized",
                "value": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Authentication is required"
                  }
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The app secret does not include the required scope",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "forbidden",
                "value": {
                  "error": {
                    "code": "forbidden",
                    "message": "The credential does not allow this operation"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "not_found",
                "value": {
                  "error": {
                    "code": "not_found",
                    "message": "The resource was not found"
                  }
                }
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "idempotency_conflict",
                "value": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "The Idempotency-Key was already used with a different request"
                  }
                }
              }
            }
          }
        }
      },
      "FailedDependency": {
        "description": "This feature is not configured for your app or environment",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "chain_config_missing",
                "value": {
                  "error": {
                    "code": "chain_config_missing",
                    "message": "The requested network is not configured for this environment"
                  }
                }
              }
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "The request is valid but this account, method, or route cannot perform it",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "payment_method_not_supported",
                "value": {
                  "error": {
                    "code": "payment_method_not_supported",
                    "message": "The requested payment method is not supported"
                  }
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Too many requests. Retry after the `Retry-After` interval.",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          },
          "Retry-After": {
            "description": "Seconds until the caller should retry.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          "RateLimit-Limit": {
            "description": "Quota for the most constrained policy.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          "RateLimit-Remaining": {
            "description": "Requests remaining in that policy window.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          "RateLimit-Reset": {
            "description": "Seconds until that policy window resets.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "rate_limited",
                "value": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests"
                  }
                }
              }
            }
          }
        }
      },
      "BadGateway": {
        "description": "An upstream service returned an error. Retry later.",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "provider_failure",
                "value": {
                  "error": {
                    "code": "provider_failure",
                    "message": "An upstream service returned an error"
                  }
                }
              }
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Temporarily unavailable. Retry later.",
        "headers": {
          "Stableyard-Version": {
            "description": "Effective date-based Stableyard API contract version for this response.",
            "schema": {
              "type": "string",
              "enum": ["2026-09-09"]
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "example": {
                "summary": "provider_unavailable",
                "value": {
                  "error": {
                    "code": "provider_unavailable",
                    "message": "The service is temporarily unavailable"
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "CreateBankBeneficiaryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "label",
          "country",
          "currency",
          "bankCode",
          "accountNumber",
          "beneficiaryName"
        ],
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "country": {
            "type": "string",
            "enum": ["PH", "VN"]
          },
          "currency": {
            "type": "string",
            "enum": ["PHP", "VND"],
            "description": "Must match country: PH/PHP or VN/VND."
          },
          "bankCode": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$",
            "description": "Read the enabled external-bank directory for the country."
          },
          "accountNumber": {
            "type": "string",
            "minLength": 4,
            "maxLength": 64,
            "writeOnly": true
          },
          "beneficiaryName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Caller assertion; the provider-verified name is authoritative on payment."
          }
        }
      },
      "SavedBankBeneficiary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "label",
          "country",
          "currency",
          "bankCode",
          "beneficiaryName",
          "accountNumberLast4",
          "status",
          "verificationStatus",
          "version",
          "createdAt",
          "disabledAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$"
          },
          "accountId": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "bankCode": {
            "type": "string"
          },
          "beneficiaryName": {
            "type": "string"
          },
          "accountNumberLast4": {
            "type": "string",
            "minLength": 4,
            "maxLength": 4
          },
          "status": {
            "type": "string",
            "enum": ["active", "disabled"]
          },
          "verificationStatus": {
            "type": "string",
            "const": "verify_on_payment"
          },
          "version": {
            "type": "integer",
            "const": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "disabledAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "CanonicalBeneficiaryPaymentCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "intent",
          "sender",
          "destination",
          "amountMode",
          "paymentAmount"
        ],
        "description": "Creates a fresh external-bank Payment using an active beneficiary owned by the sender. Rechecks compliance, route and provider verification. Stateless preview is unavailable. The response destination remains external_bank with a sanitized verified beneficiary snapshot.",
        "properties": {
          "intent": {
            "type": "string",
            "const": "send"
          },
          "sender": {
            "$ref": "#/components/schemas/CanonicalAccountLocator"
          },
          "destination": {
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "beneficiaryId"],
            "properties": {
              "type": {
                "type": "string",
                "const": "beneficiary"
              },
              "beneficiaryId": {
                "type": "string",
                "pattern": "^beneficiary_[A-Za-z0-9_-]{3,48}$"
              }
            }
          },
          "amountMode": {
            "type": "string",
            "const": "deliver_exact"
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalFiatPaymentAmountInput"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "expiresInSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 600
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "IdentityReusePolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": ["enabled", "version"],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          },
          "sourceApplicationId": {
            "type": "string",
            "format": "uuid"
          },
          "receivingApplicationId": {
            "type": "string",
            "format": "uuid"
          },
          "workflowId": {
            "type": "string",
            "format": "uuid"
          },
          "trustReview": {
            "type": "boolean",
            "description": "Configured only by Stableyard operations; false means review-first."
          },
          "agreementReference": {
            "type": "string",
            "maxLength": 128
          },
          "approvalExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "maxVerificationAgeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "maxScreeningAgeHours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 720
          },
          "validityDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "consentVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        }
      },
      "ImportAccountIdentityRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["shareToken", "consent"],
        "properties": {
          "shareToken": {
            "type": "string",
            "minLength": 100,
            "maxLength": 8192,
            "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",
            "writeOnly": true,
            "example": "eyJhbGciOiJIUzI1NiJ9.eyJzZXNzaW9uX2lkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwic2Vzc2lvbl9raW5kIjoidXNlciIsImZyb21fYXBwbGljYXRpb25faWQiOiIyMjIyMjIyMi0yMjIyLTQyMjItODIyMi0yMjIyMjIyMjIyMjIiLCJmb3JfYXBwbGljYXRpb25faWQiOiIzMzMzMzMzMy0zMzMzLTQzMzMtODMzMy0zMzMzMzMzMzMzMzMiLCJpYXQiOjAsImV4cCI6MX0.synthetic_invalid_signature",
            "description": "Short-lived token minted for Stableyard's receiving identity application. Example is deliberately invalid."
          },
          "consent": {
            "type": "object",
            "additionalProperties": false,
            "required": ["accepted", "version", "reference"],
            "properties": {
              "accepted": {
                "type": "boolean",
                "const": true
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_.:-]+$",
                "example": "v1"
              },
              "reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9_.:-]+$",
                "example": "consent_receipt_123"
              }
            }
          }
        }
      },
      "IdentityImportResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["import", "verification"],
        "properties": {
          "import": {
            "type": "object",
            "additionalProperties": false,
            "required": ["id", "status", "nextAction"],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^kyc_import_[a-zA-Z0-9_-]+$",
                "example": "kyc_import_123"
              },
              "status": {
                "type": "string",
                "enum": [
                  "submitting",
                  "imported",
                  "requires_reconciliation",
                  "rejected"
                ]
              },
              "nextAction": {
                "type": "object",
                "additionalProperties": false,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["none", "wait", "contact_support"]
                  }
                }
              }
            }
          },
          "verification": {
            "$ref": "#/components/schemas/KycVerification"
          }
        }
      },
      "StableyardApiVersion": {
        "type": "string",
        "enum": ["2026-08-28", "2026-09-09"],
        "example": "2026-09-09",
        "description": "Immutable date-based contract recorded on the resource. Historical values may appear on existing records; only versions advertised in x-stableyard-supported-api-versions are accepted for new requests."
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": ["code", "message"],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "example": "bad_request"
              },
              "message": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000,
                "example": "The request is invalid"
              },
              "details": {}
            }
          }
        }
      },
      "PaymentDestinationCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "chainId",
          "networkCode",
          "chainName",
          "chainFamily",
          "assetSymbol",
          "tokenAddress",
          "decimals",
          "assetKind",
          "logoUrl",
          "minimumAmount",
          "maximumAmount",
          "available",
          "disabledReason"
        ],
        "properties": {
          "chainId": {
            "type": "integer",
            "minimum": 1,
            "example": 8453
          },
          "networkCode": {
            "type": "string",
            "example": "base"
          },
          "chainName": {
            "type": "string",
            "example": "Base"
          },
          "chainFamily": {
            "type": "string",
            "enum": ["evm", "tron", "btc", "solana", "movement"]
          },
          "assetSymbol": {
            "type": "string",
            "pattern": "^[A-Z0-9]{2,16}$",
            "example": "USDC"
          },
          "tokenAddress": {
            "type": "string",
            "example": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 6
          },
          "assetKind": {
            "type": "string",
            "enum": ["token", "native"]
          },
          "logoUrl": {
            "type": ["string", "null"],
            "format": "uri",
            "description": "Optional asset logo override. Official Stableyard interface SDKs use their bundled chain and asset logos when null."
          },
          "minimumAmount": {
            "type": "string",
            "pattern": "^(?:[1-9][0-9]*(?:\\.[0-9]+)?|0\\.(?:[0-9]*[1-9][0-9]*))$",
            "example": "10"
          },
          "maximumAmount": {
            "type": "string",
            "pattern": "^(?:[1-9][0-9]*(?:\\.[0-9]+)?|0\\.(?:[0-9]*[1-9][0-9]*))$",
            "example": "1000"
          },
          "available": {
            "type": "boolean",
            "const": true
          },
          "disabledReason": {
            "type": "null"
          }
        }
      },
      "PaymentCheckoutLinkResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "paymentId",
          "paymentUrl",
          "expiresAt",
          "returnUrl",
          "paymentStatus",
          "canAcceptPayment"
        ],
        "properties": {
          "paymentId": {
            "type": "string",
            "pattern": "^payment_[A-Za-z0-9_-]+$"
          },
          "paymentUrl": {
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "returnUrl": {
            "type": ["string", "null"],
            "format": "uri"
          },
          "paymentStatus": {
            "type": "string",
            "enum": [
              "requires_payment_method",
              "requires_action",
              "processing",
              "accepted",
              "succeeded",
              "failed",
              "cancelled",
              "expired"
            ]
          },
          "canAcceptPayment": {
            "type": "boolean"
          }
        }
      },
      "CanonicalDecimalPaymentAmountInput": {
        "title": "Decimal amount",
        "description": "Recommended for business integrations. For example, `10.00` USDC.",
        "type": "object",
        "additionalProperties": false,
        "required": ["amount", "assetCode"],
        "properties": {
          "amount": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$",
            "example": "50.00"
          },
          "assetType": {
            "type": "string",
            "enum": ["crypto", "fiat"],
            "default": "crypto"
          },
          "assetCode": {
            "type": "string",
            "pattern": "^[A-Z0-9][A-Z0-9._-]{1,23}$",
            "example": "USDC"
          },
          "chainId": {
            "type": "integer",
            "minimum": 1,
            "example": 8453
          },
          "tokenAddress": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        }
      },
      "CanonicalAtomicPaymentAmountInput": {
        "title": "Atomic amount",
        "description": "Use when your application already works in token atomic units. `decimals` is required.",
        "type": "object",
        "additionalProperties": false,
        "required": ["amountAtomic", "decimals", "assetCode"],
        "properties": {
          "amountAtomic": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[1-9][0-9]*$",
            "example": "50000000"
          },
          "assetType": {
            "type": "string",
            "enum": ["crypto", "fiat"],
            "default": "crypto"
          },
          "assetCode": {
            "type": "string",
            "pattern": "^[A-Z0-9][A-Z0-9._-]{1,23}$",
            "example": "USDC"
          },
          "chainId": {
            "type": "integer",
            "minimum": 1,
            "example": 8453
          },
          "tokenAddress": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 6
          }
        }
      },
      "CanonicalPaymentAmountInput": {
        "title": "Payment amount",
        "description": "Specify the payment amount once, either as a human-readable decimal string or in token atomic units. Never send both representations.",
        "oneOf": [
          {
            "title": "Decimal amount",
            "$ref": "#/components/schemas/CanonicalDecimalPaymentAmountInput"
          },
          {
            "title": "Atomic amount",
            "$ref": "#/components/schemas/CanonicalAtomicPaymentAmountInput"
          }
        ]
      },
      "CanonicalFiatDecimalPaymentAmountInput": {
        "title": "Decimal fiat amount",
        "description": "The exact fiat amount the merchant must receive. The currency must match the selected QR country.",
        "type": "object",
        "additionalProperties": false,
        "required": ["amount", "assetType", "assetCode"],
        "properties": {
          "amount": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$",
            "example": "500.00"
          },
          "assetType": {
            "type": "string",
            "const": "fiat"
          },
          "assetCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9._-]{1,23}$",
            "example": "PHP"
          }
        }
      },
      "CanonicalFiatAtomicPaymentAmountInput": {
        "title": "Atomic fiat amount",
        "description": "The exact fiat amount in the currency's minor units. `decimals` must match the selected QR country's currency.",
        "type": "object",
        "additionalProperties": false,
        "required": ["amountAtomic", "decimals", "assetType", "assetCode"],
        "properties": {
          "amountAtomic": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[1-9][0-9]*$",
            "example": "50000"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 2
          },
          "assetType": {
            "type": "string",
            "const": "fiat"
          },
          "assetCode": {
            "type": "string",
            "pattern": "^[A-Z][A-Z0-9._-]{1,23}$",
            "example": "PHP"
          }
        }
      },
      "CanonicalFiatPaymentAmountInput": {
        "title": "Fiat payment amount",
        "oneOf": [
          {
            "title": "Decimal fiat amount",
            "$ref": "#/components/schemas/CanonicalFiatDecimalPaymentAmountInput"
          },
          {
            "title": "Atomic fiat amount",
            "$ref": "#/components/schemas/CanonicalFiatAtomicPaymentAmountInput"
          }
        ]
      },
      "CanonicalPaymentAmount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount",
          "amountAtomic",
          "assetType",
          "assetCode",
          "decimals"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$",
            "example": "50.00"
          },
          "amountAtomic": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[1-9][0-9]*$",
            "example": "50000000"
          },
          "assetType": {
            "type": "string",
            "enum": ["crypto", "fiat"]
          },
          "assetCode": {
            "type": "string",
            "example": "USDC"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 6
          },
          "chainId": {
            "type": "integer",
            "minimum": 1,
            "example": 8453
          },
          "tokenAddress": {
            "type": "string"
          }
        }
      },
      "CanonicalAccountLocator": {
        "title": "UPA account locator",
        "description": "Identify a UPA using either its Stableyard account ID or your own external user ID.",
        "oneOf": [
          {
            "title": "Stableyard account ID",
            "type": "object",
            "additionalProperties": false,
            "required": ["accountId"],
            "properties": {
              "accountId": {
                "type": "string",
                "example": "acct_123"
              }
            }
          },
          {
            "title": "External user ID",
            "type": "object",
            "additionalProperties": false,
            "required": ["externalUserId"],
            "properties": {
              "externalUserId": {
                "type": "string",
                "maxLength": 128,
                "example": "user_123"
              }
            }
          }
        ]
      },
      "CanonicalReceiveRecipient": {
        "title": "Receive payment recipient",
        "description": "Choose where Stableyard ultimately settles the receive Payment. A UPA uses its settlement profile; an external wallet is paid directly without creating a UPA.",
        "oneOf": [
          {
            "title": "UPA by account ID",
            "type": "object",
            "additionalProperties": false,
            "required": ["accountId"],
            "properties": {
              "accountId": {
                "type": "string",
                "example": "acct_123"
              }
            }
          },
          {
            "title": "UPA by external user ID",
            "type": "object",
            "additionalProperties": false,
            "required": ["externalUserId"],
            "properties": {
              "externalUserId": {
                "type": "string",
                "maxLength": 128,
                "example": "user_123"
              }
            }
          },
          {
            "title": "External wallet",
            "type": "object",
            "additionalProperties": false,
            "required": ["wallet"],
            "properties": {
              "wallet": {
                "type": "object",
                "additionalProperties": false,
                "required": ["chainId", "address", "assetCode"],
                "properties": {
                  "chainId": {
                    "type": "integer",
                    "minimum": 1,
                    "example": 8453
                  },
                  "address": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 256
                  },
                  "assetCode": {
                    "type": "string",
                    "example": "USDC"
                  },
                  "tokenAddress": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              }
            }
          }
        ]
      },
      "CanonicalSendDestination": {
        "title": "Send payment destination",
        "description": "Send to another UPA, a payment handle, or an external crypto wallet. External QR and bank rails use their dedicated request variants below.",
        "oneOf": [
          {
            "title": "UPA account",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "account"],
            "properties": {
              "type": {
                "type": "string",
                "const": "upa"
              },
              "account": {
                "$ref": "#/components/schemas/CanonicalAccountLocator"
              }
            }
          },
          {
            "title": "Payment handle",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "paymentHandle"],
            "properties": {
              "type": {
                "type": "string",
                "const": "payment_handle"
              },
              "paymentHandle": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "example": "alice@partner"
              }
            }
          },
          {
            "title": "External crypto wallet",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "chainId", "address", "assetCode"],
            "properties": {
              "type": {
                "type": "string",
                "const": "crypto_wallet"
              },
              "chainId": {
                "type": "integer",
                "minimum": 1,
                "example": 8453
              },
              "address": {
                "type": "string",
                "minLength": 8,
                "maxLength": 256,
                "example": "0x2222222222222222222222222222222222222222"
              },
              "assetCode": {
                "type": "string",
                "example": "USDC"
              },
              "tokenAddress": {
                "type": "string"
              }
            }
          }
        ]
      },
      "CanonicalSendPaymentCreateRequest": {
        "title": "Send payment",
        "description": "Move funds from an existing UPA payment source to another UPA, payment handle, or external crypto wallet. Crypto Send supports direct transfers and, when enabled, Vault-funded cross-chain or cross-token Routing. The paymentAmount identifies the exact destination asset and amount. Commercial fees are calculated on the quoted source input and added on top; sourceAmount shows the total sender debit. Routing uses exact_output and does not reduce the authorized destination amount for slippage. Preview first and stop when the selected source is unavailable. Routed Vault sends keep the same Payment ID end to end.",
        "type": "object",
        "additionalProperties": false,
        "required": ["intent", "sender", "destination", "paymentAmount"],
        "properties": {
          "intent": {
            "type": "string",
            "const": "send"
          },
          "sender": {
            "$ref": "#/components/schemas/CanonicalAccountLocator"
          },
          "destination": {
            "$ref": "#/components/schemas/CanonicalSendDestination"
          },
          "amountMode": {
            "type": "string",
            "const": "deliver_exact",
            "default": "deliver_exact"
          },
          "mandateId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Optional active Vault mandate authorizing this outgoing occurrence. A mandate constrains Vault spending; it does not schedule recurring Payments.",
            "example": "vault_mandate_123"
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalPaymentAmountInput"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "expiresInSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 600
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CanonicalExternalQrPaymentCreateRequest": {
        "title": "External QR payment",
        "description": "Pay an external merchant QR through the canonical Payment API. The merchant receives the exact fiat obligation (`deliver_exact`); Stableyard collects quoted USDC in an Arbitrum One Payment escrow. The sender uses direct Arbitrum USDC, or a linked Base USDC wallet when Base routing is enabled and the provider returns enough confirmed quote time. The QR provider is invoked only after source and escrow evidence are verified. This rail has no standalone Offramp API and cannot use the stateless preview endpoint.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "intent",
          "sender",
          "destination",
          "amountMode",
          "paymentAmount"
        ],
        "properties": {
          "intent": {
            "type": "string",
            "const": "send"
          },
          "sender": {
            "$ref": "#/components/schemas/CanonicalAccountLocator"
          },
          "destination": {
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "country", "qrPayload"],
            "properties": {
              "type": {
                "type": "string",
                "const": "external_qr"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "example": "PH"
              },
              "qrPayload": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096,
                "example": "000201010212..."
              }
            }
          },
          "amountMode": {
            "type": "string",
            "const": "deliver_exact"
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalFiatPaymentAmountInput"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "expiresInSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 600
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CanonicalExternalBankPaymentCreateRequest": {
        "title": "External bank payment",
        "description": "Pay an exact fiat amount to a one-time bank beneficiary supplied inline. Stableyard verifies the account and freezes the payout quote before source-fund collection. US payouts require a saved linked-bank destination instead. The account number is never returned or persisted in raw form.",
        "type": "object",
        "additionalProperties": false,
        "required": [
          "intent",
          "sender",
          "destination",
          "amountMode",
          "paymentAmount"
        ],
        "properties": {
          "intent": {
            "type": "string",
            "const": "send"
          },
          "sender": {
            "$ref": "#/components/schemas/CanonicalAccountLocator"
          },
          "destination": {
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "country", "bankCode", "accountNumber"],
            "properties": {
              "type": {
                "type": "string",
                "const": "external_bank"
              },
              "country": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2,
                "pattern": "^[A-Za-z]{2}$",
                "example": "VN"
              },
              "bankCode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
                "example": "970436"
              },
              "accountNumber": {
                "type": "string",
                "minLength": 4,
                "maxLength": 64,
                "writeOnly": true,
                "example": "0123456789"
              },
              "beneficiaryName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Required for Philippines (PH) bank transfers; optional for Vietnam (VN). Supply the beneficiary's bank account holder name. Stableyard checks the verified beneficiary name against this value."
              }
            },
            "if": {
              "properties": {
                "country": {
                  "pattern": "^[Pp][Hh]$"
                }
              },
              "required": ["country"]
            },
            "then": {
              "required": ["beneficiaryName"]
            }
          },
          "amountMode": {
            "type": "string",
            "const": "deliver_exact"
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalFiatPaymentAmountInput"
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "externalReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "expiresInSeconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 86400,
            "default": 600
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CanonicalLinkedBankPaymentCreateRequest": {
        "title": "Linked bank payout",
        "description": "Pay a verified bank account already linked to the sending UPA. Callers supply only the Stableyard bankAccountId. Whether an exact USD amount (deliver_exact) or an exact crypto amount (collect_exact) is accepted depends on the bank route: a route with a rate lock requires deliver_exact; a route without one (the delivered USD is confirmed only at payout) requires collect_exact. Each payout also carries a flat Stableyard rail fee charged on top of the amount sent (ACH and FedNow $0.50, Fedwire $10.00); it is frozen when the Payment is created and reported in funding.platformFixedFee.",
        "oneOf": [
          {
            "title": "Deliver an exact USD amount",
            "description": "Only for a linked-bank route that can quote a rate lock ahead of collection.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "intent",
              "sender",
              "destination",
              "amountMode",
              "paymentAmount"
            ],
            "properties": {
              "intent": {
                "type": "string",
                "const": "send"
              },
              "sender": {
                "$ref": "#/components/schemas/CanonicalAccountLocator"
              },
              "destination": {
                "type": "object",
                "additionalProperties": false,
                "required": ["type", "bankAccountId"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bank_account"
                  },
                  "bankAccountId": {
                    "type": "string",
                    "pattern": "^bank_[A-Za-z0-9_-]{3,59}$",
                    "example": "bank_123"
                  }
                }
              },
              "amountMode": {
                "type": "string",
                "const": "deliver_exact"
              },
              "paymentAmount": {
                "$ref": "#/components/schemas/CanonicalFiatPaymentAmountInput"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "externalReference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "expiresInSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 86400,
                "default": 600
              },
              "metadata": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          {
            "title": "Collect an exact crypto amount",
            "description": "For a linked-bank route with no rate lock: the sender specifies exactly how much crypto to send, and the delivered USD amount is confirmed only at payout.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "intent",
              "sender",
              "destination",
              "amountMode",
              "paymentAmount"
            ],
            "properties": {
              "intent": {
                "type": "string",
                "const": "send"
              },
              "sender": {
                "$ref": "#/components/schemas/CanonicalAccountLocator"
              },
              "destination": {
                "type": "object",
                "additionalProperties": false,
                "required": ["type", "bankAccountId"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bank_account"
                  },
                  "bankAccountId": {
                    "type": "string",
                    "pattern": "^bank_[A-Za-z0-9_-]{3,59}$",
                    "example": "bank_123"
                  }
                }
              },
              "amountMode": {
                "type": "string",
                "const": "collect_exact"
              },
              "paymentAmount": {
                "$ref": "#/components/schemas/CanonicalPaymentAmountInput"
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "externalReference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "expiresInSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 86400,
                "default": 600
              },
              "metadata": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        ]
      },
      "CanonicalPaymentCreateRequest": {
        "title": "Create payment request",
        "description": "Choose Receive payment when collecting money and Send payment when moving funds owned by an existing UPA. Payment methods such as Direct crypto, Routing, and an enabled hosted on-ramp are selected later within a receive Payment.",
        "oneOf": [
          {
            "title": "Receive payment",
            "description": "Create a bounded checkout that collects funds and settles them to a UPA or external wallet.",
            "type": "object",
            "additionalProperties": false,
            "required": ["intent", "recipient", "paymentAmount"],
            "properties": {
              "intent": {
                "type": "string",
                "const": "receive"
              },
              "recipient": {
                "$ref": "#/components/schemas/CanonicalReceiveRecipient"
              },
              "amountMode": {
                "type": "string",
                "const": "collect_exact",
                "default": "collect_exact"
              },
              "paymentAmount": {
                "$ref": "#/components/schemas/CanonicalPaymentAmountInput"
              },
              "settlement": {
                "type": "object",
                "additionalProperties": false,
                "required": ["settlementDestinationId"],
                "properties": {
                  "settlementDestinationId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              },
              "returnUrl": {
                "type": "string",
                "format": "uri",
                "maxLength": 2048,
                "description": "Optional hosted-checkout return URL. It must exactly match an app URL configured in Payment settings."
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "externalReference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "expiresInSeconds": {
                "type": "integer",
                "minimum": 60,
                "maximum": 86400,
                "default": 600
              },
              "metadata": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          {
            "title": "Send payment",
            "$ref": "#/components/schemas/CanonicalSendPaymentCreateRequest"
          },
          {
            "title": "External QR payment",
            "$ref": "#/components/schemas/CanonicalExternalQrPaymentCreateRequest"
          },
          {
            "$ref": "#/components/schemas/CanonicalBeneficiaryPaymentCreateRequest"
          },
          {
            "title": "External bank payment",
            "$ref": "#/components/schemas/CanonicalExternalBankPaymentCreateRequest"
          },
          {
            "title": "Linked bank payout",
            "$ref": "#/components/schemas/CanonicalLinkedBankPaymentCreateRequest"
          }
        ]
      },
      "CanonicalPaymentDestination": {
        "title": "Resolved payment destination",
        "oneOf": [
          {
            "title": "UPA account",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "accountId"],
            "properties": {
              "type": {
                "type": "string",
                "const": "upa"
              },
              "accountId": {
                "type": "string"
              }
            }
          },
          {
            "title": "Payment handle",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "paymentHandle", "accountId"],
            "properties": {
              "type": {
                "type": "string",
                "const": "payment_handle"
              },
              "paymentHandle": {
                "type": "string"
              },
              "accountId": {
                "type": "string"
              }
            }
          },
          {
            "title": "External crypto wallet",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "chainId",
              "address",
              "assetCode",
              "tokenAddress"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "crypto_wallet"
              },
              "chainId": {
                "type": "integer",
                "minimum": 1
              },
              "address": {
                "type": "string"
              },
              "assetCode": {
                "type": "string"
              },
              "tokenAddress": {
                "type": "string"
              }
            }
          },
          {
            "title": "External merchant QR",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "country", "currency", "dynamic", "merchant"],
            "properties": {
              "type": {
                "type": "string",
                "const": "external_qr"
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "example": "PH"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$",
                "example": "PHP"
              },
              "dynamic": {
                "type": "boolean"
              },
              "merchant": {
                "oneOf": [
                  {
                    "title": "Merchant details",
                    "type": "object",
                    "additionalProperties": false,
                    "required": ["name", "city"],
                    "properties": {
                      "name": {
                        "type": ["string", "null"]
                      },
                      "city": {
                        "type": ["string", "null"]
                      }
                    }
                  },
                  {
                    "title": "Merchant details unavailable",
                    "type": "null"
                  }
                ]
              }
            }
          },
          {
            "title": "External bank beneficiary",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "country", "currency", "beneficiary"],
            "properties": {
              "type": {
                "type": "string",
                "const": "external_bank"
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "example": "VN"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$",
                "example": "VND"
              },
              "beneficiary": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "accountHolderName",
                  "accountNumberLast4",
                  "bankCode",
                  "bankName",
                  "country"
                ],
                "properties": {
                  "accountHolderName": {
                    "type": ["string", "null"],
                    "maxLength": 200
                  },
                  "accountNumberLast4": {
                    "type": ["string", "null"],
                    "pattern": "^[A-Za-z0-9]{4}$"
                  },
                  "bankCode": {
                    "type": ["string", "null"],
                    "maxLength": 64
                  },
                  "bankName": {
                    "type": ["string", "null"],
                    "maxLength": 200
                  },
                  "country": {
                    "type": ["string", "null"],
                    "pattern": "^[A-Z]{2}$"
                  }
                }
              }
            }
          },
          {
            "title": "Verified linked bank account",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "bankAccountId",
              "country",
              "currency",
              "bankName",
              "accountNumberLast4",
              "rail"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "bank_account"
              },
              "bankAccountId": {
                "type": "string",
                "pattern": "^bank_[A-Za-z0-9_-]{3,59}$",
                "example": "bank_123"
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$",
                "example": "US"
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$",
                "example": "USD"
              },
              "bankName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160,
                "example": "Example Bank"
              },
              "accountNumberLast4": {
                "type": "string",
                "pattern": "^[A-Za-z0-9]{4,8}$",
                "example": "6789"
              },
              "rail": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "example": "ach"
              }
            }
          }
        ],
        "discriminator": {
          "propertyName": "type"
        }
      },
      "CanonicalPaymentPreviewResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sender",
          "paymentAmount",
          "sourceAmount",
          "destination",
          "estimatedSettlementAmount",
          "estimatedFees",
          "paymentSource",
          "route",
          "fundingOptions",
          "nextAction"
        ],
        "properties": {
          "sender": {
            "type": "object",
            "additionalProperties": false,
            "required": ["accountId"],
            "properties": {
              "accountId": {
                "type": "string",
                "example": "acct_123"
              }
            }
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalPaymentAmount"
          },
          "sourceAmount": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CanonicalPaymentAmount"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total sender debit in the source asset, including commercial fees added to the required routing input. Null when the route is unavailable and the source input cannot be quoted."
          },
          "destination": {
            "$ref": "#/components/schemas/CanonicalPaymentDestination"
          },
          "estimatedSettlementAmount": {
            "$ref": "#/components/schemas/CanonicalPaymentAmount"
          },
          "estimatedFees": {
            "type": "object",
            "additionalProperties": false,
            "required": ["totalFeeBps", "totalFeeAmountAtomic"],
            "properties": {
              "totalFeeBps": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "totalFeeAmountAtomic": {
                "type": ["string", "null"],
                "pattern": "^[0-9]+$",
                "description": "Commercial fee in source atomic units; null when the source input cannot be quoted."
              }
            }
          },
          "paymentSource": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "type",
              "chainId",
              "assetCode",
              "tokenAddress",
              "address"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": ["connected_wallet", "vault", "deposit_balance"]
              },
              "chainId": {
                "type": "integer",
                "minimum": 1
              },
              "assetCode": {
                "type": "string"
              },
              "tokenAddress": {
                "type": "string"
              },
              "address": {
                "type": ["string", "null"]
              }
            }
          },
          "route": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "required",
              "sourceChainId",
              "destinationChainId",
              "sourceAssetCode",
              "destinationAssetCode"
            ],
            "properties": {
              "required": {
                "type": "boolean"
              },
              "sourceChainId": {
                "type": "integer",
                "minimum": 1
              },
              "destinationChainId": {
                "type": "integer",
                "minimum": 1
              },
              "sourceAssetCode": {
                "type": "string"
              },
              "destinationAssetCode": {
                "type": "string"
              }
            }
          },
          "fundingOptions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["type", "available", "executionMode"],
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "connected_wallet",
                    "vault",
                    "deposit_balance",
                    "external_wallet"
                  ]
                },
                "available": {
                  "type": "boolean"
                },
                "executionMode": {
                  "type": "string"
                },
                "unavailableReason": {
                  "type": "string"
                }
              }
            }
          },
          "nextAction": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "type",
              "createPaymentEndpoint",
              "confirmPaymentEndpoint"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": ["transaction", "managed_authorization"]
              },
              "createPaymentEndpoint": {
                "type": "string",
                "const": "/v2/payments"
              },
              "confirmPaymentEndpoint": {
                "type": "string",
                "const": "/v2/payments/{paymentId}/confirm"
              }
            }
          }
        }
      },
      "DecodeQrRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["sender", "country", "qrPayload"],
        "properties": {
          "sender": {
            "type": "object",
            "additionalProperties": false,
            "required": ["accountId"],
            "properties": {
              "accountId": {
                "type": "string",
                "example": "acct_123"
              }
            }
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "PH"
          },
          "qrPayload": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          }
        }
      },
      "DecodeQrResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["payable", "merchant", "accountNumber", "qrInfo"],
        "properties": {
          "accountNumber": {
            "type": ["string", "null"],
            "maxLength": 64,
            "description": "Decoded destination account number when returned; preserve leading zeros. Sensitive data, not a linked bank account or an authorization to pay."
          },
          "qrInfo": {
            "$ref": "#/components/schemas/DecodedQrInfo"
          },
          "payable": {
            "type": "boolean",
            "description": "False for a personal/peer-to-peer QR classification -- not payable through POST /v2/payments."
          },
          "merchant": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "displayName": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              },
              "rail": {
                "type": "string"
              },
              "dynamic": {
                "type": "boolean"
              },
              "business": {
                "type": "boolean"
              }
            }
          },
          "manualBankTransfer": {
            "type": "object",
            "description": "Present only when payable is false and the QR decodes to a manual bank-transfer destination.",
            "additionalProperties": false,
            "required": ["accountNumber"],
            "properties": {
              "accountNumber": {
                "type": "string"
              },
              "bankCode": {
                "type": "string"
              },
              "accountHolderName": {
                "type": "string"
              }
            }
          },
          "providerReferenceId": {
            "type": "string"
          },
          "destinationAmount": {
            "type": "object",
            "description": "Present only for a dynamic QR that embeds a fixed amount; absent for a static/amount-flexible QR.",
            "additionalProperties": false,
            "required": ["amount", "currency"],
            "properties": {
              "amount": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "example": "50.00"
              },
              "currency": {
                "type": "string",
                "example": "PHP"
              }
            }
          }
        }
      },
      "DecodedQrInfo": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "country",
          "currency",
          "amount",
          "txId",
          "merchant",
          "beneficiaryName",
          "bank",
          "amountUsd",
          "fee"
        ],
        "description": "Normalized, allowlisted QR display metadata. Keys are always present; unknown values are null. Amounts are exact decimal strings. Decode metadata is not a locked Payment quote.",
        "properties": {
          "country": {
            "type": ["string", "null"],
            "pattern": "^[A-Z]{2}$"
          },
          "currency": {
            "type": ["string", "null"],
            "pattern": "^[A-Z0-9]{2,12}$"
          },
          "amount": {
            "type": ["string", "null"],
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$",
            "description": "Fiat amount encoded in the QR, in currency. Null when no amount was returned, including a zero sentinel on a classified static/personal QR unless explicitly dynamic. The payer supplies a positive amount when creating the Payment."
          },
          "txId": {
            "type": ["string", "null"],
            "maxLength": 200,
            "description": "Decode reference, if supplied. Never submit it as payout authorization; Payment creation revalidates the QR."
          },
          "merchant": {
            "type": ["string", "null"],
            "maxLength": 200
          },
          "beneficiaryName": {
            "type": ["string", "null"],
            "maxLength": 200
          },
          "bank": {
            "type": ["object", "null"],
            "additionalProperties": false,
            "required": ["code", "name"],
            "properties": {
              "code": {
                "type": ["string", "null"],
                "maxLength": 64
              },
              "name": {
                "type": ["string", "null"],
                "maxLength": 200
              }
            }
          },
          "amountUsd": {
            "type": ["string", "null"],
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$",
            "description": "Indicative USD amount from the QR decode, when available. Not funding.required."
          },
          "fee": {
            "type": ["string", "null"],
            "pattern": "^(0|[1-9][0-9]{0,17})(\\.[0-9]{1,6})?$",
            "description": "Indicative decode fee. Not a locked fee and does not include Stableyard or app fees. Use the Payment funding quote for payable amounts and fee currency."
          }
        }
      },
      "CanonicalPaymentSettlement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "settlementDestinationId",
          "destinationType",
          "destinationAddress",
          "chainId",
          "assetCode",
          "tokenAddress",
          "decimals"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["settlement_destination", "crypto_wallet"]
          },
          "settlementDestinationId": {
            "type": ["string", "null"]
          },
          "destinationType": {
            "type": "string"
          },
          "destinationAddress": {
            "type": "string"
          },
          "chainId": {
            "type": "integer",
            "minimum": 1
          },
          "assetCode": {
            "type": "string"
          },
          "tokenAddress": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36
          }
        }
      },
      "CanonicalPaymentParticipant": {
        "type": "object",
        "additionalProperties": false,
        "required": ["role", "accountId"],
        "properties": {
          "role": {
            "type": "string",
            "enum": ["sender", "recipient"]
          },
          "accountId": {
            "type": "string",
            "description": "A UPA account belonging to the authenticated organization, app, and environment. Participants that belong to another app are omitted."
          }
        }
      },
      "CanonicalPaymentResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "apiVersion",
          "intent",
          "amountMode",
          "status",
          "offrampStatus",
          "stage",
          "operationalState",
          "operationalReasonCode",
          "operationalUpdatedAt",
          "statusVersion",
          "paymentAmount",
          "participants",
          "destination",
          "settlement",
          "fees",
          "funding",
          "externalReference",
          "description",
          "metadata",
          "expiresAt",
          "acceptedAt",
          "succeededAt",
          "cancelledAt",
          "failure",
          "refundSummary",
          "incidentRecoverySummary",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^payment_[A-Za-z0-9_-]+$"
          },
          "apiVersion": {
            "$ref": "#/components/schemas/StableyardApiVersion"
          },
          "intent": {
            "type": "string",
            "enum": ["receive", "send"]
          },
          "amountMode": {
            "type": "string",
            "enum": ["collect_exact", "deliver_exact"]
          },
          "status": {
            "type": "string",
            "enum": [
              "requires_payment_method",
              "requires_action",
              "processing",
              "accepted",
              "succeeded",
              "failed",
              "cancelled",
              "expired"
            ],
            "description": "Customer-facing financial lifecycle. Operational recovery never regresses a succeeded Payment or replaces this value with requires_intervention."
          },
          "offrampStatus": {
            "type": ["string", "null"],
            "enum": [
              "not_started",
              "processing",
              "failed",
              "refunding",
              "refunded",
              "succeeded",
              null
            ],
            "description": "External payout outcome. failed: the payout failed after funding; a failure before funding is not_started. refunding: Stableyard is returning the source amount to the sender's preferred crypto settlement destination. refunded: the return is confirmed. Null for other Payment types."
          },
          "stage": {
            "type": ["string", "null"],
            "enum": [
              "escrow_provisioning",
              "awaiting_payment",
              "destination_verifying",
              "provider_processing",
              "quote_pending",
              "transaction_broadcast",
              "receipt_verifying",
              "payment_detected",
              "settlement_pending",
              "settlement_broadcast",
              "settlement_confirming",
              "settlement_returned",
              "payout_pending",
              "payout_processing",
              "payout_confirming",
              "refund_pending",
              "refund_broadcast",
              null
            ],
            "description": "Current financial-processing stage. Operational review is represented separately by operationalState."
          },
          "operationalState": {
            "type": "string",
            "enum": ["normal", "retrying", "requires_intervention"],
            "description": "Operational health of the Payment. requires_intervention means Stableyard must act; it is not a financial payment status."
          },
          "operationalReasonCode": {
            "type": ["string", "null"],
            "enum": [
              "collection_requires_intervention",
              "custody_after_failure",
              "duplicate_payment_detected",
              "fee_payout_failed",
              "fee_payout_requires_intervention",
              "fee_payout_retry_scheduled",
              "late_payment_received",
              "payment_execution_requires_intervention",
              "payment_execution_retry_scheduled",
              "escrow_provisioning_retry_scheduled",
              "payment_session_requires_intervention",
              "payout_failed",
              "payout_requires_intervention",
              "payout_retry_scheduled",
              "refund_failed",
              "refund_requires_intervention",
              "refund_retry_scheduled",
              "settlement_failed",
              "settlement_requires_intervention",
              "settlement_retry_scheduled",
              "settlement_unconfirmed",
              null
            ],
            "description": "Machine-readable operational reason when operationalState is not normal."
          },
          "operationalUpdatedAt": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When the operational state or reason last changed."
          },
          "statusVersion": {
            "type": "integer",
            "minimum": 1
          },
          "paymentAmount": {
            "$ref": "#/components/schemas/CanonicalPaymentAmount"
          },
          "sourceAmount": {
            "$ref": "#/components/schemas/CanonicalPaymentAmount",
            "description": "Frozen source debit including commercial fees, exposed for Send execution to callers permitted to view sender fees."
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalPaymentParticipant"
            },
            "description": "Only participant UPAs that belong to your app are returned. The array can be empty for creator-only visibility."
          },
          "recipientDisplay": {
            "oneOf": [
              {
                "title": "Recipient display snapshot",
                "type": "object",
                "additionalProperties": false,
                "required": ["displayName", "logoUrl"],
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "logoUrl": {
                    "type": ["string", "null"],
                    "format": "uri",
                    "maxLength": 2048
                  }
                }
              },
              {
                "title": "No recipient display snapshot",
                "type": "null"
              }
            ],
            "description": "Immutable payer-facing recipient identity captured when the Payment was created."
          },
          "destination": {
            "$ref": "#/components/schemas/CanonicalPaymentDestination"
          },
          "settlement": {
            "description": "Immutable receive-side settlement snapshot. Null for Payment types that do not use a receive settlement destination.",
            "oneOf": [
              {
                "title": "Settlement destination",
                "$ref": "#/components/schemas/CanonicalPaymentSettlement"
              },
              {
                "title": "No settlement destination",
                "type": "null"
              }
            ]
          },
          "fees": {
            "oneOf": [
              {
                "title": "Commercial fee quote pending",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "pricingStatus",
                  "platformFeeBps",
                  "partnerFeeBps",
                  "platformFeeAmountAtomic",
                  "partnerFeeAmountAtomic",
                  "merchantNetAmountAtomic"
                ],
                "properties": {
                  "version": {
                    "type": ["string", "number", "null"]
                  },
                  "pricingStatus": {
                    "type": "string",
                    "const": "quote_pending"
                  },
                  "platformFeeBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "partnerFeeBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "platformFeeAmountAtomic": {
                    "type": "null"
                  },
                  "partnerFeeAmountAtomic": {
                    "type": "null"
                  },
                  "merchantNetAmountAtomic": {
                    "type": "null"
                  }
                }
              },
              {
                "title": "Quoted commercial fee snapshot",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version",
                  "pricingStatus",
                  "platformFeeBps",
                  "partnerFeeBps",
                  "platformFeeAmountAtomic",
                  "partnerFeeAmountAtomic",
                  "merchantNetAmountAtomic"
                ],
                "properties": {
                  "version": {
                    "type": ["string", "number", "null"]
                  },
                  "pricingStatus": {
                    "type": "string",
                    "const": "quoted"
                  },
                  "platformFeeBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "partnerFeeBps": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "platformFeeAmountAtomic": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "partnerFeeAmountAtomic": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "merchantNetAmountAtomic": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^(0|[1-9][0-9]*)$"
                  }
                }
              },
              {
                "title": "Fees unavailable",
                "type": "null"
              }
            ],
            "description": "Commercial fee terms are returned only to the partner that owns them. quote_pending exposes frozen BPS but keeps exact monetary amounts null until the payout quote is frozen; quoted exposes immutable exact atomic amounts, including genuine zero values."
          },
          "funding": {
            "description": "Create-time funding quote for an external fiat send rail. required is the exact source amount. When the sender's active Payment Source is a Stableyard-managed Vault, creation immediately authorizes Vault funding of this amount into the Payment's escrow, and the destination payout starts once that collection is verified. Otherwise creation itself does not debit funds or submit the destination payout. Null for ordinary receive and direct-send Payments.",
            "oneOf": [
              {
                "title": "External payout funding",
                "$ref": "#/components/schemas/CanonicalExternalQrFunding"
              },
              {
                "title": "No separate funding collection",
                "type": "null"
              }
            ]
          },
          "externalReference": {
            "type": ["string", "null"]
          },
          "description": {
            "type": ["string", "null"]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "expiresAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "acceptedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "succeededAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "cancelledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "failure": {
            "oneOf": [
              {
                "title": "Failure details",
                "type": "object",
                "additionalProperties": false,
                "required": ["code", "message"],
                "properties": {
                  "code": {
                    "type": ["string", "null"]
                  },
                  "message": {
                    "type": ["string", "null"]
                  }
                }
              },
              {
                "title": "No failure",
                "type": "null"
              }
            ]
          },
          "refundSummary": {
            "$ref": "#/components/schemas/CanonicalPaymentRefundSummary"
          },
          "incidentRecoverySummary": {
            "$ref": "#/components/schemas/CanonicalPaymentIncidentRecoverySummary"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CanonicalFundingAmount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount",
          "amountAtomic",
          "assetType",
          "assetCode",
          "decimals",
          "chainId",
          "tokenAddress"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$"
          },
          "amountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "assetType": {
            "type": "string",
            "const": "crypto"
          },
          "assetCode": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36
          },
          "chainId": {
            "type": "integer",
            "minimum": 1
          },
          "tokenAddress": {
            "type": "string"
          }
        }
      },
      "CanonicalPaymentDepositInstructions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "address",
          "chainId",
          "tokenAddress",
          "assetCode",
          "decimals",
          "amount",
          "amountAtomic"
        ],
        "description": "The exact on-chain deposit to make. Send precisely amountAtomic of tokenAddress on chainId to address; anything else will not be recognized as this Payment's funding.",
        "properties": {
          "address": {
            "type": "string"
          },
          "chainId": {
            "type": "integer",
            "minimum": 1
          },
          "tokenAddress": {
            "type": "string"
          },
          "assetCode": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$"
          },
          "amountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        }
      },
      "CanonicalExternalQrFunding": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "required",
          "providerPrincipal",
          "providerFee",
          "platformFee",
          "platformFixedFee",
          "partnerFee",
          "totalFees",
          "exchangeRate",
          "quoteExpiresAt",
          "depositAddress"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["escrow", "vault_treasury"],
            "description": "`escrow`: source funds are collected into a Payment-specific escrow. Every new external payout uses it. `vault_treasury` may appear on older records."
          },
          "required": {
            "$ref": "#/components/schemas/CanonicalFundingAmount"
          },
          "providerPrincipal": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "providerFee": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "platformFee": {
            "description": "Stableyard platform fee in the funding asset, including platformFixedFee.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "platformFixedFee": {
            "description": "Flat Stableyard fee for the payout rail, charged on top of the amount sent and already included in platformFee: ACH and FedNow $0.50, Fedwire $10.00, valued 1:1 in the USD stablecoin funding asset. Zero for payouts without a rail fee. Null when fee visibility is restricted or no collection escrow exists.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "partnerFee": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalFees": {
            "description": "Total payout fees in the funding asset: providerFee + platformFee (Stableyard) + partnerFee (app partner). Already included in required; do not add again. Null when fee visibility is restricted or a frozen component is unavailable. Excludes any additional fee quoted separately by a selected funding method.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalFundingAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "exchangeRate": {
            "description": "Directional rate frozen from the payout quote. One unit of baseAssetCode equals rate units of quoteAssetCode.",
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["rate", "baseAssetCode", "quoteAssetCode"],
                "properties": {
                  "rate": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,18})?$"
                  },
                  "baseAssetCode": {
                    "type": "string"
                  },
                  "quoteAssetCode": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "quoteExpiresAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "depositAddress": {
            "description": "Direct funding instruction for the selected Payment Source, when eligible. Null while escrow is provisioning. For an eligible Base USDC source, poll checkout for the automatically prepared Routing option and use its Base funding instructions; never fund the Arbitrum escrow directly from Base.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CanonicalPaymentDepositInstructions"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CanonicalPaymentRefundSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "count",
          "requestedAmountAtomic",
          "confirmedAmountAtomic"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "none",
              "pending",
              "partially_refunded",
              "refunded",
              "failed",
              "requires_intervention"
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "requestedAmountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "confirmedAmountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        },
        "description": "Aggregate progress for Refund resources attached to this Payment. Supported direct receive refunds are created through the Partner API. Returns of failed external payouts are reported through `offrampStatus`, not here."
      },
      "CanonicalPaymentIncidentRecoverySummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "pendingCount",
          "confirmedCount",
          "failedCount",
          "requiresInterventionCount",
          "requestedAmountAtomic",
          "confirmedAmountAtomic"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "pendingCount": {
            "type": "integer",
            "minimum": 0
          },
          "confirmedCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0
          },
          "requiresInterventionCount": {
            "type": "integer",
            "minimum": 0
          },
          "requestedAmountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "confirmedAmountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          }
        },
        "description": "Recovery of duplicate, late, overpaid, or underpaid receipts. These amounts never contribute to refundSummary for the accepted merchant payment."
      },
      "CanonicalPaymentNextAction": {
        "title": "Payment next action",
        "description": "The exact action the caller must complete. Null means Stableyard needs no action from the partner right now.",
        "oneOf": [
          {
            "title": "Action required",
            "type": "object",
            "additionalProperties": false,
            "required": ["id", "type", "expiresAt"],
            "properties": {
              "id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "transaction",
                  "managed_authorization",
                  "payment_method"
                ]
              },
              "expiresAt": {
                "type": ["string", "null"],
                "format": "date-time"
              },
              "depositInstructions": {
                "description": "Present only when type is \"transaction\" for a collection deposit: the exact on-chain payment to make to advance this Payment.",
                "$ref": "#/components/schemas/CanonicalPaymentDepositInstructions"
              }
            }
          },
          {
            "title": "Start account KYC",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "start_kyc_session"
              }
            }
          },
          {
            "title": "Re-verify identity",
            "description": "The current approved verification lacks identity data or a document type this payout requires, and the user cannot supply it on a form. Call POST /v2/accounts/{accountId}/kyc/session to get a new verification link; the current approval stays in force until the new session is decided.",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "reverify_identity"
              }
            }
          },
          {
            "title": "Verify UPA email",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "verify_account_email"
              }
            }
          },
          {
            "title": "Complete hosted compliance",
            "description": "Open this Stableyard-hosted URL as a top-level page. The link uses a one-time exchange and asks only for information missing from the verified account.",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "url", "expiresAt"],
            "properties": {
              "type": {
                "type": "string",
                "const": "complete_compliance"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "title": "Waiting for review",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "wait_for_partner_kyc"
              }
            }
          },
          {
            "title": "Contact support",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "contact_support"
              }
            }
          },
          {
            "title": "No action required (type none)",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "none"
              }
            }
          },
          {
            "title": "No action required",
            "type": "null"
          }
        ]
      },
      "CanonicalPaymentResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["payment", "nextAction"],
        "properties": {
          "payment": {
            "$ref": "#/components/schemas/CanonicalPaymentResource"
          },
          "checkout": {
            "type": "object",
            "additionalProperties": false,
            "required": ["paymentUrl", "clientSecret", "expiresAt", "returnUrl"],
            "properties": {
              "paymentUrl": {
                "type": "string",
                "format": "uri"
              },
              "clientSecret": {
                "type": "string",
                "minLength": 32,
                "maxLength": 512
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              },
              "returnUrl": {
                "type": ["string", "null"],
                "format": "uri"
              }
            }
          },
          "nextAction": {
            "$ref": "#/components/schemas/CanonicalPaymentNextAction"
          }
        }
      },
      "CanonicalPaymentListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["payments", "nextCursor"],
        "properties": {
          "payments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalPaymentResource"
            }
          },
          "nextCursor": {
            "type": ["string", "null"]
          }
        }
      },
      "CanonicalConfirmPaymentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["actionId", "proof"],
        "properties": {
          "actionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "proof": {
            "description": "Submit exactly the proof type requested by `nextAction`; never guess it from the payment source.",
            "oneOf": [
              {
                "title": "Submitted transaction",
                "type": "object",
                "additionalProperties": false,
                "required": ["type", "transactionHash"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "transaction"
                  },
                  "transactionHash": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                }
              },
              {
                "title": "Managed authorization",
                "type": "object",
                "additionalProperties": false,
                "required": ["type", "authorization"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "managed_authorization"
                  },
                  "authorization": {
                    "type": "string",
                    "const": "approved"
                  }
                }
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CanonicalCancelPaymentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["reasonCode"],
        "properties": {
          "reasonCode": {
            "type": "string",
            "enum": ["customer_request", "duplicate", "abandoned", "other"]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        }
      },
      "CanonicalCreateRefundRequest": {
        "title": "Create refund request",
        "description": "Refund exactly one decimal or atomic amount from a supported accepted direct receive Payment. Stableyard derives the payer destination from verified receipt evidence. Failed external payouts are returned by Stableyard and cannot be requested through this body.",
        "type": "object",
        "additionalProperties": false,
        "required": ["reasonCode", "reason"],
        "properties": {
          "amount": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$",
            "example": "5.00"
          },
          "amountAtomic": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[1-9][0-9]*$",
            "example": "5000000"
          },
          "reasonCode": {
            "type": "string",
            "enum": ["customer_request", "operational"]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "oneOf": [
          {
            "title": "Decimal refund amount",
            "required": ["amount"],
            "not": {
              "required": ["amountAtomic"]
            }
          },
          {
            "title": "Atomic refund amount",
            "required": ["amountAtomic"],
            "not": {
              "required": ["amount"]
            }
          }
        ]
      },
      "CanonicalRefund": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "paymentId",
          "status",
          "amount",
          "amountAtomic",
          "assetCode",
          "chainId",
          "transactionHash",
          "reasonCode",
          "reason",
          "createdAt",
          "broadcastAt",
          "confirmedAt",
          "failure"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^refund_"
          },
          "paymentId": {
            "type": "string",
            "pattern": "^payment_"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "pending_approval",
              "signing",
              "retry_wait",
              "broadcast",
              "confirmed",
              "failed",
              "requires_intervention",
              "cancelled"
            ]
          },
          "amount": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "amountAtomic": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[1-9][0-9]*$"
          },
          "assetCode": {
            "type": "string"
          },
          "chainId": {
            "type": "integer",
            "minimum": 1
          },
          "transactionHash": {
            "type": ["string", "null"]
          },
          "reasonCode": {
            "type": "string",
            "enum": [
              "duplicate_payment",
              "customer_request",
              "late_payment",
              "overpayment",
              "underpayment",
              "operational",
              "offramp_provider_terminal_failure"
            ]
          },
          "reason": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "broadcastAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "confirmedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "failure": {
            "oneOf": [
              {
                "title": "Failure details",
                "type": "object",
                "additionalProperties": false,
                "required": ["code", "message"],
                "properties": {
                  "code": {
                    "type": ["string", "null"]
                  },
                  "message": {
                    "type": ["string", "null"]
                  }
                }
              },
              {
                "title": "No failure",
                "type": "null"
              }
            ]
          }
        }
      },
      "CanonicalRefundResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["refund"],
        "properties": {
          "refund": {
            "$ref": "#/components/schemas/CanonicalRefund"
          }
        }
      },
      "CanonicalRefundListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["refunds", "nextCursor"],
        "properties": {
          "refunds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CanonicalRefund"
            }
          },
          "nextCursor": {
            "type": ["string", "null"]
          }
        }
      },
      "PartnerConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "appId",
          "organizationId",
          "environmentId",
          "apiVersion",
          "supportedApiVersions",
          "namespace",
          "scopes",
          "credentialType",
          "credentialMode",
          "status",
          "modules",
          "compliance",
          "fees",
          "networks",
          "capabilities",
          "integrations",
          "links"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "app_123"
          },
          "appId": {
            "type": "string",
            "example": "app_123"
          },
          "organizationId": {
            "type": "string",
            "example": "org_123"
          },
          "environmentId": {
            "type": "string",
            "example": "env_123"
          },
          "apiVersion": {
            "$ref": "#/components/schemas/StableyardApiVersion"
          },
          "supportedApiVersions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StableyardApiVersion"
            }
          },
          "namespace": {
            "type": "string",
            "example": "partner"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": ["v2:accounts", "v2:deposit_addresses", "v2:payments"]
          },
          "credentialType": {
            "type": "string",
            "enum": ["standard", "restricted"],
            "description": "Standard keys dynamically receive permissions for enabled app products. Restricted keys retain an explicit scope subset."
          },
          "credentialMode": {
            "type": "string",
            "enum": ["app_secret", "portal_session"],
            "description": "Identifies whether the request used a server app secret or a short-lived Partner Dashboard session."
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "modules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerConfigModule"
            }
          },
          "compliance": {
            "type": "object",
            "additionalProperties": false,
            "required": ["partnerKyb", "requirements"],
            "properties": {
              "partnerKyb": {
                "type": "object",
                "additionalProperties": false,
                "required": ["status", "updatedAt"],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "not_started",
                      "pending",
                      "approved",
                      "action_required"
                    ],
                    "description": "Standing of your organization's KYB, which fiat access requires."
                  },
                  "updatedAt": {
                    "type": ["string", "null"],
                    "format": "date-time"
                  }
                }
              },
              "requirements": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "partnerFiatAccess",
                  "individualUpaFiatAccess",
                  "businessUpaFiatAccess"
                ],
                "properties": {
                  "partnerFiatAccess": {
                    "type": "string",
                    "const": "kyb"
                  },
                  "individualUpaFiatAccess": {
                    "type": "string",
                    "const": "kyc"
                  },
                  "businessUpaFiatAccess": {
                    "type": "string",
                    "const": "kyb"
                  }
                }
              }
            }
          },
          "fees": {
            "$ref": "#/components/schemas/PartnerFeeConfig"
          },
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerNetworkConfig"
            }
          },
          "capabilities": {
            "$ref": "#/components/schemas/PartnerCapabilities"
          },
          "integrations": {
            "type": "object",
            "additionalProperties": false,
            "required": ["clientApi", "webhooks", "partnerConsole"],
            "properties": {
              "clientApi": {
                "$ref": "#/components/schemas/PartnerIntegrationAvailability"
              },
              "webhooks": {
                "$ref": "#/components/schemas/PartnerIntegrationAvailability"
              },
              "partnerConsole": {
                "$ref": "#/components/schemas/PartnerIntegrationAvailability",
                "description": "Whether the Stableyard dashboard is available to this app."
              }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": ["docs", "openapi", "dashboard"],
            "properties": {
              "docs": {
                "type": "string",
                "example": "https://docs.stableyard.fi"
              },
              "openapi": {
                "type": "string",
                "example": "/v2/openapi/partners.json"
              },
              "dashboard": {
                "type": "string",
                "example": "https://dashboard.stableyard.fi"
              }
            }
          }
        }
      },
      "PartnerConfigModule": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "scopes",
          "defaultEnabled",
          "optional",
          "entitled",
          "credentialAllowed",
          "operational",
          "available",
          "disabledReason"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "deposit_addresses"
          },
          "name": {
            "type": "string",
            "example": "Deposit Addresses"
          },
          "description": {
            "type": "string",
            "example": "Issue reusable receive addresses and track inbound deposits."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": ["v2:deposit_addresses"]
          },
          "defaultEnabled": {
            "type": "boolean"
          },
          "optional": {
            "type": "boolean"
          },
          "entitled": {
            "type": "boolean",
            "description": "Commercial product access configured for this app environment."
          },
          "credentialAllowed": {
            "type": "boolean",
            "description": "Whether the presented API key is permitted to use the product."
          },
          "operational": {
            "type": "boolean",
            "description": "Whether the product is currently available in this environment."
          },
          "available": {
            "type": "boolean",
            "description": "True only when entitled, credentialAllowed, and operational are all true."
          },
          "disabledReason": {
            "type": ["string", "null"],
            "enum": [
              "not_entitled",
              "credential_not_allowed",
              "runtime_not_configured",
              null
            ]
          }
        }
      },
      "PartnerIntegrationAvailability": {
        "type": "object",
        "additionalProperties": false,
        "required": ["enabled", "availableToCredential"],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "availableToCredential": {
            "type": "boolean"
          }
        }
      },
      "PartnerPaymentMethodAvailability": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "entitled",
          "credentialAllowed",
          "operational",
          "available",
          "disabledReason"
        ],
        "properties": {
          "entitled": {
            "type": "boolean",
            "description": "Whether the app environment is commercially entitled to this payment method."
          },
          "credentialAllowed": {
            "type": "boolean",
            "description": "Whether the presented API key can use this payment method."
          },
          "operational": {
            "type": "boolean",
            "description": "Whether the payment method is currently available in this environment."
          },
          "available": {
            "type": "boolean",
            "description": "True only when entitled, credentialAllowed, and operational are all true."
          },
          "disabledReason": {
            "type": ["string", "null"],
            "enum": [
              "not_entitled",
              "credential_not_allowed",
              "runtime_not_configured",
              null
            ]
          }
        }
      },
      "PartnerFeeConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "partnerFeeBps",
          "partnerFeePercent",
          "platformFeeBps",
          "platformFeePercent",
          "totalFeeBps",
          "totalFeePercent",
          "model",
          "currency"
        ],
        "properties": {
          "partnerFeeBps": {
            "type": "integer",
            "minimum": 0,
            "example": 25
          },
          "partnerFeePercent": {
            "type": "number",
            "minimum": 0,
            "example": 0.25
          },
          "platformFeeBps": {
            "type": "integer",
            "minimum": 0,
            "example": 50
          },
          "platformFeePercent": {
            "type": "number",
            "minimum": 0,
            "example": 0.5
          },
          "totalFeeBps": {
            "type": "integer",
            "minimum": 0,
            "example": 75
          },
          "totalFeePercent": {
            "type": "number",
            "minimum": 0,
            "example": 0.75
          },
          "model": {
            "type": "string",
            "const": "deducted_at_final_settlement"
          },
          "currency": {
            "type": "string",
            "const": "USD"
          }
        }
      },
      "PartnerNetworkConfig": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "aliases",
          "chainFamily",
          "chainId",
          "depositAddresses",
          "connectedWallets",
          "settlement",
          "paymentCollection",
          "defaultAsset",
          "supportedAssets"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "base"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": ["base", "base-mainnet", "8453"]
          },
          "chainFamily": {
            "type": "string",
            "enum": ["evm", "tron", "btc", "solana", "movement"]
          },
          "chainId": {
            "type": "integer",
            "example": 8453
          },
          "depositAddresses": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "supported",
              "provider",
              "operational",
              "disabledReason"
            ],
            "properties": {
              "supported": {
                "type": "boolean"
              },
              "provider": {
                "type": ["string", "null"],
                "description": "Opaque reference. Do not depend on its value."
              },
              "operational": {
                "type": "boolean",
                "description": "Whether deposit addresses can be issued on this network now."
              },
              "disabledReason": {
                "description": "Why deposit addresses are unavailable on this network. Treat any non-null value as unavailable.",
                "type": ["string", "null"],
                "enum": [
                  "deposit_addresses_not_supported_on_network",
                  "deposit_address_issuance_paused",
                  "deposit_webhook_not_configured",
                  "deposit_webhook_provider_not_configured",
                  null
                ]
              }
            }
          },
          "connectedWallets": {
            "type": "object",
            "additionalProperties": false,
            "required": ["supported"],
            "properties": {
              "supported": {
                "type": "boolean"
              }
            }
          },
          "settlement": {
            "type": "object",
            "additionalProperties": false,
            "required": ["supported"],
            "properties": {
              "supported": {
                "type": "boolean"
              }
            }
          },
          "paymentCollection": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "supported",
              "provider",
              "network",
              "configured",
              "detectionMode",
              "disabledReason"
            ],
            "properties": {
              "supported": {
                "type": "boolean",
                "description": "Whether one-time Payments can be collected on this network."
              },
              "provider": {
                "type": ["string", "null"],
                "description": "Opaque reference. Do not depend on its value."
              },
              "network": {
                "type": ["string", "null"],
                "description": "Network code.",
                "example": "base"
              },
              "configured": {
                "type": "boolean",
                "description": "Whether Payment collection is available on this network now."
              },
              "detectionMode": {
                "type": ["string", "null"],
                "enum": [
                  "provider_webhook",
                  "transaction_hash_submission",
                  null
                ],
                "description": "How Payment receipts are detected. Movement uses a payer-submitted hash that Stableyard verifies; supported EVM networks are detected automatically."
              },
              "disabledReason": {
                "description": "Why Payment collection is unavailable on this network. Treat any non-null value as unavailable.",
                "type": ["string", "null"],
                "enum": [
                  "payment_collection_not_supported_on_network",
                  "payment_collection_webhook_not_configured",
                  "payment_transaction_submission_disabled",
                  "payment_transaction_verification_not_configured",
                  null
                ]
              }
            }
          },
          "defaultAsset": {
            "$ref": "#/components/schemas/PartnerNetworkAsset"
          },
          "supportedAssets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PartnerNetworkAsset"
            }
          }
        }
      },
      "PartnerNetworkAsset": {
        "type": "object",
        "additionalProperties": false,
        "required": ["symbol", "tokenAddress", "decimals"],
        "example": {
          "symbol": "USDC",
          "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "decimals": 6,
          "kind": "token",
          "minimumDeposit": {
            "amount": "0.5",
            "amountAtomic": "500000",
            "inclusive": true
          }
        },
        "properties": {
          "symbol": {
            "type": "string",
            "example": "USDC"
          },
          "tokenAddress": {
            "type": "string",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 6
          },
          "kind": {
            "type": "string",
            "enum": ["token", "native"]
          },
          "minimumDeposit": {
            "type": "object",
            "additionalProperties": false,
            "required": ["amount", "amountAtomic", "inclusive"],
            "properties": {
              "amount": {
                "type": "string",
                "example": "0.5"
              },
              "amountAtomic": {
                "type": "string",
                "example": "500000"
              },
              "inclusive": {
                "type": "boolean",
                "example": true
              }
            }
          },
          "pricing": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "referenceCurrency",
              "referenceAmount",
              "assetAmount",
              "description"
            ],
            "description": "Optional indicative reference rate for a non-USD stablecoin. It is informational and not a quote.",
            "properties": {
              "referenceCurrency": {
                "type": "string",
                "example": "USD"
              },
              "referenceAmount": {
                "type": "string",
                "example": "1"
              },
              "assetAmount": {
                "type": "string",
                "example": "33"
              },
              "description": {
                "type": "string",
                "example": "1 USD = 33 THBT"
              }
            }
          }
        }
      },
      "PartnerCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accounts",
          "depositAddresses",
          "payments",
          "balancesAndTransactions",
          "webhooks",
          "vaults"
        ],
        "properties": {
          "accounts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "entitled",
              "credentialAllowed",
              "operational",
              "available",
              "disabledReason",
              "availableToCredential",
              "accountIdLookup",
              "externalUserIdLookup",
              "handles",
              "connectedWallets",
              "emailVerification"
            ],
            "properties": {
              "entitled": {
                "type": "boolean"
              },
              "credentialAllowed": {
                "type": "boolean"
              },
              "operational": {
                "type": "boolean"
              },
              "available": {
                "type": "boolean"
              },
              "disabledReason": {
                "type": ["string", "null"],
                "enum": [
                  "not_entitled",
                  "credential_not_allowed",
                  "runtime_not_configured",
                  null
                ]
              },
              "availableToCredential": {
                "type": "boolean"
              },
              "accountIdLookup": {
                "type": "boolean"
              },
              "externalUserIdLookup": {
                "type": "boolean"
              },
              "handles": {
                "type": "boolean"
              },
              "connectedWallets": {
                "type": "boolean"
              },
              "emailVerification": {
                "$ref": "#/components/schemas/AccountEmailVerificationPolicy"
              }
            }
          },
          "depositAddresses": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "entitled",
              "credentialAllowed",
              "operational",
              "available",
              "disabledReason",
              "availableToCredential",
              "supportedChainIds",
              "availableChainIds",
              "supportedNetworks"
            ],
            "properties": {
              "entitled": {
                "type": "boolean"
              },
              "credentialAllowed": {
                "type": "boolean"
              },
              "operational": {
                "type": "boolean"
              },
              "available": {
                "type": "boolean"
              },
              "disabledReason": {
                "type": ["string", "null"],
                "enum": [
                  "not_entitled",
                  "credential_not_allowed",
                  "runtime_not_configured",
                  null
                ]
              },
              "availableToCredential": {
                "type": "boolean"
              },
              "supportedChainIds": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "example": [
                  42161,
                  1,
                  8453,
                  137,
                  56,
                  43114,
                  4663,
                  4217,
                  10103,
                  10002,
                  728126428,
                  10001
                ]
              },
              "availableChainIds": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "example": [
                  42161,
                  1,
                  8453,
                  137,
                  56,
                  43114,
                  4663,
                  4217,
                  10103,
                  10002,
                  728126428,
                  10001
                ]
              },
              "supportedNetworks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "chainId",
                    "chainFamily",
                    "operational",
                    "disabledReason",
                    "assets"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "example": "base"
                    },
                    "chainId": {
                      "type": "integer",
                      "example": 8453
                    },
                    "chainFamily": {
                      "type": "string",
                      "enum": ["evm", "tron", "btc", "solana", "movement"]
                    },
                    "operational": {
                      "type": "boolean"
                    },
                    "disabledReason": {
                      "type": ["string", "null"],
                      "enum": [
                        "deposit_addresses_not_supported_on_network",
                        "deposit_address_issuance_paused",
                        "deposit_webhook_not_configured",
                        "deposit_webhook_provider_not_configured",
                        null
                      ]
                    },
                    "assets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PartnerNetworkAsset"
                      }
                    }
                  }
                }
              }
            }
          },
          "payments": {
            "type": "object",
            "additionalProperties": true,
            "required": [
              "entitled",
              "credentialAllowed",
              "operational",
              "available",
              "disabledReason",
              "availableToCredential",
              "capabilities",
              "methods",
              "publicPaymentCreation"
            ],
            "properties": {
              "entitled": {
                "type": "boolean"
              },
              "credentialAllowed": {
                "type": "boolean"
              },
              "operational": {
                "type": "boolean"
              },
              "available": {
                "type": "boolean"
              },
              "disabledReason": {
                "type": ["string", "null"],
                "enum": [
                  "not_entitled",
                  "credential_not_allowed",
                  "runtime_not_configured",
                  null
                ]
              },
              "availableToCredential": {
                "type": "boolean"
              },
              "capabilities": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "crypto",
                  "onramp",
                  "externalQr",
                  "externalBank",
                  "card"
                ],
                "properties": {
                  "crypto": {
                    "type": "boolean"
                  },
                  "onramp": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "externalQr": {
                    "type": "boolean",
                    "description": "Whether the app has the optional External QR Payment entitlement."
                  },
                  "externalBank": {
                    "type": "boolean",
                    "description": "Whether the app has the optional External Bank Transfer entitlement."
                  },
                  "card": {
                    "type": "boolean"
                  }
                }
              },
              "methods": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "direct",
                  "routing",
                  "onramp",
                  "externalQr",
                  "externalBank",
                  "card"
                ],
                "properties": {
                  "direct": {
                    "$ref": "#/components/schemas/PartnerPaymentMethodAvailability"
                  },
                  "routing": {
                    "$ref": "#/components/schemas/PartnerPaymentMethodAvailability"
                  },
                  "onramp": {
                    "$ref": "#/components/schemas/PartnerPaymentMethodAvailability"
                  },
                  "externalQr": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Optional Payment send rail for an external merchant QR. This is not a standalone Offramp API.",
                    "required": [
                      "entitled",
                      "credentialAllowed",
                      "operational",
                      "available",
                      "disabledReason",
                      "destinationType",
                      "standaloneApi",
                      "countries",
                      "preparationAvailable",
                      "paymentExecutionAvailable",
                      "sourceChainIds"
                    ],
                    "properties": {
                      "entitled": {
                        "type": "boolean"
                      },
                      "credentialAllowed": {
                        "type": "boolean"
                      },
                      "operational": {
                        "type": "boolean"
                      },
                      "available": {
                        "type": "boolean"
                      },
                      "disabledReason": {
                        "type": ["string", "null"],
                        "enum": [
                          "not_entitled",
                          "credential_not_allowed",
                          "runtime_not_configured",
                          null
                        ]
                      },
                      "sourceChainIds": {
                        "type": "array",
                        "items": {
                          "type": "integer"
                        },
                        "description": "Configured QR funding source chains. Base wallet routes also require a provider-confirmed quote window."
                      },
                      "destinationType": {
                        "type": "string",
                        "const": "external_qr"
                      },
                      "standaloneApi": {
                        "type": "boolean",
                        "const": false
                      },
                      "countries": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "country",
                            "countryName",
                            "currency",
                            "currencyDecimals",
                            "rails",
                            "enabled"
                          ],
                          "properties": {
                            "country": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$",
                              "example": "PH"
                            },
                            "countryName": {
                              "type": "string",
                              "example": "Philippines"
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$",
                              "example": "PHP"
                            },
                            "currencyDecimals": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 18,
                              "example": 2,
                              "description": "Minor-unit precision of currency. Payment amounts may not exceed it, and minimumAmountAtomic/maximumAmountAtomic are expressed in it."
                            },
                            "rails": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "example": ["qr"]
                            },
                            "minimumAmountAtomic": {
                              "type": "string",
                              "pattern": "^(0|[1-9][0-9]*)$"
                            },
                            "maximumAmountAtomic": {
                              "type": "string",
                              "pattern": "^(0|[1-9][0-9]*)$"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        }
                      },
                      "preparationAvailable": {
                        "type": "boolean"
                      },
                      "paymentExecutionAvailable": {
                        "type": "boolean"
                      }
                    }
                  },
                  "externalBank": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Optional Payment send rail for a verified one-time bank beneficiary supplied inline. Saved linked-bank beneficiaries use their bankAccountId; neither shape establishes ownership by the sending UPA subject.",
                    "required": [
                      "entitled",
                      "credentialAllowed",
                      "operational",
                      "available",
                      "disabledReason",
                      "destinationType",
                      "standaloneApi",
                      "directoryEndpoint",
                      "paymentSourceAssets",
                      "countries",
                      "preparationAvailable",
                      "paymentExecutionAvailable"
                    ],
                    "properties": {
                      "entitled": {
                        "type": "boolean"
                      },
                      "credentialAllowed": {
                        "type": "boolean"
                      },
                      "operational": {
                        "type": "boolean"
                      },
                      "available": {
                        "type": "boolean"
                      },
                      "disabledReason": {
                        "type": ["string", "null"],
                        "enum": [
                          "not_entitled",
                          "credential_not_allowed",
                          "runtime_not_configured",
                          null
                        ]
                      },
                      "destinationType": {
                        "type": "string",
                        "const": "external_bank"
                      },
                      "standaloneApi": {
                        "type": "boolean",
                        "const": false
                      },
                      "directoryEndpoint": {
                        "type": "string",
                        "const": "/v2/payments/external-bank/banks?country={country}"
                      },
                      "paymentSourceAssets": {
                        "type": "array",
                        "description": "Payment Source assets that bank payouts collect directly into escrow. Bank payouts are funded only by paying this asset on the same chain into the Payment's escrow; cross-chain routes are not offered. Empty when the rail is unavailable.",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": ["chainId", "tokenAddress", "assetSymbol"],
                          "properties": {
                            "chainId": {
                              "type": "integer",
                              "example": 8453
                            },
                            "tokenAddress": {
                              "type": "string",
                              "example": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
                            },
                            "assetSymbol": {
                              "type": "string",
                              "example": "USDC"
                            }
                          }
                        }
                      },
                      "countries": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "country",
                            "countryName",
                            "currency",
                            "currencyDecimals",
                            "rails",
                            "enabled"
                          ],
                          "properties": {
                            "country": {
                              "type": "string",
                              "pattern": "^[A-Z]{2}$",
                              "example": "VN"
                            },
                            "countryName": {
                              "type": "string",
                              "example": "Vietnam"
                            },
                            "currency": {
                              "type": "string",
                              "pattern": "^[A-Z]{3}$",
                              "example": "VND"
                            },
                            "currencyDecimals": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 18,
                              "example": 0,
                              "description": "Minor-unit precision of currency. Payment amounts may not exceed it, and minimumAmountAtomic/maximumAmountAtomic are expressed in it."
                            },
                            "rails": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "example": ["bank_transfer"]
                            },
                            "minimumAmountAtomic": {
                              "type": "string",
                              "pattern": "^(0|[1-9][0-9]*)$"
                            },
                            "maximumAmountAtomic": {
                              "type": "string",
                              "pattern": "^(0|[1-9][0-9]*)$"
                            },
                            "enabled": {
                              "type": "boolean"
                            }
                          }
                        }
                      },
                      "preparationAvailable": {
                        "type": "boolean"
                      },
                      "paymentExecutionAvailable": {
                        "type": "boolean"
                      }
                    }
                  },
                  "card": {
                    "$ref": "#/components/schemas/PartnerPaymentMethodAvailability"
                  }
                }
              },
              "publicPaymentCreation": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "enabled",
                  "authentication",
                  "purpose",
                  "methods",
                  "destinations",
                  "allowedFiatCurrencies",
                  "paymentTtlSeconds",
                  "configureEndpoint",
                  "createEndpoint"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "authentication": {
                    "type": "string",
                    "const": "none"
                  },
                  "purpose": {
                    "type": "string",
                    "const": "fund_wallet_or_pay_enabled_upa"
                  },
                  "methods": {
                    "type": "array",
                    "description": "Configured methods that are enabled for the app and currently available for at least one destination.",
                    "items": {
                      "type": "string",
                      "enum": ["crypto", "routing", "onramp"]
                    }
                  },
                  "destinations": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PaymentDestinationCapability"
                    }
                  },
                  "allowedFiatCurrencies": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Z]{3}$"
                    }
                  },
                  "paymentTtlSeconds": {
                    "type": "integer",
                    "minimum": 120,
                    "maximum": 3600
                  },
                  "configureEndpoint": {
                    "type": "string",
                    "description": "Configure public payment creation in the Stableyard dashboard. Partner code does not need this value."
                  },
                  "createEndpoint": {
                    "type": "string",
                    "example": "/v2/public/apps/app_123/payments"
                  }
                }
              }
            }
          },
          "balancesAndTransactions": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "enabled",
              "availableToCredential",
              "balances",
              "transactions"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "availableToCredential": {
                "type": "boolean"
              },
              "balances": {
                "$ref": "#/components/schemas/PartnerIntegrationAvailability"
              },
              "transactions": {
                "$ref": "#/components/schemas/PartnerIntegrationAvailability"
              }
            }
          },
          "webhooks": {
            "$ref": "#/components/schemas/WebhookCapabilities"
          },
          "vaults": {
            "$ref": "#/components/schemas/VaultCapability"
          }
        }
      },
      "VaultCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entitled",
          "credentialAllowed",
          "operational",
          "available",
          "disabledReason",
          "scope",
          "runtime",
          "ownershipModes",
          "managedApproval",
          "spendLimit",
          "yieldProviders",
          "tokens",
          "resourceVersion"
        ],
        "properties": {
          "entitled": {
            "type": "boolean"
          },
          "credentialAllowed": {
            "type": "boolean"
          },
          "operational": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "scope": {
            "type": "string",
            "const": "v2:vaults"
          },
          "runtime": {
            "type": "string",
            "enum": ["enabled", "disabled", "unavailable"]
          },
          "disabledReason": {
            "type": ["string", "null"],
            "enum": [
              "not_entitled",
              "credential_not_allowed",
              "runtime_not_configured",
              null
            ]
          },
          "ownershipModes": {
            "type": "object",
            "additionalProperties": false,
            "required": ["external", "stableyard"],
            "properties": {
              "external": {
                "type": "boolean",
                "description": "External owner or partner multisig signs policy updates."
              },
              "stableyard": {
                "type": "boolean",
                "description": "Stableyard-managed Vaults are enabled for this app."
              }
            }
          },
          "managedApproval": {
            "type": "object",
            "additionalProperties": false,
            "required": ["method", "ready", "disabledReason"],
            "properties": {
              "method": {
                "type": "string",
                "const": "email_otp"
              },
              "ready": {
                "type": "boolean",
                "description": "True when managed-vault email approval is available."
              },
              "disabledReason": {
                "type": ["string", "null"],
                "enum": [
                  "missing_scope",
                  "runtime_disabled",
                  "configuration_error",
                  "email_module_unavailable",
                  "email_not_configured",
                  null
                ]
              }
            }
          },
          "spendLimit": {
            "oneOf": [
              {
                "title": "Configured spend limit",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "defaultAmountAtomic",
                  "maxAmountAtomic",
                  "currency",
                  "decimals",
                  "period"
                ],
                "properties": {
                  "defaultAmountAtomic": {
                    "type": "string",
                    "example": "500000000"
                  },
                  "maxAmountAtomic": {
                    "type": "string",
                    "example": "5000000000"
                  },
                  "currency": {
                    "type": "string",
                    "const": "USD"
                  },
                  "decimals": {
                    "type": "integer",
                    "const": 6
                  },
                  "period": {
                    "type": "string",
                    "const": "fixed_30_day"
                  }
                }
              },
              {
                "title": "Spend limit unavailable",
                "type": "null"
              }
            ]
          },
          "yieldProviders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["none", "aave", "morpho"]
            }
          },
          "tokens": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["symbol", "chainId", "tokenAddress", "decimals"],
              "properties": {
                "symbol": {
                  "type": "string",
                  "enum": ["USDC", "USDT"]
                },
                "chainId": {
                  "type": "integer",
                  "example": 42161
                },
                "tokenAddress": {
                  "type": "string",
                  "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                },
                "decimals": {
                  "type": "integer",
                  "const": 6
                }
              }
            }
          },
          "resourceVersion": {
            "type": ["integer", "null"],
            "minimum": 1
          }
        }
      },
      "VaultAction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "vaultId",
          "type",
          "status",
          "resourceVersion",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "vault_action_123"
          },
          "vaultId": {
            "type": "string",
            "example": "vault_123"
          },
          "policyId": {
            "type": ["string", "null"],
            "example": "vault_policy_123"
          },
          "type": {
            "type": "string",
            "enum": [
              "sign_policy",
              "approve_managed_policy",
              "install_policy",
              "auto_supply_yield",
              "redeem_yield",
              "execute_payment"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "queued",
              "processing",
              "completed",
              "failed",
              "cancelled"
            ]
          },
          "nextAction": {
            "type": ["object", "null"],
            "additionalProperties": true,
            "description": "Public wallet, signature, email approval, or wait instruction. Treat the action type as the discriminator and never modify transaction calldata. `execute_safe_transaction` is an on-chain transaction the Vault owner must execute; it includes a `completion` request descriptor for submitting the mined transaction hash."
          },
          "resourceVersion": {
            "type": "integer",
            "minimum": 1
          },
          "failureCode": {
            "type": ["string", "null"]
          },
          "expiresAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VaultPolicyResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "vaultId",
          "version",
          "policySchemaVersion",
          "status",
          "ownershipMode",
          "allowedTokens",
          "spendLimits",
          "yieldRules",
          "resourceVersion",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "vault_policy_123"
          },
          "vaultId": {
            "type": "string",
            "example": "vault_123"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "policySchemaVersion": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "pending_authorization",
              "authorized",
              "installing",
              "active",
              "superseded",
              "revoked",
              "failed"
            ]
          },
          "ownershipMode": {
            "type": "string",
            "enum": ["external", "stableyard"]
          },
          "allowedTokens": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["symbol", "chainId", "tokenAddress", "decimals"],
              "properties": {
                "symbol": {
                  "type": "string",
                  "enum": ["USDC", "USDT"]
                },
                "chainId": {
                  "type": "integer",
                  "example": 42161
                },
                "tokenAddress": {
                  "type": "string",
                  "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                },
                "decimals": {
                  "type": "integer",
                  "const": 6
                }
              }
            }
          },
          "spendLimits": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "spendLimitAtomic",
              "currency",
              "decimals",
              "period",
              "periodSeconds",
              "enforcement"
            ],
            "properties": {
              "spendLimitAtomic": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$",
                "example": "500000000"
              },
              "currency": {
                "type": "string",
                "const": "USD"
              },
              "decimals": {
                "type": "integer",
                "const": 6
              },
              "period": {
                "type": "string",
                "const": "fixed_30_day"
              },
              "periodSeconds": {
                "type": "integer",
                "const": 2592000
              },
              "enforcement": {
                "type": "string",
                "description": "Informational enforcement identifier. Do not depend on its value."
              }
            }
          },
          "yieldRules": {
            "type": "object",
            "additionalProperties": false,
            "required": ["provider", "mode"],
            "properties": {
              "provider": {
                "type": "string",
                "enum": ["none", "aave", "morpho"]
              },
              "mode": {
                "type": "string",
                "enum": ["disabled", "auto_supply_and_redeem_before_payment"]
              }
            }
          },
          "authorization": {
            "type": "object",
            "additionalProperties": true,
            "description": "Present on single-policy responses while authorization is pending."
          },
          "nextAction": {
            "oneOf": [
              {
                "title": "Vault action required",
                "$ref": "#/components/schemas/VaultAction"
              },
              {
                "title": "No Vault action required",
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": ["string", "null"]
          },
          "resourceVersion": {
            "type": "integer",
            "minimum": 1
          },
          "failureCode": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VaultSpendUsage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "vaultId",
          "status",
          "period",
          "periodSeconds",
          "supportedAssets"
        ],
        "properties": {
          "vaultId": {
            "type": "string",
            "example": "vault_123"
          },
          "status": {
            "type": "string",
            "enum": ["active", "not_active"]
          },
          "reason": {
            "type": "string",
            "description": "Present when status is not_active."
          },
          "period": {
            "type": "string",
            "const": "fixed_30_day"
          },
          "periodSeconds": {
            "type": "integer",
            "const": 2592000
          },
          "limitUsdAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "limitAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "consumedAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "onchainConsumedAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "settledRecordedAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "pendingAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "availableAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "windowStartedAt": {
            "type": "string",
            "format": "date-time"
          },
          "resetsAt": {
            "type": "string",
            "format": "date-time"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "supportedAssets": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["symbol", "chainId", "tokenAddress", "decimals"],
              "properties": {
                "symbol": {
                  "type": "string",
                  "enum": ["USDC", "USDT"]
                },
                "chainId": {
                  "type": "integer",
                  "example": 42161
                },
                "tokenAddress": {
                  "type": "string",
                  "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
                },
                "decimals": {
                  "type": "integer",
                  "const": 6
                }
              }
            }
          }
        }
      },
      "VaultResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "chainId",
          "ownershipMode",
          "status",
          "resourceVersion",
          "monitoring",
          "earning",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "vault_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "chainId": {
            "type": "integer",
            "example": 42161
          },
          "ownershipMode": {
            "type": "string",
            "enum": ["external", "stableyard"]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_authorization",
              "provisioning",
              "awaiting_policy",
              "active",
              "suspended",
              "failed",
              "requires_intervention"
            ]
          },
          "safeAddress": {
            "type": ["string", "null"],
            "description": "The Vault's smart-account address once it is deployed."
          },
          "predictedSafeAddress": {
            "type": ["string", "null"],
            "description": "Allocated Vault address. It is not evidence of deployment or readiness to receive funds. Wait for status active before funding or using the Vault."
          },
          "rolesModuleAddress": {
            "type": ["string", "null"],
            "description": "Address of the Vault's on-chain policy module."
          },
          "activePolicyId": {
            "type": ["string", "null"]
          },
          "activePolicy": {
            "oneOf": [
              {
                "title": "Active Vault policy",
                "$ref": "#/components/schemas/VaultPolicyResource"
              },
              {
                "title": "No active Vault policy",
                "type": "null"
              }
            ]
          },
          "latestPolicy": {
            "oneOf": [
              {
                "title": "Latest Vault policy",
                "$ref": "#/components/schemas/VaultPolicyResource"
              },
              {
                "title": "No Vault policy",
                "type": "null"
              }
            ]
          },
          "nextAction": {
            "oneOf": [
              {
                "title": "Vault action required",
                "$ref": "#/components/schemas/VaultAction"
              },
              {
                "title": "No Vault action required",
                "type": "null"
              }
            ]
          },
          "pendingActions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaultAction"
            }
          },
          "spendUsage": {
            "$ref": "#/components/schemas/VaultSpendUsage"
          },
          "mandates": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "monitoring": {
            "type": "object",
            "additionalProperties": false,
            "required": ["provider", "status", "registeredAt"],
            "properties": {
              "provider": {
                "type": "string",
                "description": "Opaque reference. Do not depend on its value."
              },
              "status": {
                "type": "string",
                "example": "registered"
              },
              "registeredAt": {
                "type": ["string", "null"],
                "format": "date-time"
              }
            }
          },
          "earning": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "enabled",
              "provider",
              "currentApyBps",
              "earnedAmountRaw"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "provider": {
                "type": "string",
                "enum": ["none", "aave", "morpho"]
              },
              "currentApyBps": {
                "type": ["integer", "null"]
              },
              "earnedAmountRaw": {
                "type": ["string", "null"]
              }
            }
          },
          "resourceVersion": {
            "type": "integer",
            "minimum": 1
          },
          "failureCode": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VaultPolicyListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["data"],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VaultPolicyResource"
            }
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "VaultAuditEventsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["data"],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "vaultId",
                "eventType",
                "actor",
                "payload",
                "createdAt"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "vaultId": {
                  "type": "string"
                },
                "policyId": {
                  "type": ["string", "null"]
                },
                "eventType": {
                  "type": "string",
                  "example": "vault.policy.created",
                  "description": "Event name, for example `vault.created`, `vault.policy.created` or `vault.policy_active`."
                },
                "actor": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": ["type", "id"],
                  "description": "Who caused the event. `partner_app` is a call made with your app credentials; other values are Stableyard-initiated.",
                  "properties": {
                    "type": {
                      "type": "string",
                      "example": "partner_app"
                    },
                    "id": {
                      "type": ["string", "null"]
                    }
                  }
                },
                "payload": {
                  "type": "object",
                  "additionalProperties": true
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "VaultPolicyInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "spendLimit": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "amountAtomic": {
                "type": "string",
                "pattern": "^[0-9]+$",
                "example": "500000000",
                "description": "Delegated Vault payment cap for each fixed 30-day cycle, using six-decimal USD atomic units. 500000000 means 500 USD. A signed policy update preserves usage and the existing reset time instead of refilling the allowance."
              }
            }
          },
          "allowedTokens": {
            "type": "array",
            "minItems": 1,
            "maxItems": 2,
            "items": {
              "type": "string",
              "enum": ["USDC", "USDT"]
            },
            "example": ["USDC"]
          },
          "yield": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "provider": {
                "type": "string",
                "enum": ["none", "aave", "morpho"],
                "default": "none",
                "description": "Select one yield provider. Changing providers requires a signed policy update and an empty Vault/yield position."
              }
            }
          }
        }
      },
      "VaultMandateRecipient": {
        "type": "object",
        "additionalProperties": false,
        "required": ["chainId", "address", "tokenAddress"],
        "properties": {
          "chainId": {
            "type": "integer",
            "enum": [42161],
            "description": "Vault mandates currently execute from Arbitrum Vault assets."
          },
          "address": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "example": "0x3333333333333333333333333333333333333333"
          },
          "tokenAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          }
        }
      },
      "VaultMandateToken": {
        "type": "object",
        "additionalProperties": false,
        "required": ["chainId", "tokenAddress", "symbol", "decimals"],
        "properties": {
          "chainId": {
            "type": "integer",
            "enum": [42161],
            "description": "Vault mandates currently execute from Arbitrum Vault assets."
          },
          "tokenAddress": {
            "type": "string",
            "pattern": "^0x[a-fA-F0-9]{40}$",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "symbol": {
            "type": "string",
            "enum": ["USDC", "USDT"]
          },
          "decimals": {
            "type": "integer",
            "enum": [6]
          }
        }
      },
      "VaultMandateMutationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "mandateId", "status"],
        "properties": {
          "id": {
            "type": "string",
            "example": "vault_mandate_123",
            "description": "Canonical mandate identifier. Equal to mandateId."
          },
          "mandateId": {
            "type": "string",
            "example": "vault_mandate_123"
          },
          "policyId": {
            "type": "string",
            "example": "vault_policy_123",
            "description": "Pending policy version that must be authorized and installed before the mandate change takes effect."
          },
          "status": {
            "type": "string",
            "enum": ["pending_authorization", "pending_revocation", "revoked"]
          },
          "nextAction": {
            "$ref": "#/components/schemas/VaultAction"
          }
        }
      },
      "WebhookEventGroup": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "label", "events"],
        "properties": {
          "id": {
            "type": "string",
            "example": "payments"
          },
          "label": {
            "type": "string",
            "example": "Payments"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Extensible partner webhook event name. Currently emitted public values: account.created, account.updated, bank_funding.completed, bank_funding.failed, compliance.action_required, compliance.submitted, compliance.approved, compliance.rejected, compliance.requires_intervention, deposit.detected, deposit.settled, deposit.failed, deposit.requires_intervention, deposit.reversed, kyc.session_created, kyc.updated, partner_kyc.requires_information, partner_kyc.information_submitted, partner_kyc.ready_to_submit, partner_kyc.submitted, partner_kyc.approved, partner_kyc.rejected, offramp_partner_account.linked, smart_wallet.active, smart_wallet.deployment_failed, smart_wallet.requires_intervention, vault.policy_active, vault.failed, vault.funding_posted, vault.funding_requires_intervention, vault.yield_supply_settled, vault.yield_supply_failed, payment.created, payment.requires_action, payment.processing, payment.accepted, payment.refund_pending, payment.partially_refunded, payment.refunded, payment.succeeded, payment.failed, payment.cancelled, payment.expired, payment.requires_intervention, payment.duplicate_received, payment.late_received, payment.settlement_returned. `payment.requires_intervention` reports an operational condition: inspect the Payment's operationalState and operationalReasonCode without treating it as a replacement for the financial status.",
              "x-known-values": [
                "account.created",
                "account.updated",
                "bank_funding.completed",
                "bank_funding.failed",
                "compliance.action_required",
                "compliance.submitted",
                "compliance.approved",
                "compliance.rejected",
                "compliance.requires_intervention",
                "deposit.detected",
                "deposit.settled",
                "deposit.failed",
                "deposit.requires_intervention",
                "deposit.reversed",
                "kyc.session_created",
                "kyc.updated",
                "partner_kyc.requires_information",
                "partner_kyc.information_submitted",
                "partner_kyc.ready_to_submit",
                "partner_kyc.submitted",
                "partner_kyc.approved",
                "partner_kyc.rejected",
                "offramp_partner_account.linked",
                "smart_wallet.active",
                "smart_wallet.deployment_failed",
                "smart_wallet.requires_intervention",
                "vault.policy_active",
                "vault.failed",
                "vault.funding_posted",
                "vault.funding_requires_intervention",
                "vault.yield_supply_settled",
                "vault.yield_supply_failed",
                "payment.created",
                "payment.requires_action",
                "payment.processing",
                "payment.accepted",
                "payment.refund_pending",
                "payment.partially_refunded",
                "payment.refunded",
                "payment.succeeded",
                "payment.failed",
                "payment.cancelled",
                "payment.expired",
                "payment.requires_intervention",
                "payment.duplicate_received",
                "payment.late_received",
                "payment.settlement_returned"
              ]
            },
            "example": [
              "payment.accepted",
              "payment.succeeded",
              "payment.requires_intervention"
            ]
          }
        }
      },
      "WebhookCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "supportedEvents",
          "recommendedEvents",
          "eventGroups",
          "signatures",
          "deliveryPolicy"
        ],
        "properties": {
          "supportedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Extensible partner webhook event name. Currently emitted public values: account.created, account.updated, bank_funding.completed, bank_funding.failed, compliance.action_required, compliance.submitted, compliance.approved, compliance.rejected, compliance.requires_intervention, deposit.detected, deposit.settled, deposit.failed, deposit.requires_intervention, deposit.reversed, kyc.session_created, kyc.updated, partner_kyc.requires_information, partner_kyc.information_submitted, partner_kyc.ready_to_submit, partner_kyc.submitted, partner_kyc.approved, partner_kyc.rejected, offramp_partner_account.linked, smart_wallet.active, smart_wallet.deployment_failed, smart_wallet.requires_intervention, vault.policy_active, vault.failed, vault.funding_posted, vault.funding_requires_intervention, vault.yield_supply_settled, vault.yield_supply_failed, payment.created, payment.requires_action, payment.processing, payment.accepted, payment.refund_pending, payment.partially_refunded, payment.refunded, payment.succeeded, payment.failed, payment.cancelled, payment.expired, payment.requires_intervention, payment.duplicate_received, payment.late_received, payment.settlement_returned. `payment.requires_intervention` reports an operational condition: inspect the Payment's operationalState and operationalReasonCode without treating it as a replacement for the financial status.",
              "x-known-values": [
                "account.created",
                "account.updated",
                "bank_funding.completed",
                "bank_funding.failed",
                "compliance.action_required",
                "compliance.submitted",
                "compliance.approved",
                "compliance.rejected",
                "compliance.requires_intervention",
                "deposit.detected",
                "deposit.settled",
                "deposit.failed",
                "deposit.requires_intervention",
                "deposit.reversed",
                "kyc.session_created",
                "kyc.updated",
                "partner_kyc.requires_information",
                "partner_kyc.information_submitted",
                "partner_kyc.ready_to_submit",
                "partner_kyc.submitted",
                "partner_kyc.approved",
                "partner_kyc.rejected",
                "offramp_partner_account.linked",
                "smart_wallet.active",
                "smart_wallet.deployment_failed",
                "smart_wallet.requires_intervention",
                "vault.policy_active",
                "vault.failed",
                "vault.funding_posted",
                "vault.funding_requires_intervention",
                "vault.yield_supply_settled",
                "vault.yield_supply_failed",
                "payment.created",
                "payment.requires_action",
                "payment.processing",
                "payment.accepted",
                "payment.refund_pending",
                "payment.partially_refunded",
                "payment.refunded",
                "payment.succeeded",
                "payment.failed",
                "payment.cancelled",
                "payment.expired",
                "payment.requires_intervention",
                "payment.duplicate_received",
                "payment.late_received",
                "payment.settlement_returned"
              ]
            },
            "example": [
              "account.created",
              "account.updated",
              "bank_funding.completed",
              "bank_funding.failed",
              "compliance.action_required",
              "compliance.submitted",
              "compliance.approved",
              "compliance.rejected",
              "compliance.requires_intervention",
              "deposit.detected",
              "deposit.settled",
              "deposit.failed",
              "deposit.requires_intervention",
              "deposit.reversed",
              "kyc.session_created",
              "kyc.updated",
              "partner_kyc.requires_information",
              "partner_kyc.information_submitted",
              "partner_kyc.ready_to_submit",
              "partner_kyc.submitted",
              "partner_kyc.approved",
              "partner_kyc.rejected",
              "offramp_partner_account.linked",
              "smart_wallet.active",
              "smart_wallet.deployment_failed",
              "smart_wallet.requires_intervention",
              "vault.policy_active",
              "vault.failed",
              "vault.funding_posted",
              "vault.funding_requires_intervention",
              "vault.yield_supply_settled",
              "vault.yield_supply_failed",
              "payment.created",
              "payment.requires_action",
              "payment.processing",
              "payment.accepted",
              "payment.refund_pending",
              "payment.partially_refunded",
              "payment.refunded",
              "payment.succeeded",
              "payment.failed",
              "payment.cancelled",
              "payment.expired",
              "payment.requires_intervention",
              "payment.duplicate_received",
              "payment.late_received",
              "payment.settlement_returned"
            ]
          },
          "recommendedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Extensible partner webhook event name. Currently emitted public values: account.created, account.updated, bank_funding.completed, bank_funding.failed, compliance.action_required, compliance.submitted, compliance.approved, compliance.rejected, compliance.requires_intervention, deposit.detected, deposit.settled, deposit.failed, deposit.requires_intervention, deposit.reversed, kyc.session_created, kyc.updated, partner_kyc.requires_information, partner_kyc.information_submitted, partner_kyc.ready_to_submit, partner_kyc.submitted, partner_kyc.approved, partner_kyc.rejected, offramp_partner_account.linked, smart_wallet.active, smart_wallet.deployment_failed, smart_wallet.requires_intervention, vault.policy_active, vault.failed, vault.funding_posted, vault.funding_requires_intervention, vault.yield_supply_settled, vault.yield_supply_failed, payment.created, payment.requires_action, payment.processing, payment.accepted, payment.refund_pending, payment.partially_refunded, payment.refunded, payment.succeeded, payment.failed, payment.cancelled, payment.expired, payment.requires_intervention, payment.duplicate_received, payment.late_received, payment.settlement_returned. `payment.requires_intervention` reports an operational condition: inspect the Payment's operationalState and operationalReasonCode without treating it as a replacement for the financial status.",
              "x-known-values": [
                "account.created",
                "account.updated",
                "bank_funding.completed",
                "bank_funding.failed",
                "compliance.action_required",
                "compliance.submitted",
                "compliance.approved",
                "compliance.rejected",
                "compliance.requires_intervention",
                "deposit.detected",
                "deposit.settled",
                "deposit.failed",
                "deposit.requires_intervention",
                "deposit.reversed",
                "kyc.session_created",
                "kyc.updated",
                "partner_kyc.requires_information",
                "partner_kyc.information_submitted",
                "partner_kyc.ready_to_submit",
                "partner_kyc.submitted",
                "partner_kyc.approved",
                "partner_kyc.rejected",
                "offramp_partner_account.linked",
                "smart_wallet.active",
                "smart_wallet.deployment_failed",
                "smart_wallet.requires_intervention",
                "vault.policy_active",
                "vault.failed",
                "vault.funding_posted",
                "vault.funding_requires_intervention",
                "vault.yield_supply_settled",
                "vault.yield_supply_failed",
                "payment.created",
                "payment.requires_action",
                "payment.processing",
                "payment.accepted",
                "payment.refund_pending",
                "payment.partially_refunded",
                "payment.refunded",
                "payment.succeeded",
                "payment.failed",
                "payment.cancelled",
                "payment.expired",
                "payment.requires_intervention",
                "payment.duplicate_received",
                "payment.late_received",
                "payment.settlement_returned"
              ]
            },
            "example": [
              "account.created",
              "account.updated",
              "bank_funding.completed",
              "bank_funding.failed",
              "compliance.action_required",
              "compliance.approved",
              "compliance.rejected",
              "compliance.requires_intervention",
              "deposit.detected",
              "deposit.settled",
              "deposit.reversed",
              "deposit.requires_intervention",
              "payment.processing",
              "payment.accepted",
              "payment.refund_pending",
              "payment.partially_refunded",
              "payment.refunded",
              "payment.succeeded",
              "payment.failed",
              "payment.cancelled",
              "payment.expired",
              "payment.requires_intervention",
              "payment.duplicate_received",
              "payment.late_received",
              "payment.settlement_returned"
            ]
          },
          "eventGroups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventGroup"
            },
            "example": [
              {
                "id": "accounts",
                "label": "Accounts",
                "events": ["account.created", "account.updated"]
              },
              {
                "id": "deposits",
                "label": "Deposits",
                "events": [
                  "deposit.detected",
                  "deposit.settled",
                  "deposit.requires_intervention",
                  "deposit.reversed",
                  "deposit.failed"
                ]
              },
              {
                "id": "bank_funding",
                "label": "Bank funding",
                "events": ["bank_funding.completed", "bank_funding.failed"]
              },
              {
                "id": "payments",
                "label": "Payments",
                "events": [
                  "payment.created",
                  "payment.requires_action",
                  "payment.processing",
                  "payment.accepted",
                  "payment.refund_pending",
                  "payment.partially_refunded",
                  "payment.refunded",
                  "payment.succeeded",
                  "payment.failed",
                  "payment.cancelled",
                  "payment.expired",
                  "payment.requires_intervention",
                  "payment.duplicate_received",
                  "payment.late_received",
                  "payment.settlement_returned"
                ]
              },
              {
                "id": "kyc",
                "label": "KYC",
                "events": [
                  "kyc.session_created",
                  "kyc.updated",
                  "partner_kyc.requires_information",
                  "partner_kyc.information_submitted",
                  "partner_kyc.ready_to_submit",
                  "partner_kyc.submitted",
                  "partner_kyc.approved",
                  "partner_kyc.rejected",
                  "offramp_partner_account.linked"
                ]
              },
              {
                "id": "compliance",
                "label": "Compliance",
                "events": [
                  "compliance.action_required",
                  "compliance.submitted",
                  "compliance.approved",
                  "compliance.rejected",
                  "compliance.requires_intervention"
                ]
              },
              {
                "id": "vaults",
                "label": "Vaults",
                "events": [
                  "vault.policy_active",
                  "vault.failed",
                  "vault.funding_posted",
                  "vault.funding_requires_intervention",
                  "vault.yield_supply_settled",
                  "vault.yield_supply_failed"
                ]
              },
              {
                "id": "smart_wallets",
                "label": "Smart Wallets",
                "events": [
                  "smart_wallet.active",
                  "smart_wallet.deployment_failed",
                  "smart_wallet.requires_intervention"
                ]
              }
            ]
          },
          "signatures": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "header",
              "timestampHeader",
              "deliveryHeader",
              "eventHeader",
              "scheme",
              "signedPayload"
            ],
            "properties": {
              "header": {
                "type": "string",
                "example": "x-stableyard-signature"
              },
              "timestampHeader": {
                "type": "string",
                "example": "x-stableyard-timestamp"
              },
              "deliveryHeader": {
                "type": "string",
                "example": "x-stableyard-delivery"
              },
              "eventHeader": {
                "type": "string",
                "example": "x-stableyard-event"
              },
              "scheme": {
                "type": "string",
                "example": "hmac-sha256"
              },
              "signedPayload": {
                "type": "string",
                "example": "<timestamp>.<deliveryId>.<eventId>.<rawBody>"
              }
            }
          },
          "deliveryPolicy": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "guarantee",
              "retryableStatuses",
              "maxAttempts",
              "localPrivateDestinationsAllowed",
              "dedupe"
            ],
            "properties": {
              "guarantee": {
                "type": "string",
                "const": "at_least_once"
              },
              "retryableStatuses": {
                "type": "array",
                "items": {
                  "type": "integer"
                },
                "example": [408, 425, 429, 500, 502, 503, 504]
              },
              "maxAttempts": {
                "type": "integer",
                "minimum": 1,
                "example": 3
              },
              "localPrivateDestinationsAllowed": {
                "type": "boolean",
                "example": false
              },
              "dedupe": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "deliveryRetryHeader",
                  "eventHeader",
                  "resourceStrategy"
                ],
                "properties": {
                  "deliveryRetryHeader": {
                    "type": "string",
                    "const": "x-stableyard-delivery"
                  },
                  "eventHeader": {
                    "type": "string",
                    "const": "x-stableyard-event-id"
                  },
                  "resourceStrategy": {
                    "type": "string",
                    "example": "Use the event name plus the public resource id in the payload, such as depositId or paymentId, for business-level idempotency."
                  }
                }
              }
            }
          }
        }
      },
      "Asset": {
        "type": "object",
        "required": ["chainId", "tokenAddress", "symbol", "decimals"],
        "properties": {
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428,
              10001
            ],
            "description": "Supported deposit chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428, Bitcoin=10001."
          },
          "tokenAddress": {
            "type": "string",
            "description": "Contract/mint address for tokens, the EVM zero address for native EVM assets, native for BTC, or the Solana System Program address for SOL.",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "symbol": {
            "type": "string",
            "enum": [
              "USDC",
              "USDT",
              "THBT",
              "JPYC",
              "USDG",
              "BTC",
              "ETH",
              "POL",
              "BNB",
              "SOL"
            ]
          },
          "decimals": {
            "type": "integer",
            "enum": [6, 8, 9, 18]
          },
          "kind": {
            "type": "string",
            "enum": ["token", "native"],
            "description": "Present on deposit-address supportedAssets entries to distinguish contract tokens from native gas assets."
          }
        }
      },
      "Money": {
        "type": "object",
        "required": ["asset", "amount"],
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/Asset"
          },
          "amount": {
            "type": "string",
            "description": "Atomic units for the token asset.",
            "example": "1250000"
          }
        }
      },
      "Account": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "externalUserId",
          "subjectType",
          "status",
          "paymentAcceptance",
          "metadata",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "acct_123"
          },
          "externalUserId": {
            "type": "string",
            "maxLength": 128,
            "example": "user_123",
            "description": "The partner-owned external user ID supplied when this account was created. Unicode control characters are rejected."
          },
          "subjectType": {
            "type": "string",
            "enum": ["individual", "business", "unclassified"],
            "example": "individual",
            "description": "Legal subject represented by the UPA. New accounts are individual or business. Some older accounts return unclassified and cannot use fiat rails until Stableyard classifies them."
          },
          "status": {
            "type": "string",
            "enum": ["active", "suspended", "closed"]
          },
          "displayProfile": {
            "$ref": "#/components/schemas/AccountDisplayProfile"
          },
          "paymentAcceptance": {
            "$ref": "#/components/schemas/AccountPaymentAcceptance"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Optional partner metadata. Must be JSON-safe, at most 4096 bytes, depth 3, 25 keys per object, 512 characters per string, and 50 items per array."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountDisplayProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": ["displayName", "logoUrl", "version"],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "example": "Acme Downtown"
          },
          "logoUrl": {
            "type": ["string", "null"],
            "format": "uri",
            "maxLength": 2048,
            "example": "https://cdn.example.com/acme-downtown.png"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "example": 2
          }
        },
        "description": "Account-level recipient presentation. It identifies who is being paid and is distinct from app branding."
      },
      "AccountPaymentAcceptance": {
        "type": "object",
        "additionalProperties": false,
        "required": ["publicReceiveEnabled", "version"],
        "properties": {
          "publicReceiveEnabled": {
            "type": "boolean",
            "example": false
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "example": 1
          }
        },
        "description": "Per-UPA opt-in for public receive Payment creation. App-level public Payment policy is enforced separately."
      },
      "UpdateAccountPaymentAcceptanceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["publicReceiveEnabled", "expectedVersion", "reason"],
        "properties": {
          "publicReceiveEnabled": {
            "type": "boolean"
          },
          "expectedVersion": {
            "type": "integer",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500
          }
        }
      },
      "UpdateAccountDisplayProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["displayName", "expectedVersion", "reason"],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "example": "Acme Downtown"
          },
          "logoUrl": {
            "type": ["string", "null"],
            "format": "uri",
            "maxLength": 2048,
            "example": "https://cdn.example.com/acme-downtown.png"
          },
          "expectedVersion": {
            "type": "integer",
            "minimum": 0,
            "description": "Use 0 when setting the profile for the first time."
          },
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500,
            "example": "Update the payer-facing store identity."
          }
        }
      },
      "PaymentHandle": {
        "type": "object",
        "required": [
          "id",
          "accountId",
          "namespace",
          "handle",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "handle_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "namespace": {
            "type": "string",
            "example": "partner"
          },
          "handle": {
            "type": "string",
            "example": "alice"
          },
          "status": {
            "type": "string",
            "enum": ["active", "disabled"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConnectedWallet": {
        "type": "object",
        "required": [
          "id",
          "accountId",
          "kind",
          "chainId",
          "address",
          "status",
          "ownershipVerificationStatus",
          "settlementProfileId",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "wallet_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "kind": {
            "type": "string",
            "enum": ["evm", "tron", "solana", "movement"]
          },
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428
            ],
            "example": 42161,
            "description": "Supported connected-wallet chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428. Address family must match the selected chain ID."
          },
          "address": {
            "type": "string",
            "example": "0x1111111111111111111111111111111111111111",
            "description": "Wallet address. EVM addresses are normalized to lowercase before storage; other address families retain their submitted casing."
          },
          "label": {
            "type": ["string", "null"],
            "example": "Connected wallet"
          },
          "status": {
            "type": "string",
            "enum": ["active", "disabled"],
            "description": "Whether this wallet link can be used by the account."
          },
          "ownershipVerificationStatus": {
            "type": "string",
            "enum": ["unverified", "verified"],
            "description": "Ownership is unverified until Stableyard records a successful proof. Linking a wallet alone never verifies ownership."
          },
          "ownershipVerificationMethod": {
            "type": ["string", "null"],
            "example": "eip712_signature"
          },
          "ownershipVerifiedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "settlementProfileId": {
            "type": ["string", "null"],
            "example": "settle_123",
            "description": "The active settlement profile id when this wallet is the account settlement wallet; otherwise null."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BankAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "accountHolderName",
          "country",
          "currency",
          "bankName",
          "accountNumberLast4",
          "rail",
          "status",
          "verification",
          "disabledAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "bank_account_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "accountHolderName": {
            "type": "string",
            "example": "Alice Doe"
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "US"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "example": "USD"
          },
          "bankName": {
            "type": "string",
            "example": "Example Bank"
          },
          "bankCode": {
            "type": "string",
            "maxLength": 64,
            "description": "Public country-directory bank code when supplied for a local bank link."
          },
          "accountNumberLast4": {
            "type": "string",
            "example": "1234"
          },
          "rail": {
            "type": ["string", "null"],
            "example": "ach"
          },
          "status": {
            "type": "string",
            "enum": ["pending_verification", "active", "restricted", "disabled"]
          },
          "verification": {
            "type": "object",
            "additionalProperties": false,
            "required": ["version", "verifiedAt"],
            "properties": {
              "version": {
                "type": "integer",
                "minimum": 0
              },
              "verifiedAt": {
                "type": ["string", "null"],
                "format": "date-time"
              }
            }
          },
          "disabledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SettlementDestination": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "type",
          "status",
          "preferred",
          "capabilities",
          "resource",
          "disabledAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "destination_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "type": {
            "type": "string",
            "enum": ["crypto_wallet", "bank_account", "payment_rail_identifier"],
            "example": "crypto_wallet"
          },
          "status": {
            "type": "string",
            "enum": ["pending_verification", "active", "restricted", "disabled"],
            "example": "active"
          },
          "preferred": {
            "type": "boolean"
          },
          "capabilities": {
            "type": "object",
            "additionalProperties": true,
            "description": "What this destination supports. `settlementSupported` must be true before this destination can be selected.",
            "example": {
              "directions": ["receive"],
              "settlementSupported": true,
              "unavailableReason": null,
              "network": {
                "code": "base",
                "chainId": 8453,
                "chainFamily": "evm"
              },
              "assets": [
                {
                  "symbol": "USDC",
                  "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                  "decimals": 6
                }
              ]
            }
          },
          "resource": {
            "type": "object",
            "additionalProperties": true,
            "description": "Masked view of the linked wallet, bank account, or rail identifier. Tokens and full identifiers are never returned.",
            "example": {
              "type": "crypto_wallet",
              "connectedWalletId": "wallet_123",
              "chainId": 8453,
              "address": "0x1111111111111111111111111111111111111111",
              "walletKind": "external",
              "label": "Primary wallet",
              "ownershipVerificationStatus": "unverified"
            }
          },
          "disabledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SettlementDestinationsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "destinations", "nextCursor"],
        "properties": {
          "accountId": {
            "type": "string"
          },
          "destinations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SettlementDestination"
            }
          },
          "nextCursor": {
            "type": ["string", "null"]
          }
        }
      },
      "LinkedBankDirectoryResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["country", "currency", "banks"],
        "properties": {
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "banks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["code", "name"],
              "properties": {
                "code": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                }
              }
            }
          }
        }
      },
      "BankAccountRequirementsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["version", "accountId", "countries"],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "accountId": {
            "type": "string"
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "country",
                "name",
                "currency",
                "implementation",
                "schema",
                "alternatives",
                "available",
                "unavailableReason"
              ],
              "properties": {
                "country": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                },
                "name": {
                  "type": "string"
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$"
                },
                "implementation": {
                  "type": "string",
                  "enum": ["supported", "planned"]
                },
                "available": {
                  "type": "boolean"
                },
                "unavailableReason": {
                  "type": ["string", "null"]
                },
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Strict JSON Schema for country-specific bank fields, including normalization and bank-directory annotations."
                },
                "alternatives": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "label",
                      "fields",
                      "resourceType",
                      "available"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "fields": {
                        "type": "object",
                        "additionalProperties": true
                      },
                      "resourceType": {
                        "type": "string",
                        "const": "payment_rail_identifier"
                      },
                      "available": {
                        "type": "boolean",
                        "const": false
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "BankAccountResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["bankAccount"],
        "properties": {
          "bankAccount": {
            "$ref": "#/components/schemas/BankAccount"
          }
        }
      },
      "CreateBankAccountResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["bankAccount", "settlementDestination", "provisioning"],
        "properties": {
          "bankAccount": {
            "$ref": "#/components/schemas/BankAccount"
          },
          "settlementDestination": {
            "$ref": "#/components/schemas/SettlementDestination"
          },
          "provisioning": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "providerProvisioningCompleted",
              "settlementReady",
              "nextAction"
            ],
            "properties": {
              "providerProvisioningCompleted": {
                "type": "boolean",
                "description": "True once the bank account is set up for payouts."
              },
              "settlementReady": {
                "type": "boolean",
                "description": "Whether received funds can settle automatically to this bank. Currently `false` for every bank; to pay a linked bank, create a send Payment with its `bankAccountId`."
              },
              "nextAction": {
                "type": "object",
                "additionalProperties": true,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "none",
                      "complete_provider_onboarding",
                      "contact_support"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Short-lived hosted onboarding URL. Returned only in the current response when action is required."
                  },
                  "expiresAt": {
                    "type": ["string", "null"],
                    "format": "date-time"
                  }
                }
              }
            }
          }
        }
      },
      "BankAccountsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "bankAccounts", "nextCursor"],
        "properties": {
          "accountId": {
            "type": "string"
          },
          "bankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BankAccount"
            }
          },
          "nextCursor": {
            "type": ["string", "null"]
          }
        }
      },
      "SettlementProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "version",
          "connectedWalletId",
          "settlementDestinationId",
          "status",
          "destinationType",
          "chainId",
          "destinationAddress",
          "assetSymbol",
          "tokenAddress",
          "snapshot"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "settle_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "example": 2
          },
          "connectedWalletId": {
            "type": ["string", "null"],
            "example": "wallet_123"
          },
          "settlementDestinationId": {
            "type": ["string", "null"],
            "example": "destination_123"
          },
          "status": {
            "type": "string",
            "enum": ["draft", "active", "inactive", "failed"],
            "example": "active"
          },
          "destinationType": {
            "type": "string",
            "enum": ["smart_wallet", "connected_wallet", "external_wallet"],
            "example": "connected_wallet"
          },
          "chainId": {
            "type": "integer",
            "enum": [42161, 1, 8453, 137, 56, 43114, 4663, 4217, 10103, 10002],
            "description": "Supported settlement chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002. Settlement currently supports EVM, Solana, and Movement token destinations. Movement also supports THBT, while Polygon supports direct same-chain JPYC settlement. Tron can be used for deposits but not as a settlement destination.",
            "example": 42161
          },
          "destinationAddress": {
            "type": "string",
            "example": "0x1111111111111111111111111111111111111111"
          },
          "assetSymbol": {
            "type": "string",
            "enum": ["USDC", "USDT", "THBT", "JPYC", "USDG"]
          },
          "tokenAddress": {
            "type": "string",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "snapshot": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SettlementProfileResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["settlementProfile"],
        "properties": {
          "settlementProfile": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SettlementProfile"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PaymentSourcePreference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "version",
          "type",
          "chainId",
          "assetSymbol",
          "tokenAddress",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "source_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "version": {
            "type": "integer",
            "minimum": 1,
            "example": 1
          },
          "type": {
            "type": "string",
            "enum": ["connected_wallet", "vault"]
          },
          "chainId": {
            "type": "integer",
            "enum": [42161, 1, 8453, 137, 56, 43114, 4663, 4217, 10103, 10002],
            "description": "Supported settlement chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002. Settlement currently supports EVM, Solana, and Movement token destinations. Movement also supports THBT, while Polygon supports direct same-chain JPYC settlement. Tron can be used for deposits but not as a settlement destination."
          },
          "tokenAddress": {
            "type": "string",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "sourceAddress": {
            "type": ["string", "null"],
            "example": "0x3333333333333333333333333333333333333333"
          },
          "sourceRef": {
            "type": ["string", "null"],
            "example": "wallet_123"
          },
          "assetSymbol": {
            "type": "string",
            "enum": ["USDC", "USDT", "THBT", "JPYC", "USDG"],
            "example": "USDC"
          },
          "status": {
            "type": "string",
            "enum": ["active", "disabled"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaymentSourceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["paymentSource"],
        "properties": {
          "paymentSource": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaymentSourcePreference"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DepositAddress": {
        "type": "object",
        "description": "A deposit address accepts every supported token on its network, so no single assetSymbol/tokenAddress is included.",
        "required": [
          "id",
          "accountId",
          "chainId",
          "address",
          "supportedAssets",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "deposit_addr_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428,
              10001
            ],
            "description": "Supported deposit chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428, Bitcoin=10001."
          },
          "address": {
            "type": "string",
            "example": "0x1111111111111111111111111111111111111111"
          },
          "supportedAssets": {
            "type": "array",
            "description": "Token and native assets accepted at this receive address on the requested chain.",
            "items": {
              "$ref": "#/components/schemas/Asset"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": false,
            "description": "Network hints for display.",
            "properties": {
              "networkCode": {
                "type": "string",
                "example": "arbitrum"
              },
              "chainFamily": {
                "type": "string",
                "enum": ["evm", "tron", "btc", "solana", "movement"]
              }
            }
          },
          "status": {
            "type": "string",
            "enum": ["active", "disabled"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Deposit": {
        "type": "object",
        "required": [
          "id",
          "accountId",
          "depositAddressId",
          "status",
          "amount",
          "sourceTransfer",
          "fees",
          "settlement",
          "settlementProfileSnapshot"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "deposit_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "depositAddressId": {
            "type": "string",
            "example": "deposit_addr_123"
          },
          "status": {
            "type": "string",
            "enum": [
              "detected",
              "confirming",
              "settling",
              "settled",
              "reversed",
              "failed",
              "ignored",
              "requires_intervention"
            ]
          },
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "sourceTransfer": {
            "type": "object",
            "additionalProperties": false,
            "required": ["amount", "txHash", "logIndex"],
            "properties": {
              "amount": {
                "$ref": "#/components/schemas/Money"
              },
              "txHash": {
                "type": ["string", "null"]
              },
              "logIndex": {
                "type": ["integer", "null"]
              },
              "fromAddress": {
                "type": ["string", "null"],
                "description": "On-chain sender address that funded this deposit, when captured from the source chain."
              }
            }
          },
          "fees": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "partnerAmountAtomic",
              "platformAmountAtomic",
              "networkAmountAtomic",
              "setupAmountAtomic",
              "denomination",
              "basis",
              "actualReceivedAmountAtomic"
            ],
            "properties": {
              "partnerAmountAtomic": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "platformAmountAtomic": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "networkAmountAtomic": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "setupAmountAtomic": {
                "type": "string",
                "pattern": "^[0-9]+$",
                "description": "One-time Tron address setup fee charged on this deposit; zero otherwise."
              },
              "denomination": {
                "$ref": "#/components/schemas/Asset"
              },
              "basis": {
                "type": "string",
                "enum": ["source_amount", "verified_destination_receipt"],
                "description": "`source_amount` is returned before final settlement evidence exists. `verified_destination_receipt` is returned once Stableyard has verified the amount received at the destination."
              },
              "actualReceivedAmountAtomic": {
                "type": ["string", "null"],
                "pattern": "^[0-9]+$"
              }
            }
          },
          "netSettlementAmount": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ]
          },
          "settlement": {
            "type": "object",
            "additionalProperties": false,
            "required": ["status", "txHash", "settledAt"],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "settled",
                  "failed",
                  "requires_intervention"
                ]
              },
              "txHash": {
                "type": ["string", "null"]
              },
              "settledAt": {
                "type": ["string", "null"],
                "format": "date-time"
              },
              "reasonCode": {
                "type": "string",
                "description": "Stable machine-readable reason when settlement requires manual review, including verified Routing refund failures such as routing_refund_proof_missing, routing_refund_proof_mismatch, or routing_refund_retry_exhausted."
              }
            }
          },
          "settlementProfileSnapshot": {
            "type": "object",
            "additionalProperties": true,
            "description": "Immutable settlement profile snapshot captured when the deposit was detected."
          },
          "txHash": {
            "type": ["string", "null"],
            "example": "0xabc123..."
          },
          "observedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "settledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DepositNetworksResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["networks", "fees", "refreshedAt"],
        "properties": {
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositNetwork"
            }
          },
          "fees": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "version",
              "basis",
              "partnerFeeBps",
              "platformFeeBps",
              "totalFeeBps"
            ],
            "description": "Current reusable-deposit commercial fee rates for this organization. Rates freeze per deposit at detection. Use supportedAssets[].feeModel for the fee model that applies to each asset.",
            "properties": {
              "version": {
                "type": "integer",
                "enum": [3]
              },
              "basis": {
                "type": "string",
                "enum": ["verified_destination_receipt"]
              },
              "partnerFeeBps": {
                "type": "integer",
                "minimum": 0
              },
              "platformFeeBps": {
                "type": "integer",
                "minimum": 0
              },
              "totalFeeBps": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "refreshedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DepositNetwork": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "aliases",
          "chainFamily",
          "chainId",
          "live",
          "depositAddresses",
          "supportedAssets"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "ethereum"
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "chainFamily": {
            "type": "string",
            "enum": ["evm", "tron", "btc", "solana", "movement"]
          },
          "chainId": {
            "type": "integer",
            "example": 1
          },
          "live": {
            "type": "boolean",
            "description": "True when deposit addresses can currently be created and monitored on this network. Routing liquidity is reported separately per asset and is destination-dependent."
          },
          "depositAddresses": {
            "type": "object",
            "additionalProperties": false,
            "required": ["operational", "disabledReason"],
            "properties": {
              "operational": {
                "type": "boolean"
              },
              "disabledReason": {
                "type": ["string", "null"],
                "enum": [
                  "deposit_addresses_not_supported_on_network",
                  "deposit_address_issuance_paused",
                  "deposit_webhook_not_configured",
                  "deposit_webhook_provider_not_configured",
                  null
                ],
                "example": null
              }
            }
          },
          "supportedAssets": {
            "type": "array",
            "description": "Only listed assets are accepted. A transfer of an unlisted asset to an existing address is held for review.",
            "items": {
              "$ref": "#/components/schemas/DepositNetworkAsset"
            }
          }
        }
      },
      "DepositNetworkAsset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "symbol",
          "tokenAddress",
          "decimals",
          "kind",
          "minimumDeposit",
          "maximumDeposit",
          "configuredMaximumDeposit",
          "liquidity",
          "feeModel",
          "sourceDeduction",
          "sourceSetupCharge"
        ],
        "properties": {
          "symbol": {
            "type": "string",
            "example": "USDT"
          },
          "tokenAddress": {
            "type": "string",
            "example": "0xdac17f958d2ee523a2206206994597c13d831ec7"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 36,
            "example": 6
          },
          "kind": {
            "type": "string",
            "enum": ["token", "native"]
          },
          "feeModel": {
            "type": "object",
            "additionalProperties": false,
            "required": ["version", "basis"],
            "properties": {
              "version": {
                "type": "integer",
                "enum": [3, 4]
              },
              "basis": {
                "type": "string",
                "enum": ["verified_destination_receipt", "source_amount"]
              }
            }
          },
          "minimumDeposit": {
            "description": "Smallest amount recorded as a deposit on this source asset. A specific route or fee combination may require more to settle automatically.",
            "type": "object",
            "additionalProperties": false,
            "required": ["amount", "amountAtomic", "inclusive"],
            "properties": {
              "amount": {
                "type": "string",
                "example": "0.5"
              },
              "amountAtomic": {
                "type": "string",
                "example": "500000"
              },
              "inclusive": {
                "type": "boolean",
                "example": true
              }
            }
          },
          "maximumDeposit": {
            "description": "Null when no cap or sampled Routing quote is known. A liquidity-basis value is the highest sampled quotable amount, not a guaranteed hard limit. A configured-basis value is an enforced per-deposit cap; larger confirmed deposits require manual review.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["amount", "amountAtomic", "inclusive", "basis"],
                "properties": {
                  "amount": {
                    "type": "string",
                    "example": "10240"
                  },
                  "amountAtomic": {
                    "type": "string",
                    "example": "10240000000"
                  },
                  "inclusive": {
                    "type": "boolean",
                    "example": true
                  },
                  "basis": {
                    "type": "string",
                    "enum": ["liquidity", "configured"]
                  }
                }
              }
            ]
          },
          "configuredMaximumDeposit": {
            "description": "The actual enforced per-deposit hard cap, if configured. Null means no configured cap, not unlimited Routing liquidity.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["amount", "amountAtomic", "inclusive"],
                "properties": {
                  "amount": {
                    "type": "string",
                    "example": "1000"
                  },
                  "amountAtomic": {
                    "type": "string",
                    "example": "1000000000"
                  },
                  "inclusive": {
                    "type": "boolean",
                    "example": true
                  }
                }
              }
            ]
          },
          "liquidity": {
            "type": "object",
            "additionalProperties": false,
            "required": ["available", "checkedAt"],
            "properties": {
              "available": {
                "type": ["boolean", "null"],
                "description": "True/false from sampled Routing quotes to reference destinations; null when not measured. This is not account-specific preferred-settlement liquidity."
              },
              "checkedAt": {
                "type": ["string", "null"],
                "format": "date-time"
              }
            }
          },
          "sourceDeduction": {
            "description": "Current per-deposit source-asset deduction before Routing. Null for assets with no fixed source deduction. Actual gas and Routing rates can vary.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["amount", "amountAtomic", "reason"],
                "properties": {
                  "amount": {
                    "type": "string",
                    "example": "2"
                  },
                  "amountAtomic": {
                    "type": "string",
                    "example": "2000000"
                  },
                  "reason": {
                    "type": "string",
                    "enum": ["btc_fee_reserve", "tron_sweep_charge"]
                  }
                }
              }
            ]
          },
          "sourceSetupCharge": {
            "description": "A one-time charge on the first eligible Tron USDT deposit for this reusable address. A pending or ambiguous first charge holds later deposits until verified.",
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["amount", "amountAtomic", "reason", "frequency"],
                "properties": {
                  "amount": {
                    "type": "string",
                    "example": "2"
                  },
                  "amountAtomic": {
                    "type": "string",
                    "example": "2000000"
                  },
                  "reason": {
                    "type": "string",
                    "enum": ["tron_address_setup"]
                  },
                  "frequency": {
                    "type": "string",
                    "enum": ["once_per_address"]
                  }
                }
              }
            ]
          }
        }
      },
      "DepositAddressesResponse": {
        "type": "object",
        "required": ["accountId", "depositAddresses"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "depositAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DepositAddress"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass this value as cursor to fetch the next page."
          }
        }
      },
      "DepositsResponse": {
        "type": "object",
        "required": ["accountId", "deposits"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "deposits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deposit"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass this value as cursor to fetch the next page."
          }
        }
      },
      "AccountBundle": {
        "type": "object",
        "additionalProperties": false,
        "required": ["account", "connectedWallets"],
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "paymentHandle": {
            "$ref": "#/components/schemas/PaymentHandle"
          },
          "connectedWallets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConnectedWallet"
            }
          },
          "settlementProfile": {
            "$ref": "#/components/schemas/SettlementProfile"
          }
        }
      },
      "TransactionPerspective": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "direction"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_sender123"
          },
          "direction": {
            "type": "string",
            "enum": ["sent", "received", "self", "related"],
            "description": "Direction from the perspective of the account that requested or matched this transaction."
          },
          "counterpartyAccountId": {
            "type": "string",
            "example": "acct_receiver123",
            "description": "Other Stableyard account on the transaction when known."
          }
        }
      },
      "OfframpTransactionAmount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amountAtomic",
          "assetCode",
          "decimals",
          "chainId",
          "tokenAddress"
        ],
        "properties": {
          "amountAtomic": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "assetCode": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "chainId": {
            "type": "integer"
          },
          "tokenAddress": {
            "type": "string"
          }
        }
      },
      "OfframpTransactionDetails": {
        "type": "object",
        "additionalProperties": false,
        "description": "Frozen off-ramp quote and recipient details. Bank account numbers are represented by their last four characters; unavailable recipient fields are null. Amounts are exact atomic strings and the exchange rate retains its direction.",
        "required": [
          "version",
          "country",
          "destinationType",
          "fiatAmount",
          "fundingAmount",
          "providerPrincipal",
          "fees",
          "exchangeRate",
          "receiver"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "country": {
            "type": "string"
          },
          "destinationType": {
            "type": "string",
            "enum": ["external_qr", "external_bank", "bank_account"]
          },
          "fiatAmount": {
            "type": "object",
            "additionalProperties": false,
            "required": ["amountAtomic", "assetCode", "decimals"],
            "properties": {
              "amountAtomic": {
                "type": ["string", "null"],
                "pattern": "^[0-9]+$",
                "description": "Exact fiat amount scaled by the accompanying decimals (exact-input payout receipts can use six decimals), or null when unknown when this transaction snapshot was recorded (for example, an exact-input payout before the payout completes). Null is not zero or proof of payout failure. Read the associated Payment for its current payout result."
              },
              "assetCode": {
                "type": "string"
              },
              "decimals": {
                "type": "integer"
              }
            }
          },
          "fundingAmount": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OfframpTransactionAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "providerPrincipal": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OfframpTransactionAmount"
              },
              {
                "type": "null"
              }
            ]
          },
          "fees": {
            "type": "object",
            "additionalProperties": false,
            "required": ["provider", "platform", "partner", "total"],
            "properties": {
              "provider": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/OfframpTransactionAmount"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "platform": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/OfframpTransactionAmount"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "partner": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/OfframpTransactionAmount"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "total": {
                "description": "Total payout fees in the funding asset: provider + platform (Stableyard) + partner (app partner). Already included in fundingAmount; do not add again. Null when any component is unavailable.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/OfframpTransactionAmount"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "exchangeRate": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["rate", "baseAssetCode", "quoteAssetCode"],
                "properties": {
                  "rate": {
                    "type": "string"
                  },
                  "baseAssetCode": {
                    "type": "string"
                  },
                  "quoteAssetCode": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "receiver": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "bankName", "bankCode", "accountNumberLast4"],
            "properties": {
              "name": {
                "type": ["string", "null"]
              },
              "bankName": {
                "type": ["string", "null"]
              },
              "bankCode": {
                "type": ["string", "null"]
              },
              "accountNumberLast4": {
                "type": ["string", "null"]
              }
            }
          }
        }
      },
      "Transaction": {
        "type": "object",
        "required": [
          "id",
          "accountId",
          "status",
          "amount",
          "description",
          "sourceType",
          "sourceId"
        ],
        "properties": {
          "offrampDetails": {
            "$ref": "#/components/schemas/OfframpTransactionDetails"
          },
          "id": {
            "type": "string",
            "example": "txn_123"
          },
          "accountId": {
            "type": "string",
            "example": "acct_123",
            "description": "Account whose perspective this response is for."
          },
          "senderAccountId": {
            "type": "string",
            "example": "acct_sender123",
            "description": "Present when the perspective account is the sender."
          },
          "receiverAccountId": {
            "type": "string",
            "example": "acct_receiver123",
            "description": "Present when the perspective account is the receiver."
          },
          "direction": {
            "type": "string",
            "enum": ["sent", "received", "self", "related"]
          },
          "perspective": {
            "$ref": "#/components/schemas/TransactionPerspective"
          },
          "status": {
            "type": "string",
            "enum": ["pending", "completed", "posted", "failed", "reversed"]
          },
          "amount": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ],
            "description": "Amount for the requested account's perspective. For a Send, the sender sees the gross source debit and the recipient sees the net destination amount actually settled."
          },
          "description": {
            "type": "string",
            "example": "USDC payment"
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "payment",
              "deposit",
              "vault_funding",
              "fee",
              "refund",
              "adjustment"
            ]
          },
          "sourceId": {
            "type": "string",
            "example": "payment_123"
          },
          "paymentId": {
            "type": "string",
            "pattern": "^payment_[A-Za-z0-9_-]+$",
            "description": "Canonical Payment associated with this financial leg."
          },
          "financialLegKind": {
            "type": "string",
            "enum": [
              "collection",
              "send_execution",
              "settlement",
              "fee_payout",
              "refund",
              "adjustment"
            ]
          },
          "sourceTransfer": {
            "type": "object",
            "additionalProperties": false,
            "required": ["amount"],
            "properties": {
              "amount": {
                "$ref": "#/components/schemas/Money"
              },
              "txHash": {
                "type": "string",
                "description": "Source-chain transaction hash when the financial leg originated from an on-chain transfer."
              },
              "logIndex": {
                "type": "integer",
                "minimum": 0,
                "description": "Source-chain event index when the transfer was detected from an indexed token event."
              },
              "fromAddress": {
                "type": "string",
                "description": "On-chain sender address that funded this financial leg, when captured from the source chain."
              }
            }
          },
          "settlement": {
            "type": "object",
            "additionalProperties": false,
            "required": ["amount", "txHash"],
            "properties": {
              "amount": {
                "$ref": "#/components/schemas/Money"
              },
              "txHash": {
                "type": ["string", "null"]
              }
            }
          }
        }
      },
      "CreateExternalAccountRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["externalUserId", "subjectType"],
        "properties": {
          "externalUserId": {
            "type": "string",
            "maxLength": 128,
            "example": "user_123",
            "description": "Stable partner-owned identifier. Unicode control characters are rejected."
          },
          "subjectType": {
            "type": "string",
            "enum": ["individual", "business"],
            "example": "individual",
            "description": "Required legal classification of the UPA subject. This is explicit and is never inferred from identifiers, wallets, metadata, or payment behavior."
          },
          "handle": {
            "type": "string",
            "maxLength": 105,
            "example": "alice"
          },
          "displayProfile": {
            "type": "object",
            "additionalProperties": false,
            "required": ["displayName"],
            "properties": {
              "displayName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120,
                "example": "Acme Downtown"
              },
              "logoUrl": {
                "type": ["string", "null"],
                "format": "uri",
                "maxLength": 2048,
                "example": "https://cdn.example.com/acme-downtown.png"
              }
            },
            "description": "Optional payer-facing recipient identity. It is separate from app branding and can be updated later with the versioned display-profile endpoint."
          },
          "wallets": {
            "type": "array",
            "minItems": 1,
            "description": "Optional connected wallets to link during account creation. If one settlement-supported wallet is sent, it becomes settlement. If multiple wallets are sent, mark one with isPreferredSettlement; otherwise the first settlement-supported wallet becomes settlement.",
            "items": {
              "$ref": "#/components/schemas/WalletLink"
            }
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320,
            "example": "alice@example.com",
            "description": "Optional UPA email, linked during account creation. Requires emailVerified."
          },
          "emailVerified": {
            "type": "boolean",
            "example": true,
            "description": "Set with email. true asserts you already verified this address yourself, using the same partner_asserted contract as POST /accounts/{id}/email/verification-challenges — Stableyard trusts the assertion without sending its own OTP, and only if partner-asserted verification is enabled for this app environment. false or omitted starts Stableyard's own OTP flow to that address."
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true,
            "description": "Optional partner metadata. Must be JSON-safe, at most 4096 bytes, depth 3, 25 keys per object, 512 characters per string, and 50 items per array."
          }
        }
      },
      "WalletLink": {
        "type": "object",
        "required": ["address", "chainId"],
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "minLength": 8,
            "maxLength": 256,
            "example": "0x1111111111111111111111111111111111111111"
          },
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428
            ],
            "description": "Supported connected-wallet chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428. Address family must match the selected chain ID. Bitcoin is deposit-only and cannot be linked as a wallet."
          },
          "label": {
            "type": "string",
            "maxLength": 128,
            "example": "User wallet on Arbitrum"
          },
          "isPreferredSettlement": {
            "type": "boolean",
            "default": false,
            "description": "When true, this settlement-supported wallet becomes the account's preferred settlement wallet. Only one wallet in the request may set this."
          }
        }
      },
      "SetPaymentHandleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["handle"],
        "properties": {
          "handle": {
            "type": "string",
            "minLength": 3,
            "maxLength": 105,
            "example": "alice",
            "description": "Bare handle uses the authenticated app namespace. Qualified `alice@namespace` is also accepted when the namespace matches the authenticated app."
          }
        }
      },
      "ConnectWalletRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["wallets"],
        "properties": {
          "wallets": {
            "type": "array",
            "minItems": 1,
            "description": "Wallets to link. For a wallet-less account without a settlement profile, the first settlement-supported wallet becomes settlement. Otherwise, linking wallets does not change settlement unless one wallet is marked isPreferredSettlement.",
            "items": {
              "$ref": "#/components/schemas/WalletLink"
            }
          }
        }
      },
      "SetSettlementProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "Select an active typed settlement destination returned by the settlement-destinations endpoint. Native assets cannot be selected for token settlement. THBT is Movement-only. JPYC is Polygon-only. USDG is Robinhood Chain-only (4663).",
        "required": ["settlementDestinationId"],
        "properties": {
          "settlementDestinationId": {
            "type": "string",
            "example": "destination_123",
            "description": "Use the ID returned by `GET /v2/accounts/{accountId}/settlement-destinations`."
          },
          "assetSymbol": {
            "type": "string",
            "enum": ["USDC", "USDT", "THBT", "JPYC", "USDG"],
            "example": "USDC"
          }
        }
      },
      "CreateBankAccountRequest": {
        "description": "Country-specific bank inputs.",
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "country": {
                "type": "string",
                "const": "US"
              },
              "currency": {
                "type": "string",
                "const": "USD"
              },
              "accountHolderName": {
                "type": "string",
                "title": "Recipient name",
                "minLength": 1,
                "maxLength": 160
              },
              "beneficiaryType": {
                "type": "string",
                "title": "Beneficiary type",
                "enum": ["individual", "business"],
                "default": "individual"
              },
              "bankName": {
                "type": "string",
                "title": "Bank name",
                "minLength": 1,
                "maxLength": 160
              },
              "accountNumber": {
                "type": "string",
                "title": "Account number",
                "minLength": 4,
                "maxLength": 17,
                "pattern": "^[0-9]{4,17}$",
                "writeOnly": true,
                "x-normalize": "digits"
              },
              "accountType": {
                "type": "string",
                "title": "Account type",
                "enum": ["checking", "savings"]
              },
              "routing": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "aba"
                  },
                  "routingNumber": {
                    "type": "string",
                    "title": "ABA routing number",
                    "minLength": 9,
                    "maxLength": 9,
                    "pattern": "^[0-9]{9,9}$",
                    "writeOnly": true,
                    "x-normalize": "digits",
                    "description": "Use the routing number for the selected ACH, Fedwire, or FedNow rail."
                  }
                },
                "required": ["type", "routingNumber"]
              },
              "rail": {
                "type": "string",
                "title": "Rail",
                "enum": ["ach", "fedwire", "fednow"],
                "default": "ach"
              },
              "beneficiaryAddress": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "street1": {
                    "type": "string",
                    "title": "Street",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "street2": {
                    "type": "string",
                    "title": "Street 2",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "city": {
                    "type": "string",
                    "title": "City",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "region": {
                    "type": "string",
                    "title": "State / region",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "postalCode": {
                    "type": "string",
                    "title": "Postal code",
                    "minLength": 1,
                    "maxLength": 24
                  },
                  "country": {
                    "type": "string",
                    "title": "Country code",
                    "minLength": 2,
                    "maxLength": 2,
                    "pattern": "^[A-Z]{2}$",
                    "x-normalize": "uppercase"
                  }
                },
                "required": [
                  "street1",
                  "city",
                  "region",
                  "postalCode",
                  "country"
                ],
                "title": "Beneficiary address"
              },
              "bankAddress": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "street1": {
                    "type": "string",
                    "title": "Street",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "street2": {
                    "type": "string",
                    "title": "Street 2",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "city": {
                    "type": "string",
                    "title": "City",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "region": {
                    "type": "string",
                    "title": "State / region",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "postalCode": {
                    "type": "string",
                    "title": "Postal code",
                    "minLength": 1,
                    "maxLength": 24
                  },
                  "country": {
                    "type": "string",
                    "title": "Country code",
                    "minLength": 2,
                    "maxLength": 2,
                    "pattern": "^[A-Z]{2}$",
                    "x-normalize": "uppercase"
                  }
                },
                "required": [
                  "street1",
                  "city",
                  "region",
                  "postalCode",
                  "country"
                ],
                "title": "Bank address"
              }
            },
            "required": [
              "country",
              "currency",
              "accountHolderName",
              "bankName",
              "accountNumber",
              "accountType",
              "routing",
              "beneficiaryAddress",
              "bankAddress"
            ],
            "title": "United States bank account"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "country": {
                "type": "string",
                "const": "PH"
              },
              "currency": {
                "type": "string",
                "const": "PHP"
              },
              "accountHolderName": {
                "type": "string",
                "title": "Recipient name",
                "minLength": 1,
                "maxLength": 160
              },
              "beneficiaryType": {
                "type": "string",
                "title": "Beneficiary type",
                "enum": ["individual", "business"],
                "default": "individual"
              },
              "bankName": {
                "type": "string",
                "title": "Bank name",
                "minLength": 1,
                "maxLength": 160
              },
              "bankCode": {
                "type": "string",
                "title": "Bank code",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$",
                "x-bank-directory": true
              },
              "accountNumber": {
                "type": "string",
                "title": "Account number",
                "minLength": 4,
                "maxLength": 34,
                "pattern": "^[0-9]{4,34}$",
                "writeOnly": true,
                "x-normalize": "digits"
              },
              "rail": {
                "type": "string",
                "const": "bank_transfer",
                "default": "bank_transfer"
              }
            },
            "required": [
              "country",
              "currency",
              "accountHolderName",
              "bankName",
              "bankCode",
              "accountNumber"
            ],
            "title": "Philippines bank account"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "country": {
                "type": "string",
                "const": "VN"
              },
              "currency": {
                "type": "string",
                "const": "VND"
              },
              "accountHolderName": {
                "type": "string",
                "title": "Recipient name",
                "minLength": 1,
                "maxLength": 160,
                "x-normalize": "vietnam_name"
              },
              "beneficiaryType": {
                "type": "string",
                "title": "Beneficiary type",
                "enum": ["individual", "business"],
                "default": "individual"
              },
              "bankName": {
                "type": "string",
                "title": "Bank name",
                "minLength": 1,
                "maxLength": 160
              },
              "bankCode": {
                "type": "string",
                "title": "Bank code",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[A-Za-z0-9_-]+$",
                "x-bank-directory": true
              },
              "accountNumber": {
                "type": "string",
                "title": "Account number",
                "minLength": 4,
                "maxLength": 34,
                "pattern": "^[0-9]{4,34}$",
                "writeOnly": true,
                "x-normalize": "digits"
              },
              "rail": {
                "type": "string",
                "const": "bank_transfer",
                "default": "bank_transfer"
              }
            },
            "required": [
              "country",
              "currency",
              "accountHolderName",
              "bankName",
              "bankCode",
              "accountNumber"
            ],
            "title": "Vietnam bank account"
          }
        ],
        "discriminator": {
          "propertyName": "country"
        }
      },
      "CreateOnrampBankAccountRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["connectedWalletId", "destinationAssetCode"],
        "description": "Omit recipientType, recipientName and recipientAddress to use the name and address already verified for the UPA (see recipientOnFile on the requirements). Send all three together to override them. The recipient type must match the UPA subject type. Existing provider recipients are reused only when exactly one matches the requested name; unrelated or ambiguous recipients require operations review.",
        "dependentRequired": {
          "recipientType": ["recipientName", "recipientAddress"],
          "recipientName": ["recipientType", "recipientAddress"],
          "recipientAddress": ["recipientType", "recipientName"]
        },
        "properties": {
          "connectedWalletId": {
            "type": "string",
            "pattern": "^wallet_[A-Za-z0-9_-]{3,59}$",
            "example": "wallet_abc123"
          },
          "destinationAssetCode": {
            "type": "string",
            "enum": ["USDC", "USDT"],
            "description": "Only supported chain/asset pairs are accepted; other combinations return payment_method_not_supported."
          },
          "rail": {
            "type": "string",
            "enum": ["ach", "fedwire", "fednow"],
            "default": "ach"
          },
          "recipientType": {
            "type": "string",
            "enum": ["individual", "business"]
          },
          "recipientName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "recipientAddress": {
            "$ref": "#/components/schemas/OnrampRecipientAddress"
          }
        }
      },
      "OnrampRecipientAddress": {
        "type": "object",
        "additionalProperties": false,
        "required": ["street1", "city", "region", "postalCode", "country"],
        "properties": {
          "street1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "street2": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "street3": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "postalCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "US"
          }
        }
      },
      "OnrampBankAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "status",
          "rail",
          "sourceAsset",
          "destinationAssetCode",
          "destinationChainId",
          "connectedWalletId",
          "bankName",
          "accountNumberLast4",
          "developerFeeBps",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "onramp_acct_123"
          },
          "accountId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "provisioning",
              "active",
              "requires_intervention",
              "disabled",
              "retired"
            ]
          },
          "rail": {
            "type": ["string", "null"],
            "enum": ["ach", "fedwire", "fednow", null]
          },
          "sourceAsset": {
            "type": "string",
            "example": "USD"
          },
          "destinationAssetCode": {
            "type": "string",
            "example": "USDC"
          },
          "destinationChainId": {
            "type": "integer",
            "example": 42161
          },
          "connectedWalletId": {
            "type": "string",
            "description": "The connected wallet this bank account forwards to. Fixed when the bank account is issued: an existing account cannot be re-pointed, so a different wallet, chain or asset requires a different bank account."
          },
          "developerFeeBps": {
            "type": ["integer", "null"],
            "minimum": 0,
            "maximum": 10000,
            "example": 25,
            "description": "Developer fee rate frozen for this facility. 25 bps is 0.25% of each incoming deposit before conversion. Null means the existing account's rate is unconfirmed; it does not mean zero. Existing facilities are not repriced by issuance retries."
          },
          "bankName": {
            "type": ["string", "null"]
          },
          "accountNumberLast4": {
            "type": ["string", "null"],
            "description": "Last 4 digits only. Use the deposit-instructions endpoint for the full details."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OnrampBankAccountRequirements": {
        "type": "object",
        "required": [
          "accountId",
          "available",
          "recipientOnFile",
          "unavailableReason",
          "recipientTypes",
          "rails",
          "supportedDestinations",
          "destinations",
          "developerFeeBps"
        ],
        "properties": {
          "developerFeeBps": {
            "type": ["integer", "null"],
            "minimum": 0,
            "maximum": 10000,
            "example": 25,
            "description": "Rate to disclose before issuing a new USD funding account: 25 bps (0.25%), deducted from each incoming deposit before conversion. Null when issuance pricing is unavailable. Read an existing facility for its own frozen rate."
          },
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "recipientOnFile": {
            "type": "boolean",
            "description": "True when a verified name and address is on file, so the funding account can be created without recipient details."
          },
          "available": {
            "type": "boolean",
            "description": "True only when at least one rail is available and at least one connected wallet is on a supported destination."
          },
          "unavailableReason": {
            "type": ["string", "null"],
            "enum": [
              "onramp_route_not_configured",
              "no_eligible_destination",
              null
            ],
            "description": "Why the flow cannot be started, or null when it can."
          },
          "supportedDestinations": {
            "type": "array",
            "description": "Supported delivery chains and assets, including when this UPA has no eligible wallet. Listing does not grant rail access or approval.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": ["chainId", "networkName", "assetCodes"],
              "properties": {
                "chainId": {
                  "type": "integer",
                  "minimum": 1,
                  "example": 42161
                },
                "networkName": {
                  "type": "string",
                  "example": "Arbitrum One"
                },
                "assetCodes": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "enum": ["USDC", "USDT"]
                  }
                }
              }
            }
          },
          "recipientTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["individual", "business"]
            }
          },
          "rails": {
            "type": "array",
            "description": "Rails available in this environment. One rail can be available while another is not.",
            "items": {
              "type": "object",
              "required": ["rail", "country", "currency"],
              "properties": {
                "rail": {
                  "type": "string",
                  "enum": ["ach", "fedwire", "fednow"]
                },
                "country": {
                  "type": "string",
                  "example": "US"
                },
                "currency": {
                  "type": "string",
                  "example": "USD"
                }
              }
            }
          },
          "destinations": {
            "type": "array",
            "description": "Connected wallets on a supported destination chain, with the asset codes supported on that chain.",
            "items": {
              "type": "object",
              "required": [
                "connectedWalletId",
                "chainId",
                "address",
                "label",
                "assetCodes"
              ],
              "properties": {
                "connectedWalletId": {
                  "type": "string",
                  "pattern": "^wallet_[A-Za-z0-9_-]{3,59}$"
                },
                "chainId": {
                  "type": "integer",
                  "minimum": 1,
                  "example": 42161
                },
                "address": {
                  "type": "string"
                },
                "label": {
                  "type": ["string", "null"]
                },
                "assetCodes": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "enum": ["USDC", "USDT"]
                  }
                }
              }
            }
          }
        }
      },
      "OnrampBankAccountsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "onrampBankAccounts"],
        "properties": {
          "accountId": {
            "type": "string"
          },
          "onrampBankAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnrampBankAccount"
            }
          }
        }
      },
      "OnrampDepositInstructions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "rail",
          "acceptedRails",
          "currency",
          "destination",
          "beneficiary",
          "bank",
          "developerFeeBps"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "onramp_acct_123"
          },
          "accountId": {
            "type": "string"
          },
          "rail": {
            "type": ["string", "null"],
            "enum": ["ach", "fedwire", "fednow", null],
            "description": "The rail named when the account was requested."
          },
          "acceptedRails": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["ach", "fedwire", "fednow"]
            },
            "description": "Every rail a sender can use with these bank details: what the account was issued with, limited to the rails enabled for the app.",
            "example": ["ach", "fedwire", "fednow"]
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "developerFeeBps": {
            "type": ["integer", "null"],
            "minimum": 0,
            "maximum": 10000,
            "example": 25,
            "description": "This facility’s frozen developer fee rate, deducted from incoming deposits before conversion. Null is unconfirmed, not zero."
          },
          "destination": {
            "type": "object",
            "required": ["assetCode", "chainId"],
            "properties": {
              "assetCode": {
                "type": "string",
                "example": "USDC"
              },
              "chainId": {
                "type": "integer",
                "example": 42161
              }
            },
            "description": "Where converted funds are delivered."
          },
          "beneficiary": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "example": "Jane Customer"
              }
            },
            "description": "The account holder name to put on the transfer."
          },
          "bank": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "example": "Example Bank"
              },
              "phone": {
                "type": "string"
              },
              "abaRoutingNumber": {
                "type": "string",
                "example": "000000000"
              },
              "accountNumber": {
                "type": "string",
                "example": "9990005543"
              },
              "accountType": {
                "type": "string",
                "example": "checking"
              }
            }
          }
        }
      },
      "OnrampBankFundingTransaction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "onrampBankAccountId",
          "status",
          "createdAt",
          "developerFee"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "onramp_txn_123"
          },
          "onrampBankAccountId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["pending", "processing", "succeeded", "failed"]
          },
          "sourceAmount": {
            "type": ["string", "null"],
            "example": "100.00",
            "description": "Gross USD received before fees, as an exact decimal string."
          },
          "sourceAsset": {
            "type": ["string", "null"],
            "example": "USD"
          },
          "destinationAmount": {
            "type": ["string", "null"],
            "example": "99.50",
            "description": "Net stablecoin delivered after applicable fees, as an exact decimal string."
          },
          "destinationAssetCode": {
            "type": ["string", "null"],
            "example": "USDC"
          },
          "developerFee": {
            "type": ["object", "null"],
            "additionalProperties": false,
            "required": ["amount", "currency"],
            "properties": {
              "amount": {
                "type": "string",
                "pattern": "^[0-9]+(\\.[0-9]+)?$",
                "example": "0.25"
              },
              "currency": {
                "type": "string",
                "example": "USD"
              }
            },
            "description": "Actual developer fee confirmed by the banking provider’s receipt, or null when not confirmed. It is not an estimate from developerFeeBps and does not prove the fee has been paid out to Stableyard. Provider/prepaid fees are separate."
          },
          "destinationTxHash": {
            "type": ["string", "null"],
            "description": "On-chain delivery transaction. May appear shortly after `succeeded`."
          },
          "failureCode": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "settledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        }
      },
      "OnrampBankFundingTransactionsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["onrampBankAccountId", "transactions"],
        "properties": {
          "onrampBankAccountId": {
            "type": "string"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnrampBankFundingTransaction"
            }
          }
        }
      },
      "SetPaymentSourceRequest": {
        "oneOf": [
          {
            "title": "Connected wallet source",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "connectedWalletId"],
            "properties": {
              "type": {
                "type": "string",
                "const": "connected_wallet"
              },
              "connectedWalletId": {
                "type": "string",
                "example": "wallet_123",
                "description": "Must belong to the account."
              },
              "assetSymbol": {
                "type": "string",
                "enum": ["USDC", "USDT", "THBT", "JPYC", "USDG"],
                "example": "USDC"
              }
            }
          },
          {
            "title": "Vault source",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "vaultId"],
            "properties": {
              "type": {
                "type": "string",
                "const": "vault"
              },
              "vaultId": {
                "type": "string",
                "example": "vault_123",
                "description": "Must be the account's active Stableyard Vault with an active policy. Payments use this account default; Payment creation has no fundingSource override. Enabled Vault routing can deliver to a different supported chain or token."
              },
              "assetSymbol": {
                "type": "string",
                "enum": ["USDC", "USDT"],
                "example": "USDC",
                "description": "Vault payment sources currently support only Vault policy assets on Arbitrum."
              }
            }
          }
        ]
      },
      "GenerateDepositAddressRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["chainIds"],
        "properties": {
          "chainIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 12,
            "uniqueItems": true,
            "description": "One or more chain IDs. Supported deposit chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428, Bitcoin=10001.",
            "example": [42161, 8453],
            "items": {
              "type": "integer",
              "enum": [
                42161,
                1,
                8453,
                137,
                56,
                43114,
                4663,
                4217,
                10103,
                10002,
                728126428,
                10001
              ]
            }
          }
        }
      },
      "CheckDepositTransactionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["transactionHash", "chainId", "depositAddress"],
        "properties": {
          "transactionHash": {
            "type": "string",
            "maxLength": 256,
            "description": "Observed transaction hash or signature.",
            "example": "0xabc1230000000000000000000000000000000000000000000000000000000000"
          },
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428,
              10001
            ],
            "example": 42161,
            "description": "Supported deposit chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428, Bitcoin=10001."
          },
          "depositAddress": {
            "type": "string",
            "minLength": 8,
            "maxLength": 256,
            "description": "The account receive address that should have received the transfer.",
            "example": "0x1111111111111111111111111111111111111111"
          },
          "tokenAddress": {
            "type": "string",
            "maxLength": 128,
            "description": "Optional token identifier used to disambiguate multiple matching transfers. Use the configured contract/mint, the EVM zero address for ETH/POL/BNB, native:btc for BTC, or the Solana System Program address for SOL.",
            "example": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
          },
          "logIndex": {
            "type": "integer",
            "minimum": 0,
            "description": "Optional token log/account index used to disambiguate token transfers. Omit it for native EVM and SOL transfers."
          }
        }
      },
      "DepositCheckResponse": {
        "type": "object",
        "required": ["checked", "detected"],
        "properties": {
          "checked": {
            "type": "boolean",
            "example": true
          },
          "detected": {
            "type": "boolean",
            "example": true
          },
          "isTransferDone": {
            "type": "boolean",
            "example": true,
            "description": "True only when the hash is verified as a supported deposit transfer to the submitted active deposit address and passes the chain minimum. Known check failures return false with HTTP 200."
          },
          "verified": {
            "type": "boolean",
            "example": true,
            "description": "True when Stableyard verified the transaction on-chain."
          },
          "supported": {
            "type": "boolean",
            "example": true,
            "description": "False when the transaction exists but is not a supported configured token/native deposit transfer, is unconfirmed, or does not pass the chain minimum."
          },
          "chainId": {
            "type": "integer",
            "enum": [
              42161,
              1,
              8453,
              137,
              56,
              43114,
              4663,
              4217,
              10103,
              10002,
              728126428,
              10001
            ],
            "example": 42161,
            "description": "Supported deposit chain IDs: Arbitrum=42161, Ethereum=1, Base=8453, Polygon=137, BNB Smart Chain=56, Avalanche=43114, Robinhood Chain=4663, Tempo=4217, Solana=10103, Movement=10002, Tron=728126428, Bitcoin=10001."
          },
          "depositAddress": {
            "type": "string",
            "example": "0x1111111111111111111111111111111111111111"
          },
          "transactionHash": {
            "type": "string",
            "example": "0xabc1230000000000000000000000000000000000000000000000000000000000"
          },
          "hashExists": {
            "type": "boolean",
            "example": false,
            "description": "False when the hash is malformed or the transaction was not found on-chain."
          },
          "depositAddressExists": {
            "type": "boolean",
            "example": true,
            "description": "False when the submitted deposit address is not active for the account and chain."
          },
          "addressMatched": {
            "type": "boolean",
            "example": true,
            "description": "For non-deposit transaction-hash checks, indicates whether the chain transaction appeared to touch the submitted deposit address."
          },
          "reason": {
            "type": "string",
            "example": "unsupported_deposit_transaction"
          },
          "minimumTransactionAmountAtomic": {
            "type": "string",
            "example": "10000",
            "description": "Minimum threshold in the asset's atomic units when a verified deposit is ignored for being too small."
          },
          "minimumTransactionAmount": {
            "type": "string",
            "example": "0.0001",
            "description": "Human-readable minimum threshold when a verified deposit is ignored for being too small."
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "description": "Known validation, not-found, conflict, or verification error returned with HTTP 200 for transaction-hash checks.",
            "properties": {
              "code": {
                "type": "string",
                "example": "not_found"
              },
              "message": {
                "type": "string",
                "example": "transaction not found"
              }
            }
          },
          "idempotent": {
            "type": "boolean",
            "example": false
          },
          "ignored": {
            "type": "boolean",
            "example": false,
            "description": "True when Stableyard recorded the observed deposit but did not create a transaction. Reusable USDC/USDT/USDG deposits are accepted at 0.5 tokens and above except Tron USDT, whose inclusive minimum is 10 USDT. Native BTC has an inclusive minimum of 0.0001 BTC (10,000 sats). Movement THBT is accepted at 16.5 or above. Polygon JPYC is accepted at 100 JPYC or above. Native BNB deposits are paused by default: new arrivals are recorded as ignored with reason native_bnb_deposits_paused and remain at the address. Other native assets retain their documented strict minimum rules."
          },
          "deposit": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Deposit"
              },
              {
                "type": "null"
              }
            ]
          },
          "transaction": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Transaction"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AccountEmailVerificationPolicy": {
        "type": "object",
        "additionalProperties": false,
        "required": ["mode", "partnerAssertionAllowed", "version"],
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["stableyard_email_otp", "partner_asserted"]
          },
          "partnerAssertionAllowed": {
            "type": "boolean"
          },
          "version": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AccountEmailVerificationAssertion": {
        "type": "object",
        "additionalProperties": false,
        "required": ["method"],
        "properties": {
          "method": {
            "type": "string",
            "const": "partner_asserted"
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Optional timestamp when the partner verified email ownership. Omit to let Stableyard timestamp acceptance."
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$",
            "description": "Optional partner-side email verification reference. Raw evidence is not returned by Stableyard APIs."
          }
        }
      },
      "AccountEmailContact": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "type", "email", "status", "createdAt", "updatedAt"],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^account_contact_[A-Za-z0-9_-]+$",
            "example": "account_contact_123"
          },
          "type": {
            "type": "string",
            "const": "email"
          },
          "email": {
            "type": "string",
            "example": "al***@example.com",
            "description": "Masked canonical UPA email."
          },
          "status": {
            "type": "string",
            "enum": ["pending_verification", "verified", "disabled"]
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time"
          },
          "verificationMethod": {
            "type": "string",
            "enum": [
              "stableyard_email_otp",
              "managed_policy_email_otp",
              "partner_asserted",
              "legacy_verified"
            ],
            "description": "How the email was verified. legacy_verified appears only on older accounts."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountEmailResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "contact"],
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "contact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountEmailContact"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AccountEmailChallenge": {
        "type": "object",
        "additionalProperties": false,
        "required": ["id", "email", "status", "attemptsRemaining", "expiresAt"],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^account_email_[A-Za-z0-9_-]+$",
            "example": "account_email_123"
          },
          "email": {
            "type": "string",
            "example": "al***@example.com",
            "description": "Masked email being verified."
          },
          "status": {
            "type": "string",
            "enum": ["pending", "verified", "expired", "failed"]
          },
          "verificationMethod": {
            "type": "string",
            "enum": ["stableyard_email_otp", "partner_asserted"]
          },
          "attemptsRemaining": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "verifiedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountEmailVerificationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["contact", "nextAction"],
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/AccountEmailContact"
          },
          "challenge": {
            "$ref": "#/components/schemas/AccountEmailChallenge"
          },
          "nextAction": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "none"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "enter_email_verification_code"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "start_kyc_session"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["type"],
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "request_new_email_verification"
                  }
                }
              }
            ]
          }
        }
      },
      "KycVerification": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "accountId",
          "status",
          "eligibility",
          "nextAction",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^kyc_[A-Za-z0-9_-]+$",
            "example": "kyc_123"
          },
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "status": {
            "type": "string",
            "enum": [
              "not_started",
              "pending",
              "in_progress",
              "approved",
              "rejected",
              "expired",
              "requires_review"
            ]
          },
          "verificationUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Hosted verification URL to send to the account holder while action is required."
          },
          "eligibility": {
            "type": "object",
            "additionalProperties": false,
            "required": ["status"],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "eligible",
                  "expired",
                  "revoked",
                  "requires_review",
                  "not_eligible"
                ],
                "description": "Current Stableyard identity eligibility. Regulated operations recheck this value at execution time."
              },
              "verifiedAt": {
                "type": "string",
                "format": "date-time"
              },
              "validUntil": {
                "type": "string",
                "format": "date-time"
              },
              "revokedAt": {
                "type": "string",
                "format": "date-time"
              },
              "reasonCode": {
                "type": "string",
                "maxLength": 128,
                "description": "Why the account is no longer eligible. `verification_validity_elapsed`: the verification passed its validity period. `operator_revoked`: Stableyard revoked it. `identity_eligibility_invalid`: the verification outcome no longer supports eligibility. Treat any other value as `identity_eligibility_invalid`.",
                "x-known-values": [
                  "identity_eligibility_invalid",
                  "verification_validity_elapsed",
                  "operator_revoked"
                ],
                "example": "identity_eligibility_invalid"
              }
            }
          },
          "nextAction": {
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "none",
                  "start_verification",
                  "complete_verification",
                  "refresh_verification",
                  "contact_support"
                ]
              }
            }
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountKycResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "verifications"],
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "current": {
            "$ref": "#/components/schemas/KycVerification"
          },
          "verifications": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/KycVerification"
            }
          }
        }
      },
      "ActivateComplianceCapabilityRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["capability", "country", "currency", "rail"],
        "properties": {
          "capability": {
            "type": "string",
            "enum": ["linked_bank", "bank_payout", "bank_onramp"],
            "description": "Regulated capability to make ready for this UPA."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "US",
            "description": "ISO 3166-1 alpha-2 market for the requested capability."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "example": "USD",
            "description": "ISO 4217 currency for the requested capability."
          },
          "rail": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9._-]*$",
            "example": "ach",
            "description": "Stableyard rail code advertised in partner configuration."
          },
          "business": {
            "type": "object",
            "additionalProperties": false,
            "required": ["legalName"],
            "description": "Business UPAs only. Required when creating the first hosted KYB application; omit when resuming or activating another capability.",
            "properties": {
              "legalName": {
                "type": "string",
                "minLength": 3,
                "maxLength": 100
              }
            }
          },
          "amountAtomic": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,79}$",
            "example": "5000",
            "description": "Optional intended amount in the requested fiat currency's atomic unit. Use only when capability eligibility depends on an amount tier."
          }
        }
      },
      "ComplianceCapabilityNextAction": {
        "description": "The next action for this capability.",
        "oneOf": [
          {
            "title": "Resume hosted business verification",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "continue_business_verification"
              }
            },
            "description": "POST the original capability activation to obtain the current hosted link. Do not treat this action as approval."
          },
          {
            "title": "Complete hosted compliance",
            "type": "object",
            "additionalProperties": false,
            "required": ["type", "url", "expiresAt"],
            "properties": {
              "type": {
                "type": "string",
                "const": "complete_compliance"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Secure verification URL for the account holder. Individual flows use a one-time Stableyard link; business flows use a third-party-hosted KYB link. Do not log, cache or share this credential-bearing URL."
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "title": "Wait for compliance review",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "wait_for_compliance_review"
              }
            }
          },
          {
            "title": "Compliance action already in progress",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "compliance_in_progress"
              }
            }
          },
          {
            "title": "Contact support",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "contact_support"
              }
            }
          },
          {
            "title": "No action required",
            "type": "object",
            "additionalProperties": false,
            "required": ["type"],
            "properties": {
              "type": {
                "type": "string",
                "const": "none"
              }
            }
          }
        ]
      },
      "ComplianceCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "status", "ready", "nextAction", "updatedAt"],
        "properties": {
          "name": {
            "type": "string",
            "enum": ["linked_bank", "bank_payout", "bank_onramp"]
          },
          "status": {
            "type": "string",
            "enum": [
              "action_required",
              "submission_pending",
              "provider_review",
              "active",
              "restricted",
              "rejected",
              "closed",
              "requires_intervention"
            ]
          },
          "ready": {
            "type": "boolean"
          },
          "nextAction": {
            "$ref": "#/components/schemas/ComplianceCapabilityNextAction"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ComplianceCapabilityActivationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "capability"],
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "capability": {
            "$ref": "#/components/schemas/ComplianceCapability"
          }
        }
      },
      "ComplianceCapabilitiesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "capabilities"],
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "capabilities": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/ComplianceCapability"
            }
          }
        }
      },
      "RevokeComplianceClaimReuseRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["reason"],
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 10,
            "maxLength": 500,
            "example": "The account holder withdrew consent for future claim reuse."
          }
        }
      },
      "RevokeComplianceClaimReuseResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "claimReuse"],
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^acct_[A-Za-z0-9_-]+$",
            "example": "acct_123"
          },
          "claimReuse": {
            "type": "object",
            "additionalProperties": false,
            "required": ["status", "revokedCount", "revokedAt"],
            "properties": {
              "status": {
                "type": "string",
                "const": "revoked"
              },
              "revokedCount": {
                "type": "integer",
                "minimum": 0,
                "example": 3
              },
              "revokedAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "BalancesResponse": {
        "type": "object",
        "required": [
          "accountId",
          "balanceType",
          "custodyScope",
          "activityTotals"
        ],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "balanceType": {
            "type": "string",
            "enum": ["recorded_activity_projection"],
            "description": "An accounting projection from Stableyard-posted events, not a live custody balance."
          },
          "custodyScope": {
            "type": "string",
            "enum": ["not_a_custody_balance"],
            "description": "The response must not be used to authorize spend. Query the relevant wallet, escrow, or Vault source for actual custody."
          },
          "activityTotals": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "asset",
                "netRecordedFlowAtomic",
                "reservedForVaultPaymentsAtomic",
                "source",
                "observedAt"
              ],
              "properties": {
                "asset": {
                  "$ref": "#/components/schemas/Asset"
                },
                "netRecordedFlowAtomic": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$",
                  "example": "-600000",
                  "description": "Signed cumulative net amount reflected by Stableyard-posted accounting events. It may be negative when an externally funded wallet or Vault sends value before Stableyard records a corresponding inflow,."
                },
                "reservedForVaultPaymentsAtomic": {
                  "type": "string",
                  "example": "0",
                  "description": "Amount currently reserved or submitted for authorized Vault payments. This is reservation context, not a deduction from a spendable balance."
                },
                "source": {
                  "type": "string",
                  "example": "ledger"
                },
                "observedAt": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Time the recorded activity projection last changed."
                }
              }
            }
          }
        }
      },
      "TransactionsResponse": {
        "type": "object",
        "required": ["accountId", "transactions"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass this value as cursor to fetch the next page."
          }
        }
      },
      "TransactionDetailResponse": {
        "type": "object",
        "required": ["accountId", "transaction"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123"
          },
          "transaction": {
            "$ref": "#/components/schemas/Transaction"
          },
          "ledgerEntries": {
            "type": "array",
            "description": "Redacted balanced ledger rows attached to this transaction for the requested account only.",
            "items": {
              "$ref": "#/components/schemas/LedgerEntry"
            }
          }
        }
      },
      "LedgerEntry": {
        "type": "object",
        "required": ["id", "direction", "amount", "createdAt"],
        "properties": {
          "id": {
            "type": "string",
            "example": "ledger_123"
          },
          "direction": {
            "type": "string",
            "enum": ["debit", "credit"]
          },
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "HandleAvailability": {
        "type": "object",
        "required": ["namespace", "handle", "available", "status"],
        "properties": {
          "namespace": {
            "type": "string",
            "example": "partner"
          },
          "handle": {
            "type": "string",
            "example": "alice"
          },
          "available": {
            "type": "boolean",
            "example": true
          },
          "status": {
            "type": "string",
            "enum": ["available", "taken"]
          }
        }
      },
      "ResolvedPaymentHandle": {
        "type": "object",
        "required": ["accountId", "paymentHandle"],
        "properties": {
          "accountId": {
            "type": "string",
            "example": "acct_123",
            "description": "Canonical UPA account ID to use with account-scoped partner endpoints."
          },
          "paymentHandle": {
            "$ref": "#/components/schemas/PaymentHandle"
          }
        }
      }
    }
  }
}
