Invoices

Create an invoice

post

Create an invoice for the client for a specified amount. Make sure that the URLs that you provide in the url_success and url_failed fields use the secure HTTPS protocol, use domain names (not IP addresses) and are considered clean by VirusTotal and similar scanners.

Note: Cryptoprocessing is required to collect sender data in compliance with the MiCA regulations. For more details, see About user data collection.

The end_user_reference parameter is used to group, track and analyse transactions made by a specific customer. To prevent transactions from getting delayed or cancelled, always make sure to include the correct ID. The ID must not contain any personal or identifying customer data.

If you do not provide sender data in the request, the invoice will still be created, but your customer will be prompted for their data on the invoice form. If the customer is already registered in your system, include their end_user_reference and the sender_data object for a smoother user experience.

Warning: For invoices with a timer and pre-selected currency, sender_type and sender_data are required.

Header parameters
X-Processing-KeystringRequired

Private key

X-Processing-SignaturestringRequired

Private secret key

Body
typestring · enumOptional

For partial pay invoices, set this parameter to good_until_expired. For standard invoices, use fill_or_kill or leave this parameter empty.

Possible values:
end_user_referencestringOptional
Permanent ID of the customer in your system. Must not contain personal data, such as the user's name or email address. Include this customer's data in the sender_data object.
timerbooleanRequired
If this parameter is set to true, the invoice will expire in 15 minutes after it is created.
titlestring · min: 1 · max: 50Required

Invoice title that the customer will see.

descriptionstring · max: 1000Optional

Invoice description that the customer will see.

foreign_idstring · max: 255Required

Unique foreign ID in your system. Must not contain personal data, such as the user's name or email address.

currencystringRequired
Currency you want to receive deposits in. For a list of all available currencies, see Supported currencies.
sender_currencystringOptional
Currency of the customer's invoice payment. Invoices with a timer and a pre-selected currency will be externalized at the time of sending this parameter with timer set to true.
amountnumberRequired

Invoice amount that you want to receive from the customer.

url_successstring · uriRequired

The URL the customer will be redirected to in case of a successful invoice payment.

url_failedstring · uriRequired

The URL the customer will be redirected to in case of an unsuccessful invoice payment.

email_userstring · emailRequired

If the amount the customer pays does not match the amount you set for the invoice, Cryptoprocessing will send an email to this address instructing the customer on how they can receive a refund. If they paid less, they will receive a full refund. If they paid more, the customer will get instructions on how to be refunded the difference.

sender_typestring · enumOptional
Whether the sender is a natural person (natural) or a legal entity (legal). If you include the sender_type parameter in the request, sender_data is also required.
Possible values:
Responses
200

OK

application/json
post
POST /api/v2/invoices/create HTTP/1.1
Host: app.cryptoprocessing.com
X-Processing-Key: text
X-Processing-Signature: text
Content-Type: application/json
Accept: */*
Content-Length: 161

{
    "timer": false,
    "title": "Invoice Title",
    "currency": "EUR",
    "amount": 106.75,
    "foreign_id": "user_196",
    "end_user_reference": "12345",
    "url_success": "https://example.com/success",
    "url_failed": "https://example.com/failed",
    "email_user": "[email protected]",
    "sender_type": natural,
    "sender_data": {
      "first_name": "Friedrich",
      "last_name": "Müller",
      "date_of_birth": "1995-08-17"
      }
}
{
  "data": {
    "id": 127,
    "url": "https://wallet.coinspaid.com/invoice/iEU3uh",
    "foreign_id": "user_196",
    "end_user_reference": 12345,
    "address": "2N2xtaZCNygY3iq6XKPJsdoPMDX85LUc8SM",
    "title": "Invoice 171",
    "status": "created",
    "currency": "EUR",
    "amount": "0.106.75000000",
    "sender_currency": null,
    "sender_amount": null,
    "fixed_at": null,
    "release_at": null,
    "seconds_left": null
  }
}

Was this helpful?