{"openapi":"3.1.0","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://api.bitclear.li","description":"Generated server url"}],"paths":{"/v4/payouts":{"get":{"tags":["payouts"],"summary":"Retrieves a list of payouts based on search criteria. Sorted by createdTime, ascending","operationId":"getPayouts","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","maximum":128,"minimum":1}},{"name":"createdTimeFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"createdTimeTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"transferCurrency","in":"query","required":false,"schema":{"type":"string"}},{"name":"priceCurrency","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalPayoutId","in":"query","required":false,"schema":{"type":"string"}},{"name":"destinationAddress","in":"query","required":false,"schema":{"type":"string"}},{"name":"destinationCode","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PaginatedPayoutsDto"}}}}}},"post":{"tags":["payouts"],"summary":"Create new payout","operationId":"createPayout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayoutRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PayoutDto"}}}}}}},"/v4/payouts/{id}/approve":{"post":{"tags":["payouts"],"summary":"Approve payout","operationId":"approvePayout","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"}}}},"/v4/payments":{"get":{"tags":["payment-controller"],"summary":"Retrieves a list of payments based on search criteria. Sorted by createdTime, ascending","operationId":"getPayments","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","maximum":128,"minimum":1}},{"name":"createdTimeFrom","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"createdTimeTo","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"transferCurrency","in":"query","required":false,"schema":{"type":"string"}},{"name":"priceCurrency","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PaginatedPaymentsDto"}}}}}},"post":{"tags":["payment-controller"],"operationId":"createPayment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentRequest"}}},"required":true},"responses":{"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}}}}},"/v4/conversions":{"post":{"tags":["conversion-controller"],"operationId":"createConversion","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ConversionResponse"}}}}}}},"/v4/payouts/{id}":{"get":{"tags":["payouts"],"summary":"Get payout by id","operationId":"getPayout","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PayoutDto"}}}}}}},"/v4/payout-limits":{"get":{"tags":["payout-limits"],"summary":"Returns information about current balance and payout limits.","operationId":"getPayoutLimits","parameters":[{"name":"transferCurrency","in":"query","required":true,"schema":{"type":"string"}},{"name":"priceCurrency","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PayoutLimitDto"}}}}}}},"/v4/payments/{id}":{"get":{"tags":["payment-controller"],"operationId":"getPaymentById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PaymentDto"}}}}}}},"/v4/currencies":{"get":{"tags":["currency-controller"],"summary":"Get the list of supported currencies","operationId":"getCurrencies","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyResponse"}}}}}}}},"/v4/conversions/estimate":{"get":{"tags":["conversion-controller"],"operationId":"estimateConversion","parameters":[{"name":"sellAmount","in":"query","required":true,"schema":{"type":"string","format":"decimal"}},{"name":"sellCurrency","in":"query","required":true,"schema":{"type":"string"}},{"name":"buyCurrency","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/EstimateConversionResult"}}}}}}}},"components":{"schemas":{"CreatePayoutRequest":{"type":"object","properties":{"transferAmount":{"type":"string","format":"decimal","description":"Amount of `transferCurrency` which will be send. Either `priceAmount` or `transferAmount` must be specified."},"priceAmount":{"type":"string","format":"decimal","description":"Amount of `priceCurrency`. If `priceAmount` is used, `transferAmount` will be estimated based on it and the current exchange rate. Either `priceAmount` or `transferAmount` must be specified."},"transferCurrency":{"type":"string","description":"The currency which will be used to send the payout transaction.","minLength":1},"priceCurrency":{"type":"string","description":"The currency in which the client will be charged in.","minLength":1},"comment":{"type":"string","description":"Optional comment about the payout.","maxLength":150,"minLength":0},"notificationUrl":{"type":"string","description":"URL for callback notifications about the payout's state changes."},"autoApprove":{"type":"boolean","description":"If set to true, the payout will be automatically approved."},"externalPayoutId":{"type":"string","description":"Client-provided ID allowing to match payouts between systems."},"destination":{"$ref":"#/components/schemas/PayoutDestinationDto","description":"Destination of the payout."}},"required":["destination","priceCurrency","transferCurrency"]},"PayoutDestinationDto":{"type":"object","properties":{"destinationType":{"type":"string","description":"Type of the destination","enum":["CRYPTO_ADDRESS","BANK_ACCOUNT","INTERNAL_CLIENT"]},"cryptoAddress":{"type":"string","description":"Crypto address to which payout should be sent (present only for crypto payouts)"},"internalClientCode":{"type":"string","description":"Client's code to which payout should be sent (present only for internal payouts)"}},"required":["destinationType"]},"PayoutDto":{"type":"object","properties":{"payoutId":{"type":"string","format":"uuid","description":"Payout ID."},"transferAmount":{"type":"string","format":"decimal","description":"Amount which will be sent."},"priceAmount":{"type":"string","format":"decimal","description":"Amount of `priceCurrency` the client will be charged for sending this payout."},"priceCurrency":{"type":"string","description":"Currency which the client will be charged in."},"transferCurrency":{"type":"string","description":"The currency which will be send."},"comment":{"type":"string","description":"Optional custom information about the payout provided by the client."},"expirationTime":{"type":"string","format":"date-time","description":"Expiration time for the payout. We guarantee offered exchange rate within this time. After the payout expires, it can no longer be approved."},"createdTime":{"type":"string","format":"date-time","description":"Time the payout offer was created."},"notificationUrl":{"type":"string","description":"URL for callback notifications about the payout's state changes."},"sentTime":{"type":"string","format":"date-time","description":"Time the payout was sent. This will only be present for sent payouts."},"externalPayoutId":{"type":"string","description":"Client-defined payout ID."},"status":{"type":"string","description":"Status of the payout.","enum":["NEW","EXPIRED","SENT","CANCELLED","QUEUED"]},"destination":{"$ref":"#/components/schemas/PayoutDestinationDto","description":"Destination of the payout."}},"required":["createdTime","destination","expirationTime","payoutId","priceAmount","priceCurrency","status","transferAmount","transferCurrency"]},"CreatePaymentRequest":{"type":"object","properties":{"priceAmount":{"type":"string","format":"decimal","description":"Amount of `priceCurrency` which will be used to calculate amount of `transferCurrency`. This will usually be in fiat currency."},"priceCurrency":{"type":"string","description":"Currency used for `priceAmount`.","minLength":1},"transferCurrency":{"type":"string","description":"Currency which the customer will use to pay.","minLength":1},"notificationUrl":{"type":"string","description":"URL for callback notifications about payment's state changes."},"externalPaymentId":{"type":"string","description":"Client-provided ID allowing to match payments between systems."}},"required":["priceAmount","priceCurrency","transferCurrency"]},"PaymentDto":{"type":"object","properties":{"paymentId":{"type":"string","description":"Payment ID."},"priceAmount":{"type":"string","format":"decimal","description":"Amount of `priceCurrency` requested when creating this payment."},"priceCurrency":{"type":"string","description":"Currency used for `priceAmount`."},"transferAmount":{"type":"string","format":"decimal","description":"Amount of `transferCurrency` which customer needs to pay."},"transferCurrency":{"type":"string","description":"Currency which the end-customer will use to pay."},"address":{"type":"string","description":"Address to which customer should send coins to."},"paymentUri":{"type":"string","description":"URI for software wallets. This URI can be made into a QR code and displayed to be scanned by wallet software."},"expirationTime":{"type":"string","format":"date-time","description":"After this time the payment will expire and customer will not be able to pay successfully."},"paymentPageUrl":{"type":"string","description":"Bitclear Payment Page URL for this payment. This page allows customers to easily pay for the given payment."},"notificationUrl":{"type":"string","description":"URL for callback notifications about the payment's state changes."},"pendingPaidPriceAmount":{"type":"string","format":"decimal","description":"Pending amount in `priceCurrency`. Pending means that we're awaiting confirmation from the blockchain."},"acceptedPaidPriceAmount":{"type":"string","format":"decimal","description":"Accepted amount in `priceCurrency`. Accepted means that funds have been credited to merchant's account."},"pendingPaidTransferAmount":{"type":"string","format":"decimal","description":"Pending amount in `transferCurrency`. Pending means that we're awaiting confirmation from the blockchain. If pending transaction turns out to be fraudulent, these funds may disappear."},"acceptedPaidTransferAmount":{"type":"string","format":"decimal","description":"Accepted amount in `transferCurrency`. Accepted means that funds have been credited to merchant's account."},"status":{"type":"string","description":"Status of the payment.","enum":["NEW","UNDERPAID","UNCONFIRMED","CONFIRMED","EXPIRED","INVALID"]},"externalPaymentId":{"type":"string","description":"Client-defined payment ID."},"transactions":{"type":"array","description":"Transactions recognized for this payment.","items":{"$ref":"#/components/schemas/TransactionDto"},"uniqueItems":true}},"required":["acceptedPaidPriceAmount","acceptedPaidTransferAmount","address","expirationTime","paymentId","paymentPageUrl","pendingPaidPriceAmount","pendingPaidTransferAmount","priceAmount","priceCurrency","status","transactions","transferAmount","transferCurrency"]},"TransactionDto":{"type":"object","properties":{"transactionHash":{"type":"string","description":"Identifier which can be used to find transaction on the blockchain."},"amount":{"type":"string","format":"decimal","description":"Amount sent in this transaction."},"observedTime":{"type":"string","format":"date-time","description":"Time the transaction has been observed on the blockchain."},"acceptedTime":{"type":"string","format":"date-time","description":"Time the transaction has been accepted. For risky transaction we may wait for the blockchain confirmations, otherwise it will be the same as `observedTime`."},"rejectedTime":{"type":"string","format":"date-time","description":"Time the transaction was rejected by the blockchain. This will only be defined for rejected transactions."},"state":{"type":"string","description":"State of the transaction.","enum":["PENDING","REJECTED","APPROVED"]}},"required":["amount","observedTime","state","transactionHash"]},"ConversionRequest":{"type":"object","properties":{"sellAmount":{"type":"string","format":"decimal"},"sellCurrency":{"type":"string"},"buyCurrency":{"type":"string"}},"required":["buyCurrency","sellCurrency"]},"ConversionResponse":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]},"PaginatedPayoutsDto":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"payouts":{"type":"array","items":{"$ref":"#/components/schemas/PayoutDto"}}}},"PayoutLimitDto":{"type":"object","properties":{"available":{"type":"string","format":"decimal","description":"Balance available for payouts in given currency."},"minPayoutAmount":{"type":"string","format":"decimal","description":"Minimum allowed payout amount in given currency."},"currency":{"type":"string","description":"Currency used for all amounts in this response."}},"required":["available","currency","minPayoutAmount"]},"PaginatedPaymentsDto":{"type":"object","properties":{"totalCount":{"type":"integer","format":"int32"},"limit":{"type":"integer","format":"int32"},"payments":{"type":"array","items":{"$ref":"#/components/schemas/PaymentDto"}}},"required":["limit","payments","totalCount"]},"CurrencyResponse":{"type":"object","properties":{"code":{"type":"string","minLength":1},"currencyType":{"type":"string","minLength":1},"blockchain":{"type":"string"},"precision":{"type":"integer","format":"int32"},"paymentPriceEnabled":{"type":"boolean"},"paymentTransferEnabled":{"type":"boolean"},"payoutTransferEnabled":{"type":"boolean"},"payoutPriceEnabled":{"type":"boolean"}},"required":["code","currencyType","paymentPriceEnabled","paymentTransferEnabled","payoutPriceEnabled","payoutTransferEnabled","precision"]},"EstimateConversionResult":{"type":"object","properties":{"amount":{"type":"string","format":"decimal"},"currency":{"type":"string"}},"required":["amount","currency"]}}}}