Processing Webhooks

Once the invoice is created, it becomes payable until it expires. During this time, the exchange rate is fixed to ensure you receive the exact requested amount. The payment must be broadcasted to the cryptocurrency’s network during this window, and the correct amount has to be sent.

When all goes smoothly, the invoice is marked as paid after the payment has been confirmed on the blockchain (this can also take place after the invoice has expired). The received amount is converted to your set settlement currency and added to your Confirmo balance.

With every invoice status change, a webhook notification is sent to your server if you have filled the URL in the notifyurl field.

Once your notification handler receives a response, especially when paid status is announced, it is recommended to call GET invoice detail to verify notification data. It is not recommended to rely on webhook notification POST's data only. Consult the notifications page on how to securely handle the webhooks.

An example of webhook for a newly created payment can be seen below.

{
 'id': 'invSZfmkLxTc9xv',
 'address': None,
 'confirmations': 0,
 'confirmingSince': None,
 'createdAt': 1762425625,
 'customerAmount': None,
 'cryptoUri': None,
 'flags': {'refundable': False,
  'notRefundableCause': 'WRONG_INVOICE_STATE',
  'resolvableStatus': 'NO',
  'overpaymentResolvable': False},
 'merchantAmount': {'amount': '100', 'currency': 'USD'},
 'networkFee': None,
 'paid': None,
 'paidSince': None,
 'expiredSince': None,
 'activeSince': None,
 'preparedSince': 1762425625,
 'product': {'name': 'example product', 'description': ''},
 'rate': None,
 'refunds': [],
 'requiredConfirmations': None,
 'returnUrl': 'https://yourEShop.com/orderReceived',
 'status': 'prepared',
 'timeoutTime': 1762426525,
 'cryptoTransactions': [],
 'unhandledExceptions': False,
 'overUnderPaidAmount': '0',
 'layer2Attributes': None,
 'takeInfo': None,
 'cryptoExternalUrl': None,
 'resolvedManually': None,
 'settlementAmount': {'amount': '0', 'currency': 'USDC'},
 'notifyEmail': None,
 'notifyUrl': 'https://yourEShop.com/orderReceived',
 'errorSince': None,
 'reference': None,
 'refundLink': None,
 'requiredConfirmationsToRefund': None,
 'url': 'https://confirmo.net/public/invoice/invSZfmkLxTc9xv?m=mer2eykomjgk',
 'settlement': None,
 'emailInvoiceId': None,
 'buttonInvoiceId': None,
 'subscriptionId': None,
 'fee': None,
 'resolvedByEmail': None,
 'closedAt': None,
 'customerEmail': None,
 'automaticRefundProhibited': False,
 'customerPaymentMethodId': None};