Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
Endpoints
Retrieves a paginated list of payments for a tenant.
Example request:
curl --request GET \
--get "https://staging-crypto.theaggregator.wtf//api/v1/foo/payments?provider_id=magni&order_id=ut&status=et&start_date=quia&end_date=praesentium&filter=et&limit=7" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging-crypto.theaggregator.wtf//api/v1/foo/payments"
);
const params = {
"provider_id": "magni",
"order_id": "ut",
"status": "et",
"start_date": "quia",
"end_date": "praesentium",
"filter": "et",
"limit": "7",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200, success):
{
"current_page": 1,
"data": [
{
"id": "9b57fd7f-9284-4224-ac43-fddb26e745a5",
"provider_id": "nowpayments",
"order_id": "optional_order_id",
"currency": "usd",
"network": "btc",
"external_id": "4637891210",
"amount": 12481,
"paid_amount": 0,
"payout_address": "38eLpSQspZ81ZvDEkfwdb7gHb4iixRvyBX",
"status": 0,
"description": null,
"callback_url": null,
"invoice_url": "address",
"success_url": null,
"cancel_url": null
}
],
"first_page_url": "https://staging-crypto.theaggregator.wtf//api/v1/foo/payments?page=1",
"from": 1,
"next_page_url": null,
"path": "https://staging-crypto.theaggregator.wtf//api/v1/foo/payments",
"per_page": 15,
"prev_page_url": null,
"to": 1
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create a payment
This endpoint allows you to create a new payment. Depending on the mode, it returns either a payment address or a payment URL. Below is an example of the request body you would send for creating a new payment:
Example request:
curl --request POST \
"https://staging-crypto.theaggregator.wtf//api/v1/acme/payments/create" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"order_id\": \"order_id\",
\"pay_currency\": \"usdterc20\",
\"amount\": 123,
\"mode\": 1,
\"currency\": \"USD\",
\"network\": \"maxime\",
\"language\": \"en\",
\"ttl\": 60,
\"fee\": 42,
\"order_description\": \"Description\",
\"success_url\": \"https:\\/\\/www.google.com\",
\"cancel_url\": \"http:\\/\\/www.google.com\"
}"
const url = new URL(
"https://staging-crypto.theaggregator.wtf//api/v1/acme/payments/create"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"order_id": "order_id",
"pay_currency": "usdterc20",
"amount": 123,
"mode": 1,
"currency": "USD",
"network": "maxime",
"language": "en",
"ttl": 60,
"fee": 42,
"order_description": "Description",
"success_url": "https:\/\/www.google.com",
"cancel_url": "http:\/\/www.google.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200, mode 0):
200 {
"paymentId": "9b57fd7f-9284-4224-ac43-fddb26e745a5",
"paymentAddress": "38hSRQHgjY7PWH7Q2KeDFkF8bjXmf7DtpY"
}
Example response (200, mode 1):
200 {
"paymentId": "9b57fd7f-9284-4224-ac43-fddb26e745a5",
"url": "https://sandbox.nowpayments.io/payment/?iid=4983894114"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
paymentId
The unique identifier of the payment.
paymentAddress
The address to send the payment to (mode 0).
url
The URL to complete the payment (mode 1).