Plasma
Search…
Crypto checkout integration API

Crypto checkout Integration Required

For your work you will need
    Create account or login on https://app.plasmapay.com
    Pass KYC verification on https://app.plasmapay.com/id/profile/identification
    Go to business dashboard on https://app.plasmapay.com/business
    Create your first crypto checkout app
    Then you can use server-to-server integration using provided API KEY. Go to API Reference Docs.

Order

1
2
ENDPOINTS:
3
4
GET 'https://app.plasmapay.com/business/crypto/api/v1/public/quote'
5
6
POST 'https://app.plasmapay.com/business/crypto/api/v1/public/orders/create'
7
8
GET 'https://app.plasmapay.com/business/crypto/api/v1/public/orders/{orderId}'
9
Copied!
Invoices are statements of amounts owed by a customer, and are either generated one-off.
They contain invoice items, and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary).
Note that finalizing the invoice, when automatic, does not happen immediately as the invoice is created. PlasmaPay would sent a webhook after success invoice payment. If you (and the platforms you may have connected to) have no webhooks configured, PlasmaPay provides an API that can be called to figure out invoice status.
PlasmaPay applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the success message was receved you should send this `API_KEY` for all your request to the server. Using an request without `API_KEY` will return an error.

GET /quote

Get a quote.

Shell
JS
1
curl
2
-X GET
3
-H "content-type: application/json"
4
-H "authorization: Bearer <API_KEY>"
5
https://app.plasmapay.com/business/crypto/api/v1/public/quote?from={FROM}&to={TO}&amount={AMOUNT}
Copied!
1
var request = require('request');
2
3
4
const options = {
5
uri: 'https://app.plasmapay.com/business/crypto/api/v1/public/quote',
6
method: 'GET',
7
headers: {
8
'content-Type': 'application/json',
9
'authorization': 'Bearer API_KEY'
10
},
11
qs: {
12
"from": "{FROM}",
13
"to": "{TO}",
14
"amount": "{AMOUNT}"
15
}
16
}
17
18
19
20
request(options, function (error, response, body) {
21
if (!error && response.statusCode === 200) {
22
// Handle body
23
}
24
});
Copied!
RESPONSE
1
200 Ok
2
Content-Type: application/json
Copied!
BODY
1
{
2
"quoteId": "{QUOTE_ID}",
3
"fiat": {
4
"amount": "{AMOUNT}",
5
"currencyCode": "{FROM}",
6
"min": "{MIN_AMOUNT}",
7
"max": "{MAX_AMOUNT}"
8
},
9
"crypto": {
10
"amount": "{CRYPTO_AMOUNT}",
11
"currencyCode": "{TO}"
12
}
13
}
Copied!
In order to get a quote from the server you must make a GET request to
GET https://app.plasmapay.com/business/crypto/api/v1/public/quote
with the apiKey as query parameter or Bearer <API_KEY> as authorization header.
Parameter
Meaning
Available values
from={FROM}
Currency code you want to sell (required)
EUR
to={TO}
Currency code you want to buy (required)
BTC
amount={AMOUNT}
Amount in a currency code FROM (required)
-
After receive the success response you can create an order by using https://app.plasmapay.com/business/crypto/api/v1/public/create api to create a new order.

POST /orders/create

Create an order by sending form via post

Shell
JS
1
curl
2
-X POST
3
-H "content-type: application/json"
4
-H "authorization: Bearer <API_KEY>"
5
https://app.plasmapay.com/business/crypto/api/v1/public/orders/create
6
-d '{"withdrawalAddress": "{WITHDRAWAL_ADDRESS}", "quoteId": "{QUOTE_ID}", "metadata": {"{KEY}": "{VALUE}"}, "merchantId": "{MERCHANT_ID}", "accountId": "{USER_ID}", "email": "{EMAIL}", "phone": "{PHONE}" }'
Copied!
1
var request = require('request');
2
3
4
const options = {
5
uri: 'https://app.plasmapay.com/business/crypto/api/v1/public/orders/create',
6
method: 'POST',
7
headers: {
8
'content-Type': 'application/json',
9
'authorization': 'Bearer API_KEY'
10
},
11
json: {
12
"withdrawalAddress": "{WITHDRAWAL_ADDRESS}",
13
"quoteId": "{QUOTE_ID}",
14
"metadata": {
15
"{KEY}": "{VALUE}"
16
},
17
"merchantId": "{MERCHANT_ID}",
18
"accountId": "{USER_ID}",
19
"email": "{EMAIL}",
20
"phone": "{PHONE}"
21
}
22
}
23
24
25
26
request(options, function (error, response, body) {
27
if (!error && response.statusCode === 200) {
28
// Handle body
29
}
30
});
Copied!
RESPONSE
1
200 Ok
2
Content-Type: application/json
Copied!
BODY
1
{
2
"id": "{ID}",
3
"status": "{STATUS}",
4
"method": "{METHOD}",
5
"fiatCurrencyCode": "{FIAT_CURRENCY_CODE}",
6
"fiatAmount": "{FIAT_AMOUNT}",
7
"cryptoCurrencyCode": "{CRYPTO_CURRENCY_CODE}",
8
"cryptoAmount": "{CRYPTO_AMOUNT}",
9
"quote": "{QUOTE}",
10
"withdrawalAddress": "{WITHDRAWAL_ADDRESS}",
11
"link": "{LINK}",
12
"createdAt": "{CREATED_AT}",
13
"updatedAt": "{UPDATED_AT}",
14
"metadata": {
15
"{KEY}": "{VALUE}"
16
},
17
"merchantId": "{MERCHANT_ID}",
18
"accountId": "{USER_ID}",
19
"email": "{EMAIL}",
20
"phone": "{PHONE}"
21
}
Copied!
In order to create a new order on the server you must make a POST request to
POST https://app.plasmapay.com/business/crypto/api/v1/public/orders/create
with the apiKey as query parameter or Bearer <API_KEY> as authorization header.
After receive response you must redirect/open user browser with {LINK}.
Parameter
Meaning
withdrawalAddress={WITHDRAWAL_ADDRESS}
string (required) Withdrawal address you want to get crypto
quoteId={QUOTE_ID}
string (required) Quote ID you have got from /quote request
method={METHOD}
string (optional) Method of payment example "credit_card"
successUri={SUCCESS_URI}
string (optional) Success URI for return user to your success page
failureUri={FAILURE_URI}
string (optional) Failure URI for return user to your failure page
merchantId={MERCHANT_ID}
string (optional) External ID / ID of your order
accountId={USER_ID}
string (optional) External user ID / ID of your user
metadata={METADATA}
string (optional) Key value storage
email={EMAIL}
string (optional) Email of a user
phone={PHONE}
string (optional) The phone number to lookup in E.164 format, which consists of a + followed by the country code and subscriber number - 12 to 24 characters

GET /orders/{orderId}

Get an order.

Shell
JS
1
curl
2
-X GET
3
-H "content-type: application/json"
4
-H "authorization: Bearer <API_KEY>"
5
https://app.plasmapay.com/business/crypto/api/v1/public/orders/{orderId}
Copied!
1
var request = require('request');
2
3
4
const options = {
5
uri: 'https://app.plasmapay.com/business/crypto/api/v1/public/orders/{orderId}',
6
method: 'GET',
7
headers: {
8
'content-Type': 'application/json',
9
'authorization': 'Bearer API_KEY'
10
},
11
json: true
12
}
13
14
15
16
request(options, function (error, response, body) {
17
if (!error && response.statusCode === 200) {
18
// Handle body
19
}
20
});
Copied!
RESPONSE
1
200 Ok
2
Content-Type: application/json
Copied!
BODY
1
{
2
"id": "{ID}",
3
"status": "{STATUS}",
4
"method": "{METHOD}",
5
"fiatCurrencyCode": "{FIAT_CURRENCY_CODE}",
6
"fiatAmount": "{FIAT_AMOUNT}",
7
"cryptoCurrencyCode": "{CRYPTO_CURRENCY_CODE}",
8
"cryptoAmount": "{CRYPTO_AMOUNT}",
9
"quote": "{QUOTE}",
10
"withdrawalAddress": "{WITHDRAWAL_ADDRESS}",
11
"link": "{LINK}",
12
"createdAt": "{CREATED_AT}",
13
"updatedAt": "{UPDATED_AT}",
14
"metadata": {
15
"{KEY}": "{VALUE}"
16
},
17
"merchantId": "{MERCHANT_ID}",
18
"accountId": "{USER_ID}",
19
"email": "{EMAIL}",
20
"phone": "{PHONE}"
21
}
Copied!
In order to get a quote from the server you must make a GET request to
GET https://app.plasmapay.com/business/crypto/api/v1/public/orders/{orderId}
with the apiKey as query parameter or Bearer <API_KEY> as authorization header.

Status codes

The PlasmaPay API uses the following error codes:
Code
Meaning
200
OK Successful request
201
Created New object saved
204
No content Object deleted
Code
Meaning
400
Bad Request -- You have passed a malformed request
401
Unauthorized -- Your API key is incorrect
403
Forbidden -- The resource requested is not available with your permissions
404
Not Found -- The specified resource could not be found
422
Unprocurable Entity -- Your request is invalid
500
Internal Server Error -- We had a problem with our server. Try again later
503
Service Unavailable (Time out) -- The server is overloaded or down for maintenance
Last modified 1yr ago