API Docs

Create a new Rune order

Creates a new Rune order with the specified details.

POSThttps://api.ordinalsbot.com/tokenpay/user/order/rune
Header parameters
Body
amountnumber

The amount for the order.

Example: 1
tokenstring

The token for the order.

Example: "SHITCOINPARADISE"
webhookUrlstring

The webhook URL for the order.

Example: "https://webhook.site/f5a2dcec-b7e4-4845-92d1-22ded0057104"
additionalFeeinteger

The additional fee for the order.

Example: 0
descriptionstring

The description for the order.

Example: "e14fefbe-fc23-40a2-b0d6-6aab7bff3438"
Response

Successfully created the order.

Body
createdAtinteger
Example: 1721745751531
accountIdstring
Example: "ordinalsbot"
feeChargeobject
descriptionstring
Example: "e14fefbe-fc23-40a2-b0d6-6aab7bff3438"
idstring
Example: "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600"
statestring
Example: "pending"
tokenChargeobject
webhookUrlstring
Example: "https://webhook.site/f5a2dcec-b7e4-4845-92d1-22ded0057104"
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/user/order/rune', {
    method: 'POST',
    headers: {
      "x-api-key": "your-api-key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "createdAt": 1721745751531,
  "accountId": "ordinalsbot",
  "feeCharge": {
    "createdAt": 1721745751432,
    "additionalFee": 23315,
    "amount": 32315,
    "protocol": "bitcoin",
    "address": "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y",
    "txid": null,
    "state": "pending_payment",
    "token": "BTC"
  },
  "description": "e14fefbe-fc23-40a2-b0d6-6aab7bff3438",
  "id": "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600",
  "state": "pending",
  "tokenCharge": {
    "createdAt": 1721745751530,
    "additionalFee": 0,
    "amount": 1,
    "protocol": "rune",
    "address": "bc1p76ppg0q24p2v6faxkaffrvtg0n9u2wvgjzr2g48nfnhk6z7g8wasnwtsql",
    "txid": null,
    "state": "pending_payment",
    "token": "SHITCOINPARADISE"
  },
  "webhookUrl": "https://webhook.site/f5a2dcec-b7e4-4845-92d1-22ded0057104"
}

Check specific transaction by txid

POSThttps://api.ordinalsbot.com/tokenpay/utils/checktx
Body
txidstring

The transaction ID to be validated.

Example: "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
Response

A successful response

Body
txidstring
Example: "f358178f7f72a07cb983da3b19097a5b8a8160b367609701d3d1c15e7f3147e4"
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/utils/checktx', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "txid": "f358178f7f72a07cb983da3b19097a5b8a8160b367609701d3d1c15e7f3147e4"
}

Retrieve an order by ID

Fetches an order from the Firestore database using the provided order ID.

GEThttps://api.ordinalsbot.com/tokenpay/order/{orderId}
Path parameters
orderId*string

The ID of the order to retrieve.

Example: "1234567890abcdef"
Response

Successfully retrieved the order.

Body
createdAtinteger
Example: 1721745751531
accountIdstring
Example: "ordinalsbot"
feeChargeobject
descriptionstring
Example: "e14fefbe-fc23-40a2-b0d6-6aab7bff3438"
idstring
Example: "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600"
statestring
Example: "pending"
tokenChargeobject
webhookUrlstring
Example: "https://webhook.site/f5a2dcec-b7e4-4845-92d1-22ded0057104"
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/order/{orderId}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "createdAt": 1721745751531,
  "accountId": "ordinalsbot",
  "feeCharge": {
    "createdAt": 1721745751432,
    "additionalFee": 23315,
    "amount": 32315,
    "protocol": "bitcoin",
    "address": "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y",
    "txid": null,
    "state": "pending_payment",
    "token": "BTC"
  },
  "description": "e14fefbe-fc23-40a2-b0d6-6aab7bff3438",
  "id": "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600",
  "state": "pending",
  "tokenCharge": {
    "createdAt": 1721745751530,
    "additionalFee": 0,
    "amount": 1,
    "protocol": "rune",
    "address": "bc1p76ppg0q24p2v6faxkaffrvtg0n9u2wvgjzr2g48nfnhk6z7g8wasnwtsql",
    "txid": null,
    "state": "pending_payment",
    "token": "SHITCOINPARADISE"
  },
  "webhookUrl": "https://webhook.site/f5a2dcec-b7e4-4845-92d1-22ded0057104"
}

Withdraw funds from user account

Withdraws funds from the user's account to the specified address.

POSThttps://api.ordinalsbot.com/tokenpay/user/account/withdraw
Header parameters
Body
protocolstring

The protocol for the withdrawal.

Example: "bitcoin"
tokenstring

The token for the withdrawal.

Example: "BTC"
amountnumber

The amount to withdraw.

Example: 0.5
addressstring

The address to withdraw to.

Example: "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y"
Response

Successfully created the withdrawal request.

Body
idstring
Example: "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600"
accountIdstring
Example: "user123"
protocolstring
Example: "bitcoin"
tokenstring
Example: "BTC"
amountnumber
Example: 0.5
addressstring
Example: "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y"
statestring
Example: "pending"
createdAtinteger
Example: 1721745751531
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/user/account/withdraw', {
    method: 'POST',
    headers: {
      "x-api-key": "your-api-key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "id": "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600",
  "accountId": "user123",
  "protocol": "bitcoin",
  "token": "BTC",
  "amount": 0.5,
  "address": "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y",
  "state": "pending",
  "createdAt": 1721745751531
}

Get withdrawal details

Retrieves the details of a specific withdrawal using the withdrawal ID.

GEThttps://api.ordinalsbot.com/tokenpay/user/withdrawal/{withdrawalId}
Path parameters
withdrawalId*string

The ID of the withdrawal to retrieve.

Example: "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600"
Header parameters
Response

Successfully retrieved the withdrawal details.

Body
idstring
Example: "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600"
accountIdstring
Example: "user123"
protocolstring
Example: "bitcoin"
tokenstring
Example: "BTC"
amountnumber
Example: 0.5
addressstring
Example: "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y"
statestring
Example: "completed"
createdAtinteger
Example: 1721745751531
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/user/withdrawal/{withdrawalId}', {
    method: 'GET',
    headers: {
      "x-api-key": "your-api-key"
    },
});
const data = await response.json();
Response
{
  "id": "f2bcddd4-bd8d-4c88-bf8a-61be0d5b0600",
  "accountId": "user123",
  "protocol": "bitcoin",
  "token": "BTC",
  "amount": 0.5,
  "address": "bc1qh3rp2pns6nrr8mhx0rlzd5kktwm33wc4ax0h4y",
  "state": "completed",
  "createdAt": 1721745751531
}

Create a payment PSBT

Handles the creation of a payment PSBT.

POSThttps://api.ordinalsbot.com/tokenpay/create-payment-psbt
Body
orderIdstring

The ID of the order.

Example: "order123"
paymentAddressstring

The payment address.

Example: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
paymentPublicKeystring

The payment public key.

Example: "02b463a1e6b8e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1"
ordinalAddressstring

The ordinal address.

Example: "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kygt080"
ordinalPublicKeystring

The ordinal public key.

Example: "03b463a1e6b8e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1e1a1"
feeRatenumber

The fee rate for the transaction.

Example: 0.0001
Response

Successfully created the payment PSBT.

Body
psbtstring

The created PSBT.

Example: "cHNidP8BAFICAAAA..."
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/create-payment-psbt', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "psbt": "cHNidP8BAFICAAAA..."
}

Get account balance

Retrieves the balance of a specific user account.

GEThttps://api.ordinalsbot.com/tokenpay/user/account/balance
Header parameters
Response

Successfully retrieved the account balance.

Body
bitcoinobject
runeobject
Request
const response = await fetch('https://api.ordinalsbot.com/tokenpay/user/account/balance', {
    method: 'GET',
    headers: {
      "x-api-key": "your-api-key"
    },
});
const data = await response.json();
Response
{
  "bitcoin": {
    "BTC": 0
  },
  "rune": {
    "XRUNE": 10
  }
}

Last updated