API for developers Billing

Billing API

Billing API: see which bridges your workspace pays for and until when, price a new bill and pay it from your TPcopier wallet, all from your own code.

Plans, bills and your wallet

Your workspace is paid per bridge, at the website's prices. With the API: see what you have, price a bill, and pay it - from your wallet (topped up in the app with USDT) or another way the app offers.

curl -H "Authorization: Bearer $TPC_KEY" https://tpcopier.com/api/v1/billing          # your bridges, what is paid and until when
curl -H "Authorization: Bearer $TPC_KEY" https://tpcopier.com/api/v1/bridge/types     # the bridges your workspace uses

A bill is priced with POST /api/v1/billing/quote, made with POST /api/v1/billing/bills and paid with POST /api/v1/billing/orders - each one's fields are below.

Further reading: the OpenAPI Specification our API description follows.

Endpoints in this guide

Base address https://tpcopier.com. Send your key with every request - Authorization: Bearer tpc_... - up to 120 requests a minute. Open an endpoint for its fields, its answers and an example.

bridgeSignal sources, accounts and the links between them
GET/api/v1/bridge/typesBridge Types

The seven kinds of bridge, which ones this workspace uses, and each one's steps - and the free trial: its one bridge, the accounts it carries, its clock (trial.state).

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/bridge/types"
PUT/api/v1/bridge/typesSave Bridge Types

Request body

{
  "selected": [
    ""
  ]
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X PUT -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"selected": [""]}' \
     "https://tpcopier.com/api/v1/bridge/types"
appStatus, signals, trades, accounts and settings
GET/api/v1/billingBilling

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/billing"
shopPlans, bills, orders and licences
POST/api/v1/billing/ordersBuy Plan

Request body

{
  "plan_code": "",
  "months": 1,
  "accept_no_refund": false,
  "method": "binance"
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"plan_code": "", "months": 1, "accept_no_refund": false, "method": "binance"}' \
     "https://tpcopier.com/api/v1/billing/orders"
POST/api/v1/billing/quoteBill Quote

What a bill for these bridges would cost, and until when each would run.

Request body

{
  "items": [],
  "months": 1,
  "accept_no_refund": false,
  "method": "binance"
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"items": [], "months": 1, "accept_no_refund": false, "method": "binance"}' \
     "https://tpcopier.com/api/v1/billing/quote"
POST/api/v1/billing/billsBuy Bridges

One bill for the bridges picked, paid with Binance Pay or by transfer.

Request body

{
  "items": [],
  "months": 1,
  "accept_no_refund": false,
  "method": "binance"
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"items": [], "months": 1, "accept_no_refund": false, "method": "binance"}' \
     "https://tpcopier.com/api/v1/billing/bills"
GET/api/v1/billing/orders/{ref}Order Status

Parameters

ref *pathstring

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/billing/orders/{ref}"
GET/api/v1/walletWallet

The wallet: its balance (USDT), its top-ups and everything it paid for - and the ways to add money.

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -H "Authorization: Bearer $TPC_KEY" \
     "https://tpcopier.com/api/v1/wallet"
POST/api/v1/wallet/top-upWallet Top Up

Add money to the wallet: Binance Pay's checkout (checkout_url), or a transfer (pay it, then send its reference - the order's window). Once confirmed it is on the balance and pays for anything with method 'wallet'.

Request body

{
  "amount": 50,
  "method": "transfer"
}

Responses

200 Successful Response · 422 Validation Error · 401 402 403 429 - see Errors

Example

curl -X POST -H "Authorization: Bearer $TPC_KEY" -H "Content-Type: application/json" \
     -d '{"amount": 50, "method": "transfer"}' \
     "https://tpcopier.com/api/v1/wallet/top-up"