Skip to main content
POST /api/v2/invoices/create HTTP/1.1
Host: app.alphapo.net
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]"
}
{
  "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
  }
}
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. 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.

Authorizations

X-processing-key
string
header
required

Your API key.

X-processing-signature
string
header
required

The request body, signed with HMAC-SHA512 with your secret key. You can find the secret key in your account.

Body

application/json
timer
boolean
required

If this parameter is set to true, the invoice will expire in 15 minutes after it is created.

title
string
required

Invoice title that the customer will see.

Required string length: 1 - 50
foreign_id
string
required

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

Maximum string length: 255
currency
string
required

Currency you want to receive deposits in. For a list of all available currencies, see Supported currencies.

amount
number
required

Invoice amount that you want to receive from the customer.

url_success
string<uri>
required

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

url_failed
string<uri>
required

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

email_user
string<email>
required

If the amount the customer pays does not match the amount you set for the invoice, AlphaPo 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.

type
enum<string>

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

Available options:
fill_or_kill,
good_until_expired
end_user_reference
string

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.

description
string

Invoice description that the customer will see.

Maximum string length: 1000
sender_currency
string

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.

Response

OK

data
object