MENU navbar-image

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
}
 

Request      

GET api/v1/{tenant}/payments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

tenant   string   

Example: omnis

Query Parameters

provider_id   string  optional  

optional The ID of the payment provider. Example: magni

order_id   string  optional  

optional The order ID associated with the payment. Example: ut

status   string  optional  

optional The status of the payment. Example: et

start_date   string  optional  

optional The start date for filtering payments. Example: quia

end_date   string  optional  

optional The end date for filtering payments. Example: praesentium

filter   string  optional  

optional Comma-separated list of fields to include in the response. Example: et

limit   integer  optional  

optional The number of items to return (max: 200). Example: 7

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"
}
 

Request      

POST api/v1/{tenant}/payments/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

tenant   string   

The tenant identifier for whom the payment is being created. Example: acme

Body Parameters

order_id   string   

The unique order ID for the payment. Example: order_id

pay_currency   string   

The cryptocurrency to be used for the payment. Example: usdterc20

amount   number   

The total amount to be paid. Example: 123

mode   integer   

Specifies the payment mode. Use 0 for direct payment and 1 for payment URL. Example: 1

currency   string   

The currency of the amount specified. Example: USD

network   string  optional  

Example: maxime

language   string   

The language preference for the payment process. Example: en

ttl   integer   

The time-to-live in minutes for this payment request. Example: 60

fee   number  optional  

Must be at least 0. Example: 42

order_description   string  optional  

optional A brief description of the order. Example: Description

success_url   string  optional  

optional A valid URL where the user is redirected after successful payment. Example: https://www.google.com

cancel_url   string  optional  

optional A valid URL where the user is redirected if the payment is cancelled. Example: http://www.google.com

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).