Create an invoice

post
Create an invoice

https://business-sandbox.cryptopay.me/api/invoices
This endpoint allows you to create invoices.
Request
Response
Headers
Authorization
required
string
HMAC using API key and signature
Content-Type
required
string
application/json
Date
required
string
Current date in HTTP-date format
Body Parameters
price_amount
required
string
The invoice amount
price_currency
required
string
The invoice amount currency
pay_currency
required
string
The cryptocurrency that the invoice must be paid in
custom_id
required
string
The payment reference ID in your system
success_redirect_url
optional
string
The URL that the customer will be redirected to upon transaction confirmation
name
optional
string
The invoice name
description
optional
string
The invoice description
meta
optional
object
Custom key-value data
201: Created
{
"id": "cc75b958-5780-4b34-a33a-cf63b349fbab",
"custom_id": "209584732",
"status": "new",
"status_context": null,
"address": "2NG8f2EVxN8XJ4DHriRt9q9LkdVCpQZ2UGB",
"uri": "bitcoin:2NG8f2EVxN8XJ4DHriRt9q9LkdVCpQZ2UGB?amount=0.02038328",
"price_amount": "100.0",
"price_currency": "EUR",
"pay_amount": "0.02038328",
"pay_currency": "BTC",
"fee": "1.0",
"fee_currency": "EUR",
"paid_amount": "0.0",
"exchange": {
"pair": "BTCEUR",
"rate": "4905.9838",
"fee": "0.0",
"fee_currency": "EUR"
},
"transactions": [],
"name": "invoice name",
"description": "invoice description",
"metadata": {
"foo": "bar"
},
"success_redirect_url": null,
"hosted_page_url": "https://hosted-business.cryptopay.me/invoices/cc75b958-5780-4b34-a33a-cf63b349fbab",
"created_at": "2019-05-02T13:56:56+00:00",
"expires_at": "2019-05-02T14:06:56+00:00"
}

API call example.

curl -X POST \
https://business-sandbox.cryptopay.me/api/invoices \
-H 'Authorization: HMAC ***' \
-H 'Content-Type: application/json' \
-H 'Date: Tue, 19 Mar 2019 10:11:40 GMT' \
-d '{"price_amount":"100", "price_currency":"EUR", "pay_currency":"BTC", "custom_id":"209584732"}'

Response schema.

Parameter

Type

Description

id

string

Invoice ID

custom_id

string

Invoice reference ID in your system

status

string

Invoice status. Refer to the invoice statuses section

status_context

string

Invoice status context. Refer to the invoice statuses section

address

string

Invoice cryptocurrency address

uri

string

Invoice URI. May be used for generating a QR code

price_amount

string

Invoice amount

price_currency

string

Invoice amount currency. Refer to a list of supported currencies

pay_amount

string

Cryptocurrency amount to pay

pay_currency

string

Cryptocurrency type

fee

string

Processing fee

fee_currency

string

Processing fee currency

paid_amount

string

Transaction amount that has been received

exchange

object

Exchange details

pair

string

Currency pair

rate

string

Exchange rate

fee

string

Exchange fee

fee_currency

string

Exchange fee currency

transactions

object

Cryptocurrency transaction hash and its risk level details

txid

string

Transaction hash

risk

object

Transaction risk level details

score

number

Transaction risk score

level

string

Transaction risk level. low, medium or high depending on the score value

resource_name

string

A resource name the transaction has been received from e.g. Bitstamp

resource_category

string

A resource category the transaction has been received from e.g. Exchange

name

string

Invoice name

description

string

Invoice description

metadata

object

Key-value data

success_redirect_url

string

URL that a customer will be redirected to upon transaction confirmation

hosted_page_url

string

Invoice hosted page that renders invoice details

created_at

string

Invoice creation date and time

expires_at

string

Invoice expiration date and time