Invoices

Invoice is a request for payment in bitcoins which contains a unique bitcoin address and the amount of bitcoins that has to be paid while invoice is valid. Invoice has several status options and we make a callback on every status change.

Number of required confirmations

Confirmations

Transaction amount, BTC

1

below 1

3

from 1 to 10

6

more than 10

Invoice validity:

Currency

Time

EUR, USD, GBP

10 minutes

BTC

2 hours

Invoice status list

Status

Description

pending

The invoice has just been created. While the invoice is valid, we will monitor bitcoin network and check whether the invoice has been paid or not.

paid

The invoice has been paid by the client and Cryptopay will monitor bitcoin network for the transaction confirmation.

confirmed

Invoice transaction has got the required number of confirmations and the invoice amount has been credited to a merchant's account.

timeout

The invoice hasn't been paid. The invoice expired.

paid_timeout

Invoice has been paid after being expired. As soon as the transaction gets confirmed, the invoice changes its ststus to сonfirmed_paid_timeout.

confirmed_paid_timeout

After the transaction gets confirmations, the invoice can be recalculated at the new exchange rate. You can also make a refund.

refunded

Invoice has been refunded either back to client's bitcoin address or to the merchant's bitcoin account.

partpaid

Invoice has been partly paid in time frame provided (It can become paid if the user will cover full invoice amount. Please note that it will get a paid_timeout status after the invoice expires)

overpaid

The client has paid more than it was requested. As soon as the transaction gets confirmed, the extra amount (overage) can be either refunded back to the customer's wallet or credited to a merchant's account

сancelled

Invoice has been cancelled.

Callback validation

A validation_hash parameter is added to all callback requests. Its purpose is to authenticate the callback. This signature must be properly checked by the receiving server in order to ensure that the request is legitimate and hasn't been tampered.

The signature is computed by concatenating the Merchant API Key with an invoice UUID, price in cents and currency ISO code and applying a SHA1 hash function to it. You should use the following pattern: "#{merchant.api_key}_#{uuid}_#{price_cents}#{currency}"