openapi: '3.0.3' info: title: UMA Auth API version: '0.1' description: >- This API allows you to authenticate with the UMA server to take actions on a user's wallet. It's the exposed communication layer between the NWC server and the main UMA server. license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' servers: - url: https://{vasp_host}/{basePath} description: The production VASP API server variables: vasp_host: default: vasp.net description: This value should be defined by the UMA VASP implementation. basePath: # open meaning there is the opportunity to use special base paths as assigned by the provider, default is `umanwc/v1` default: umanwc/v1 security: - bearerAuth: [] paths: /invoice: post: operationId: make_invoice tags: - UmaAuth summary: "make_invoice: Create a new invoice" requestBody: content: application/json: schema: title: MakeInvoiceRequest type: object properties: amount: type: integer format: int64 description: The amount to invoice in msats. minimum: 0 exclusiveMinimum: true example: 1000 description: type: string description: A memo to attach to the invoice. example: "Payment for services rendered." description_hash: type: string description: A hash of a longer description field. example: "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" expiry: type: integer description: The number of seconds until the invoice expires. minimum: 0 exclusiveMinimum: true example: 3600 required: - amount responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /payments/bolt11: post: operationId: pay_invoice tags: - UmaAuth summary: "pay_invoice: Pay a bolt11 invoice" requestBody: content: application/json: schema: title: PayInvoiceRequest type: object properties: invoice: type: string description: The bolt11 invoice to pay. example: lntb1u1pw0k7jw amount: type: integer format: int64 nullable: true description: The amount to pay for a 0-amount invoice. minimum: 0 exclusiveMinimum: true example: 1000 budget_currency_code: type: string description: >- The code of the currency the sender used to set budget. Optional if the budget is set in SAT. example: "USD" required: - invoice responses: '200': description: OK content: application/json: schema: title: PayInvoiceResponse type: object properties: preimage: type: string description: The preimage of the payment. example: abcd1234 total_budget_currency_amount: type: integer format: int64 description: >- The total cost of the payment in the smallest unit of `budget_currency_code` in the request. This is the amount that will be deducted from the budget for this connection. Optional if `budget_currency_code` is null. minimum: 0 exclusiveMinimum: true example: 1000 required: - preimage '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /invoices/{payment_hash}: get: operationId: lookup_invoice tags: - UmaAuth summary: "lookup_invoice: Get an invoice by its payment hash" parameters: - name: payment_hash in: path required: true description: The payment hash of the invoice. schema: type: string example: f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /balance: get: operationId: get_balance tags: - UmaAuth summary: "get_balance: Get the balance of the user's wallet" parameters: - name: currency_code in: query required: false description: >- The currency code of the balance. Assumed to be in msats if not provided. schema: type: string example: "USD" responses: '200': description: OK content: application/json: schema: title: GetBalanceResponse type: object properties: balance: type: number description: The balance of the user's wallet. minimum: 0 example: 1000 currency: $ref: '#/components/schemas/Currency' required: - balance '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /receiver/lud16/{receiver_address}: get: operationId: lookup_user_by_lud16 tags: - UmaAuth summary: "lookup_user_by_lud16: Get receiver info by LUD16 address." parameters: - name: receiver_address in: path required: true description: The receiver's LUD16 address. schema: type: string example: "$alice@vasp.net" - name: base_sending_currency_code in: query required: false description: >- The currency code of the sender's balance. Assumed to be in msats if not provided. This is used to calculate the multiplier for the receiver's currencies. schema: type: string example: "USD" responses: '200': description: OK content: application/json: schema: title: LookupUserResponse type: object properties: currencies: type: array description: The currencies the receiver accepts in order of preference. items: $ref: '#/components/schemas/CurrencyPreference' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /quote/lud16: get: operationId: fetch_quote_for_lud16 tags: - UmaAuth summary: "fetch_quote_for_lud16: Get a quote for a payment to an LUD16 address" parameters: - name: sending_currency_code in: query required: true description: The currency code being sent from the sender's wallet. schema: type: string example: "MXN" - name: receiving_currency_code in: query required: true description: The currency code of the currency that the receiver will receive. schema: type: string example: "USD" - name: locked_currency_amount in: query required: true description: >- The amount to send/receive in the smallest unit of the locked currency (eg. cents). See `locked_currency_side` for more information. schema: type: integer format: int64 minimum: 0 exclusiveMinimum: true example: 1000 - name: locked_currency_side in: query required: true description: >- The side of the quote which should be locked and specified in the `locked_currency_amount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to "sending", and the `locked_currency_amount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to "receiving" and the `locked_currency_amount` to 10000 (in cents). schema: $ref: '#/components/schemas/LockedCurrencySide' - name: receiver_address in: query required: true description: The LUD16 address to send the payment to. schema: type: string example: "$alice@vasp.net" responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Quote' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /quote/{payment_hash}: post: operationId: execute_quote tags: - UmaAuth summary: "execute_quote: Execute a quote" parameters: - name: payment_hash in: path required: true description: The payment hash of the quote to execute. schema: type: string example: "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" requestBody: content: application/json: schema: title: ExecuteQuoteRequest type: object properties: budget_currency_code: type: string description: >- The code of the currency the sender used to set budget. Optional if it is the same as `sending_currency_code`. example: "USD" responses: '200': description: OK content: application/json: schema: title: ExecuteQuoteResponse type: object properties: preimage: type: string description: The preimage of the payment. example: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" total_budget_currency_amount: type: integer format: int64 description: >- The total cost of the payment in the smallest unit of `budget_currency_code` in the request. This is the amount that will be deducted from the budget for this connection. Optional if `budget_currency_code` is null. minimum: 0 exclusiveMinimum: true example: 1000 required: - preimage '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /payments/lud16: post: operationId: pay_to_lud16_address tags: - UmaAuth summary: "pay_to_lud16_address: Pay directly to an LNURL address based on a fixed sending amount." requestBody: content: application/json: schema: title: PayToAddressRequest type: object properties: receiver_address: type: string description: The LUD16 address to pay. example: "$alice@vasp.net" sending_currency_code: type: string description: The code of the currency being sent from the sender's wallet. example: "MXN" sending_currency_amount: type: integer format: int64 description: The amount to send in the smallest unit of the sending currency (eg. cents). minimum: 0 exclusiveMinimum: true example: 1000 receiving_currency_code: type: string description: The code of the currency being received by the receiver. If not provided, the receiver's default currency will be used. example: "USD" budget_currency_code: type: string description: >- The code of the currency the sender used to set budget. Optional if it is the same as `sending_currency_code`. example: "USD" required: - receiver_address - sending_currency_code - sending_currency_amount responses: '200': description: OK content: application/json: schema: type: object title: PayToAddressResponse properties: preimage: type: string description: The preimage of the payment. example: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" quote: description: The quote used to pay the address. $ref: '#/components/schemas/Quote' total_budget_currency_amount: type: integer format: int64 description: >- The total cost of the payment in the smallest unit of `budget_currency_code` in the request. This is the amount that will be deducted from the budget for this connection. Optional if `budget_currency_code` is null. minimum: 0 exclusiveMinimum: true example: 1000 required: - preimage - quote '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /payments/keysend: post: operationId: pay_keysend tags: - UmaAuth summary: "pay_keysend: Pay directly to the pubkey of the receiver node based on a fixed receiving amount" requestBody: content: application/json: schema: title: PayKeysendRequest type: object properties: amount: type: integer format: int64 minimum: 0 exclusiveMinimum: true description: The amount to pay in msats. example: 10000 pubkey: type: string description: The public key of the receiver's node. example: "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798" preimage: type: string description: Preimage of the payment. example: 1000 tlv_records: type: array description: The tlv records. items: type: object description: The tlv record. properties: type: type: integer description: The tlv type example: 5482373484 value: type: string description: The hex encoded tlv value. example: "0123456789abcdef" required: - type - value budget_currency_code: type: string description: >- The code of the currency the sender used to set budget. Optional if the budget is set to SAT. example: "USD" required: - amount - pubkey responses: '200': description: OK content: application/json: schema: type: object title: PayKeysendResponse properties: preimage: type: string description: The preimage of the payment. example: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" total_budget_currency_amount: type: integer format: int64 description: >- The total cost of the payment in the smallest unit of `budget_currency_code` in the request. This is the amount that will be deducted from the budget for this connection. Optional if `budget_currency_code` is null. minimum: 0 exclusiveMinimum: true example: 1000 required: - preimage '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /info: get: operationId: get_info tags: - UmaAuth summary: "get_info: Get information about the user's wallet connection" responses: '200': description: OK content: application/json: schema: title: GetInfoResponse type: object properties: alias: type: string description: The alias of the user's node. example: "Alice's Wallet" color: type: string description: The color of the user's node. example: "#FF0000" pubkey: type: string description: The pubkey of the user's node. example: "abcd1234" network: type: string description: The bitcoin network of the user's node. example: "testnet" enum: - regtest - signet - testnet - mainnet block_height: type: integer description: The current block height of the user's node. minimum: 0 example: 1000 block_hash: type: string description: The current block hash of the user's node. example: "abcd1234" methods: type: array description: A list of supported methods for this connection. items: type: string description: The name of method. example: "make_invoice" lud16: type: string description: The lightning or UMA address for the user. example: "$alice@vasp.net" currencies: type: array description: The currencies the user's wallet supports. Ordered by preference. If not provided, assume this user only supports BTC. items: $ref: '#/components/schemas/CurrencyPreference' required: - pubkey - network - methods '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /transactions: get: operationId: list_transactions tags: - UmaAuth summary: "list_transactions: Lists invoices and payments" parameters: - name: from in: query required: false description: Starting timestamp in seconds since epoch (inclusive). schema: type: integer format: int64 example: 1683148800 - name: until in: query required: false description: Ending timestamp in seconds since epoch (inclusive). schema: type: integer format: int64 example: 1683148800 - name: limit in: query required: false description: Maximum number of transactions to return. schema: type: integer minimum: 0 exclusiveMinimum: true example: 10 - name: offset in: query required: false description: Offset of the first transaction to return. schema: type: integer minimum: 0 example: 0 - name: unpaid in: query required: false description: Whether to include unpaid invoices. schema: type: boolean example: false - name: type in: query required: false description: >- Type of transactions to return: "incoming" for invoices, "outgoing" for payments, undefined for both. schema: $ref: '#/components/schemas/TransactionType' responses: '200': description: OK content: application/json: schema: title: ListTransactionsResponse type: object properties: transactions: type: array description: A list of transactions including invoices and payments. items: $ref: '#/components/schemas/Transaction' required: - transactions '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /budget_estimate: get: operationId: get_budget_estimate tags: - UmaAuth summary: "get_budget_estimate: Estimate the total cost of the payment to complete the payment in the currency of sender's budget." parameters: - name: sending_currency_code in: query required: true description: The code of the currency that will be sent from the sender's wallet. schema: type: string example: "SAT" - name: sending_currency_amount in: query required: true description: The amount to send in the smallest unit of the sending currency (eg. cents). schema: type: integer format: int64 minimum: 0 exclusiveMinimum: true example: 1000 - name: budget_currency_code in: query required: true description: >- The code of the currency the sender used to set budget. schema: type: string example: "USD" responses: '200': description: OK content: application/json: schema: title: BudgetEstimateResponse type: object properties: estimated_budget_currency_amount: type: integer format: int64 description: >- The estimated cost of the payment in the smallest unit of `budget_currency_code`. This amount will be used to calculate the amount to hold from the budget for this connection while the payment is in-flight. minimum: 0 exclusiveMinimum: true example: 1000 required: - estimated_budget_currency_amount '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '429': description: Too Many Requests content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: TransactionType: type: string enum: - incoming - outgoing description: >- Type of transaction: "incoming" for invoices, "outgoing" for payments. Transaction: type: object properties: type: $ref: '#/components/schemas/TransactionType' invoice: type: string description: The full, encoded invoice. example: "lnbcrt1pjrsa37pp50geu5vxkzn4ddc4hmfkz9x308tw9lrrqtktz2hpm0rccjyhcyp5qdqh2d68yetpd45kueeqv3jk6mccqzpgxq9z0rgqsp5ge2rdw0tzvakxslmtvfmqf2fr7eucg9ughps5vdvp6fm2utk20rs9q8pqqqssqjs3k4nzrzg2nu9slu9c3srv2ae8v69ge097q9seukyw2nger8arj93m6erz8u657hfdzztfmc55wjjm9k337krl00fyw6s9nnwaafaspcqp2uv" nullable: true description: type: string description: The invoice's description. example: "Pay for pizza." nullable: true description_hash: type: string description: The invoice's description hash. example: "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" nullable: true preimage: type: string description: The payment preimage, optional if unpaid. example: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" nullable: true payment_hash: type: string description: Payment hash for the payment example: "7332c2671019264cf0e9b8626bde20c9c3979799c570a276fb9512e22aef1f08" amount: type: integer format: int64 description: Value in msats. minimum: 0 exclusiveMinimum: true example: 1000 fees_paid: type: integer format: int64 description: Value in msats. minimum: 0 example: 1000 nullable: true created_at: type: integer format: int64 description: The time the payment/invoice was created. example: 1683148800 expires_at: type: integer format: int64 nullable: true description: The time the invoice expires. example: 1683148800 settled_at: type: integer format: int64 nullable: true description: The time at which the transaction was settled, if it was settled. example: 1683148800 metadata: type: object description: Additional metadata attached to the invoice. example: {} nullable: true fx: type: object description: >- Foreign exchange rate for the transaction. properties: receiving_currency: $ref: '#/components/schemas/Currency' sending_currency: $ref: '#/components/schemas/Currency' total_receiving_amount: type: integer format: int64 description: The total amount that will be received in the smallest unit of the receiving currency (eg. cents). minimum: 0 exclusiveMinimum: true example: 1000 total_sending_amount: type: integer format: int64 description: The total amount that will be sent in the smallest unit of the sending currency (eg. cents). minimum: 0 exclusiveMinimum: true example: 1000 multiplier: type: number description: Number of sending currency units per receiving currency unit. minimum: 0 exclusiveMinimum: true example: 123 fees: type: integer format: int64 description: The fees associated with the quote in the smallest unit of the sending currency (eg. cents). minimum: 0 example: 10 nullable: true required: - amount - payment_hash - created_at - type Quote: type: object properties: sending_currency: description: The currency of the sender's balance. $ref: '#/components/schemas/Currency' receiving_currency: description: The currency of the receiver's balance. $ref: '#/components/schemas/Currency' payment_hash: type: string description: The payment hash of the quote. Used as an identifier to execute the quote. example: "f1d2d2f924e986ac86fdf7b36c94bcdf32beec15" expires_at: type: integer format: int64 description: The time the quote expires in unix timestamp. example: 1683148800 multiplier: type: number description: Number of sending currency units per receiving currency unit. minimum: 0 exclusiveMinimum: true example: 123 fees: type: integer format: int64 description: The fees associated with the quote in the smallest unit of the sending currency (eg. cents). minimum: 0 example: 10 total_sending_amount: type: integer format: int64 description: The total amount that will be sent in the smallest unit of the sending currency (eg. cents). minimum: 0 exclusiveMinimum: true example: 123010 total_receiving_amount: type: integer format: int64 description: The total amount that will be received in the smallest unit of the receiving currency (eg. cents). minimum: 0 exclusiveMinimum: true example: 1000 created_at: type: integer format: int64 description: The time the quote was created in unix timestamp. example: 1683148800 required: - sending_currency - receiving_currency - payment_hash - expires_at - multiplier - fees - total_sending_amount - total_receiving_amount - created_at Currency: type: object properties: code: type: string description: The ISO-4217 currency code. example: "USD" symbol: type: string description: The currency symbol. example: "$" name: type: string description: The currency name. example: "United States Dollar" decimals: type: integer description: >- Number of digits after the decimal point for display on the sender side, and to add clarity around what the "smallest unit" of the currency is. For example, in USD, by convention, there are 2 digits for cents - $5.95. In this case, `decimals` would be 2. Note that the multiplier is still always in the smallest unit (cents). In addition to display purposes, this field can be used to resolve ambiguity in what the multiplier means. For example, if the currency is "BTC" and the multiplier is 1000, really we're exchanging in SATs, so `decimals` would be 8. minimum: 0 example: 2 required: - code - symbol - name - decimals CurrencyPreference: type: object properties: currency: $ref: '#/components/schemas/Currency' multiplier: type: number description: >- Estimated number of milli-sats per smallest unit of this currency (eg. cents) If base_sending_currency_code was specified, this is the rate relative to that currency instead of milli-sats. minimum: 0 exclusiveMinimum: true example: 100000000 min: type: integer format: int64 description: The minimum amount that can be received in this currency. minimum: 0 exclusiveMinimum: true example: 1 max: type: integer format: int64 description: The maximum amount that can be received in this currency. minimum: 0 exclusiveMinimum: true example: 1000000 required: - currency - multiplier - min - max ErrorCode: type: string enum: - RATE_LIMITED - NOT_IMPLEMENTED - INSUFFICIENT_BALANCE - PAYMENT_FAILED - NOT_FOUND - QUOTA_EXCEEDED - RESTRICTED - UNAUTHORIZED - INTERNAL - OTHER description: The NIP47 response error code. ErrorResponse: type: object properties: code: $ref: '#/components/schemas/ErrorCode' message: type: string description: The error message. example: "This feature is not implemented." required: - code - message LockedCurrencySide: type: string enum: - sending - receiving description: >- The side of the quote which should be locked and specified in the `locked_currency_amount`. For example, if I want to send exactly $5 MXN from my wallet, I would set this to "sending", and the `locked_currency_amount` to 500 (in cents). If I want the receiver to receive exactly $10 USD, I would set this to "receiving" and the `locked_currency_amount` to 10000 (in cents).