Shell Python

Introduction

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Accept crypto payments. Personal and business wallet - all in one.

The UseGateway API provides a simple and powerful REST API to integrate Bitcoin, Ethereum, Litecoin, Tron, TON, Binance Smart Chain, Polygon, Optimism, USDT, TRC-20/ERC-20/BEP-20 Tokens payments into your business or application. This API reference provides information on available endpoints and how to interact with them.

Authentication

Authorized request example

# You can also use wget
curl -X GET https://api.usegateway.net/v1/payments/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/payments/', headers = headers)

print(r.json())

Most requests to the UseGateway API must be authenticated with an API key. You can create an API key in your Settings page after creating an UseGateway account.

Authenticated API requests should be made with a x-api-key header. Your secret API key should be passed as the value.

If authentication fails, a JSON object with an error message will be returned as a response along with HTTP status 401.

Versioning

The URLs for the various resources use the following pattern:

https://api.usegateway.net/v{version}/{operation-specific component}

The components of the URL are:

version - the API version. Currently there is only one version, "1", in operation operation-specific component - this identifies the actual operation you want to do, eg /payments for getting a list of payments

Thus the URL getting a list of the orders for the authenticated user is https://api.usegateway.net/v1/payments

Rate Limits

Our API enforces rate limits to ensure fair usage and prevent abuse. The rate limits are based on the number of requests per minute and vary depending on the endpoint. If you exceed the rate limit, you will receive a 429 Too Many Requests response.

Rate Limiting Strategies

To avoid hitting the rate limit, we recommend the following strategies:

If you require a higher rate limit or have any questions about our rate limiting policies, please contact us at [email protected].

Pagination

All GET endpoints which return an object list support cursor based pagination with pagination information inside a pagination object. Use parameter page and limit to configure pagination. Default limit is set to 50 but values up to 100 are permitted.

Example responses

200 Response

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "crypto",
      "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
      "value": {
        "amount": 10,
        "currency": "USDT_TRC20"
      },
      "comment": "tg: @username",
      "withdrawal": null,
      "timeline": [
        {
          "status": "Received",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Declined",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Parameters

Name Description
total Total objects in query
page Page of query
size Number of results per call. Accepted values: 0 - 100. Default 50

Errors

All error messages include a type identifier and a human readable message. validation_error with status code 400 is returned when the validation of the resource fails on POST or PUT/PATCH requests. Response contains errors field with a list of errors.

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The object requested is hidden for administrators only.
404 Not Found -- The specified object could not be found.
405 Method Not Allowed -- You tried to access a object with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The object requested has been removed from our servers.
422 Validation Error -- Your request data or params are invalid.
429 Too Many Requests -- You're requesting too many objects! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
502 Bad Gateway -- The server received an invalid response from an upstream server. Please try again later.
503 Service Unavailable -- Please try again later.
509 Maintenance -- We're temporarily offline for maintenance.

Webhooks

Webhooks make it easier to integrate with UseGateway by allowing you to subscribe to a set of events. You can subscribe to the events by going to your settings page and adding a new webhook subscription. When you create a new subscription, you can specify what events you would like to receive updates for.

Example of a webhook payload

{
    "event": "payment.completed",
    "created_at": "2022-07-31T20:50:02Z",
    "data": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "payment",
      "code": "YJM5BAID",
      "name": "Product",
      "description": "The best Product",
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
      "redirect_url": "https://example.com",
      "cancel_url": "https://example.com",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "confirmed_at": null,
      "timeline": [
        {
          "status": "Opened",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "pricing_type": "fixed_price",
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "exchange_rates": {
        "BTC-USD": 63518.66790770726,
        "LTC-USD": 79.19978496955301,
        "TRX-USD": 0.11165933035111154,
        "USDT_TRC20-USD": 0.9999728001379997
      },
      "pricing": {
        "tron": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        },
        "bitcoin": {
          "amount": 0.00043344,
          currency": "BTC"
        },
        "litecoin": {
          "amount": 0.16979439,
          "currency": "LTC"
        },
        "usdt_trc20": {
          "amount": 10.004165,
          "currency": "USDT_TRC20"
        }
      },
      "transactions": [],
      "payment_threshold": {
        "overpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "overpayment_relative_threshold": 0.05,
        "underpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "underpayment_relative_threshold": 0.05
      }
   }
}

Events

Event Description
payment.created New payment is created
payment.completed Transaction has been confirmed and the associated payment is completed
payment.expired Payment has been expired
payment.unresolved Payment had some problems
payment.resolved Payment has been resolved
payment.closed Payment has been closed
invoice.created New invoice is created
invoice.viewed Invoice has been viewed
invoice.expired Invoice has been expired
invoice.renewed Invoice has been renewed and recalculated
invoice.paid Transaction has been confirmed and the associated invoice is paid
invoice.unresolved Invoice had some problems
invoice.resolved Invoice has been resolved
invoice.closed Invoice has been closed
deposit.created New deposit is created
deposit.replenished Transaction has been confirmed and the deposit was replenished
deposit.unresolved Underpaid replenishment
deposit.resolved Deposit has been resolved
deposit.closed Deposit has been closed
h2h.created New H2H is created
h2h.replenished Transaction has been confirmed and the H2H was replenished
transaction.refunded Transaction has been refunded
withdrawal.completed Withdrawal has been completed
withdrawal_request.created New withdrawal request is created
withdrawal_request.approved Withdrawal request has been paid and approved
withdrawal_request.declined Withdrawal request has been declined

Fields

Field Type Description
event WebhookEvent Webhook event
created_at timestamp Delivery time
data object Corresponding resource object

Securing Webhooks

Because of the way webhooks work, attackers can impersonate services by simply sending a fake webhook to an endpoint. Think about it: it's just an HTTP POST from an unknown source. This is a potential security hole for many applications, or at the very least, a source of problems.

In order to prevent it, UseGateway signs every webhook and its metadata with a unique key for each endpoint. This signature can then be used to verify the webhook indeed comes from UseGateway, and only process it if it is.

Verifying Webhook with the Svix Libraries

First install the libraries if you haven't already:

# Install cURL. E.g. on arch linux:
pacman -S curl
pip install svix

The payload is the raw (string) body of the request, and the headers are the headers passed in the request.

Then verify webhooks using the code below.

No easy way to verify the signature just with cURL.
from svix.webhooks import Webhook

secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw"

# These were all sent from the server
headers = {
  "svix-id": "msg_p5jXN8AQM9LWM0D4loKWxJek",
  "svix-timestamp": "1614265330",
  "svix-signature": "v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=",
}
payload = '{"test": 2432232314}'

wh = Webhook(secret)
# Throws on error, returns the verified content on success
payload = wh.verify(payload, headers)

Verifying Webhook manually

Each webhook call includes three headers with additional information that are used for verification:

Constructing the signed content The content to sign is composed by concatenating the id, timestamp and payload, separated by the full-stop character ..

In code, it will look something like:

signed_content = "${svix_id}.${svix_timestamp}.${body}"

Where body is the raw body of the request. The signature is sensitive to any changes, so even a small change in the body will cause the signature to be completely different. This means that you should not change the body in any way before verifying.

Determining the expected signature

UseGateway uses an HMAC with SHA-256 to sign its webhooks.

So to calculate the expected signature, you should HMAC the signed_content from above using the base64 portion of your signing secret (this is the part after the whsec_ prefix) as the key. For example, given the secret whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw you will want to use MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw.

This generated signature should match one of the ones sent in the Svix-Signature header.

The Svix-Signature header is composed of a list of space delimited signatures and their corresponding version identifiers. The signature list is most commonly of length one. Though there could be any number of signatures. For example:

v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE= v1,bm9ldHUjKzFob2VudXRob2VodWUzMjRvdWVvdW9ldQo= v2,MzJsNDk4MzI0K2VvdSMjMTEjQEBAQDEyMzMzMzEyMwo=

Make sure to remove the version prefix and delimiter (e.g. v1,) before verifying the signature.

Please note that to compare the signatures it's recommended to use a constant-time string comparison method in order to prevent timing attacks.

Verify timestamp

As mentioned above, UseGateway also sends the timestamp of the attempt in the Svix-Timestamp header. You should compare this timestamp against your system timestamp and make sure it's within your tolerance in order to prevent timestamp attacks.

Exchange Rates

The UseGateway API can also be used to get real-time exchange rates between any one cryptocurrency and standard (fiat) currency.

Get Exchange Rate

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/rates/{currency1}/{currency2} \
  -H 'Accept: application/json'

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('https://api.usegateway.net/v1/rates/{currency1}/{currency2}', headers = headers)

print(r.json())

GET /rates/{currency1}/{currency2}

Get the current price of the specific cryptocurrency to another supported currency that you need.

Example responses

200 Response

{
  "rate": {
    "BTC-USD": 31234.4262
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response RateResponseSchema
400 Bad Request Bad Request Error None
422 Unprocessable Entity Validation Error HTTPValidationError

Payments

To request a cryptocurrency payment, you create a payment. You can create and view payments. Since cryptocurrency transactions are push transactions, a payment will expire after a waiting period (payment window) if no transaction has been detected. Payments are identified by a unique code.

Statuses

Status Description
Opened Payment is opened and waiting for transaction
Completed Transaction validated by the blockchain network
Expired Payment request expired after appointed time
Unresolved Transaction confirmed but the payment diverged from what was expected
Resolved Merchant marked the payment as resolved
Closed Request cancelled -- only new unpaid payments can be cancelled

Get Payments

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/payments/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/payments/', headers = headers)

print(r.json())

GET /payments/

Returns all payments

Example responses

200 Response

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "payment",
      "code": "YJM5BAID",
      "name": "Product",
      "description": "The best Product",
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
      "redirect_url": "https://example.com",
      "cancel_url": "https://example.com",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z",
      "timeline": [
        {
          "status": "Opened",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Completed",
          "created_at": "2019-08-24T14:18:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "pricing_type": "fixed_price",
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "exchange_rates": {
        "BTC-USD": 63518.66790770726,
        "LTC-USD": 79.19978496955301,
        "TRX-USD": 0.11165933035111154,
        "USDT_TRC20-USD": 0.9999728001379997
      },
      "pricing": {
        "tron": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        },
        "bitcoin": {
          "amount": 0.00043344,
          "currency": "BTC"
        },
        "litecoin": {
          "amount": 0.16979439,
          "currency": "LTC"
        },
        "usdt_trc20": {
          "amount": 10.004165,
          "currency": "USDT_TRC20"
        }
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 145.622008,
              "currency": "TRX"
            },
            "local": {
              "amount": 10,
              "currency": "USD"
            }
          },
          "detected_at": "2019-08-24T14:18:22Z",
          "confirmed_at": "2019-08-24T14:18:22Z"
        }
      ],
      "payment_threshold": {
        "overpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "overpayment_relative_threshold": 0.05,
        "underpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "underpayment_relative_threshold": 0.05
      }
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_PaymentResponseSchema_

Create Payment

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/payments/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "name": "Product",
    "description": "The best Product",
    "pricing_type": "fixed_price",
    "local_price": {
      "amount": 10,
      "currency": "USD"
    },
    "metadata": {
      "user_id": 123
    },
    "redirect_url": "https://example.com",
    "cancel_url": "https://example.com"
  }'

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
data = {
  "name": "Product",
  "description": "The best Product",
  "pricing_type": "fixed_price",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 123
  },
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com"
}

r = requests.post('https://api.usegateway.net/v1/payments/', headers=headers, json=data)

print(r.json())

POST /payments/

Body parameter

{
  "name": "Product",
  "description": "The best Product",
  "pricing_type": "fixed_price",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 123
  },
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com"
}

To get paid in cryptocurrency, you need to create a payment object and provide the user with a cryptocurrency address to which they must send cryptocurrency. Once a payment is created a customer must broadcast a transaction to the blockchain before the payment expires.

Parameters

Name Type Required Description
name string (255) true Payment name
description string (255) false More detailed description of the payment
pricing_type PricingType true Payment pricing type
local_price PaymentPricePayloadSchema true Price in local fiat currency
metadata object false Developer defined key value pairs
redirect_url string(uri) false Redirect URL after successful payment
cancel_url string(uri) false Redirect URL after cancelled payment

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "payment",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": null,
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "pricing_type": "fixed_price",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
201 Created Successful Response PaymentResponseSchema
422 Unprocessable Entity Validation Error HTTPValidationError

Show Payment

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/payments/{id}/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/payments/{id}/', headers = headers)

print(r.json())

GET /payments/{id}/

Retrieves the details of a payment that has been previously created. Supply the unique payment code that was returned when the payment was created. This information is also returned when a payment is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "payment",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:18:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Completed",
      "created_at": "2019-08-24T14:18:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "pricing_type": "fixed_price",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response PaymentResponseSchema
404 Not Found Not Found Error None

Cancel Payment

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/payments/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/payments/{id}/cancel', headers = headers)

print(r.json())

PATCH /payments/{id}/cancel

Cancels a payment that has been previously created. Supply the unique payment code that was returned when the payment was created.

Note: Only new payments can be successfully canceled. Once transaction is detected, payment can no longer be canceled.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "payment",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": null,
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Closed",
      "created_at": "2019-08-24T14:16:28Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "pricing_type": "fixed_price",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response PaymentResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

Resolve Payment

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/payments/{id}/resolve \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/payments/{id}/resolve', headers = headers)

print(r.json())

PATCH /payments/{id}/resolve

Resolve a payment that has been previously marked as unresolved. Supply the unique payment code that was returned when the payment was created.

Note: Only unresolved payments can be successfully resolved. For more on unresolved payments, visit the Payment section of this reference.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "payment",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:18:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Unresolved (Underpaid)",
      "created_at": "2019-08-24T14:18:22Z"
    },
    {
      "status": "Resolved",
      "created_at": "2019-08-24T14:22:22Z"
    },
  ],
  "metadata": {
    "user_id": 123
  },
  "pricing_type": "fixed_price",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 14.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 1,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response PaymentResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

Invoices

The invoicing feature lets you easily request crypto payments from your customers. You can manage your payments, track your invoice status, and review your transaction history all in one place.

Statuses

Status Description
Created Invoice is created and waiting to be viewed by a customer
Viewed Invoice was viewed and the payment timer was initiated
Expired Invoice expired after appointed time
Renewed Invoice was renewed and recalculated
Paid Invoice was successfully paid
Unresolved Transaction confirmed but the payment diverged from what was expected
Resolved Merchant marked the invoice as resolved
Closed Request cancelled -- only new unpaid invoices can be cancelled

Get Invoices

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/invoices/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/invoices/', headers = headers)

print(r.json())

GET /invoices/

Get all invoices for the user

Example responses

200 Response

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "invoice",
      "code": "YJM5BAID",
      "name": "Product",
      "description": "The best Product",
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "hosted_url": "https://pay.usegateway.net/invoices/YJM5BAID",
      "redirect_url": "https://example.com",
      "cancel_url": "https://example.com",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z",
      "timeline": [
        {
          "status": "Opened",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Viewed",
          "created_at": "2019-08-24T14:18:22Z"
        },
        {
          "status": "Paid",
          "created_at": "2019-08-24T14:23:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "exchange_rates": {
        "BTC-USD": 63518.66790770726,
        "LTC-USD": 79.19978496955301,
        "TRX-USD": 0.11165933035111154,
        "USDT_TRC20-USD": 0.9999728001379997
      },
      "pricing": {
        "tron": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        },
        "bitcoin": {
          "amount": 0.00043344,
          "currency": "BTC"
        },
        "litecoin": {
          "amount": 0.16979439,
          "currency": "LTC"
        },
        "usdt_trc20": {
          "amount": 10.004165,
          "currency": "USDT_TRC20"
        }
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 145.622008,
              "currency": "TRX"
            },
            "local": {
              "amount": 10,
              "currency": "USD"
            }
          },
          "detected_at": "2019-08-24T14:18:22Z",
          "confirmed_at": "2019-08-24T14:18:22Z"
        }
      ],
      "payment_threshold": {
        "overpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "overpayment_relative_threshold": 0.05,
        "underpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "underpayment_relative_threshold": 0.05
      }
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_InvoiceResponseSchema_

Create Invoice

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/invoices/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "name": "Product",
    "description": "The best Product",
      "amount": 10,
      "currency": "USD"
    },
    "metadata": {
      "user_id": 123
    },
    "redirect_url": "https://example.com",
    "cancel_url": "https://example.com"
  }'

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
data = {
  "name": "Product",
  "description": "The best Product",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 123
  },
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com"
}

r = requests.post('https://api.usegateway.net/v1/invoices/', headers=headers, json=data)

print(r.json())

POST /invoices/

Body parameter

{
  "name": "Product",
  "description": "The best Product",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 123
  },
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com"
}

To send an invoice in cryptocurrency, you need to create an invoice object and provide the user with the hosted url where they will be able to pay. Once an invoice is viewed at the hosted url, a timer to pay will be started.

Parameters

Name Type Required Description
name string (255) true Invoice name
description string (255) false More detailed description of the invoice
local_price InvoicePricePayloadSchema true Price in local fiat currency
metadata object false Developer defined key value pairs
redirect_url string(uri) false Redirect URL after successful invoice
cancel_url string(uri) false Redirect URL after cancelled invoice

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "invoice",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/invoices/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": null,
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
201 Created Successful Response InvoiceResponseSchema
422 Unprocessable Entity Validation Error HTTPValidationError

Show Invoice

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/invoices/{id}/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/invoices/{id}/', headers = headers)

print(r.json())

GET /invoices/{id}/

Retrieves the details of an invoice that has been previously created. Supply the unique short code that was returned when the invoice was created. This information is also returned when an invoice is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "invoice",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/invoices/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:18:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Viewed",
      "created_at": "2019-08-24T14:18:22Z"
    },
    {
      "status": "Paid",
      "created_at": "2019-08-24T14:23:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response InvoiceResponseSchema
404 Not Found Not Found Error None

Cancel Invoice

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/invoices/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/invoices/{id}/cancel', headers = headers)

print(r.json())

PATCH /invoices/{id}/cancel

Voids an invoice that has been previously created. Supply the unique invoice code that was returned when the invoice was created.

Note: Only invoices with OPEN or VIEWED status can be voided. Once a payment is detected, the invoice can no longer be voided.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "invoice",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": null,
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Closed",
      "created_at": "2019-08-24T14:16:28Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response InvoiceResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

Resolve Invoice

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/invoices/{id}/resolve \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/invoices/{id}/resolve', headers = headers)

print(r.json())

PATCH /invoices/{id}/resolve

Resolve an invoice that has been previously marked as unresolved. Supply the unique invoice code that was returned when the invoice was created.

Note: Only invoices with an unresolved charge can be successfully resolved.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "invoice",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:18:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Unresolved (Underpaid)",
      "created_at": "2019-08-24T14:18:22Z"
    },
    {
      "status": "Resolved",
      "created_at": "2019-08-24T14:22:22Z"
    },
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 14.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 1,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response InvoiceResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

Deposits

Deposits make it possible to have a permanent payment addresses associated with specified user_id and site to accept any transaction, that is not lower than minimal available amount. Deposits can have many transactions and each transaction is a replenishment. Deposits can also be quickly integrated into a website by associating with any ID in website system. Each deposit has a publicly accessible hosted page that can be shared with anyone.

Statuses

Status Description
Created Deposit is created and waiting for transaction
Replenished Deposit was replenished by a confirmed transaction
Unresolved Transaction confirmed but was less than the minimal replenishment amount
Resolved Merchant marked the deposit as resolved
Closed Request cancelled -- only new unpaid deposits can be cancelled

Get Deposits

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/deposits/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/deposits/', headers = headers)

print(r.json())

GET /deposits/

Get all deposits for the user.

Example responses

200 Response

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "deposit",
      "code": "YJM5BAID",
      "user_id": "UserEmail or UserID or UserPhone",
      "site": "example.com",
      "name": "Deposit",
      "description": "Deposit of User123",
      "local_currency": "USD",
      "default_cryptocurrency": "BTC",
      "local_price": {
        "amount": 10,
        "currency": "USD"
      },
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "redirect_url": "https://google.com",
      "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
      "created_at": "2019-08-24T14:15:22Z",
      "timeline": [
        {
          "status": "Created",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Replenished",
          "created_at": "2019-08-24T14:18:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 140,
              "currency": "TRX"
            },
            "local": {
              "amount": 10,
              "currency": "USD"
            },
          },
          "detected_at": "2019-08-24T14:18:22Z",
          "confirmed_at": "2019-08-24T14:18:22Z"
        }
      ]
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_DepositResponseSchema_

Create Deposit

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/deposits/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "site": "example.com",
    "name": "Deposit",
    "description": "Deposit of User123",
    "local_price": {
      "amount": 10,
      "currency": "USD"
    },
    "redirect_url": "https://google.com",
    "metadata": {
      "email": "[email protected]"
    }
  }'

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
data = {
  "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "email": "[email protected]"
  }
}

r = requests.post('https://api.usegateway.net/v1/deposits/', headers=headers, json=data)

print(r.json())

POST /deposits/

Deposits allow you to create payment addresses that are associated with a specific user_id and site, and can accept multiple transactions.

Data parameter

{
  "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "redirect_url": "https://google.com",
  "metadata": {
    "email": "[email protected]"
  }
}

Parameters

Name Type Required Description
user_id string (255) true Any user identifier
site string (255) true Site name
name string (255) false Deposit name
description string (255) false More detailed description of the deposit
local_price PaymentPricePayloadSchema false Price in local fiat currency
redirect_url string(uri) false Redirect URL
metadata object false Developer defined key value pairs

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "deposit",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_currency": "USD",
  "default_cryptocurrency": "BTC",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",  
  "redirect_url": "https://google.com",
  "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "transactions": []
}

Responses

Status Meaning Description Schema
201 Created Successful Response DepositResponseSchema
422 Unprocessable Entity Validation Error HTTPValidationError

Show Deposit

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/deposits/{id}/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/deposits/{id}/', headers = headers)

print(r.json())

GET /deposits/{id}/

Retrieves the details of a deposit that has been previously created. Supply the unique deposit code that was returned when the deposit was created. This information is also returned when a deposit is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "deposit",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_currency": "USD",
  "default_cryptocurrency": "BTC",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "redirect_url": "https://google.com",
  "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Replenished",
      "created_at": "2019-08-24T14:18:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response DepositResponseSchema
404 Not Found Not Found Error None

Resolve Deposit

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/deposits/{id}/resolve \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/deposits/{id}/resolve', headers = headers)

print(r.json())

PATCH /deposits/{id}/resolve

Resolve a deposit that has been previously marked as unresolved. Supply the unique deposit code that was returned when the deposit was created.

Note: Only unresolved deposits can be successfully resolved.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "deposit",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_currency": "USD",
  "default_cryptocurrency": "BTC",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "redirect_url": "https://google.com",
  "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Unresolved (Underpaid)",
      "created_at": "2019-08-24T14:18:22Z"
    },
    {
      "status": "Resolved",
      "created_at": "2019-08-24T14:22:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 14.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 1,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:18:22Z",
      "confirmed_at": "2019-08-24T14:18:22Z"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful Response DepositResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

Cancel Deposit

Code samples

# You can also use wget
curl -X PATCH https://api.usegateway.net/v1/deposits/{id}/cancel \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.patch('https://api.usegateway.net/v1/deposits/{id}/cancel', headers = headers)

print(r.json())

PATCH /deposits/{id}/cancel

Cancels a deposit that has been previously created. Supply the unique deposit code that was returned when the deposit was created.

Note: You can cancel any deposit. After a deposit is canceled, it will not be available for payment.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "deposit",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_currency": "USD",
  "default_cryptocurrency": "BTC",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "redirect_url": "https://google.com",
  "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Closed",
      "created_at": "2019-08-24T14:18:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "transactions": []
}

Responses

Status Meaning Description Schema
200 OK Successful Response DepositResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None

H2H (Host-To-Host)

The H2H (Host to Host) API enables partners to seamlessly integrate wallet functionalities into their system, allowing end-users to create and manage individual wallets, accept payments, check balances, and initiate withdrawals. This API is designed to provide a secure and straightforward way to handle financial transactions while maintaining a high level of user autonomy within the partner's environment.

Statuses

Status Description
Created H2H is created and waiting for transaction
Replenished H2H was replenished by a confirmed transaction

Create H2H

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/h2h/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "H2H",
    "description": "H2H of User123",
    "metadata": {
      "email": "[email protected]"
    }
  }'

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
data = {
  "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "H2H",
  "description": "H2H of User123",
  "metadata": {
    "email": "[email protected]"
  }
}

r = requests.post('https://api.usegateway.net/v1/h2h/', headers=headers, json=data)

print(r.json())

POST /h2h/

H2H allow you to create payment addresses that are associated with a specific user_id and site, and can accept multiple transactions.

Data parameter

{
  "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name": "H2H",
  "description": "H2H of User123",
  "metadata": {
    "email": "[email protected]"
  }
}

Parameters

Name Type Required Description
user_id string (255) true Any user identifier
name string (255) false H2H name
description string (255) false More detailed description of the h2h
metadata object false Developer defined key value pairs

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "h2h",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "name": "H2H",
  "description": "H2H of User123",
  "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  }
}

Responses

Status Meaning Description Schema
201 Created Successful Response H2HResponseSchema
422 Unprocessable Entity Validation Error HTTPValidationError

Show H2H by user_id

Code samples

# You can also use wget
curl -X GET 'https://api.usegateway.net/v1/h2h/check?user_id=test' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
params = {
  'user_id': 'test',
}

r = requests.get('https://api.usegateway.net/v1/h2h/check', headers = headers, params = params)

print(r.json())

GET /h2h/check

Retrieves the details of a H2H that has been previously created. Supply the unique deposit code that was returned when the deposit was created. This information is also returned when a deposit is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "code": "YJM5BAID",
}

Responses

Status Meaning Description Schema
200 OK Successful Response H2HResponseSchema
404 Not Found Not Found Error None

Delete H2H

Code samples

# You can also use wget
curl -X DELETE 'https://api.usegateway.net/v1/h2h/delete?user_id=test' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
params = {
  'user_id': 'test',
}

r = requests.delete('https://api.usegateway.net/v1/h2h/delete', headers = headers, params = params)

print(r.json())

DELETE /h2h/delete

Deletes existing H2H

Example responses

204 Response

Responses

Status Meaning Description Schema
204 No Content No Content None
404 Not Found Not Found Error None

Get H2H ApiKey

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/h2h/{id}/apikey/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco"
  }'

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
}
data = {
   "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco"
}

r = requests.post('https://api.usegateway.net/v1/h2h/{id}/apikey/', headers=headers, json=data)

print(r.json())

POST /h2h/{id}/apikey/

Checks seed for H2H, returns H2H's apikey.

Data parameter

{
  "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco"
}

Parameters

Name Type Required Description
seed string (255) true H2H seed phrase

Example responses

200 Response

{
  "key": "7714a58a6649d1b24179938a2b1ac0d5"
}

Responses

Status Meaning Description Schema
200 OK Successful Response ApiKeyResponceSchema
404 Not Found Not Found Error None

Show H2H

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/', headers = headers)

print(r.json())

GET /h2h/{id}/

Retrieves the details of a H2H that has been previously created. Supply the unique deposit code that was returned when the deposit was created. This information is also returned when a deposit is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "h2h",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "name": "H2H",
  "description": "H2H of User123",
  "seed": None,
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response H2HResponseSchema
404 Not Found Not Found Error None

Show H2H Balance

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/balance \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/balance', headers = headers)

print(r.json())

GET /h2h/{id}/balance

Gets balance of the H2H

Example responses

200 Response

{
  "TBTC": {
    "value": 0,
    "local": 0
  },
  "BCH": {
    "value": 0,
    "local": 0
  },
  "ETH": {
    "value": 0,
    "local": 0
  },
  "BNB": {
    "value": 0,
    "local": 0
  },
  "OPBNB": {
    "value": 0,
    "local": 0
  },
  "LTC": {
    "value": 0,
    "local": 0
  },
  "USDT_TRC20": {
    "value": 0,
    "local": 0
  },
  "USDC_TRC20": {
    "value": 0,
    "local": 0
  },
  "USDT_ERC20": {
    "value": 0,
    "local": 0
  },
  "USDC_ERC20": {
    "value": 0,
    "local": 0
  },
  "USDT_BEP20": {
    "value": 0,
    "local": 0
  },
  "USDC_BEP20": {
    "value": 0,
    "local": 0
  },
  "DAI_BEP20": {
    "value": 0,
    "local": 0
  },
  "XRP_BEP20": {
    "value": 0,
    "local": 0
  },
  "BUSD_BEP20": {
    "value": 0,
    "local": 0
  },
  "TBCC_BEP20": {
    "value": 0,
    "local": 0
  },
  "TRX": {
    "value": 0,
    "local": 0
  },
  "DOGE": {
    "value": 0,
    "local": 0
  },
  "DASH": {
    "value": 0,
    "local": 0
  },
  "MATIC": {
    "value": 0,
    "local": 0
  },
  "OPETH": {
    "value": 0,
    "local": 0
  }
}

Responses

Status Meaning Description Schema
200 OK Successful Response WalletBalanceResponseSchema
404 Not Found Not Found Error None

Get H2H Max Amount

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/max_amount/{cryptocurrency} \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/max_amount/{cryptocurrency}', headers = headers)

print(r.json())

GET /h2h/{id}/max_amount/{cryptocurrency}

Gets max amount for withdrawal of the H2H

Example responses

200 Response

{
  "BTC": 0,
  "local": 0
}

Responses

Status Meaning Description Schema
200 OK Successful Response WalletMaxAmountSchema
404 Not Found Not Found Error None

Get H2H Total Fees

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/get_fees/{cryptocurrency} \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/get_fees/{cryptocurrency}', headers = headers)

print(r.json())

GET /h2h/{id}/get_fees/{cryptocurrency}

Gets total estimate proceeds of the H2H for amount

Example responses

200 Response

{
  "network_fee": {
    "amount": 0,
    "local": 0,
    "cryptocurrency": "BTC"
  },
  "service_fee": 0,
  "service_fee_local": 0
}

Responses

Status Meaning Description Schema
200 OK Successful Response WalletFeeResponseSchema
404 Not Found Not Found Error None

Get H2H Transactions

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/transactions/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/transactions/', headers = headers)

print(r.json())

GET /h2h/{id}/transactions/

Get all H2H transactions

Example responses

200 Response

{
  "items": [
    {
      "id": "018f0730-182b-3fc5-1ce8-7ed2bb70d534",
      "txid": "c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
      "type": "Replenishment",
      "exchange_rate_confirmed": 0.11195802461448179,
      "network": "tron",
        "value": {
          "local": {
            "amount": 8.55,
            "currency": "USD"
          },
          "crypto": {
            "amount": 76.359114,
            "currency": "TRX" 
          }
        },
      "status": "Confirmed",
      "transaction_link": "https://tronscan.org/#/transaction/c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
      "affect_status": {
        "status": "Replenished",
        "created_at": "2024-04-22T19:02:23.539575Z"
      },
      "metadata": {
        "email": "[email protected]"
      },
      "local_price_requested": null,
      "detected_at": "2024-04-22T19:02:23.530831Z",
      "confirmed_at": "2024-04-22T19:02:23.530460Z",
      "deposit": {
        "id": "018f0597-6d08-b890-fb70-a3356013dd46",
        "user_id": "3fa85f64df-5717-4562-b3fc-2c963f66afa6",
        "site": "example.com",
        "name": "H2H",
        "description": "H2H of User123",
        "created_at": "2024-04-22T11:36:01.032780Z"
      },
      "payment": null,
      "invoice": null
    }
  ],
  "total": 1,
  "page": 1,
  "size": 50,
  "total_sum": 8.55
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_TransactionResponseSchema_

Get H2H Withdrawals

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/h2h/{id}/withdrawals/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}

r = requests.get('https://api.usegateway.net/v1/h2h/{id}/withdrawals/', headers = headers)

print(r.json())

GET /h2h/{id}/withdrawals/

Get all H2H withdrawals

Example responses

200 Response

{
  "items": [
    {
      "id": "018f0745-f6a3-d181-3470-25b8ef4c33a9",
      "type": "Withdrawal",
      "txid": "a3e8b45aa77b0dd4d221592791635735bd7642f77c6ba2afc11c376d4335bb8a",
      "receiver_address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
      "exchange_rate_sended": 0.1119726938946018,
      "cryptocurrency_code": "TRX",
      "currency_code": "USD",
      "value_crypto": 1,
      "value_fiat": 0.11,
      "fees_crypto": 0,
      "fees_fiat": 0,
      "fees_cryptocurrency_code": null,
      "service_fees_crypto": 0,
      "service_fees_fiat": 0,
      "status": "Success",
      "transaction_link": "https://tronscan.org/#/transaction/a3e8b45aa77b0dd4d221592791635735bd7642f77c6ba2afc11c376d4335bb8a",
      "created_at": "2024-04-22T19:26:16.740055Z",
      "confirmed_at": "2024-04-22T19:26:19.740055Z",
    }
  ],
  "total": 1,
  "page": 1,
  "size": 50,
  "pages": 1
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_WithdrawalResponseSchema_

Create H2H Withdrawal

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/h2h/withdrawals/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -H 'h2h-api-key: <Your H2H API Key>' 
  -d '{
    "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco",
    "address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
    "cryptocurrency": "TRX",
    "amount": 1
  }'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>',
  'h2h-api-key': '<Your H2H API Key>'
}
data = {
  "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco",
  "address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
  "cryptocurrency": "TRX",
  "amount": 1
}

r = requests.post('https://api.usegateway.net/v1/h2h/withdrawals/', headers=headers, json=data)

print(r.json())

POST /h2h/withdrawals/

Checks the seed phrase to see if it matches the user's H2H wallet. If successful, sends a transaction to the specified address, depending on the cryptocurrency.

Data parameter

{
  "seed": "pause virtual seven flee salt kitten welcome suit latin sudden have tobacco",
  "address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
  "cryptocurrency": "TRX",
  "amount": 1
}

Parameters

Name Type Required Description
seed string (255) true H2H seed phrase
address string (255) true Withdrawal address
cryptocurrency Cryptocurrency true Withdrawal cryptocurrency
amount float true Withdrawal amount

Example responses

201 Response

{
  "id": "018f0745-f6a3-d181-3470-25b8ef4c33a9",
  "type": "Withdrawal",
  "txid": null,
  "receiver_address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
  "exchange_rate_sended": 0.1119726938946018,
  "cryptocurrency_code": "TRX",
  "currency_code": "USD",
  "value_crypto": 1,
  "value_fiat": 0.11,
  "fees_crypto": 0,
  "fees_fiat": 0,
  "fees_cryptocurrency_code": null,
  "service_fees_crypto": 0,
  "service_fees_fiat": 0,
  "status": "In progress",
  "transaction_link": null,
  "created_at": "2024-04-22T19:26:16.740055Z",
  "confirmed_at": "2024-04-22T19:26:19.740055Z",
}

Responses

Status Meaning Description Schema
201 Created Successful Response WithdrawalResponseSchema
422 Unprocessable Entity Validation Error HTTPValidationError

Withdrawal Requests

If you want to prepare a withdrawal you can use Withdrawal Requests API. All Withdrawal Requests are available in your merchant page. You can request a crypto or fiat withdrawal. Then approve or decline any withdrawal request.

Statuses

Status Description
Received Withdrawal Request was received and waiting to be approved or declined
Approved Withdrawal Request was successful processed
Declcined Withdrawal Request was declined

Get Withdrawal Requests

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/withdrawal_requests/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/withdrawal_requests/', headers = headers)

print(r.json())

GET /withdrawal_requests/

Get all withdrawal requests for the user.

Example responses

200 Response

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "crypto",
      "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
      "value": {
        "amount": 10,
        "currency": "USDT_TRC20"
      },
      "comment": "tg: @username",
      "comment_withdrawal": "Bank receipt ID 72VXJY5GD",
      "timeline": [
        {
          "status": "Received",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Declined",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Responses

Status Meaning Description Schema
200 OK Successful Response Page_WithdrawalRequestResponseSchema_

Create Withdrawal Request

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/withdrawal_requests/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "address": "some usdt address",
    "value": {
      "crypto": {
        "amount": 10,
        "currency": "USDT_TRC20"
      }
    }
  }'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}
data = {
  "address": "some usdt address",
  "value": {
    "crypto": {
      "amount": 10,
      "currency": "USDT_TRC20"
    }
  }
}

r = requests.post('https://api.usegateway.net/v1/withdrawal_requests/', headers=headers, json=data)

print(r.json())

POST /withdrawal_requests/

Withdrawal requests allow you to create a request that can be fulfilled later. You can request a withdrawal to a pre-specified cryptocurrency address as well as any other fiat currency details that will then be converted to cryptocurrency.

You can create a withdrawal request in 2 types: in cryptocurrency or in a fiat (local) currency. Just specify necessary type in the value field. See more in examples.

Request in cryptocurrency example

{
  "address": "some usdt address",
  "value": {
    "crypto": {
      "amount": 10,
      "currency": "USDT_TRC20"
    }
  }
}

Request in fiat example

{
  "value": {
    "local": {
      "amount": 10,
      "currency": "USD"
    }
  },
  "comment": "tg: @username, card number: 4111 1111 1111 1111"
}

Parameters

Name Type Required Description
address string true if type is crypto Withdrawal address
value ValuePayloadSchema true Withdrawal amount and currency
comment string (255) false Any additional info

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "crypto",
  "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
  "value": {
    "amount": 10,
    "currency": "USDT_TRC20"
  },
  "comment": "tg: @username",
  "comment_withdrawal": "Bank receipt ID 72VXJY5GD",
  "timeline": [
    {
      "status": "Received",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "created_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
201 Created Successful Response WithdrawalRequestResponseSchema
400 Bad Request Bad Request Error None
422 Unprocessable Entity Validation Error HTTPValidationError

Show Withdrawal Request

Code samples

# You can also use wget
curl -X GET https://api.usegateway.net/v1/withdrawal_requests/{id}/ \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' 

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.get('https://api.usegateway.net/v1/withdrawal_requests/{id}/', headers=headers)

print(r.json())

GET /withdrawal_requests/{id}/

Retrieves the details of a withdrawal request that has been previously created. Supply the unique withdrawal request code that was returned when the withdrawal request was created. This information is also returned when a withdrawal request is first created.

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "crypto",
  "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
  "value": {
    "amount": 10,
    "currency": "USDT_TRC20"
  },
  "comment": "tg: @username",
  "comment_withdrawal": "Bank receipt ID 72VXJY5GD",
  "timeline": [
    {
      "status": "Received",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Declined",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "created_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK Successful Response WithdrawalRequestResponseSchema
404 Not Found Not Found Error None

Decline Withdrawal Request

Code samples

# You can also use wget
curl -X POST https://api.usegateway.net/v1/withdrawal_requests/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: <Your API Key>' \
  -d '{
    "comment": "Client`s card is blocked",
  }'
import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': '<Your API Key>'
}

r = requests.post('/v1/withdrawal_requests/{id}/decline', headers = headers)

print(r.json())

POST /withdrawal_requests/{id}/decline

Declines a withdrawal request that has been previously created. Supply the unique withdrawal request code that was returned when the withdrawal request was created.

Note: Only new unpaid withdrawal requests can be successfully declined.

Body parameter

{
  "comment": "Client's card is blocked"
}

Parameters

Name Type Required Description
comment string (255) false Any additional info

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "crypto",
  "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
  "value": {
    "amount": 10,
    "currency": "USDT_TRC20"
  },
  "comment": "tg: @username",
  "comment_withdrawal": "Bank receipt ID 72VXJY5GD",
  "timeline": [
    {
      "status": "Received",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Declined",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "created_at": "2019-08-24T14:15:22Z"
}

Responses

Status Meaning Description Schema
200 OK Successful Response WithdrawalRequestResponseSchema
400 Bad Request Bad Request Error None
404 Not Found Not Found Error None
422 Unprocessable Entity Validation Error HTTPValidationError

Schemas

ApiKeyResponseSchema

{
  "key": "7714a58a6649d1b24179938a2b1ac0d5"
}

ApiKeyResponseSchema

Properties

Name Type Description
key string ApiKey

Cryptocurrency

Cryptocurrency

Properties

Name Type Description
Cryptocurrency string Available Cryptocurrencies.

Enumerated Values

Property Value
Cryptocurrency BTC
Cryptocurrency BNB
Cryptocurrency ETH
Cryptocurrency LTC
Cryptocurrency TRX
Cryptocurrency BUSD_BEP20
Cryptocurrency USDT_BEP20
Cryptocurrency USDT_TRC20

Currency

Currency

Properties

Name Type Description
Currency string Available Currencies.

Enumerated Values

Property Value
Currency USD
Currency EUR
Currency RUB
Currency UAH
Currency KZT
Currency AZN
Currency TRY

DepositPayloadSchema

{
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "SiteName",
  "name": "Product",
  "description": "The best Product",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "redirect_url": "https://google.com",
  "metadata": {
    "client_id": 1
  }
}

DepositPayloadSchema

Properties

Name Type Required Description
user_id string (255) true Any user identifier
site string (255) true Site name
name string (255) false Deposit name
description string (255) false More detailed description of the deposit
local_price PaymentPricePayloadSchema false Price in local fiat currency
redirect_url string(uri) false Redirect URL
metadata object false Developer defined key value pairs

DepositResponseSchema

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "deposit",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "site": "example.com",
  "name": "Deposit",
  "description": "Deposit of User123",
  "local_currency": "USD",
  "default_cryptocurrency": "BTC",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "redirect_url": "https://example.com",
  "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Replenished",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:15:22Z"
    }
  ]
}

DepositResponseSchema

Properties

Name Type Description
id string(uuid) Deposit ID
resource string Resource name
code string Deposit Code
user_id string Any user identifier
site string Site name
name string Deposit name
description string More detailed description of the deposit
local_currency Currency Local currency of user
default_cryptocurrency Cryptocurrency Default cryptocurrency
local_price PaymentPricePayloadSchema Price in local fiat currency
logo_url string(uri) Logo url
redirect_url string(uri) Redirect URL
hosted_url string(uri) Hosted url of deposit page
created_at string(date-time) Time of creating
timeline [StatusResponseSchema] Status history
metadata object Developer defined key value pairs
addresses object Addresses of Deposit
transactions [TransactionInResponseSchema] Transactions list

HTTPValidationError

{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

HTTPValidationError

Properties

Name Type Required Description
detail [ValidationError] false none

H2HResponseSchema

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "h2h",
  "code": "YJM5BAID",
  "user_id": "UserEmail or UserID or UserPhone",
  "name": "H2H",
  "description": "H2H of User123",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Created",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Replenished",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  }
}

H2HResponseSchema

Properties

Name Type Description
id string(uuid) Deposit ID
resource string Resource name
code string Deposit Code
user_id string Any user identifier
name string Deposit name
description string More detailed description of the deposit
seed string Seed phrase (Shows only on creating)
addresses object Addresses of H2H
created_at string(date-time) Time of creating
timeline [StatusResponseSchema] Status history
metadata object Developer defined key value pairs

InvoicePayloadSchema

{
  "name": "Product",
  "description": "The best Product",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 1
  },
  "redirect_url": "https://google.com",
  "cancel_url": "https://google.com"
}

InvoicePayloadSchema

Properties

Name Type Required Description
name string (255) true Invoice name
description string (255) false More detailed description of the invoice
local_price InvoicePricePayloadSchema true Price in local fiat currency
metadata object false Developer defined key value pairs
redirect_url string(uri) false Redirect URL after successful invoice
cancel_url string(uri) false Redirect URL after cancelled invoice

InvoicePricePayloadSchema

{
  "amount": 10,
  "currency": "USD"
}

InvoicePricePayloadSchema

Properties

Name Type Required Description
amount number (>0) true Amount
currency Currency true Available Currencies.

InvoiceResponseSchema

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "invoice",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/invoices/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Viewed",
      "created_at": "2019-08-24T14:18:22Z"
    },
    {
      "status": "Paid",
      "created_at": "2019-08-24T14:22:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

InvoiceResponseSchema

Properties

Name Type Description
id string(uuid) Invoice ID
resource string Resource name
code string Invoice code
name string Invoice name
description string Invoice description
logo_url string(uri) Logo url
hosted_url string(uri) Hosted url of Invoice page
redirect_url string(uri) Redirect url after successful invoice
cancel_url string(uri) Redirect url after cancelled invoice
created_at string(date-time) Time of creating
expires_at string(date-time) Time of expiring
confirmed_at string(date-time) Time of confirmation
timeline [StatusResponseSchema] Status history
metadata object Key value pairs
addresses object Invoice addresses
exchange_rates object Exchange rates
pricing object Invoice pricing
transactions [TransactionInResponseSchema] Invoice transactions
payment_threshold object Invoice threshold

Page_DepositResponseSchema_

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "deposit",
      "code": "YJM5BAID",
      "user_id": "UserEmail or UserID or UserPhone",
      "site": "example.com",
      "name": "Deposit",
      "description": "Deposit of User123",
      "local_currency": "USD",
      "default_cryptocurrency": "BTC",
      "local_price": {
        "amount": 10,
        "currency": "USD"
      },
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "redirect_url": "https://example.com",
      "hosted_url": "https://pay.usegateway.net/deposits/YJM5BAID",
      "created_at": "2019-08-24T14:15:22Z",
      "timeline": [
        {
          "status": "Created",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Replenished",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 14,
              "currency": "TRX"
            },
            "local": {
              "amount": 1,
              "currency": "USD"
            },
          },
          "detected_at": "2019-08-24T14:15:22Z",
          "confirmed_at": "2019-08-24T14:15:22Z"
        }
      ]
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Page[DepositResponseSchema]

Properties

Name Type Description
items [DepositResponseSchema] Deposits list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50

Page_InvoiceResponseSchema_

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "invoice",
      "code": "YJM5BAID",
      "name": "Product",
      "description": "The best Product",
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "hosted_url": "https://pay.usegateway.net/invoices/YJM5BAID",
      "redirect_url": "https://example.com",
      "cancel_url": "https://example.com",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:15:22Z",
      "timeline": [
        {
          "status": "Opened",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Viewed",
          "created_at": "2019-08-24T14:18:22Z"
        },
        {
          "status": "Paid",
          "created_at": "2019-08-24T14:22:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "exchange_rates": {
        "BTC-USD": 63518.66790770726,
        "LTC-USD": 79.19978496955301,
        "TRX-USD": 0.11165933035111154,
        "USDT_TRC20-USD": 0.9999728001379997
      },
      "pricing": {
        "tron": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        },
        "bitcoin": {
          "amount": 0.00043344,
          "currency": "BTC"
        },
        "litecoin": {
          "amount": 0.16979439,
          "currency": "LTC"
        },
        "usdt_trc20": {
          "amount": 10.004165,
          "currency": "USDT_TRC20"
        }
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 145.622008,
              "currency": "TRX"
            },
            "local": {
              "amount": 10,
              "currency": "USD"
            }
          },
          "detected_at": "2019-08-24T14:15:22Z",
          "confirmed_at": "2019-08-24T14:15:22Z"
        }
      ],
      "payment_threshold": {
        "overpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "overpayment_relative_threshold": 0.05,
        "underpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "underpayment_relative_threshold": 0.05
      }
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Page[InvoiceResponseSchema]

Properties

Name Type Description
items [InvoiceResponseSchema] Invoices list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50

Page_PaymentResponseSchema_

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "resource": "payment",
      "code": "YJM5BAID",
      "name": "Product",
      "description": "The best Product",
      "logo_url": "https://example.com/logo.png",
      "support_email": "[email protected]",
      "support_telegram": "support",
      "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
      "redirect_url": "https://example.com",
      "cancel_url": "https://example.com",
      "created_at": "2019-08-24T14:15:22Z",
      "expires_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:15:22Z",
      "timeline": [
        {
          "status": "Opened",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Completed",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "metadata": {
        "user_id": 123
      },
      "pricing_type": "fixed_price",
      "addresses": {
        "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
        "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
        "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
        "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
      },
      "exchange_rates": {
        "BTC-USD": 63518.66790770726,
        "LTC-USD": 79.19978496955301,
        "TRX-USD": 0.11165933035111154,
        "USDT_TRC20-USD": 0.9999728001379997
      },
      "pricing": {
        "tron": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        },
        "bitcoin": {
          "amount": 0.00043344,
          "currency": "BTC"
        },
        "litecoin": {
          "amount": 0.16979439,
          "currency": "LTC"
        },
        "usdt_trc20": {
          "amount": 10.004165,
          "currency": "USDT_TRC20"
        }
      },
      "transactions": [
        {
          "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
          "network": "tron",
          "status": "Confirmed",
          "exchange_rate_confirmed": 0.0686647,
          "value": {
            "crypto": {
              "amount": 145.622008,
              "currency": "TRX"
            },
            "local": {
              "amount": 10,
              "currency": "USD"
            }
          },
          "detected_at": "2019-08-24T14:15:22Z",
          "confirmed_at": "2019-08-24T14:15:22Z"
        }
      ],
      "payment_threshold": {
        "overpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "overpayment_relative_threshold": 0.05,
        "underpayment_absoulte_threshold": {
          "amount": 1,
          "currency": "USD"
        },
        "underpayment_relative_threshold": 0.05
      }
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Page[PaymentResponseSchema]

Properties

Name Type Description
items [PaymentResponseSchema] Payments list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50

Page_TransactionResponseSchema_

{
  "items": [
    {
      "id": "018f0730-182b-3fc5-1ce8-7ed2bb70d534",
      "txid": "c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
      "type": "Replenishment",
      "exchange_rate_confirmed": 0.11195802461448179,
      "network": "tron",
        "value": {
          "local": {
            "amount": 8.55,
            "currency": "USD"
          },
          "crypto": {
            "amount": 76.359114,
            "currency": "TRX" 
          }
        },
      "status": "Confirmed",
      "transaction_link": "https://tronscan.org/#/transaction/c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
      "affect_status": {
        "status": "Replenished",
        "created_at": "2024-04-22T19:02:23.539575Z"
      },
      "metadata": {
        "email": "[email protected]"
      },
      "local_price_requested": null,
      "detected_at": "2024-04-22T19:02:23.530831Z",
      "confirmed_at": "2024-04-22T19:02:23.530460Z",
      "deposit": {
        "id": "018f0597-6d08-b890-fb70-a3356013dd46",
        "user_id": "3fa85f64df-5717-4562-b3fc-2c963f66afa6",
        "site": "example.com",
        "name": "H2H",
        "description": "H2H of User123",
        "created_at": "2024-04-22T11:36:01.032780Z"
      },
      "payment": null,
      "invoice": null
    }
  ],
  "total": 1,
  "page": 1,
  "size": 50,
  "total_sum": 8.55
}

Page[TransactionResponseSchema]

Properties

Name Type Description
items [TransactionResponseSchema] Transactions list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50
total_sum float Total amount of transactions in USD

Page_WithdrawalResponseSchema_

{
  "items": [
    {
      "id": "018f0745-f6a3-d181-3470-25b8ef4c33a9",
      "type": "Withdrawal",
      "txid": "a3e8b45aa77b0dd4d221592791635735bd7642f77c6ba2afc11c376d4335bb8a",
      "receiver_address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
      "exchange_rate_sended": 0.1119726938946018,
      "cryptocurrency_code": "TRX",
      "currency_code": "USD",
      "value_crypto": 1,
      "value_fiat": 0.11,
      "fees_crypto": 0,
      "fees_fiat": 0,
      "fees_cryptocurrency_code": null,
      "service_fees_crypto": 0,
      "service_fees_fiat": 0,
      "status": "Success",
      "transaction_link": "https://tronscan.org/#/transaction/a3e8b45aa77b0dd4d221592791635735bd7642f77c6ba2afc11c376d4335bb8a",
      "created_at": "2024-04-22T19:26:16.740055Z",
      "confirmed_at": "2024-04-22T19:26:19.740055Z",
    }
  ],
  "total": 1,
  "page": 1,
  "size": 50,
  "pages": 1
}

Page[WithdrawalResponseSchema]

Properties

Name Type Description
items [WithdrawalResponseSchema] Withdrawal list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50

Page_WithdrawalRequestResponseSchema_

{
  "items": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "crypto",
      "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
      "value": {
        "amount": 10,
        "currency": "USDT_TRC20"
      },
      "comment": "tg: @username",
      "withdrawal": null,
      "timeline": [
        {
          "status": "Received",
          "created_at": "2019-08-24T14:15:22Z"
        },
        {
          "status": "Declined",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "total": 1,
  "page": 1,
  "size": 1
}

Page[WithdrawalRequestResponseSchema]

Properties

Name Type Description
items [WithdrawalRequestResponseSchema] Withdrawal Requests list
total integer Total objects in query
page integer Page of query
size integer Number of results per call. Accepted values: 0 - 100. Default 50

PaymentPayloadSchema

{
  "name": "Product",
  "description": "The best Product",
  "pricing_type": "fixed_price",
  "local_price": {
    "amount": 10,
    "currency": "USD"
  },
  "metadata": {
    "user_id": 1
  },
  "redirect_url": "https://google.com",
  "cancel_url": "https://google.com"
}

PaymentPayloadSchema

Properties

Name Type Required Description
name string (255) true Payment name
description string (255) false More detailed description of the payment
pricing_type PricingType true Payment pricing type
local_price PaymentPricePayloadSchema true Price in local fiat currency
metadata object false Developer defined key value pairs
redirect_url string(uri) false Redirect URL after successful payment
cancel_url string(uri) false Redirect URL after cancelled payment

PaymentPricePayloadSchema

{
  "amount": 10,
  "currency": "USD"
}

PaymentPricePayloadSchema

Properties

Name Type Required Description
amount number (>0) true Amount
currency Currency true Available Currencies.

PaymentResponseSchema

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "resource": "payment",
  "code": "YJM5BAID",
  "name": "Product",
  "description": "The best Product",
  "logo_url": "https://example.com/logo.png",
  "support_email": "[email protected]",
  "support_telegram": "support",
  "hosted_url": "https://pay.usegateway.net/payments/YJM5BAID",
  "redirect_url": "https://example.com",
  "cancel_url": "https://example.com",
  "created_at": "2019-08-24T14:15:22Z",
  "expires_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:15:22Z",
  "timeline": [
    {
      "status": "Opened",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Completed",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "metadata": {
    "user_id": 123
  },
  "pricing_type": "fixed_price",
  "addresses": {
    "BTC": "1NQXdsoSQaB74cESshoDELEwNi51fbGtC9",
    "LTC": "LenidgAMkqjjkBSMqSwj82za7ULdzEAzgK",
    "TRX": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
    "USDT_TRC20": "TSE4vBVTWshcFLcX1fciKw8PY9KW6NXmDd"
  },
  "exchange_rates": {
    "BTC-USD": 63518.66790770726,
    "LTC-USD": 79.19978496955301,
    "TRX-USD": 0.11165933035111154,
    "USDT_TRC20-USD": 0.9999728001379997
  },
  "pricing": {
    "tron": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    },
    "bitcoin": {
      "amount": 0.00043344,
      "currency": "BTC"
    },
    "litecoin": {
      "amount": 0.16979439,
      "currency": "LTC"
    },
    "usdt_trc20": {
      "amount": 10.004165,
      "currency": "USDT_TRC20"
    }
  },
  "transactions": [
    {
      "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
      "network": "tron",
      "status": "Confirmed",
      "exchange_rate_confirmed": 0.0686647,
      "value": {
        "crypto": {
          "amount": 145.622008,
          "currency": "TRX"
        },
        "local": {
          "amount": 10,
          "currency": "USD"
        }
      },
      "detected_at": "2019-08-24T14:15:22Z",
      "confirmed_at": "2019-08-24T14:15:22Z"
    }
  ],
  "payment_threshold": {
    "overpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "overpayment_relative_threshold": 0.05,
    "underpayment_absoulte_threshold": {
      "amount": 1,
      "currency": "USD"
    },
    "underpayment_relative_threshold": 0.05
  }
}

PaymentResponseSchema

Properties

Name Type Description
id string(uuid) Payment ID
resource string Resource name
code string Payment code
name string Payment name
description string Payment description
logo_url string(uri) Logo url
hosted_url string(uri) Hosted url of Payment page
redirect_url string(uri) Redirect url after successful payment
cancel_url string(uri) Redirect url after cancelled payment
created_at string(date-time) Time of creating
expires_at string(date-time) Time of expiring
confirmed_at string(date-time) Time of confirmation
timeline [StatusResponseSchema] Status history
metadata object Key value pairs
pricing_type PricingType Pricing type.
addresses object Payment addresses
exchange_rates object Exchange rates
pricing object Payment pricing
transactions [TransactionInResponseSchema] Payment transactions
payment_threshold object Payment threshold

PricingType

"no_price"

PricingType

Properties

Name Type Description
PricingType string Pricing type.

Enumerated Values

Property Value
PricingType no_price
PricingType fixed_price

RateResponseSchema

{
  "rate": {
    "BTC-USD": 31234.4262
  }
}

RateResponseSchema

Properties

Name Type Description
rate object Exchange rate

StatusResponseSchema

{
  "status": "Completed",
  "created_at": "2019-08-24T14:15:22Z"
}

StatusResponseSchema

Properties

Name Type Description
status string Status name
created_at string(date-time) Time of creating

TransactionInResponseSchema

{
  "txid": "45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
  "transaction_link": "https://tronscan.org/#/transaction/45b9aa8a44a8e2d08b8421ba35672c2a6671c1e3b6e7849282ace87b446c920a",
  "network": "tron",
  "status": "Confirmed",
  "exchange_rate_confirmed": 0.0686647,
  "value": {
    "crypto": {
      "amount": 145.622008,
      "currency": "TRX"
    },
    "local": {
      "amount": 10,
      "currency": "USD"
    }
  },
  "detected_at": "2019-08-24T14:15:22Z",
  "confirmed_at": "2019-08-24T14:15:22Z"
}

TransactionInResponseSchema

Properties

Name Type Description
txid string Transaction ID
transaction_link string Transaction link in blockchain explorer
network string Blockchain Network
status string Transaction Status
exchange_rate_confirmed number Exchange Rate Confirmed
value object Value
detected_at string(date-time) Detected at
confirmed_at string(date-time) Confirmed at

TransactionResponseSchema

{
  "id": "018f0730-182b-3fc5-1ce8-7ed2bb70d534",
  "txid": "c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
  "type": "Replenishment",
  "exchange_rate_confirmed": 0.11195802461448179,
  "network": "tron",
  "value": {
    "local": {
      "amount": 8.55,
      "currency": "USD"
    },
    "crypto": {
      "amount": 76.359114,
      "currency": "TRX" 
    }
  },
  "status": "Confirmed",
  "transaction_link": "https://tronscan.org/#/transaction/c41c88b3863d8da96330f247c1e02b688448cd2e16de37dc242bd82944d0ca47",
  "affect_status": {
    "status": "Replenished",
    "created_at": "2024-04-22T19:02:23.539575Z"
  },
  "metadata": {
    "email": "[email protected]"
  },
  "local_price_requested": null,
  "detected_at": "2024-04-22T19:02:23.530831Z",
  "confirmed_at": "2024-04-22T19:02:23.530460Z",
  "deposit": {
    "id": "018f0597-6d08-b890-fb70-a3356013dd46",
    "user_id": "3fa85f64df-5717-4562-b3fc-2c963f66afa6",
    "site": "example.com",
    "name": "H2H",
    "description": "H2H of User123",
    "created_at": "2024-04-22T11:36:01.032780Z"
  },
  "payment": null,
  "invoice": null
}

TransactionResponseSchema

Properties

Name Type Description
id string(uuid) Transaction ID
txid string Transaction TXID
type string Transaction type
exchange_rate_confirmed float Exchange Rate Confirmed
value object Value
status string Transaction Status
transaction_link string Transaction link in blockchain explorer
affect_status string Transaction Affect Status
metadata object Transaction Metadata
local_price_requested float Amount Requested
detected_at string(date-time) Detected at
confirmed_at string(date-time) Confirmed at
deposit object Deposit/H2H Info
payment object Payment Info
invoice object Invoice Info

ValidationError

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

ValidationError

Properties

Name Type Description
loc [anyOf] none

anyOf

Name Type Description
» anonymous string none

or

Name Type escription
» anonymous integer none

continued

Name Type Description
msg string Error message
type string Error type

ValuePayloadSchema

{
  "amount": 0,
  "currency": "USD"
}

ValuePayloadSchema

Properties

Name Type Required Description
amount number (>0) true Amount
currency any true Currency or cryptocurrency

anyOf

Name Type Description
» anonymous Currency Available Currencies.

or

Name Type Description
» anonymous Cryptocurrency Available Cryptocurrencies.

WalletBalanceResponseSchema

{
  "TBTC": {
    "value": 0,
    "local": 0
  },
  "BCH": {
    "value": 0,
    "local": 0
  },
  "ETH": {
    "value": 0,
    "local": 0
  },
  "BNB": {
    "value": 0,
    "local": 0
  },
  "OPBNB": {
    "value": 0,
    "local": 0
  },
  "LTC": {
    "value": 0,
    "local": 0
  },
  "USDT_TRC20": {
    "value": 0,
    "local": 0
  },
  "USDC_TRC20": {
    "value": 0,
    "local": 0
  },
  "USDT_ERC20": {
    "value": 0,
    "local": 0
  },
  "USDC_ERC20": {
    "value": 0,
    "local": 0
  },
  "USDT_BEP20": {
    "value": 0,
    "local": 0
  },
  "USDC_BEP20": {
    "value": 0,
    "local": 0
  },
  "DAI_BEP20": {
    "value": 0,
    "local": 0
  },
  "XRP_BEP20": {
    "value": 0,
    "local": 0
  },
  "BUSD_BEP20": {
    "value": 0,
    "local": 0
  },
  "TBCC_BEP20": {
    "value": 0,
    "local": 0
  },
  "TRX": {
    "value": 0,
    "local": 0
  },
  "DOGE": {
    "value": 0,
    "local": 0
  },
  "DASH": {
    "value": 0,
    "local": 0
  },
  "MATIC": {
    "value": 0,
    "local": 0
  },
  "OPETH": {
    "value": 0,
    "local": 0
  }
}

WalletBalanceResponseSchema

Properties

Name Type Description
value float Amount in cryptocurrency
local float Amount in fiat

WalletMaxAmountSchema

{
  "BTC": 0,
  "local": 0
}

WalletMaxAmountSchema

WalletFeeResponseSchema

{
  "network_fee": {
    "amount": 0,
    "local": 0,
    "cryptocurrency": "BTC"
  },
  "service_fee": 0,
  "service_fee_local": 0
}

WalletFeeResponseSchema

Properties

Name Type Description
network_fee object Network Fees
service_fee float Service commission fees
service_fee_local float Service commission fees in Fiat

WebhookEvent

"payment.completed"

WebhookEvent

Properties

Name Type Description
WebhookEvent string Available Webhook events.

Enumerated Values

Property Value
WebhookEvent payment.created
WebhookEvent payment.completed
WebhookEvent payment.unresolved
WebhookEvent payment.resolved
WebhookEvent payment.expired
WebhookEvent payment.closed
WebhookEvent invoice.created
WebhookEvent invoice.viewed
WebhookEvent invoice.expired
WebhookEvent invoice.renewed
WebhookEvent invoice.paid
WebhookEvent invoice.unresolved
WebhookEvent invoice.resolved
WebhookEvent invoice.closed
WebhookEvent deposit.created
WebhookEvent deposit.replenished
WebhookEvent deposit.unresolved
WebhookEvent deposit.resolved
WebhookEvent deposit.closed
WebhookEvent transaction.refunded
WebhookEvent withdrawal.completed
WebhookEvent withdrawal_request.created
WebhookEvent withdrawal_request.approved
WebhookEvent withdrawal_request.declined

WithdrawalResponseSchema

{
  "id": "018f0745-f6a3-d181-3470-25b8ef4c33a9",
  "type": "Withdrawal",
  "txid": null,
  "receiver_address": "TXiC8yU4xMuPNtMkKrcqRRBn834kDYwxik",
  "exchange_rate_sended": 0.1119726938946018,
  "cryptocurrency_code": "TRX",
  "currency_code": "USD",
  "value_crypto": 1,
  "value_fiat": 0.11,
  "fees_crypto": 0,
  "fees_fiat": 0,
  "fees_cryptocurrency_code": null,
  "service_fees_crypto": 0,
  "service_fees_fiat": 0,
  "status": "In progress",
  "transaction_link": null,
  "created_at": "2024-04-22T19:26:16.740055Z",
  "confirmed_at": "2024-04-22T19:26:19.740055Z",
}

WithdrawalResponseSchema

Properties

Name Type Description
type string Withdrawal type
txid string Withdrawal TXID
receiver_address string Withdrawal address
exchange_rate_sended float Exchange Rate
cryptocurrency_code Cryptocurrency Withdrawal cryptocurrency
currency_code Currency Withdrawal currency
value_crypto Withdrawal Amount in Crypto
value_fiat Withdrawal Amount in Crypto
fees_crypto Withdrawal Net Fees in Crypto
fees_fiat Withdrawal Net Fees in Crypto
fees_cryptocurrency_code Cryptocurrency Withdrawal Net Fees cryptocurrency
service_fees_crypto Withdrawal Service Fees in Crypto
service_fees_fiat float Withdrawal Service Fees in Fiat
status string Withdrawal status
transaction_link string Transaction link in blockchain explorer
created_at string(date-time) Time of creating
confirmed_at string(date-time) Time of confirmation

WithdrawalRequestDeclinePayloadSchema

### Properties

|Name|Type|Required|Description|
|---|---|---|---|
|comment|string|false|Additional withdrawal info|

<h2 id="tocS_WithdrawalRequestDeclinePayloadSchema">WithdrawalRequestDeclinePayloadSchema</h2>

<a id="schemawithdrawalrequestdeclinepayloadschema"></a>
<a id="schema_WithdrawalRequestDeclinePayloadSchema"></a>
<a id="tocSwithdrawalrequestdeclinepayloadschema"></a>
<a id="tocswithdrawalrequestdeclinepayloadschema"></a>

```json
{
  "comment": "Client's card is blocked"
}

WithdrawalRequestDeclinePayloadSchema

Properties

Name Type Required Description
comment string false Additional withdrawal info

WithdrawalRequestPayloadSchema

{
  "address": "string",
  "value": {
    "property1": {
      "amount": 0,
      "currency": "USD"
    },
    "property2": {
      "amount": 0,
      "currency": "USD"
    }
  },
  "comment": "string"
}

WithdrawalRequestPayloadSchema

Properties

Name Type Required Description
address string true if type is crypto Withdrawal address
value ValuePayloadSchema true Withdrawal amount and currency
comment string (255) false Any additional info

WithdrawalRequestResponseSchema

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "type": "crypto",
  "address": "TN8etC84NYvKT7WZmU1TdvCsU3RUo2waaG",
  "value": {
    "amount": 10,
    "currency": "USDT_TRC20"
  },
  "comment": "tg: @username",
  "withdrawal": null,
  "timeline": [
    {
      "status": "Received",
      "created_at": "2019-08-24T14:15:22Z"
    },
    {
      "status": "Declined",
      "created_at": "2019-08-24T14:15:22Z"
    }
  ],
  "created_at": "2019-08-24T14:15:22Z"
}

WithdrawalRequestResponseSchema

Properties

Name Type Description
id string(uuid) Withdrawal request ID
type string Withdrawal request type
address string Destination address
value object Amount and currency or cryptocurrency
comment string Additional comments
withdrawal object Withdrawal info
status StatusResponseSchema Current status
created_at string(date-time) Time of creating