Create Wallet
POST /wallet/create
Create a new wallet with your preferred currency and label.
Headers
Name
Value
Content-Type
application/json
X-API-KEY
<token>
Body
Name
Type
Description
label*
string
Label of wallet
postback_url
string
Destination URL for sending post
Response
{
"id": 0,
"label": "string",
"postback_url": "http://example.com",
"currency": "string",
"address": "string",
"created_at": "2019-08-24T14:15:22Z",
"expires_at": "2019-09-24T14:15:22Z",
}{
"detail": "Currency does not exist"
}{
"detail": "Max length of label is 255 characters"
}{
"detail": "Max length of postback_url is 255 characters"
}{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string"
}
]
}Example
curl -X POST "https://api.nord-pay.com/wallet/create" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"currency": "USDTBEP20",
"label": "Order #123",
"postback_url": "https://example.com/postback"
}'import requests
def create_wallet(currency, label, postback_url=None):
url = "https://api.nord-pay.com/wallet/create"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
payload = {
"currency": currency,
"label": label
}
if postback_url:
payload["postback_url"] = postback_url
resp = requests.post(url, json=payload, headers=headers)
resp.raise_for_status()
return resp.json()
# usage:
wallet = create_wallet(
currency="USDTBEP20",
label="Order #123",
postback_url="https://example.com/postback"
)<?php
function createWallet(
string $currency,
string $label,
string $postbackUrl = null
): array {
$url = "https://api.nord-pay.com/wallet/create";
$payload = [
"currency" => $currency,
"label" => $label
];
if ($postbackUrl) {
$payload["postback_url"] = $postbackUrl;
}
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: YOUR_API_KEY"
],
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// usage:
$wallet = createWallet(
"USDTBEP20",
"Order #123",
"https://example.com/postback"
);async function createWallet({ currency, label, postback_url }) {
const response = await fetch("https://api.nord-pay.com/wallet/create", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
},
body: JSON.stringify({
currency,
label,
...(postback_url && { postback_url })
})
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
}
// usage:
createWallet({
currency: "USDTBEP20",
label: "Order #123",
postback_url: "https://example.com/postback"
}).then(wallet => {
// work with wallet
});const axios = require('axios');
async function createWallet({ currency, label, postback_url }) {
const { data } = await axios.post(
"https://api.nord-pay.com/wallet/create",
{
currency,
label,
...(postback_url && { postback_url })
},
{
headers: {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
}
);
return data;
}
// usage:
createWallet({
currency: "USDTBEP20",
label: "Order #123",
postback_url: "https://example.com/postback"
}).then(wallet => {
// work with wallet
});Last updated