Get lightning invoice associated with checkout transaction
If you don't want to use the IBEXPay Checkout page, you can build your own integration. On this endpoint is all the information you need.
Use the id from the CreateCheckoutResponse to make the following call and get the actual Bolt11 and the OnChain address to deposit the funds.

The transaction object represents a Bitcoin transaction. In this object, the invoiceHash field is the hash of the latest lightning invoice associated with the transaction. The onchainAddress is the address that should be used to pay On-chain. If the transaction is paid on-chain the field transactionOnchain would have at least one element on the array otherwise would be an empty array.

Also in this transaction object the field amountMsat is the complete amount of the transaction in Milisatoshis. The field feeProcessMsat corresponds to the ibex fees.

The field receivedMsat is equivalent to amountMsat - feeProcessMsat. The value of receivedMsat can be higher than amountMsat when the transaction is paid On-chain and has been overpaid.

🚧

The invoice object represent the actual lightning invoice associated with the transaction, if the invoice expires we recreate a new one.

While the invoice hasn't been paid you always get a valid Lightning invoice. On this object the hash is the same as the transaction.invoiceHash, the bolt11 is what should be presented to the user in order to pay the transaction. The field amountMsat is the amount of the invoice and is equal to the transaction.amountMsat.

If you start paying on-chain the invoice object will return an invalid invoice and won't recreate a new one.

❗️

When you start paying on-chain the array transaction.transactionOnchain would have at least one element.

This element has the fields networkTransactionId which is the actual id of the transaction on the blockchain, the field amountSat which represents the number of satoshis for the on-chain transaction and the status field which represent the status of the transaction on the blockchain, this status can be:

  • MEMPOOL, when the transaction is started and is sitting on the mempool.
  • BLOCKCHAIN, when the transaction has one confirmation or is one block deep.
  • CONFIRMED, when the transaction is fully confirmed by two confirmations or is two blocks deep.

When the transaction is paid via on-chain or lightning the field transaction.settledAtUtc would have a utc date indicating when the transaction is paid. If the transaction is not fully paid the field transaction.settledAtUtc would be null.

With on-chain sometimes there can be an underpayment, you can know if an underpayment is happening you can use the transactionOnchainAmount object, this object has the information of required sats to fulfill the transaction, confirms that is how many sats have been fulfilled and unconfirmed sats that are on the way.

If confirmedSats plus unconfirmedSats is less than requiredSats there is an underpayment, if the additions are greater means that the transaction is fulfilled and it's only waiting for blockchain confirmations.

Language
Authorization
Header
Click Try It! to start a request and see the response here!