Skip to main content

TensorRail Collect API

If you want to integrate rather than work only in the dashboard, the TensorRail Collect API lets you create collections, watch your account balance, and request settlements to your USDT wallet programmatically. This page is a conceptual guide to the surface. Exact field names, endpoints, and payloads are confirmed for your account when your API credentials are issued, and a full endpoint reference is provided alongside them.

Availability

The TensorRail Collect API is enabled per account after onboarding. Endpoint paths and payload shapes shown here are illustrative and are finalised in the reference issued with your credentials.

Authentication

All calls go to the TensorRail API and authenticate with your API key in the api-key header, the same way the rest of TensorRail works.

curl https://api.tensorrail.com/collect/balance \
-H "api-key: rail_..."

Use a test-mode key while you build and a live key when you go live. Keep keys secret; rotate them if you suspect compromise.

Core objects

  • Collection: a single local-currency payment from your customer, over a supported method and corridor, credited to your account balance once received.
  • Balance: the consolidated value TensorRail has aggregated for you, in your settlement currency, split into available, pending, and held.
  • Settlement: an instruction to send a portion of your available balance to your saved USDT wallet.

Create a collection

You create a collection for the amount and corridor you want to charge your customer, and TensorRail returns the details your customer needs to pay (for example a prompt to approve on their phone, virtual-account details, or a payment reference), depending on the method.

curl https://api.tensorrail.com/collect/collections \
-H "api-key: rail_..." \
-H "Content-Type: application/json" \
-d '{
"amount": "5000",
"currency": "<local currency>",
"country": "<corridor>",
"method": "mobile_money",
"customer_reference": "order_1234"
}'

The response includes a collection id, its status, and any method-specific instructions to present to your customer. The customer completes the payment on their side.

Track a collection

Poll the collection or, preferably, subscribe to webhooks so you are notified when it is received and credited.

curl https://api.tensorrail.com/collect/collections/{collection_id} \
-H "api-key: rail_..."

Statuses move roughly from pending (awaiting the customer) to received (paid on the rail) to credited (value added to your available or pending balance).

Read your account balance

curl https://api.tensorrail.com/collect/balance \
-H "api-key: rail_..."

The response gives your available, pending, and held amounts in your settlement currency, and can be broken down by corridor and currency.

Request a settlement

Move available balance to your saved USDT wallet.

curl https://api.tensorrail.com/collect/settlements \
-H "api-key: rail_..." \
-H "Content-Type: application/json" \
-d '{
"amount": "1000",
"wallet": "saved"
}'

The settlement response shows the gross amount, the fee and any conversion component, the net USDT, the destination wallet, and a status. Settlements go only to your saved, verified USDT wallet; the API does not send to arbitrary addresses. Track the settlement to completion, where the on-chain reference is recorded.

curl https://api.tensorrail.com/collect/settlements/{settlement_id} \
-H "api-key: rail_..."

Webhooks

Subscribe to events so your systems react without polling. Typical events:

  • collection.received: your customer paid on the rail.
  • collection.credited: value added to your account balance.
  • settlement.processing: a settlement to your USDT wallet started.
  • settlement.completed: USDT sent; on-chain reference available.
  • settlement.failed: a settlement did not complete; see the reason.

Verify webhook signatures the same way as elsewhere in TensorRail before trusting an event.

Idempotency and errors

  • Send an idempotency key on create-collection and request-settlement calls so retries do not double up.
  • Errors follow TensorRail's standard error shape, with a machine-readable code and a human-readable message.

Test mode

Use a test-mode key to build and validate the full flow, including simulated collections and simulated settlements, before switching to live.


TensorRail, Limassol, Cyprus. The definitive endpoint reference is issued with your API credentials.