Создать инвойс
curl --request POST \
--url https://sand.tranzor.io/api/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10.5,
"currency": "USD",
"description": "Заказ #1234",
"orderId": "order-1234",
"metadata": "{\"userId\": 42}"
}
'import requests
url = "https://sand.tranzor.io/api/v1/invoices"
payload = {
"amount": 10.5,
"currency": "USD",
"description": "Заказ #1234",
"orderId": "order-1234",
"metadata": "{\"userId\": 42}"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10.5,
currency: 'USD',
description: 'Заказ #1234',
orderId: 'order-1234',
metadata: '{"userId": 42}'
})
};
fetch('https://sand.tranzor.io/api/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sand.tranzor.io/api/v1/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 10.5,
'currency' => 'USD',
'description' => 'Заказ #1234',
'orderId' => 'order-1234',
'metadata' => '{"userId": 42}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sand.tranzor.io/api/v1/invoices"
payload := strings.NewReader("{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sand.tranzor.io/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sand.tranzor.io/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"invoiceId": "<string>",
"payUrl": "<string>",
"status": "PENDING",
"amount": 10.5,
"currency": "USD",
"orderId": "<string>",
"addresses": [
{
"chain": "ethereum",
"address": "0x...",
"expectedAmount": "<string>",
"isToken": true,
"tokenSymbol": "USDT"
}
],
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "Invalid API key"
}{
"success": false,
"error": "Internal server error"
}Инвойсы
Создать инвойс
Создаёт новый платёжный инвойс. Возвращает адреса для оплаты и ссылку на страницу оплаты.
POST
/
api
/
v1
/
invoices
Создать инвойс
curl --request POST \
--url https://sand.tranzor.io/api/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10.5,
"currency": "USD",
"description": "Заказ #1234",
"orderId": "order-1234",
"metadata": "{\"userId\": 42}"
}
'import requests
url = "https://sand.tranzor.io/api/v1/invoices"
payload = {
"amount": 10.5,
"currency": "USD",
"description": "Заказ #1234",
"orderId": "order-1234",
"metadata": "{\"userId\": 42}"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10.5,
currency: 'USD',
description: 'Заказ #1234',
orderId: 'order-1234',
metadata: '{"userId": 42}'
})
};
fetch('https://sand.tranzor.io/api/v1/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sand.tranzor.io/api/v1/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 10.5,
'currency' => 'USD',
'description' => 'Заказ #1234',
'orderId' => 'order-1234',
'metadata' => '{"userId": 42}'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sand.tranzor.io/api/v1/invoices"
payload := strings.NewReader("{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sand.tranzor.io/api/v1/invoices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sand.tranzor.io/api/v1/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10.5,\n \"currency\": \"USD\",\n \"description\": \"Заказ #1234\",\n \"orderId\": \"order-1234\",\n \"metadata\": \"{\\\"userId\\\": 42}\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"invoiceId": "<string>",
"payUrl": "<string>",
"status": "PENDING",
"amount": 10.5,
"currency": "USD",
"orderId": "<string>",
"addresses": [
{
"chain": "ethereum",
"address": "0x...",
"expectedAmount": "<string>",
"isToken": true,
"tokenSymbol": "USDT"
}
],
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "Invalid API key"
}{
"success": false,
"error": "Internal server error"
}Authorizations
BearerAuthHmacAuth
API ключ в формате trz_...
Body
application/json
Сумма в USD
Required range:
0.01 <= x <= 1000000Available options:
USD Описание платежа
Maximum string length:
500Ваш ID заказа (уникальный)
Maximum string length:
200Произвольные данные
Maximum string length:
2000⌘I