---
updatedAt: 2026-04-21T18:06:49.000Z
agentTools:
  projectIndex: https://docs.confirmo.net/llms.txt
---

# Create new Invoice

Creates a new Invoice for the merchant.

# OpenAPI definition

````json
{
  "components": {
    "schemas": {
      "CompanyProfileTo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProfileTo"
          },
          {
            "properties": {
              "lei": {
                "description": "Legal Entity Identifier of the company (ISO 17442): 20 upper-case alphanumeric characters ending with two check digits.",
                "example": "5493001KJTIIGC8Y1R12",
                "type": "string"
              },
              "registeredName": {
                "description": "Registered company name.",
                "example": "ACME Inc.",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              },
              "registrationNumber": {
                "description": "Company registration number.",
                "example": "12345678",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "profileId"
        ]
      },
      "CryptoTransactionTo": {
        "properties": {
          "amount": {
            "example": "1.21",
            "title": "The transaction amount in the Invoice customer currency.",
            "type": "number"
          },
          "confirmations": {
            "example": 6,
            "format": "int32",
            "title": "The number of confirmations of the transaction.",
            "type": "integer"
          },
          "createdAt": {
            "example": 1594376981,
            "format": "int64",
            "title": "The timestamp of the transaction detection.",
            "type": "integer"
          },
          "sourceAddresses": {
            "description": "A list of all addresses from which the transaction amount was received. For UTXO-based blockchains (e.g., Bitcoin), there may be multiple source addresses involved in a single transaction.",
            "example": [
              "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
              "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"
            ],
            "items": {
              "type": "string"
            },
            "title": "List of source addresses",
            "type": "array"
          },
          "txid": {
            "example": "4f13bc54e8df1620f98934078caaa59c7b480f3ed64e9838f5af519f311bb0b1",
            "title": "The transaction ID.",
            "type": "string"
          },
          "updatedAt": {
            "example": 1594376981,
            "format": "int64",
            "title": "The time of the last transaction update.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ErrorResource": {
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ErrorTo"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ErrorTo": {
        "properties": {
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Flags": {
        "properties": {
          "notRefundableCause": {
            "enum": [
              "REFUND_AMOUNT_ZERO",
              "REFUND_AMOUNT_TOO_LOW",
              "REFUND_AMOUNT_NOT_ENOUGH_TO_COVER_NETWORK_FEE",
              "WRONG_INVOICE_STATE",
              "NOT_ALLOWED",
              "LEGACY_INVOICE_WITHOUT_NETWORK_FEE"
            ],
            "title": "The reason why the Invoice is not refundable.",
            "type": "string"
          },
          "overpaymentResolvable": {
            "description": "True if an overpayment on the Invoice is resolvable, false otherwise.",
            "example": true,
            "type": "boolean"
          },
          "refundable": {
            "description": "True if the Invoice is refundable, false otherwise.",
            "example": false,
            "type": "boolean"
          },
          "resolvableStatus": {
            "enum": [
              "YES",
              "WAITING",
              "NO"
            ],
            "title": "The value telling if the Invoice exception state can be resolved by merchant.",
            "type": "string"
          },
          "resolvableSubStatus": {
            "enum": [
              "OVERPAID_NOT_ENOUGH_TO_COVER_NETWORK_FEE",
              "UNDERPAID_NOT_ENOUGH_TO_COVER_NETWORK_FEE",
              "PAYMENT_DETECTED_AFTER_EXPIRATION"
            ],
            "title": "Additional information about resolvable status",
            "type": "string"
          }
        },
        "type": "object"
      },
      "IndividualProfileTo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProfileTo"
          },
          {
            "properties": {
              "dateOfBirth": {
                "description": "Date of birth for the customer (YYYY-MM-DD).",
                "example": "1989-10-17",
                "type": "string"
              },
              "firstName": {
                "description": "First name of the individual customer.",
                "example": "John",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              },
              "lastName": {
                "description": "Last name of the individual customer.",
                "example": "Doe",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              },
              "middleName": {
                "description": "Middle name of the individual customer.",
                "example": "Michael",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              },
              "nationalIdNumber": {
                "description": "Number of the customer's official identity document, such as a passport or national identity card.",
                "example": "AB1234567",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              },
              "placeOfBirth": {
                "description": "Place of birth for the customer.",
                "example": "Seattle",
                "maxLength": 255,
                "minLength": 0,
                "type": "string"
              }
            },
            "type": "object"
          }
        ],
        "required": [
          "profileId"
        ]
      },
      "Invoice": {
        "properties": {
          "amount": {
            "description": "The original Invoice amount.",
            "example": "1000.00",
            "type": "number"
          },
          "currencyFrom": {
            "$ref": "#/components/schemas/InvoiceCurrencyFrom",
            "type": "string"
          },
          "currencyTo": {
            "deprecated": true,
            "description": "It's strongly preferred NOT populate this attribute when creating a new invoice because doing so will fix the invoice's payment method for the end customer who will pay it. The recommended approach is to leave this attribute not populated and let end customer choose their favorite payment method (merchant can always disable a particular payment method for invoicing in settings). If this attribute is populated indeed for invoice creation, 'layer2ProtocolName' attribute has to be set accordingly as well.",
            "enum": [
              "BTC",
              "LTC"
            ],
            "title": "Code of the crypto asset of the customer payment method",
            "type": "string"
          },
          "layer2ProtocolName": {
            "deprecated": true,
            "description": "It's strongly preferred NOT set this attribute (refer to 'currencyTo' attribute for details); it may only be null (for Bitcoin and Litecoin payments over their respective blockchains) or set to 'LIGHTNING', in which case the only allowed value for 'currencyTo' attribute is 'BTC' (for Bitcoin payment over the Lightning Network)",
            "enum": [
              "LIGHTNING"
            ],
            "title": "Code of the layer 2 solution of the customer payment method.",
            "type": "string"
          },
          "paymentMethodId": {
            "description": "Pre-selects the payment method the end customer will pay with. The checkout then skips the payment-method selection step and the invoice goes straight to 'active'. Leave it empty to let the customer choose their own method (a merchant can disable individual payment methods for invoicing in the settings). Valid values are the 'id' values returned by GET /api/v3/crypto-payment-methods?invoicingEnabled=true.",
            "example": "BITCOIN-BLOCKCHAIN-MAINNET-BTC-CURRENCY",
            "title": "ID of the pre-selected payment method.",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currencyFrom"
        ],
        "type": "object"
      },
      "InvoiceCreationTo": {
        "properties": {
          "customerEmail": {
            "description": "E-mail address for the customer notifications. May be required for newly registered merchants.",
            "example": "customerEmail@email.com",
            "format": "email",
            "type": "string"
          },
          "customerProfile": {
            "description": "Optional customer profile details to attach to the invoice.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/CompanyProfileTo"
              },
              {
                "$ref": "#/components/schemas/IndividualProfileTo"
              },
              {
                "$ref": "#/components/schemas/ReferenceProfileTo"
              }
            ]
          },
          "invoice": {
            "$ref": "#/components/schemas/Invoice",
            "description": "Invoice amount and currency details."
          },
          "notifyEmail": {
            "description": "E-mail address where merchant notifications will be sent.",
            "example": "orderReceived@yourEShop.com",
            "format": "email",
            "type": "string"
          },
          "notifyUrl": {
            "description": "Webhook URL where invoice webhooks will be sent.",
            "example": "https://yourEShop.com/orderReceived",
            "format": "uri",
            "maxLength": 512,
            "minLength": 0,
            "type": "string"
          },
          "product": {
            "$ref": "#/components/schemas/Product",
            "description": "Product information associated with this invoice."
          },
          "reference": {
            "description": "Any data the merchant wishes to store in the invoice. It might be, for instance, a JSON or any other string identifying the Invoice in the merchant's system.",
            "example": "anything",
            "maxLength": 512,
            "minLength": 0,
            "type": "string"
          },
          "returnUrl": {
            "description": "URL where the customer will be redirected after the payment.",
            "example": "https://yourEShop.com/orderReceived",
            "maxLength": 512,
            "minLength": 0,
            "type": "string"
          },
          "settlement": {
            "$ref": "#/components/schemas/Settlement",
            "description": "Settlement details specifying how merchant will receive funds."
          }
        },
        "required": [
          "invoice",
          "settlement"
        ],
        "type": "object"
      },
      "InvoiceCurrencyFrom": {
        "description": "The original invoice currency.",
        "enum": [
          "BTC",
          "AED",
          "ALL",
          "AMD",
          "ARS",
          "AUD",
          "AZN",
          "BDT",
          "BGN",
          "BHD",
          "BND",
          "BOB",
          "BRL",
          "BYN",
          "CAD",
          "CLP",
          "CNY",
          "COP",
          "CRC",
          "CVE",
          "CZK",
          "DKK",
          "DOP",
          "DZD",
          "EUR",
          "FKP",
          "GBP",
          "GEL",
          "GTQ",
          "HKD",
          "HRK",
          "HUF",
          "CHF",
          "IDR",
          "ILS",
          "INR",
          "ISK",
          "JMD",
          "JPY",
          "KGS",
          "KHR",
          "KWD",
          "KZT",
          "LTL",
          "MAD",
          "MDL",
          "MGA",
          "MKD",
          "MNT",
          "MOP",
          "MUR",
          "MXN",
          "MYR",
          "NGN",
          "NIO",
          "NOK",
          "NZD",
          "PEN",
          "PHP",
          "PLN",
          "PYG",
          "QAR",
          "RON",
          "RSD",
          "RUB",
          "SEK",
          "SGD",
          "THB",
          "TRY",
          "TWD",
          "UAH",
          "USD",
          "UYU",
          "VND",
          "XCD"
        ],
        "example": "EUR",
        "title": "The original invoice currency.",
        "type": "string"
      },
      "InvoiceTo": {
        "properties": {
          "activeSince": {
            "description": "The time of the Invoice's transition to active state as a Unix timestamp. May be null, if the Invoice has never been in active state.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "address": {
            "description": "The address where a customer is supposed to send crypto to.",
            "example": "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy",
            "type": "string"
          },
          "buttonInvoiceId": {
            "description": "The ID of a Payment Button, if this Invoice has been created by using one.",
            "example": "paby8ngx1eox",
            "type": "string"
          },
          "closedAt": {
            "description": "The time when the Invoice was closed as a Unix timestamp.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "confirmations": {
            "description": "The number of confirmations.",
            "example": 0,
            "format": "int32",
            "type": "integer"
          },
          "confirmingSince": {
            "description": "The time of the Invoice's transition to confirming state as a Unix timestamp. May be null, if the Invoice has never been in the confirming state.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "createdAt": {
            "description": "The time when the Invoice was created as a Unix timestamp.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "cryptoTransactions": {
            "description": "The transactions associated with this Invoice.",
            "items": {
              "$ref": "#/components/schemas/CryptoTransactionTo"
            },
            "type": "array"
          },
          "cryptoUri": {
            "description": "Standardized URI for a crypto payment. It is also used in a payment QR code. Contains at least protocol, address and remaining amount to be paid.",
            "example": "litecoin:mnLU9vBK7L1WY6JNnGYY...Jdjwfnti4Cu9xz?amount=1.00000000",
            "type": "string"
          },
          "customerAmount": {
            "$ref": "#/components/schemas/MoneyCustomerAmount"
          },
          "customerEmail": {
            "description": "The email address to which email notifications for the customer will be sent.",
            "example": "customerEmail@email.com",
            "type": "string"
          },
          "emailInvoiceId": {
            "description": "The ID of an Email Invoice, if this Invoice has been created by using one.",
            "example": "emi4og3r6g3w",
            "type": "string"
          },
          "errorSince": {
            "description": "The time of the Invoice's transition to error state as a Unix timestamp. May be null, if the Invoice has never been in error state.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "expiredSince": {
            "description": "The time of the Invoice's transition to expired state as a Unix timestamp. May be null, if the Invoice has never been in expired state.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "fee": {
            "description": "The fee of the Invoice.",
            "example": "0.00000011",
            "type": "number"
          },
          "flags": {
            "$ref": "#/components/schemas/Flags",
            "description": "Describes whether the Invoice is overpaid or underpaid and if it can be refunded."
          },
          "id": {
            "description": "The Invoice ID.",
            "example": "invl8em3zdkr",
            "type": "string"
          },
          "layer2Attributes": {
            "description": "The information about layer 2 protocol if used.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/LightningLayerAttributesTo"
              }
            ]
          },
          "merchantAmount": {
            "$ref": "#/components/schemas/MoneyMerchantAmount"
          },
          "networkFee": {
            "description": "The network fee.",
            "example": "0.00000011",
            "type": "number"
          },
          "notifyEmail": {
            "description": "The e-mail address where the e-mail notifications will be sent. The maximum length is 512 characters.",
            "example": "orderReceived@yourEShop.com",
            "type": "string"
          },
          "notifyUrl": {
            "description": "The URL where webhooks will be POSTed.",
            "example": "https://yourEShop.com/orderReceived",
            "maxLength": 512,
            "type": "string"
          },
          "overUnderPaidAmount": {
            "description": "The difference of requested and received amount. Can be positive or negative.",
            "example": "-0.00000101",
            "type": "number"
          },
          "paid": {
            "$ref": "#/components/schemas/MoneyPaidTo",
            "description": "The received amount in the requested crypto currency."
          },
          "paidSince": {
            "description": "The time when the Invoice acquired the paid status as a Unix timestamp. May be null, if the Invoice has never been in paid state.",
            "example": 1506079178,
            "format": "int64",
            "type": "integer"
          },
          "paymentMethodId": {
            "description": "Identifies the blockchain network and the asset the payment is made in. Null until the payment method is fixed — either by the end customer on the checkout page, or up-front by the merchant through the creation request's 'paymentMethodId'. Values are the 'id' values returned by GET /api/v3/crypto-payment-methods.",
            "example": "BITCOIN-BLOCKCHAIN-MAINNET-BTC-CURRENCY",
            "title": "ID of the payment method the Invoice is paid with.",
            "type": "string"
          },
          "pendingVerificationSince": {
            "description": "The time of the Invoice's transition to pending verification state as a Unix timestamp. May be null, if the Invoice has never been in pending verification state.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "preparedSince": {
            "description": "The time of the Invoice's transition to prepared state as a Unix timestamp. ",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "product": {
            "$ref": "#/components/schemas/ProductTo",
            "description": "The information about the product."
          },
          "rate": {
            "$ref": "#/components/schemas/RateTo",
            "description": "The rate of FIAT -> Crypto conversion"
          },
          "reference": {
            "description": "Any data the merchant wishes to store in the Invoice. It might be, for instance, a JSON or any other string identifying the invoice in the merchant's system. The maximum length is 512 characters.",
            "example": "string {'customer_mail': 'customer@example.com'}",
            "type": "string"
          },
          "refundLink": {
            "description": "The URL of the refund link.",
            "example": "https://pay.confirmo.com/public/permit-refund/aW52MDJleTI0MWdrNGE5MmFjNGRkYTE1YjQ5ZDI3MzA4NzBhYWEzYjc5YzE=?refundEmail=test@bitcoin.com&merchantId=dfjeivkdienmv",
            "format": "uri",
            "type": "string"
          },
          "refunds": {
            "description": "Refunds for this Invoice.",
            "items": {
              "$ref": "#/components/schemas/RefundTo"
            },
            "type": "array"
          },
          "requiredConfirmations": {
            "description": "The number of required confirmations for the Invoice to gain the paid status.",
            "example": 2,
            "format": "int32",
            "type": "integer"
          },
          "requiredConfirmationsToRefund": {
            "description": "The number of required confirmations for refunds to be allowed.",
            "example": 6,
            "format": "int32",
            "type": "integer"
          },
          "resolvedByEmail": {
            "description": "Email (or other identifier) of the one responsible for manual resolve.",
            "example": "user@mail.ex",
            "type": "string"
          },
          "resolvedManually": {
            "description": "Flag saying whether invoice was resolved manually (refund, take)",
            "example": true,
            "type": "boolean"
          },
          "returnUrl": {
            "description": "The URL where the customer will be redirected after the payment. The maximum length is 512 characters.",
            "example": "https://yourEShop.com/orderReceived",
            "type": "string"
          },
          "settlement": {
            "$ref": "#/components/schemas/SettlementInfoTo",
            "description": "The settlement for this Invoice. Presents only if it exists."
          },
          "settlementAmount": {
            "$ref": "#/components/schemas/MoneySettlementAmount"
          },
          "status": {
            "description": "Please note that invoices that transition from status 'prepared' directly to 'expired' (i.e. those which were never activated) become subject of data purging after a retention period (e.g. a year). An invoice in status 'paid' can still move to 'blocked' when a later compliance check flags its payment.",
            "enum": [
              "prepared",
              "pending_verification",
              "active",
              "confirming",
              "paid",
              "expired",
              "error",
              "blocked"
            ],
            "title": "Invoice status.",
            "type": "string"
          },
          "subscriptionId": {
            "deprecated": true,
            "description": "Deprecated. Always null; subscriptions are now standalone feature",
            "type": "string"
          },
          "takeInfo": {
            "$ref": "#/components/schemas/TakeInfoTo",
            "description": "The information about take."
          },
          "timeoutTime": {
            "description": "The time of the Invoice's expiration as a Unix timestamp.",
            "example": 1506080071,
            "format": "int64",
            "type": "integer"
          },
          "unhandledExceptions": {
            "description": "It is true if the payment gateway owes some funds to the customer or the customer has not paid the whole customer amount.",
            "example": true,
            "type": "boolean"
          },
          "url": {
            "description": "The URL of the Invoice's public view for the customers.",
            "example": "https://pay.confirmo.com/public/invoice/NOLvQIt2na6kfXBb?m=dfjeivkdienmv",
            "format": "uri",
            "type": "string"
          },
          "version": {
            "description": "Monotonic version of the invoice; the client discards any WebSocket payload whose version is not greater than the last applied one (ordering guard).",
            "example": 42,
            "format": "int32",
            "type": "integer"
          }
        },
        "required": [
          "resolvedManually"
        ],
        "type": "object"
      },
      "Layer2AttributesTo": {
        "discriminator": {
          "propertyName": "protocolName"
        },
        "properties": {
          "protocolName": {
            "description": "Layer 2 protocol name.",
            "enum": [
              "LIGHTNING",
              "POLYGON",
              "ARBITRUM",
              "OPTIMISM"
            ],
            "example": "LIGHTNING",
            "type": "string"
          }
        },
        "type": "object"
      },
      "LightningLayerAttributesTo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Layer2AttributesTo"
          },
          {
            "properties": {
              "bolt": {
                "type": "string"
              },
              "lnurl": {
                "type": "string"
              },
              "paymentHash": {
                "type": "string"
              }
            },
            "type": "object"
          }
        ]
      },
      "MoneyCustomerAmount": {
        "description": "This is the Invoice amount in cryptocurrency which needs to be paid by a customer.",
        "properties": {
          "amount": {
            "description": "Amount in FIAT has 2 decimal digits and amount in Crypto has 8 decimal digits.",
            "example": 1000,
            "type": "number"
          },
          "currency": {
            "description": "Depending on context, this can be FIAT or crypto (EUR, USD, BTC...). Please see context above.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "EUR",
            "type": "string"
          }
        }
      },
      "MoneyMerchantAmount": {
        "description": "The original Invoice amount and original Invoice currency.",
        "properties": {
          "amount": {
            "description": "Amount in FIAT has 2 decimal digits and amount in Crypto has 8 decimal digits.",
            "example": 1000,
            "type": "number"
          },
          "currency": {
            "description": "Depending on context, this can be FIAT or crypto (EUR, USD, BTC...). Please see context above.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "EUR",
            "type": "string"
          }
        }
      },
      "MoneyPaidTo": {
        "properties": {
          "amount": {
            "description": "The received amount in the requested crypto currency.",
            "example": "0.00004160",
            "type": "number"
          },
          "amountUnconfirmed": {
            "description": "Unconfirmed amount.",
            "example": "0.00000000",
            "type": "number"
          },
          "currency": {
            "description": "The requested crypto currency.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "LTC",
            "type": "string"
          },
          "diff": {
            "description": "The difference of requested and received amount.",
            "example": "0.00000000",
            "type": "number"
          }
        },
        "type": "object"
      },
      "MoneySettlementAmount": {
        "description": "Amount and currency that is credited to the merchant's balance (present only for status Paid). The currency can be one of the following: BTC, CZK, EUR, GBP, HUF, PLN, USD, USDC, USDT.",
        "properties": {
          "amount": {
            "description": "Amount in FIAT has 2 decimal digits and amount in Crypto has 8 decimal digits.",
            "example": 1000,
            "type": "number"
          },
          "currency": {
            "description": "Depending on context, this can be FIAT or crypto (EUR, USD, BTC...). Please see context above.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "EUR",
            "type": "string"
          }
        }
      },
      "Product": {
        "properties": {
          "description": {
            "description": "The description of the product.",
            "example": "Small silver computer",
            "type": "string"
          },
          "name": {
            "description": "The name of the product. The maximum length is 512 characters.",
            "example": "Computer",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "ProductTo": {
        "properties": {
          "description": {
            "description": "The description of the product.",
            "example": "Small silver computer",
            "type": "string"
          },
          "name": {
            "description": "The name of the product. The maximum length is 512 characters.",
            "example": "Computer",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProfileTo": {
        "discriminator": {
          "propertyName": "type"
        },
        "properties": {
          "city": {
            "description": "City of the customer's address.",
            "example": "Springfield",
            "maxLength": 255,
            "minLength": 0,
            "type": "string"
          },
          "country": {
            "description": "Country of the customer's address, represented as a two-letter ISO 3166-1 alpha-2 country code.",
            "enum": [
              "AD",
              "AE",
              "AF",
              "AG",
              "AI",
              "AL",
              "AM",
              "AN",
              "AO",
              "AQ",
              "AR",
              "AS",
              "AT",
              "AU",
              "AW",
              "AX",
              "AZ",
              "BA",
              "BB",
              "BD",
              "BE",
              "BF",
              "BG",
              "BH",
              "BI",
              "BJ",
              "BL",
              "BM",
              "BN",
              "BO",
              "BQ",
              "BR",
              "BS",
              "BT",
              "BV",
              "BW",
              "BY",
              "BZ",
              "CA",
              "CC",
              "CD",
              "CF",
              "CG",
              "CH",
              "CI",
              "CK",
              "CL",
              "CM",
              "CN",
              "CO",
              "CR",
              "CU",
              "CV",
              "CW",
              "CX",
              "CY",
              "CZ",
              "DE",
              "DJ",
              "DK",
              "DM",
              "DO",
              "DZ",
              "EC",
              "EE",
              "EG",
              "EH",
              "ER",
              "ES",
              "ET",
              "FI",
              "FJ",
              "FK",
              "FM",
              "FO",
              "FR",
              "GA",
              "GB",
              "GD",
              "GE",
              "GF",
              "GG",
              "GH",
              "GI",
              "GL",
              "GM",
              "GN",
              "GP",
              "GQ",
              "GR",
              "GS",
              "GT",
              "GU",
              "GW",
              "GY",
              "HK",
              "HM",
              "HN",
              "HR",
              "HT",
              "HU",
              "ID",
              "IE",
              "IL",
              "IM",
              "IN",
              "IO",
              "IQ",
              "IR",
              "IS",
              "IT",
              "JE",
              "JM",
              "JO",
              "JP",
              "KE",
              "KG",
              "KH",
              "KI",
              "KM",
              "KN",
              "KP",
              "KR",
              "KW",
              "KY",
              "KZ",
              "LA",
              "LB",
              "LC",
              "LI",
              "LK",
              "LR",
              "LS",
              "LT",
              "LU",
              "LV",
              "LY",
              "MA",
              "MC",
              "MD",
              "ME",
              "MF",
              "MG",
              "MH",
              "MK",
              "ML",
              "MM",
              "MN",
              "MO",
              "MP",
              "MQ",
              "MR",
              "MS",
              "MT",
              "MU",
              "MV",
              "MW",
              "MX",
              "MY",
              "MZ",
              "NA",
              "NC",
              "NE",
              "NF",
              "NG",
              "NI",
              "NL",
              "NO",
              "NP",
              "NR",
              "NU",
              "NZ",
              "OM",
              "PA",
              "PE",
              "PF",
              "PG",
              "PH",
              "PK",
              "PL",
              "PM",
              "PN",
              "PR",
              "PS",
              "PT",
              "PW",
              "PY",
              "QA",
              "RE",
              "RO",
              "RS",
              "RU",
              "RW",
              "SA",
              "SB",
              "SC",
              "SD",
              "SE",
              "SG",
              "SH",
              "SI",
              "SJ",
              "SK",
              "SL",
              "SM",
              "SN",
              "SO",
              "SR",
              "SS",
              "ST",
              "SV",
              "SX",
              "SY",
              "SZ",
              "TC",
              "TD",
              "TF",
              "TG",
              "TH",
              "TJ",
              "TK",
              "TL",
              "TM",
              "TN",
              "TO",
              "TR",
              "TT",
              "TV",
              "TW",
              "TZ",
              "UA",
              "UG",
              "UM",
              "US",
              "UY",
              "UZ",
              "VA",
              "VC",
              "VE",
              "VG",
              "VI",
              "VN",
              "VU",
              "WF",
              "WS",
              "XK",
              "YE",
              "YT",
              "ZA",
              "ZM",
              "ZW"
            ],
            "example": "US",
            "type": "string"
          },
          "postalCode": {
            "description": "Postal or ZIP code of the customer's address.",
            "example": "90210",
            "maxLength": 64,
            "minLength": 0,
            "type": "string"
          },
          "profileId": {
            "description": "Merchant's identifier of the customer profile.",
            "example": "profile-12345",
            "maxLength": 255,
            "minLength": 0,
            "type": "string"
          },
          "streetAddress": {
            "description": "Street portion of the customer's address.",
            "example": "123 Main Street",
            "maxLength": 255,
            "minLength": 0,
            "type": "string"
          },
          "type": {
            "description": "Customer profile type.",
            "enum": [
              "individual",
              "company",
              "reference"
            ],
            "type": "string"
          }
        },
        "required": [
          "profileId"
        ],
        "type": "object"
      },
      "RateTo": {
        "properties": {
          "currencyFrom": {
            "description": "Currency from. The original FIAT currency.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "EUR",
            "type": "string"
          },
          "currencyTo": {
            "description": "Currency to. The requested crypto currency.",
            "enum": [
              "BNB",
              "BTC",
              "ETH",
              "EURC",
              "LTC",
              "POL",
              "SOL",
              "TRX",
              "USAT",
              "USDC",
              "USDG",
              "USDT",
              "XPL",
              "AED",
              "ALL",
              "AMD",
              "ARS",
              "AUD",
              "AZN",
              "BDT",
              "BGN",
              "BHD",
              "BND",
              "BOB",
              "BRL",
              "BYN",
              "CAD",
              "CLP",
              "CNY",
              "COP",
              "CRC",
              "CVE",
              "CZK",
              "DKK",
              "DOP",
              "DZD",
              "EUR",
              "FKP",
              "GBP",
              "GEL",
              "GTQ",
              "HKD",
              "HRK",
              "HUF",
              "CHF",
              "IDR",
              "ILS",
              "INR",
              "ISK",
              "JMD",
              "JPY",
              "KGS",
              "KHR",
              "KWD",
              "KZT",
              "LTL",
              "MAD",
              "MDL",
              "MGA",
              "MKD",
              "MNT",
              "MOP",
              "MUR",
              "MXN",
              "MYR",
              "NGN",
              "NIO",
              "NOK",
              "NZD",
              "PEN",
              "PHP",
              "PLN",
              "PYG",
              "QAR",
              "RON",
              "RSD",
              "RUB",
              "SEK",
              "SGD",
              "THB",
              "TRY",
              "TWD",
              "UAH",
              "USD",
              "UYU",
              "VND",
              "XCD"
            ],
            "example": "LTC",
            "type": "string"
          },
          "value": {
            "description": "The conversion rate from currencyFrom to currencyTo.",
            "example": "1000.00",
            "type": "number"
          }
        },
        "type": "object"
      },
      "ReferenceProfileTo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProfileTo"
          }
        ],
        "required": [
          "profileId"
        ]
      },
      "RefundTo": {
        "properties": {
          "address": {
            "description": "The crypto address, the refund was sent to.",
            "example": "3Bp6GX52uY574Uq7k6opCx1zHd5hVhAXHq",
            "type": "string"
          },
          "amount": {
            "description": "The refunded amount.",
            "example": "0.005",
            "type": "number"
          },
          "createdAt": {
            "example": 1594376981,
            "format": "int64",
            "title": "The timestamp of the refund creation.",
            "type": "integer"
          },
          "id": {
            "description": "The refund ID.",
            "example": "refz0gr3qgx9",
            "type": "string"
          },
          "notifyEmail": {
            "description": "The notification e-mail.",
            "example": "test@test.com",
            "type": "string"
          },
          "paymentStatus": {
            "enum": [
              "overpaid",
              "underpaid",
              "paid-after-limit",
              "pending-verification"
            ],
            "title": "The payment status of the refund.",
            "type": "string"
          },
          "refundStatus": {
            "description": "The status of the refund.",
            "enum": [
              "pending",
              "sending",
              "refunded",
              "error",
              "cancelled",
              "not_possible"
            ],
            "type": "string"
          },
          "refundedAt": {
            "example": 1594376981,
            "format": "int64",
            "title": "The timestamp when the refund was sent.",
            "type": "integer"
          },
          "sendMode": {
            "enum": [
              "MANUAL",
              "AUTOMATIC"
            ],
            "type": "string"
          },
          "substatus": {
            "example": "SCREENING_IN_PROGRESS",
            "maxLength": 64,
            "title": "Provides additional detail about the refund status. While primary statuses indicate the overall state, substatuses offer more specific information about why the refund is in that state. Not all primary statuses have associated substatuses.",
            "type": "string"
          },
          "txid": {
            "description": "The TXID of a refund transaction.",
            "example": "4f13bc54e8df1620f98934078caaa59c7b480f3ed64e9838f5af519f311bb0b1",
            "type": "string"
          },
          "updatedAt": {
            "example": 1594376981,
            "format": "int64",
            "title": "The timestamp of the last refund update.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Settlement": {
        "properties": {
          "currency": {
            "description": "Merchant gets paid in this currency - currency of the outstanding  balance where the paid invoice's amount is added. When value of settlement and invoice currencyTo is null, then settlement currency is set same as customer currency after customer chooses crypto currency in Invoice.",
            "enum": [
              "BTC",
              "CZK",
              "EUR",
              "GBP",
              "USD",
              "USDC",
              "USDT"
            ],
            "example": "EUR",
            "title": "Currency of the outstanding balance where the paid invoice's amount is added",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettlementCurrency": {
        "description": "The currency in which the Settlement will be paid out. Merchant gets paid in this currency, when it is assigned to an invoice as settlement currency",
        "enum": [
          "BTC",
          "CZK",
          "ETH",
          "EUR",
          "GBP",
          "HUF",
          "LTC",
          "PLN",
          "POL",
          "SOL",
          "TRX",
          "USD",
          "USDC",
          "USDT"
        ],
        "example": "EUR",
        "title": "The currency in which the Settlement will be paid out.",
        "type": "string"
      },
      "SettlementInfoTo": {
        "properties": {
          "amount": {
            "description": "The amount of the Settlement.",
            "example": "276.25",
            "type": "number"
          },
          "createdAt": {
            "description": "A Unix timestamp specifying creation of the settlement.",
            "example": 1561363200,
            "format": "int64",
            "type": "integer"
          },
          "currency": {
            "$ref": "#/components/schemas/SettlementCurrency",
            "type": "string"
          },
          "fee": {
            "description": "The fee of the Settlement.",
            "example": 0,
            "type": "number"
          },
          "id": {
            "description": "The Settlement ID.",
            "example": "setv9e1qxgz8",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TakeInfoTo": {
        "properties": {
          "customerCurrency": {
            "description": "The currency in which the customer is supposed to pay.",
            "example": "LTC",
            "type": "string"
          },
          "expiration": {
            "description": "The timestamp when take offer expires.",
            "example": 1552987955,
            "format": "int64",
            "type": "integer"
          },
          "expirationDuration": {
            "description": "The number of seconds before take offer expires.",
            "example": 120,
            "format": "int64",
            "type": "integer"
          },
          "merchantCurrency": {
            "type": "string"
          },
          "offeredAmountInMerchantCurrency": {
            "type": "number"
          },
          "offeredPrice": {
            "description": "The new price of crypto currency.",
            "example": "1318.16",
            "type": "number"
          },
          "offeredSettlementAmount": {
            "description": "The new amount to be settled (after take).",
            "example": 3198,
            "type": "number"
          },
          "originalSettlementAmount": {
            "description": "The original amount to be settled (before take)",
            "example": "4505.4",
            "type": "number"
          },
          "refundAmount": {
            "description": "Used for internal purposes",
            "example": 0,
            "type": "number"
          },
          "settlementCurrency": {
            "description": "The currency of the Settlement Method.",
            "example": "EUR",
            "type": "string"
          },
          "taken": {
            "description": "True if the Invoice was taken.",
            "example": true,
            "type": "boolean"
          },
          "takenAt": {
            "description": "The take action timestamp as Unix timestamp.",
            "example": 1552987719,
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer-auth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "_Confirmo merchant API_ consists of the APIs for the Merchant communication with the Confirmo.com service.\n\n**Be sure to use HTTPS protocol.** All API requests are redirected to HTTPS, thus most of the plain HTTP requests won't\nwork (those using PUT, POST, or PATCH methods).\n\n**Please be aware that this API is subject to change.** Confirmo can add some new fields. Please, remember that when\nwriting your clients. Your client is required to ignore any fields it does not know.\n\n## Authentication\n\nCurrently, this API supports only one model of authentication - _API keys_. The keys are private for every merchant and\nshould only be used to access your invoices and settlements from the outside of the user interface.\n\n#### API key management\n\nAPI keys can be created and deleted in the user interface. After you log in to your account, navigate to `Settings` and\ncontinue to the `API Keys` <a href=\"https://dashboard.confirmo.com/platform/settings/api-keys\">section</a>. The new key\nwill be\ncreated and its token will be displayed for a limited time. Make sure to store it in a __safe__ place as it\nwill not be accessible via the UI for security reasons later.\n\nEach token will provide read/write access outside the UI to your account. It will remain valid until its\ndeletion in the UI.\n\n#### API key best practices\n\nWhen you use API keys in your applications, keep them secure.\n\nPublicly exposing your credentials can result in your account being compromised.\n\nTo keep your API keys secure, follow these best practices:\n\n* __Do not embed API keys directly in code__: API keys embedded in code can be accidentally exposed to the\n  public. For example, if you forget to remove the keys from the code that you share. Instead of embedding your API keys\n  in your applications, store them in environment variables or files outside your application's source tree.\n\n\n* __Do not store API keys in files inside your application's source tree__: If you store API keys in files, keep the\n  files outside your application's source tree to help ensure your keys do not end up in your source code control\n  system. This is particularly important if you use a public source code management system such as GitHub.\n\n\n* __Restrict your API keys to IP addresses that need them__: By restricting the IP addresses that\n  can use each key, you can reduce the impact of a compromised API key.\n\n\n* __Delete unneeded API keys__: To minimize your exposure to attack, delete any API keys that you no longer need.\n\n\n* __Review your code before publicly releasing it__: Ensure that code does not contain API keys or any other\n  private information before you make your code publicly available.\n\n#### API key usage\n\nEach request made from the outside of the application must include an `Authorization` header containing a valid API key\ntoken. Example using curl:\n\n<pre>\n  <code>\n    curl https://confirmo.net/api/v3/invoices -H 'Authorization: Bearer {YOUR_API_KEY}' \n  </code>\n</pre>\n\n## Status codes\n\nAPI responses are marked with status codes:\n\n* `200 OK` Request resolved\n\n\n* `201 Created` Request resolved by successfully creating a new object in the\n  system\n\n\n* `204 No Content` Request resolved and no content is returned\n\n\n* `400 Bad Request` Invalid format of request\n\n\n* `401 Unauthorized` Invalid or missing API key in the request header\n\n\n* `403 Forbidden` Authorized but not to access the particular resource\n\n\n* `500 Internal Server Error` The server has encountered an unexpected\n  condition; please contact support@confirmo.net\n\n\n* `503 Service Unavailable` The server could not fulfill your request;\n  please contact the Confirmo support\n\n## <a id=\"idempotent-requests\"></a>Idempotent requests\n\nSelected endpoints accept an optional `Idempotency-Key` request header to prevent duplicate transactions in \ncases such as retries caused by network issues or delays. Endpoints that support it note `Idempotency-Key`\nsupport in their description.\n\nWhen you supply the header, the value must be a non-empty, printable-ASCII string of at most 255 characters. \nWe recommend generating a fresh UUID for each logical operation.\n\nUsing the same idempotency key for multiple requests ensures that only the outcome of the original request is ever \nreturned. Confirmo saves the first response and reuses it for any subsequent requests with that same key, without \nre-executing the operation. Note that when the request failed, you will have the original error \nresponse available only on the first call, on the retry with same idempotency key only a generic `409` + \n`idempotency_key_previously_failed`.\nSome endpoints answer certain errors (e.g. a limit error, or an action the current status does not allow) as a\nregular response; such a response is stored and returned again for a retry with the same key.\n\nThe stored response remains available for 24 hours. After that period a new idempotency key must be used.\n\nError responses all share the shape `{ \"message\": ..., \"error\": ... }`, where `error` is a stable machine-readable code.\n\n`400 Bad Request` — the supplied key is malformed (empty, longer than 255 characters, or containing\nnon-printable-ASCII characters):\n\n```json\n{\n  \"message\": \"Idempotency-Key must be non-empty, at most 255 printable-ASCII characters.\",\n  \"error\": \"idempotency_key_invalid\"\n}\n```\n\n`409 Conflict` when the same key was already used by a different caller, for example another API key of your account.\nThe original request may have completed, so check its outcome before retrying, and do not resend it under a new key:\n\n```json\n{\n  \"message\": \"This Idempotency-Key was already used by a different caller. The original request may have completed. Check its outcome before retrying, and do not resend it under a new key.\",\n  \"error\": \"idempotency_key_reused_by_different_principal\"\n}\n```\n\n`409 Conflict` — the same key was already used with different request parameters (body or query):\n\n```json\n{\n  \"message\": \"This Idempotency-Key was already used with different request parameters (body or query).\",\n  \"error\": \"idempotency_key_reused_with_different_body\"\n}\n```\n\n`409 Conflict` — the same key was already used on a different endpoint:\n\n```json\n{\n  \"message\": \"This Idempotency-Key was already used on a different endpoint.\",\n  \"error\": \"idempotency_key_reused_on_different_endpoint\"\n}\n```\n\n`409 Conflict` — a request with this key is still being processed:\n\n```json\n{\n  \"message\": \"A request with this Idempotency-Key is still being processed.\",\n  \"error\": \"idempotency_key_in_progress\"\n}\n```\n\n`409 Conflict` — the original request with this key failed:\n\n```json\n{\n  \"message\": \"The original request with this Idempotency-Key failed; retry with a new Idempotency-Key.\",\n  \"error\": \"idempotency_key_previously_failed\"\n}\n```\n\nA `500` or this `409` does not prove that the operation did not take effect: a request can fail after its changes\nwere saved. Before you retry with a new key, check its outcome (e.g. whether it appears in the payouts or withdrawals\nlist).\n\n## Notifications\n\nThe _Confirmo merchant API_ allows merchants to enable simple notifications as part of invoice creation. These\nnotifications are of the following types:\n\n* [webhook notifications](#webhook-notifications)\n* [e-mail notifications](#email-notifications)\n\nNotifications are sent on the following occasions:\n\n1. invoice creation;\n2. change of invoice status;\n3. received payment/outgoing payment (refund).\n\n### <a id=\"webhook-notifications\"></a>Webhook notifications\n\nIf `notifyUrl` is defined in an invoice creation request, then the system tries to send an HTTP `POST` request\nwith `Content-Type` set to `application/json` to the URL. The request's body contains the current invoice model (same as\ncreating a new invoice response).\n\nBy default, the system will continue to send the notification until it receives `200` response or stops after 20 tries.\nAfter the first failed try it will wait for 1 second. The waiting period is doubled after each failed request.\n\nIf the system fails to send a successful request, it will try to send an error report via e-mail. It is sent\non `notifyEmail` if it was specified or on the merchant's user e-mail otherwise. This e-mail contains our error message\nand error response to the last unsuccessful request.\n\n#### Callback Password\n\n__A callback password__ is an autogenerated pseudo-random alphanumeric string used as a data validation mechanism for\nstronger security. When a callback password is created, it is used to generate signatures that are included in\nevery webhook notification **request header**.\n\nThe signature is generated - and **needs to be validated** (to ensure that the webhooks do originate from Confirmo and\nwere not forged by someone else) - by\n\n1. taking the request/response body;\n\n2. suffixing it with the callback password;\n\n3. hashing the result using the SHA256 algorithm;\n\n4. storing the hexadecimal representation in the `bp-signature` header field of the request/response.\n\n##### Example\n\n- Callback password: `azLlmIpWHM9NJbMe`\n\n\n- Response body:\n  `{\"address\":\"P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc\",\"cryptoUri\":\"bitcoin:P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc?amount=0.00779057\",\"createAtTime\":1509525927,\"serverTime\":1509525927,\"timeoutTime\":1509526226,\"id\":\"inv57dkwrrdw\",\"url\":\"https://pay.confirmo.com/public/invoice/inv57dkwrrdw\",\"reference\":\"{\\\"customerEmail\\\":\n  \\\"customer@example.com\\\", \\\"orderNumber\\\": 123, \\\"customerName\\\": \\\"Customer\n  Name\\\"}\",\"returnUrl\":\"http://yourEShop.com/thankYourForYourOrder\",\"notifyUrl\":\"https://yourEShop.com/orderReceived\",\"notifyEmail\":\"notify@email.com\",\"product\":{\"name\":\"pName\",\"description\":\"pDesc\"},\"status\":\"active\",\"rate\":{\"currency\":\"EUR\",\"currencyX\":\"BTC\",\"rate\":\"6418.02\"},\"txids\":[],\"invoice\":{\"amount\":\"50.00\",\"currency\":\"EUR\"},\"crypto\":{\"amount\":\"0.00779057\",\"currency\":\"BTC\"},\"invoiceSettlements\":[],\"refunds\":[],\"paid\":{\"amount\":\"0.00000000\",\"currency\":\"BTC\",\"diff\":\"-0.00779057\"},\"flags\":{\"split\":false,\"autoUnderpayment\":false,\"refundable\":false},\"paidAtTime\":0,\"completedAtTime\":0,\"settlementMethodCurrency\":\"CZK\",\"confirmations\":0,\"requiredConfirmations\":2,\"exception\":[]}`\n\n\n- SHA256\n  **\n  input**:`{\"address\":\"P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc\",\"cryptoUri\":\"bitcoin:P3n6Ul5FsSd59xfbzdD2VN3HHycIddjpc?amount=0.00779057\",\"createAtTime\":1509525927,\"serverTime\":1509525927,\"timeoutTime\":1509526226,\"id\":\"inv57dkwrrdw\",\"url\":\"https://pay.confirmo.com/public/invoice/inv57dkwrrdw\",\"reference\":\"{\\\"customerEmail\\\":\n  \\\"customer@example.com\\\", \\\"orderNumber\\\": 123, \\\"customerName\\\": \\\"Customer\n  Name\\\"}\",\"returnUrl\":\"http://yourEShop.com/thankYourForYourOrder\",\"notifyUrl\":\"https://yourEShop.com/orderReceived\",\"notifyEmail\":\"notify@email.com\",\"product\":{\"name\":\"pName\",\"description\":\"pDesc\"},\"status\":\"active\",\"rate\":{\"currency\":\"EUR\",\"currencyX\":\"BTC\",\"rate\":\"6418.02\"},\"txids\":[],\"invoice\":{\"amount\":\"50.00\",\"currency\":\"EUR\"},\"crypto\":{\"amount\":\"0.00779057\",\"currency\":\"BTC\"},\"invoiceSettlements\":[],\"refunds\":[],\"paid\":{\"amount\":\"0.00000000\",\"currency\":\"BTC\",\"diff\":\"-0.00779057\"},\"flags\":{\"split\":false,\"autoUnderpayment\":false,\"refundable\":false},\"paidAtTime\":0,\"completedAtTime\":0,\"settlementMethodCurrency\":\"CZK\",\"confirmations\":0,\"requiredConfirmations\":2,\"exception\":[]}azLlmIpWHM9NJbMe`\n\n\n- SHA256 **output** as a hex string (and the value of the `bp-signature`\n  header field):\n  `08468c5b3af81ca14fe5a3b40703773175cba2cc3ef8700e62e943edd4cba3ee`\n\n##### Creating/Deleting\n\nTo create a callback password, use <a href=\"https://dashboard.confirmo.com/platform/settings/security\">*Security\nSettings*</a> in\nMerchant UI.\n\nMerchant can create only one callback password. A unique callback password is generated every time and\nbecomes active right away.\n\nDeleting the callback password deactivates the mechanism (`BP_SIGNATURE` is no longer included).\n\n#### Final Status Check\n\n**It is not recommended to rely on webhook data only.** In case that callback password gets compromised, an attacker\nwould still be able to forge the webhooks. Therefore, after receiving a webhook about a status change of an entity\n(such as `paid` status for invoice), it's advised to cross-check the result by invoking Confirmo API endpoint\nfor getting details of the entity (such as <a href=\"#/Invoice/getInvoiceByMerchant\">GET invoice endpoint</a>). This is\nthe ultimate source of truth even in case that somebody managed to forge the webhook. Note that a `paid` invoice can\nstill move to `blocked` (see [Invoice states](#invoice-states)).\n\n### <a id=\"email-notifications\"></a>Email notifications\n\nThe system supports two types of email notifications in invoice creation request, each serving a different purpose:\n\n#### Merchant Notifications (`notifyEmail`)\n\n - Sends basic invoice information in human-readable format to the specified email address\n - Notification are sent:\n   - When HTTPS notifications fail (see above)\n   - When invoice payment is successful\n   - When invoice expires and enters exception state\n   - When a `paid` invoice is blocked: do not deliver the goods or services of such an invoice. This email also goes\n     to the invoice notification address in your notification settings, even when invoice emails are switched off\n     there. Without either address, it goes to the main user of your account (by default the user who\n     registered the account).\n - **Important**: Do not use customer email addresses here, as those notifications may contain merchant-specific information\n\n#### Customer Notifications (`customerEmail`)\n - Notifies customers about important invoice status changes:\n   - When invoice payment is successful\n   - When invoice expires and enters exception state\n - Should contain the end-customer's email address only\n - Note that the customer email can be set also by end-customer on the public invoice when the invoice is in Confirming state\n\n## Entity states\n\n### <a id=\"invoice-states\"></a>Invoice\n\n![Invoice state diagram](https://confirmo-test.s3.eu-central-1.amazonaws.com/Invoice-diagram.svg)\n\n- `prepared` - customer selects preffered payment method.\n  Status `prepared` exists only if the [Create invoice](#/Invoice/createInvoiceByMerchant\") endpoint\n  is called with parameter `invoice.currencyTo= null`, otherwise the end-customer will not be able to select crypto of\n  their choice. It enters `active` state, or `expired` state after 15 minutes of inactivity.\n    - next states: `active`, `expired`\n\n- `active` - Invoice with payment instructions including crypto address, crypto asset, crypto network, amount,\n  currency... By default, the invoice is active for 15 min. Expiration time can be adjusted\n  from <a href=\"https://dashboard.confirmo.com/platform/settings/invoice\">*Invoice Settings*</a>.\n    - next states: `expired`, `confirming`, `blocked`\n\n- `expired` - No payment has been sent within its active period or the amount sent is smaller than the\n  requested amount. An `expired` invoice may have a so-called `exception` [flag](#exception).\n    - final state for invoices with [exception flag](#exception) set to `false`, except for a move to `blocked`\n      (see below).\n    - next state: `paid` for invoices with [exception flag](#exception) set to `true` and were accepted/taken\n      by the merchant.\n    - next state: `blocked` when a compliance check flags a payment of the invoice.\n\n- `confirming` - payment detected, the amount is correct or higher, but the payment is not finished (usually it means it\n  has not enough confirmations) on its crypto network yet\n    - next states: `error`, `paid`, `blocked`\n\n- `error` - confirming failed. Transaction is not confirmed within next 96 hours.\n    - final state\n\n- `paid` - the invoice has been credited to the merchant's account and has sufficient confirmation(s).\n    - next state: `blocked`, only when a later compliance check flags the payment while its funds are still on the\n      payment address. The credit to the merchant's account stays.\n\n- `blocked` - a compliance check flagged the payment: its funds are frozen for a review, or returned to the customer.\n  Do not deliver the goods or services of a `blocked` invoice.\n    - final state\n\n#### <a id=\"exception\"></a>Exception\n\n`unhandledExceptions` is a special flag informing merchants about an invoice that may need attention.\n\n`unhandledExceptions` set to `true` indicates the invoice is **overpaid**, **underpaid** or **incorrect amount** has\nbeen sent to an `expired` invoice.\n\nInvoices with `unhandledExceptions = true` share the following behavior:\n\n1. Invoices are refundable from invoice `url`. However, only paying customer is allowed to request a refund from\n   invoice `url` for security reasons. Merchant can initiate refund from invoice detail in his dashboard.\n\n2. `paid` invoice. Only overpayment and not the whole amount is refundable. Invoice remains in state `paid` all time.\n\n\n3. `expired` invoice. The whole amount is refundable. The merchant can review the invoice and accept the payment to his\n   balance additionally. Once the payment is credited to merchant's balance the status of the invoice changes to `paid`.\n   The invoice is no longer refundable and `unhandledExceptions` is set to `false`.\n\n4. If the additional payment is sent to resolved (already refunded or credited) invoice `unhandledExceptions` is set\n   to `true` again.\n\n\n5. We do not mark invoices with an exception flag if the amount of overpayment or underpayment is very low and the\n   refunding amount would cost more than the network fee or very close to the network fee.\n\n\n6. Payment that matches rules specified in Dashboard\n   in [Underpayment threshold](https://dashboard.confirmo.com/platform/settings/invoice) have `unhandledExceptions` set\n   to `false`.\n\n#### Data Purging\n\nPlease note that invoices which transition directly from `prepared` to `expired` status (i.e. those which never had\ntheir `customerCurrency` (or more generally payment method) set) are subject to data purging after some retention\nperiod (e.g. a year).\n\n### Payout\n\n![Payout state diagram](https://confirmo-test.s3.eu-central-1.amazonaws.com/Payout-diagram.svg)\n\n- `prepared` - new payout\n    - next states: `confirmed`, `expired`\n\n- `confirmed` - Exchange rate has been accepted by a merchant\n    - next state: `sending`\n\n- `sending` - payout prepared to be sent. Payouts are sent on a regular basis\n    - next state: `done`\n\n- `done` - payment was successful and txid is known\n    - final state\n\n- `expired` - payout that has not been `confirmed` in given time.\n    - final state\n\n#### Data Purging\n\nSimilar to invoices, payouts which transition directly from `prepared` to `expired` status are subject to data purging\nafter some retention period (e.g. a year).\n\n## Overlay - no redirection to confirmo.com website\n\nTo open an invoice in the overlay instead of redirecting the user to our page.\nFollow these steps in the [library](https://www.npmjs.com/package/@confirmo/overlay) documentation.\n\n## Integration tips\n\n- If the notification is not received, please check that `notifyUrl` is specified correctly, a valid SSL certificate is\n  installed on your server and the `notifyUrl` starts with https:// not http://. Verify your notification handler\n  script is receiving POST's.\n\n\n- Once your notification handler receives a response, especially when `paid` status is announced, it is recommended to\n  call [Get invoice detail](#/Invoice/getInvoiceByMerchant) to verify\n  notification data.\n\n\n- It is not recommended to rely on [webhook notification](#webhook-notifications) POST's data only.\n\n\n- Please make sure, that the payment URL is not public nor available for search engines.\n\n\n- It is possible to request a refund via payment URL if the payment was sent incorrectly, so please be very cautious and\n  consider security. Even your support staff can request a refund via payment URL.\n\n## Invoice creation\n\nWhen [creating a new invoice](#/Invoice/createInvoiceByMerchant), the following parameters are the most important ones.\n\n| Parameter name         | Required | Description                          | Example | Dedicated Section                                     |\n|------------------------|----------|--------------------------------------|---------|-------------------------------------------------------|\n| `invoice.amount`       | Yes      | The original invoice's amount        | 100     | [Invoice original amount](#invoice-original-amount)   |\n| `invoice.currencyFrom` | Yes      | Code of the original invoice's asset | USD     | [Invoice original amount](#invoice-original-amount)   |\n| `invoice.currencyTo`   | No       | Code of the payment asset            | BTC     | [Invoice payment asset](#invoice-payment-asset)       |\n| `settlement.currency`  | Yes*     | Code of the settlement asset         | EUR     | [Invoice settlement asset](#invoice-settlement-asset) |\n\n&ast; Technically, it's `settlement` (not `settlement.currency`) attribute which is required, i.e. sending a request\nwith an empty `settlement` attribute is also valid (and it's equivalent to sending a request\nwith `settlement.currency = null`).\n\n### <a id=\"invoice-original-amount\"></a>Invoice original amount\n\nParameter `invoice.currencyFrom` (code of the original invoice's asset) can be set to almost any world fiat currency\n(`USD`, `EUR`, `CHF`, … ) and also to `BTC`, please refer to [Get assets endpoint](#/Assets/getAssets) to get\nlist of the currently supported assets (those with `merchantAsset=true`).\n\n### <a id=\"invoice-payment-asset\"></a>Invoice payment asset\n\nParameter `invoice.currencyTo` is highly recommended to be set to _null_. If set to _null_, the invoice is created and\nthe status of the invoice is set to **prepared**, which allows the customer to select any supported payment methods.\nSupported payment methods can be enabled/disabled in the dashboard.\n\nIt's also possible to set it to:\n\n* `BTC` to pre-select payment via native Bitcoin\n* `BTC` (alongside with parameter `invoice.layer2ProtocolName` set to `LIGHTNING`) to pre-select payment via Bitcoin\n  Lightning\n* `LTC` to pre-select payment via native Litecoin\n\nShould you need to create an invoice with other predefined payment method, please contact us at _tech@confirmo.net_.\n\n### <a id=\"invoice-settlement-asset\"></a>Invoice settlement asset\n\nParameter `settlement.currency` configure s the settlement asset in which we credit merchant balance. There are two main\noptions to choose from described in the following subsections.\n\n#### Without conversion (Keep in kind)\n\nIf you set `settlement.currency = null` when creating an Invoice, all the payments sent to the Invoice will be credited\nto the merchant account in the same crypto asset as the customer used for the payment. For instance, if the customer\nchooses to pay with TRX, the payment will be credited to the merchant's TRX balance.\n\n#### With conversion\n\nYou can choose in which asset you want to be credited; to do so, use `settlement.currency = <supported-asset-code>`.\nIn this case, all the payments to the Invoice will be converted to the settlement asset you set.\n\nCurrently, we support the following settlement assets:\n\n| `settlement.currency` | Asset name             | Asset type          |\n|-----------------------|------------------------|---------------------|\n| BTC                   | Bitcoin                | Crypto              |\n| CZK                   | Czech koruna           | Fiat                |\n| EUR                   | Euro                   | Fiat                |\n| GBP                   | British pound sterling | Fiat                |\n| HUF                   | Hungarian forint       | Fiat                |\n| PLN                   | Polish zloty           | Fiat                |\n| USD                   | United States dollar   | Fiat                |\n| USDC                  | USD Coin               | Crypto (stablecoin) |\n| USDT                  | Tether USD             | Crypto (stablecoin) |\n\n### Sample combinations\n\n| `invoice.currencyFrom` | `invoice.currencyTo` | `invoice.layer2ProtocolName` | `settlement.currency` | Description                                                                          |\n|------------------------|----------------------|------------------------------|-----------------------|--------------------------------------------------------------------------------------|\n| `USD`                  | _null_               |                              | `EUR`                 | USD invoice to be paid by a customer-chosen method and credited in EUR               |\n| `GBP`                  | _null_               |                              | `USDC`                | GBP invoice to be paid by a customer-chosen method and credited in USDC              |\n| `BTC`                  | `BTC`                | `LIGHTNING`                  | `USDT`                | BTC invoice to be paid by Bitcoin Lightning and credited in USDT                     |\n| `EUR`                  | _null_               |                              | _null_                | EUR invoice to be paid by a customer-chosen method and credited in the payment asset |\n| `CHF`                  | `LTC`                |                              | `BTC`                 | CHF invoice to be paid by Litecoin and credited in BTC                               |\n\n## Developers\n\n### Postman\n\nWhen you have downloaded [the OpenAPI specification](./confirmo-api.json), you can import it\nto [Postman](https://www.postman.com/).\nThe tool will generate all the endpoints and code snippets, which you could use in your application.\n\n<video width=\"100%\" height=\"300\" controls>\n  <source src=\"https://confirmo-test.s3.eu-central-1.amazonaws.com/postman.mp4\" type=\"video/mp4\">\n</video>\n\n### Swagger tools\n\nIf you insert the downloaded OpenAPI specification into [Swagger editor](https://editor.swagger.io/), you could then\ngenerate a Client SDK that you will be able to use for integration Confirmo API into your application. You can use\n[Swagger Codegen](https://github.com/swagger-api/swagger-codegen)\nor [OpenAPI Generator](https://openapi-generator.tech/) too.\n",
    "title": "Confirmo API",
    "version": "2.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v3/invoices": {
      "post": {
        "description": "Creates a new Invoice for the merchant.",
        "operationId": "createInvoiceByMerchant",
        "parameters": [
          {
            "description": "The name of the payment gateway integration solution (a higher-level payment gateway or plugin which integrates this payment gateway). This header is not meant to be used by direct merchant integrations and replaces the legacy 'X-Payment-Module' header. Only basic letters, numbers, underscore('_'), dash ('-'), dot ('.') and space (' ') are allowed.",
            "example": "WooCommerce",
            "in": "header",
            "name": "Payment-Module-Name",
            "required": false,
            "schema": {
              "maxLength": 100,
              "minLength": 0,
              "type": "string"
            }
          },
          {
            "description": "The version of the payment gateway integration solution (a higher-level payment gateway or plugin which integrates this payment gateway). This header is not meant to be used by direct merchant integrations. Only basic letters, numbers, dash ('-'), dot ('.') and space (' ') are allowed.",
            "example": "2.4.0",
            "in": "header",
            "name": "Payment-Module-Version",
            "required": false,
            "schema": {
              "maxLength": 50,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "invoice": {
                  "amount": "1000.00",
                  "currencyFrom": "EUR"
                },
                "notifyUrl": "https://yourEShop.com/orderReceived",
                "reference": "anything",
                "settlement": {
                  "currency": null
                }
              },
              "schema": {
                "$ref": "#/components/schemas/InvoiceCreationTo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceTo"
                }
              }
            },
            "description": "Invoice successfully created"
          },
          "400": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResource"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResource"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResource"
                }
              }
            },
            "description": "Conflict"
          }
        },
        "summary": "Create new Invoice",
        "tags": [
          "Invoice"
        ]
      }
    }
  },
  "security": [
    {
      "bearer-auth": [
        "read",
        "write"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://confirmo.net/api"
    }
  ],
  "tags": [
    {
      "description": "Invoice endpoints",
      "name": "Invoice"
    }
  ],
  "x-readme": {
    "proxy-enabled": false
  }
}
````