{"openapi":"3.0.2","info":{"title":"Centi Invoice Service","version":"0.1.0"},"paths":{"/api/v1/invoice":{"post":{"tags":["Invoice"],"summary":"Create Invoice","operationId":"create_invoice_api_v1_invoice_post","requestBody":{"content":{"application/json":{"schema":{"title":"Invoice","anyOf":[{"$ref":"#/components/schemas/StandardInvoice"},{"$ref":"#/components/schemas/RawInvoice"},{"$ref":"#/components/schemas/ExternalInvoice"},{"$ref":"#/components/schemas/StreamInvoice"},{"$ref":"#/components/schemas/RegularPOSInvoice"}]}}},"required":true},"responses":{"201":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]}]}},"/api/v1/invoice/{payment_id}":{"get":{"tags":["Invoice"],"summary":"Get Invoice","operationId":"get_invoice_api_v1_invoice__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"},{"description":"Possible values: plain, html.","required":false,"schema":{"title":"Response Type","type":"string","description":"Possible values: plain, html.","default":"plain"},"name":"response_type","in":"query"},{"description":"Available only for html response type. Defines if html page should be in simple form (e.g. to be embedded) or extended.","required":false,"schema":{"title":"Simplified","type":"boolean","description":"Available only for html response type. Defines if html page should be in simple form (e.g. to be embedded) or extended.","default":"True"},"name":"simplified","in":"query"},{"description":"Available only for html response type. Url to which we should redirect after payment succeed or failed.","required":false,"schema":{"title":"Return Url","type":"string","description":"Available only for html response type. Url to which we should redirect after payment succeed or failed."},"name":"return_url","in":"query"},{"description":"Available only for html response type. Custom redirect delay in milliseconds","required":false,"schema":{"title":"Redirect Delay","type":"integer","description":"Available only for html response type. Custom redirect delay in milliseconds"},"name":"redirect_delay","in":"query"}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Invoice"],"summary":"Abort Invoice","operationId":"abort_invoice_api_v1_invoice__payment_id__delete","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invoice/api/create":{"post":{"tags":["Invoice"],"summary":"Create Invoice","operationId":"create_invoice_invoice_api_create_post","requestBody":{"content":{"application/json":{"schema":{"title":"Invoice","anyOf":[{"$ref":"#/components/schemas/StandardInvoice"},{"$ref":"#/components/schemas/RawInvoice"},{"$ref":"#/components/schemas/ExternalInvoice"},{"$ref":"#/components/schemas/StreamInvoice"},{"$ref":"#/components/schemas/RegularPOSInvoice"}]}}},"required":true},"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true,"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]}]}},"/invoice/api/webpage/{payment_id}":{"get":{"tags":["Invoice"],"summary":"Get Webpage","operationId":"get_webpage_invoice_api_webpage__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/invoice/api/status/{payment_id}":{"get":{"tags":["Invoice"],"summary":"Get Status","operationId":"get_status_invoice_api_status__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/invoice/api/abort/":{"post":{"tags":["Invoice"],"summary":"Old Abort Invoice","operationId":"old_abort_invoice_invoice_api_abort__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"deprecated":true,"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]}]}},"/api/v1/payment/{payment_id}":{"get":{"tags":["Payment"],"summary":"Get Payment Terms","operationId":"get_payment_terms_api_v1_payment__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTerms"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Payment"],"summary":"Pay","operationId":"pay_api_v1_payment__payment_id__post","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentACK"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/api/payment_request/{payment_id}":{"get":{"tags":["Payment"],"summary":"Get Payment Terms","operationId":"get_payment_terms_payment_api_payment_request__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTerms"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/payment/api/pay/{payment_id}":{"post":{"tags":["Payment"],"summary":"Pay","operationId":"pay_payment_api_pay__payment_id__post","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentACK"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/channel/{payment_id}":{"get":{"tags":["Payment channel"],"summary":"Get Next Chunk","operationId":"get_next_chunk_api_v1_channel__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Payment channel"],"summary":"Pay Next Chunk","operationId":"pay_next_chunk_api_v1_channel__payment_id__post","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channel/api/next_chunk/{payment_id}":{"get":{"tags":["Payment channel"],"summary":"Get Next Chunk","operationId":"get_next_chunk_channel_api_next_chunk__payment_id__get","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/channel/api/pay/{payment_id}":{"post":{"tags":["Payment channel"],"summary":"Pay Next Chunk","operationId":"pay_next_chunk_channel_api_pay__payment_id__post","parameters":[{"required":true,"schema":{"title":"Payment Id","type":"string"},"name":"payment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/api/v1/utils/get_bsv_price/{currency}":{"get":{"tags":["Utils"],"summary":"Get Bsv Price","operationId":"get_bsv_price_api_v1_utils_get_bsv_price__currency__get","parameters":[{"required":true,"schema":{"title":"Currency","type":"string"},"name":"currency","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/preinvoice":{"post":{"tags":["Preinvoice"],"summary":"Create Preinvoice","operationId":"create_preinvoice_api_v1_preinvoice_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Preinvoice"}}},"required":true},"responses":{"201":{"description":"Preinvoice created and url for QR code returned","content":{"text/plain":{"schema":{"title":"Response 201 Create Preinvoice Api V1 Preinvoice Post","type":"string"},"example":"https://<base_host>/api/v1/preinvoice/<preinvoiceId>/fetch-invoice?paymail="}}},"200":{"description":"Preinvoice already existed and url for QR code returned","content":{"text/plain":{"schema":{"title":"Response 200 Create Preinvoice Api V1 Preinvoice Post","type":"string"},"example":"https://<base_host>/api/v1/preinvoice/<preinvoiceId>/fetch-invoice?paymail="}}},"204":{"description":"Preinvoice already existed and paid, nothing to return"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]}]}},"/api/v1/preinvoice/{preinvoice_id}/fetch-invoice":{"get":{"tags":["Preinvoice"],"summary":"Get Preinvoice","operationId":"get_preinvoice_api_v1_preinvoice__preinvoice_id__fetch_invoice_get","parameters":[{"required":true,"schema":{"title":"Preinvoice Id","type":"string"},"name":"preinvoice_id","in":"path"},{"description":"Paymail of customer for which we generate invoice","required":true,"schema":{"title":"Paymail","type":"string","description":"Paymail of customer for which we generate invoice"},"name":"paymail","in":"query"}],"responses":{"200":{"description":"Existing invoice returned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTerms"}}}},"201":{"description":"New invoice generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentTerms"}}}},"204":{"description":"Invoice already paid"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Beneficiary":{"title":"Beneficiary","required":["name","email","address","paymentReference"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"email":{"title":"Email","type":"string"},"address":{"title":"Address","type":"string"},"paymentReference":{"title":"Paymentreference","type":"string"},"avatar":{"title":"Avatar","type":"string"},"extendedData":{"title":"Extendeddata","type":"object"}}},"ExternalInvoice":{"title":"ExternalInvoice","required":["type","amount","country","currency","merchantId","merchantAddress","merchantEmail","provider","receiveAddress"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/InvoiceType"},"responseType":{"allOf":[{"$ref":"#/components/schemas/ResponseType"}],"default":"DPP_PAYMENT_TERMS"},"amount":{"title":"Amount","type":"number"},"country":{"title":"Country","type":"string"},"currency":{"title":"Currency","type":"string"},"merchantId":{"title":"Merchantid","type":"string"},"merchantName":{"title":"Merchantname","type":"string"},"merchantAddress":{"title":"Merchantaddress","type":"string"},"merchantEmail":{"title":"Merchantemail","type":"string"},"provider":{"title":"Provider","type":"string"},"receiveAddress":{"title":"Receiveaddress","type":"string"},"posId":{"title":"Posid","type":"string"}}},"Fee":{"title":"Fee","required":["satoshis","bytes"],"type":"object","properties":{"satoshis":{"title":"Satoshis","type":"integer"},"bytes":{"title":"Bytes","type":"integer"}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"HybridPaymentModePayment":{"title":"HybridPaymentModePayment","required":["optionId","transactions"],"type":"object","properties":{"optionId":{"title":"Optionid","type":"string"},"transactions":{"title":"Transactions","type":"array","items":{"type":"string"}},"txsBroadcasted":{"title":"Txsbroadcasted","type":"boolean","default":false}}},"HybridPaymentModePaymentACK":{"title":"HybridPaymentModePaymentACK","required":["transactionIds"],"type":"object","properties":{"transactionIds":{"title":"Transactionids","type":"array","items":{"type":"string"}},"peerChannel":{"title":"Peerchannel"}}},"InvoiceType":{"title":"InvoiceType","enum":["STANDARD","RAW","EXTERNAL","REGULAR_POS","STREAM","MEDIA"],"description":"An enumeration."},"NativeInput":{"title":"NativeInput","type":"object","properties":{}},"NativeOutput":{"title":"NativeOutput","required":["amount","script"],"type":"object","properties":{"amount":{"title":"Amount","type":"integer"},"script":{"title":"Script","type":"string"},"description":{"title":"Description","type":"string"}}},"Option":{"title":"Option","required":["transactions"],"type":"object","properties":{"transactions":{"title":"Transactions","type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}},"Originator":{"title":"Originator","required":["name"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"paymail":{"title":"Paymail","type":"string"},"avatar":{"title":"Avatar","type":"string"},"extendedData":{"title":"Extendeddata","type":"object"}}},"Payment":{"title":"Payment","type":"object","properties":{"modeId":{"title":"Modeid","type":"string"},"mode":{"$ref":"#/components/schemas/HybridPaymentModePayment"},"originator":{"$ref":"#/components/schemas/Originator"},"memo":{"title":"Memo","type":"string"},"signature":{"title":"Signature","type":"string"},"transaction":{"title":"Transaction","type":"string"},"refundTo":{"title":"Refundto","type":"string"}}},"PaymentACK":{"title":"PaymentACK","type":"object","properties":{"payment":{"title":"Payment","type":"object"},"modeId":{"title":"Modeid","type":"string"},"mode":{"$ref":"#/components/schemas/HybridPaymentModePaymentACK"},"peerChannel":{"title":"Peerchannel"}}},"PaymentTerms":{"title":"PaymentTerms","required":["creationTimestamp","expirationTimestamp","paymentUrl","beneficiary","modes"],"type":"object","properties":{"memo":{"title":"Memo","type":"string"},"version":{"title":"Version","type":"string","default":"1.0"},"network":{"title":"Network","type":"string","default":"mainnet"},"outputs":{"title":"Outputs","type":"array","items":{"type":"object"}},"creationTimestamp":{"title":"Creationtimestamp","type":"integer"},"expirationTimestamp":{"title":"Expirationtimestamp","type":"integer"},"paymentUrl":{"title":"Paymenturl","type":"string"},"beneficiary":{"$ref":"#/components/schemas/Beneficiary"},"policies":{"$ref":"#/components/schemas/Policies"},"modes":{"title":"Modes","type":"object","additionalProperties":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Option"}},{}]}}}},"Policies":{"title":"Policies","type":"object","properties":{"requiredOriginatorFields":{"title":"Requiredoriginatorfields","type":"array","items":{}}}},"Preinvoice":{"title":"Preinvoice","required":["id","amount","itemId","merchantId","spaceId","provider"],"type":"object","properties":{"id":{"title":"Id","type":"string"},"amount":{"title":"Amount","type":"number"},"itemId":{"title":"Itemid","type":"string"},"merchantId":{"title":"Merchantid","type":"string"},"spaceId":{"title":"Spaceid","type":"string"},"provider":{"title":"Provider","type":"string"}}},"RawInvoice":{"title":"RawInvoice","required":["type","amount","country","currency","posId","merchantId"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/InvoiceType"},"responseType":{"allOf":[{"$ref":"#/components/schemas/ResponseType"}],"default":"DPP_PAYMENT_TERMS"},"amount":{"title":"Amount","type":"number"},"country":{"title":"Country","type":"string"},"currency":{"title":"Currency","type":"string"},"posId":{"title":"Posid","type":"string"},"merchantId":{"title":"Merchantid","type":"string"}}},"RegularPOSInvoice":{"title":"RegularPOSInvoice","required":["type","barCode"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/InvoiceType"},"responseType":{"allOf":[{"$ref":"#/components/schemas/ResponseType"}],"default":"DPP_PAYMENT_TERMS"},"barCode":{"title":"Barcode","type":"string"}}},"ResponseType":{"title":"ResponseType","enum":["URL","BIP270_PAYMENT_REQUEST","DPP_PAYMENT_TERMS","HTML","HTML_URL"],"description":"An enumeration."},"STASInput":{"title":"STASInput","type":"object","properties":{}},"STASOutput":{"title":"STASOutput","required":["tokenId","amount","recipient"],"type":"object","properties":{"tokenId":{"title":"Tokenid","type":"string"},"amount":{"title":"Amount","type":"integer"},"recipient":{"title":"Recipient","type":"string"}}},"StandardInvoice":{"title":"StandardInvoice","required":["type","merchantId","spaceId"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/InvoiceType"},"responseType":{"allOf":[{"$ref":"#/components/schemas/ResponseType"}],"default":"DPP_PAYMENT_TERMS"},"merchantId":{"title":"Merchantid","type":"string"},"spaceId":{"title":"Spaceid","type":"string"},"provider":{"title":"Provider","type":"string","default":"CENTI"},"amount":{"title":"Amount","type":"number","default":0.0},"posId":{"title":"Posid","type":"string"},"basket":{"title":"Basket","type":"object","additionalProperties":{"type":"integer"}}}},"StreamInvoice":{"title":"StreamInvoice","required":["type","publicKey","providerId","viewId"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/InvoiceType"},"responseType":{"allOf":[{"$ref":"#/components/schemas/ResponseType"}],"default":"DPP_PAYMENT_TERMS"},"publicKey":{"title":"Publickey","type":"string"},"providerId":{"title":"Providerid","type":"string"},"viewId":{"title":"Viewid","type":"string"}}},"Transaction":{"title":"Transaction","required":["outputs"],"type":"object","properties":{"outputs":{"title":"Outputs","type":"object","additionalProperties":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/NativeOutput"},{"$ref":"#/components/schemas/STASOutput"},{"$ref":"#/components/schemas/Web3Output"}]}}},"inputs":{"title":"Inputs","type":"object","additionalProperties":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/NativeInput"},{"$ref":"#/components/schemas/STASInput"}]}}},"policies":{"$ref":"#/components/schemas/TransactionPolicies"}}},"TransactionPolicies":{"title":"TransactionPolicies","type":"object","properties":{"fees":{"title":"Fees","type":"object","additionalProperties":{"$ref":"#/components/schemas/Fee"}},"SPVRequired":{"title":"Spvrequired","type":"boolean"},"lockTime":{"title":"Locktime","type":"string","format":"date-time"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}},"Web3Output":{"title":"Web3Output","required":["tokenAddress","tokenSymbol","amount","decimals","recipient"],"type":"object","properties":{"tokenAddress":{"title":"Tokenaddress","type":"string"},"tokenSymbol":{"title":"Tokensymbol","type":"string"},"amount":{"title":"Amount","type":"integer"},"decimals":{"title":"Decimals","type":"integer"},"recipient":{"title":"Recipient","type":"string"}}}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-INVOICE-API-KEY"}}}}