# Welcome

Welcome to the OrdinalsBot Documentation! Here you will find our full API reference as well as some helpful articles to learn about inscriptions, ordinal theory and more.

## Getting Started

See below for some quick start links, if you have any questions, you can always reach out and open a ticket in our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>API Reference</strong></td><td>Here you will find all docs for the OrdinalsBot API.</td><td></td><td><a href="/api/overview">Overview</a></td><td><a href="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FEXMqVnE1mzQAonHlOrHT%2Fapi.png?alt=media&amp;token=cb4ebc38-db5f-4ab7-9363-ab3e62f4d839">api.png</a></td></tr><tr><td><strong>User Guide</strong></td><td>Here you will find helpful guides on using the OrdinalsBot app.</td><td></td><td><a href="/user-guide/inscribe-your-first-ordinal">User Guide</a></td><td><a href="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FlmDKeOH4f13dr4PqilqS%2Fguide.png?alt=media&amp;token=8a7d282a-8bb9-4588-b5dd-6b14cda7a961">guide.png</a></td></tr><tr><td><strong>Knowledge Base</strong></td><td>Here you will find helpful articles.</td><td></td><td><a href="/knowledge-base/ordinals">Knowledge Base</a></td><td><a href="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FDzCJMbZDAqdSFA92vfJz%2Flearn.png?alt=media&amp;token=f543b394-6565-40c0-8a9f-8c3a04cd931d">learn.png</a></td></tr></tbody></table>

## Feedback

If you have any feedback or find any bugs, please reach out to us, and open a ticket in our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)


# Overview

Instructions on how to use [ordinalsbot.com](https://ordinalsbot.com) API to generate inscription orders from anywhere, pay with Lightning or onchain Bitcoin and receive the inscriptions to the provided address.

**Contact**

OrdinalsBot Discord: <https://discord.ordinalsbot.com>&#x20;

Twitter: <https://twitter.com/ordinalsbot>

### API Info

API root is at: <https://api.ordinalsbot.com>

You can use <https://api.ordinalsbot.com/status> to check for API status and availability.

Note: The API root is currently in the process of being migrated to <https://api.ordinalsbot.com> - Please double check API root for a particular endpoint.

### Status

You can check status of OrdinalsBot services at [https://status.ordinalsbot.com](https://status.ordinalsbot.com/).

{% hint style="warning" %}
This service takes some files as input, inscribes them on the bitcoin blockchain as explained on [https://docs.ordinals.com](https://docs.ordinals.com/) and sends the inscribed UTXO to the provided bitcoin address.

No guarantees are made on the quality or speed of the inscription.
{% endhint %}


# Libraries

You can use the following libraries to access OrdinalsBot API.

### Javascript SDK

Github: <https://github.com/ordinalsbot/ordinalsbot-node>

NPM package: <https://www.npmjs.com/package/ordinalsbot>

You can find getting started instructions on the [Github Repository](https://github.com/ordinalsbot/ordinalsbot-node). [Usage examples](https://github.com/ordinalsbot/ordinalsbot-node/blob/main/examples/example.ts) and [tests](https://github.com/ordinalsbot/ordinalsbot-node/blob/main/test/index.js) are also included along with the open source code.


# Template-App

The OrdinalsBot Template App is a public, open-source (FOSS) boilerplate designed to streamline your development workflow when working with OrdinalsBot APIs. By forking and customizing this template, you can significantly reduce your development time and focus on building the features that matter most.

#### Key Features

* **Default Wallet Provider:** Pre-configured with <https://lasereyes.build>.
* **TanStack Integration:** Built with TanStack for scalable and efficient Typescript.
* **Next.js 15 with App Router:** Leverage the latest Next.js features for powerful front-end development.
* **Firebase Integration:** Includes built-in support for Firebase, enabling account management and database interactions.
* **Metadata & SEO Configurations:** Ready-to-go setups for improving search engine visibility and metadata management.
* **Tailwind & ShadUI:** Focus on functionality and accelerate your design & component workflow with two industry leading style & design tools.
* **Use Case Examples:** Demonstrations like "Direct Inscription" included to showcase practical implementations.

#### Why Use the Ordinals Template App?

This template is ideal for developers working with Ordinals, NFTs, or Bitcoin projects. It's perfect for building:

* Custom minting pages
* Ordinal explorers
* Tooling for Ordinals and inscriptions
* And much more!

By using this template, you’ll save time, standardize your toolset, and accelerate your development process.

#### Getting Started

To start using the Ordinals Template App, fork the repository from [GitHub](https://github.com/ordinalsbot/ordinals-template-app). Customize it as needed and take advantage of its pre-configured tools and services.

#### Contributing and Support

* **Submit Issues:** If you encounter any issues or have questions, submit them directly on GitHub via the [Issues page](https://github.com/ordinalsbot/ordinals-template-app/issues).

This template is a great way to kickstart your project with ready-to-use configurations and best practices for the Ordinals ecosystem.


# Signet

You can use our [signet](https://en.bitcoin.it/wiki/Signet) instance for testing the API.

Signet API root is at <https://signet-api.ordinalsbot.com> and Web UI is at [https://signet.ordinalsbot.com](https://signet.ordinalsbot.com/api)

<https://signet-status.ordinalsbot.com> to check for signet API status and availability.

Explorer is available at <https://signet-explorer.ordinalsbot.com>.

You can download a signet wallet at <https://github.com/nbd-wtf/obw/releases> and get signet coins from faucets like [https://signet.bc-2.jp](https://signet.bc-2.jp/).

All endpoints except text and image hash search will work on the signet instance. Just replace the API root with signet endpoint.

{% hint style="warning" %}
Note that all signet "charge" objects inside ["managed inscription"](broken://pages/DZ49lzL7RFQn0H2WdHE1) orders have **testnet** invoices due to our payment processor limitation.&#x20;

Feel free to use [Create a Direct Inscription Order](/api/create-a-direct-inscription-order)if you want to use signet end to end including payment flow.
{% endhint %}


# Testnet

{% hint style="info" %}
As of March 2025, we have switched our testnet infrastructure to **testnet4** by default. testnet3 is not supported anymore.
{% endhint %}

You can use our [testnet](https://en.bitcoin.it/wiki/Testnet) instance for testing the API.

Testnet API root: <https://testnet-api.ordinalsbot.com>&#x20;

Web UI: <https://testnet.ordinalsbot.com>

Status: <https://testnet-status.ordinalsbot.com>&#x20;

Explorer: <https://testnet-explorer.ordinalsbot.com>.

All endpoints will work on the testnet environment. Just replace the API root with testnet API root.


# Fractal

This environment is experimental and subject to changes at anytime.

You can use our fractal instance which implements a majority of the standard OrdinalsBot API services.

Fractal API root is at <https://fractal-api.ordinalsbot.com> and Web UI is at <https://fractal.ordinalsbot.com>.&#x20;

<https://fractal-api.ordinalsbot.com/status> to check for testnet API status and availability.

Explorer is available at <https://fractal-explorer.ordinalsbot.com>.

{% hint style="warning" %}
Currently all invoices and payment addresses created on fractal environment is mainnet Bitcoin BTC. &#x20;

All payments are done in BTC except direct inscribe `/inscribe` endpoint detailed in [Create a Direct Inscription Order](/api/create-a-direct-inscription-order)
{% endhint %}


# Getting Prices

Use this endpoint to check the price (in satoshis) that user will need to pay to use services offered by this API.

### `POST` price estimates

## Get Inscription Price (in satoshis)

<mark style="color:blue;">`POST`</mark> `https://api.ordinalsbot.com/price`

This endpoint will calculate all fees related to the operation and return the total as well as the breakdown.

**Price breakdown**

Here is a code example with the exact calculation used in pricing

```javascript
const discounts = []; // array of discounts applied to the order

// set at 10% at the moment but can be changed
const chainFeeRate = 0.1;

// the parameters that are discountable
// those are the values AFTER the discount
const {
  baseFee, // base fee charged by us, per item
  rareSatsFee, // fee for rare sats, per item
  collectionServiceFee, // optional fee for collections, per item
} = dicountParamters;

// the other components of the pricing, which are not discountable
const {
  chainFee, // chain fee in sats for the whole order
  count, // items count
  postage, // the postage per item
  price, // the price per item for a collection or launchpad
  additionalFee = 0, // zero by default unless specified, applies PER item,
  sizeFee, // normally 10% of chain fee but does not apply for direct orders
} = basePricing;

// the total additional fee that we will charge
const additionalFeeCharged = additionalFee * count;
// service fee component calculation
const serviceFee = (baseFee + rareSatsFee + collectionServiceFee + postage + price) * count + additionalFeeCharged + sizeFee;
// final amount, this is what the user has to pay!
const amount = serviceFee + chainFee;

// this is returned by the endpoint
const finalPricing = {
  ...basePricing,
  ...discountParameters,
  additionalFeeCharged,
  discounts,
  amount,
  serviceFee,
};
```

**Discount object**

If discounts are applied there will be an array of discount object in the `discounts` field

```typescript
{
  discount: number, // the value of the discount, either as sats or as a percent
  parameter: 'baseFee' | 'rareSatsFee' | 'collectionServiceFee', // which parameter is getting the discount
  type: 'fixed' | 'percentage', // if fixed, we directly deduct dicount from parameter, otherwise we deduct as a % from the parameter
  reason: string, // the reason for discount
}
```

#### Body Parameters

<table><thead><tr><th width="165">Name</th><th width="134">Type</th><th>Description</th></tr></thead><tbody><tr><td>order<mark style="color:red;">*</mark></td><td>Object</td><td>The order request you would send to /order, /inscribe or any other priced endpoint. </td></tr><tr><td>type<mark style="color:red;">*</mark></td><td>string</td><td>The type of your order, see all types in the table at <a href="/api/order-types">Order Types</a></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "chainFee": 18992,
    "baseFee": 9000,
    "rareSatsFee": 0,
    "additionalFee": 0,
    "additionalFeeCharged": 0,
    "postage": 546,
    "count": 2,
    "price": 0,
    "collectionServiceFee": 0,
    "discounts": [],
    "amount": 39983,
    "serviceFee": 20991
}
```

{% endtab %}
{% endtabs %}

```json
// here is a sample payload you can POST to get a pricing
{
    "type": "bulk",
    "order": {
        "files": [
            {
                "url": "https://ordinalsbot-dev.s3.amazonaws.com/7b7b3b37-792b-4f29-bd37-7436fd461453",
                "size": 860,
                "name": "btc-skull-2.jpg",
                "type": "image/jpeg"
            },
                        {
                "url": "https://ordinalsbot-dev.s3.amazonaws.com/7b7b3b37-792b-4f29-bd37-7436fd461453",
                "size": 860,
                "name": "btc-skull-2.jpg",
                "type": "image/jpeg"
            }
        ],
        "lowPostage": true,
        "receiveAddress": "tb1qwejhagpav9rkrwpk55ul6pes6f89glpkpds487",
        "rareSats": "random",
        "compress": false,
        "fee": 16
    }
}
```

## Non Standard Transaction Fees

We use <https://slipstream.mara.com/> to submit any non-standard transactions (larger than 400kb mempool policy limit) to be included in the bitcoin blockchain.

{% hint style="warning" %}
This means you need to check for their minimum fees before submitting a managed order request that will require a non-standard transaction.

You are also bound by ToS of slipstream if you create a managed inscription order with any file larger than 400kb or batch inscription request that would lead to a transaction that is over the default bitcoin mempool policy limit.
{% endhint %}


# Getting Prices (Legacy)

**Legacy endpoint kept for backwards compatibility. Results may or may not be correct. Always use POST** [**/price**](/api/getting-prices) **for reliable results.**

Use this endpoint to check the price (in satoshis) that user will need to pay to use services offered by this API.

### `GET` price estimates

## Get Inscription Price (in satoshis)

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/price`

This endpoint will calculate all fees related to the operation and return the total as well as the breakdown.

#### Query Parameters

<table><thead><tr><th width="165">Name</th><th width="134">Type</th><th>Description</th></tr></thead><tbody><tr><td>size<mark style="color:red;">*</mark></td><td>Number</td><td>Total size of all files to be inscribed in bytes</td></tr><tr><td>fee<mark style="color:red;">*</mark></td><td>Number</td><td>Miner fee that will be paid while inscribing the ordinal in sats/byte. (default=2 sats/byte)</td></tr><tr><td>count</td><td>Number</td><td>Number of files to be inscribed (default=1)</td></tr><tr><td>rareSats</td><td>String</td><td><p>Inscribe on a rare, exotic, early sat. </p><p>Options: block9 | block78 | pizza | uncommon | random</p><p>(default=random)</p><p></p><p>check <code>/inventory</code> endpoint for current availability.</p></td></tr><tr><td>type</td><td>Enum</td><td><p>The order type</p><p></p><p><strong>"bulk"</strong> for <a data-mention href="broken://pages/DZ49lzL7RFQn0H2WdHE1">Broken link</a><br><strong>"direct"</strong> for <a data-mention href="/api/create-a-direct-inscription-order">Create a Direct Inscription Order</a><br><strong>"rune-etch"</strong> for <a data-mention href="/runes/etch">Etch</a><br><strong>"rune-mint"</strong> for <a data-mention href="/runes/mint">Mint</a></p></td></tr><tr><td>batchMode</td><td>String</td><td>"separate-outputs" or "shared-output" if requesting price calculation for a batch inscription.</td></tr><tr><td>additionalFee</td><td>Number</td><td>Additional fee(in satoshis) to be added to order total and passed to your referral code.</td></tr><tr><td>postage</td><td>Number</td><td><p>Set custom postage for the order's asset: minimum 330 sats, maximum 10,000 sats.</p><p></p><p>(default=546)</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "chainFee": 41580,
    "serviceFee": 13704,
    "baseFee": 9000,
    "rareSatsFee": 0,
    "additionalFee": 0,
    "postage": 546,
    "amount": 55284,
    "totalFee": 55284
}
```

{% endtab %}
{% endtabs %}


# Create a Direct Inscription Order

Ordinalsbot supports simplified inscriptions that avoid the need to do additional commit transaction, thus reducing the cost of inscription.

Use this endpoint to create a direct inscription order that will be processed once the deposit address is funded.

{% hint style="warning" %}

* There's currently a limit of 10000 files per order.
* If you choose to send file contents as base64 or text encoded dataURL instead of url, there's a limit of 50MB per API call.
* Currently only internally hosted URLs are supported so if you're dynamically generating files, send them as [`dataURL`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) which will automatically be uploaded to OrdinalsBot buckets. (e.g. needs to be base64 and in this format \`data:plain/text;base64,dGVzdCBvcmRlcg==\`)
* The `/inscribe` endpoint has a rate limit of maximum of 2 requests every 10 seconds.
* There is a slight delay between the time the order is created and the charge address appears. You will need to poll the order after it is created to see the charge address. See [/order](/api/get-order-status)
* The deposit address for parent inscriptions will appear on the `depositAddress` field for each parent object, after which the order enters into a `waiting-parent` state. Make sure to send parents first, before paying the charge
* When paying for an order with multiple parent inscriptions make sure to craft a transaction such that you send the parents first, to the `depositAddress` of the parent array and send the charge payment last. **You can do this all in a single transaction.**
  {% endhint %}

### `POST` a new inscription order

## Create Order

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/inscribe`

Remember to include headers with your POST request:

`headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }`

#### Request Body

| Name                                             | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| files                                            | Array   | <p>An array of objects that includes:</p><p></p><p><strong>Mandatory</strong></p><p><strong>name</strong>:string; => name of the file including extension.</p><p><strong>size</strong>:number; => size of the file in bytes</p><p><strong>url</strong>:string; => file URL hosted on OrdinalsBot buckets</p><p></p><p><strong>Optional</strong></p><p><strong>metadataUrl</strong>:string; => metadata json file URL hosted on OrdinalsBot buckets</p><p><strong>metadataSize</strong>:number; => size of the metadata file in bytes</p><p><strong>metaprotocol</strong>:string; => Metaprotocol field to be included in the inscription data</p><p></p><p><em><strong>Note:</strong> you can send any dataURL text/json/image/video data in a parameter called <strong><code>dataURL</code></strong> instead of <strong>url</strong> for files</em></p><p><em>see below for sample payload.</em></p> |
| delegates                                        | Array   | <p>An array of objects that includes:<br><br><strong>Mandatory</strong><br><strong>delegateId</strong>: string; => the delegate inscription id<br><br><strong>Optional</strong></p><p><strong>metadataUrl</strong>:string; => metadata json file URL hosted on OrdinalsBot buckets</p><p><strong>metadataSize</strong>:number; => size of the metadata file in bytes</p><p><strong>metaprotocol</strong>:string; => Metaprotocol field to be included in the inscription data</p><p></p><p><em><strong>Note:</strong> you can send any dataURL text/json/image/video data in a parameter called <strong><code>dataURL</code></strong> instead of <strong>url</strong> for files</em></p>                                                                                                                                                                                                              |
| receiveAddress<mark style="color:red;">\*</mark> | String  | A single Bitcoin address to receive the inscriptions for the whole order                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| parents                                          | Array   | <p>Array of parent objects that will become parents to the inscriptions<br><br><strong>Mandatory</strong><br><strong>inscriptionId</strong>: string; => the inscription id of the parent<br><strong>returnAddress</strong>: string; => where to return this parent inscription<br><strong>value</strong>: number; => amount of sats in the parent inscription utxo</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| fee                                              | Number  | <p>Miner fee that will be paid while inscribing the ordinals in sats/byte.</p><p></p><p>(default=2 sats/byte)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| postage                                          | Number  | <p>Set custom postage for the order's asset: minimum 330 sats, maximum 10,000 sats.</p><p></p><p>(default=546)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| allowedSatributes                                | Array   | <p>Array of satributes that this inscription will be allowed to be inscribed on.<br><br>List of supported satributes are available at <a data-mention href="/sat-scanner-api/supported-satributes">/pages/O6XMHFThv8zYGGJtV2KO</a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| referral                                         | String  | Referral code to earn up to %15 of the order base fee.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| additionalFee                                    | Number  | <p>Amount of satoshis to charge extra for this order that will be added to "referral" account.</p><p>Needs to be used together with "referral" parameter.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| inscriptionIdPrefix                              | string  | <p>We will grind an inscription id prefix if this option is specified. All inscriptions in the order will have this prefix.<br>Maximum: 4 hex characters i.e. "b1fd" </p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| burnAfterInscribe                                | Boolean | ⚠️ If set to true, the "**receiveAddress**" will be ignored and inscription will be sent to p2a anchor address and then burned by sending it to OP\_RETURN "BRC20PROG".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| uncurseIt                                        | Boolean | <p>Will make the inscription envelope valid as per rules before jubilee to make the resulting inscription output not "cursed" hence, "not vindicated" (aka "blessed")</p><p>Refer to <a href="https://docs.ordinals.com/inscriptions.html#inscription-numbers">ordinals docs</a> for details.</p><p>NOTE: Some BRC20 indexers are strict about this and some are not...</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| webhookUrl                                       | String  | <p>webhook url to receive a POST payload for order updates.<br></p><p>Refer to <a data-mention href="/api/webhooks">/pages/JTttvvY9TijDbZ3AzmDH</a> for format of the webhook payload</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    status: 'ok',
    id: 'c411ca33-53dd-4d4f-b959-6c6dffcc88e5',
    ..., // input parameters
    charge: {
        // The payment address will appear with a short delay
        // Do a GET /order?id={id} to get the charge address
        amount: 1218725
    },
    chainFee: 718725 // in satoshis
    serviceFee: 2000, // in satoshis
    orderType: 'direct',
    createdAt: 1675785959855, // timestamp in ms,
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

{% hint style="success" %}
Supported file extensions may change. If you include any unsupported files order creation will fail.

Currently Supported files:\
\
`'apng', 'flac', 'gif', 'html', 'jpg','jpeg', 'mp3', 'pdf', 'png', 'svg', 'txt', 'wav', 'webm', 'webp', 'mp4', 'stl', 'glb', 'avif', 'yaml' , 'yml', 'asc', 'json', 'js', 'css', 'gz'`
{% endhint %}

```json
// Here's a sample payload you can POST to create an order with metadata
{
    "files": [
        {
            "size": 10,
            "type": "plain/text",
            "name": "my-text-inscription-file.txt",
            "dataURL": "data:plain/text;base64,dGVzdCBvcmRlcg==",
            "metadataDataURL": "data:application/json;base64,ewogICAgImluc2NyaWJlZF9ieSI6ICJPcmRpbmFsc0JvdCIKfQ==",
            "metadataSize": 37
        }
    ],
    "postage": 546,
    "receiveAddress": "",
    "fee": "11"
}
```

## Example of parent/child order with a delegate

*Inscription properties:*

* one delegate inscription of 0426b1e763be8f7b6cff7bc05640534f506d174dc6f14b57ce146bc37a553b06i0
* three parents
* chosen prefix "00"

*Result:* <https://ordinals.com/inscription/00ee0087bb02437ed3eab12089442f24fd367fe827989372871e196e6bcec218i0>

When `depositAddress` becomes available on each parent object and `address` under the `charge` object you can exectute sending of the parents and paying the charge in a single transaction. The only requirement is that you send the parents before you send the charge. Here is an example of a funding transaction to an order of this type: <https://mempool.space/tx/165987ba58ddfea7d8b4d0adfbc89b271bd01b7bcd911e2eb2ed5e431e3ad4a2>

* the three parents are sent first
* the charge payment is sent last

```json
// here is a sample playload you can post to create an order for a single delegate 
// inscription with three parents
{
    "delegates": [
        {
            "delegateId": "0426b1e763be8f7b6cff7bc05640534f506d174dc6f14b57ce146bc37a553b06i0"
        }
    ],
    "parents": [
        {
            "inscriptionId": "b951105d1e91a48a6d2aa2f8d3531314e6a7c7a16d7ffd78d3dd1feaaa2e4ffci0",
            "returnAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3"
        },
        {
            "inscriptionId": "b951105d1e91a48a6d2aa2f8d3531314e6a7c7a16d7ffd78d3dd1feaaa2e4ffci1",
            "returnAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3"
        },
        {
            "inscriptionId": "b951105d1e91a48a6d2aa2f8d3531314e6a7c7a16d7ffd78d3dd1feaaa2e4ffci2",
            "returnAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3"
        }
    ],
    "inscriptionIdPrefix": "00",
    "postage": 546,
    "receiveAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3",
    "fee": 15
}
```

## Pay Order with Special Sats

Use this endpoint to create a PSBT from user's wallet, that would pay a direct inscription deposit address created above with [#post-a-new-inscription-order](#post-a-new-inscription-order "mention")such that the resulting inscription will sit on the special sat from user's own wallet.

{% hint style="warning" %}
Make sure to **carefully review any transactions you are signing** in order to avoid unexpected consequences. Most wallets show the inputs & outputs of a PSBT before you sign them.
{% endhint %}

### Create Special Sat Payment PSBT

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/create-special-sats-psbt`

Create a PSBT that would generate a inscription on the special sat provided, fees and postage comes out of a common sat output.\
\
**Below is an example of creating the PSBT and singing it using XVerse wallet:**

```javascript
/**
 * Create a PSBT for signing the transaction by calling the /create-special-sats-psbt API.
 * This returns a base64-encoded PSBT, PSBT Hex, sender ordinal, and payment inputs that need to be signed.
 */
const {
  psbtBase64,
  paymentInputIndices,
  ordinalInputIndices,
  psbtHex
} = await axios({
  method: "post",
  url: "https://api.ordinalsbot.com/create-special-sats-psbt",
  data: {
    chargeAmount, // The amount of sats to be pay
    fundingAddress, // The address to which the user will send bitcoin funds.
    specialSatsOutput, // The special sats output selected for inscription by user. (e.g xxxxxx:0)
    paymentAddress, // The user's payment address.
    paymentPublicKey, // The user's payment address' public key..
    ordinalAddress, // The user's ordinal address.
    ordinalPublicKey, // The user's ordinal address public key.
    feeRate, // The fee rate selected by the user in sats/vB.
  },
});

// prepare the inputs for XVerse wallet to sign
const inputsToSign = [
  {
    address: ordinalsAddress,
    signingIndexes: ordinalInputIndices,
  },
  {
    address: paymentAddress,
    signingIndexes: paymentInputIndices,
  },
];

// When using XVerse Wallet
// Create the payload for signing the transaction
const payload = {
  network: { type: "Mainnet" },
  message: "Sign Transaction",
  psbtBase64: psbtBase64, // PSBT returned by the API call
  broadcast: true,
  inputsToSign: inputsToSign,
};

// Make signing request to wallet, this will prompt the user to sign
await signTransaction({
  payload,
  onFinish: async (response) => {
    try {
      console.log({ response });
      console.log(`Payment successful: ${response?.txId}`);
    } catch (saveError) {
      console.error("Error Payment:", saveError);
    }
  },
  onCancel: () => console.log("Payment canceled"),
});

```

#### Request Body

| Name                                                | Type   | Description                                                                                                                                                                                                            |
| --------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| chargeAmount<mark style="color:red;">\*</mark>      | Number | Total amount to be sent to fundingAddress as fees and postage.                                                                                                                                                         |
| fundingAddress<mark style="color:red;">\*</mark>    | String | <p>The address to which the PSBT will send funds.<br><br>Note: This address would come from <a data-mention href="/api/create-a-direct-inscription-order">/pages/IPVBmJE53CGxMwVlIQap</a></p>                          |
| paymentAddress<mark style="color:red;">\*</mark>    | String | Bitcoin payment address where common sats for fees and postage will be paid from.                                                                                                                                      |
| paymentPublicKey<mark style="color:red;">\*</mark>  | String | Bitcoin payment public key where where common sats for fees and postage will be paid from.                                                                                                                             |
| ordinalAddress<mark style="color:red;">\*</mark>    | String | The ordinal address which is a taproot address for inscriptions, runes or BRC20.                                                                                                                                       |
| ordinalPublicKey<mark style="color:red;">\*</mark>  | String | The public key for the ordinals address which is a taproot address for inscriptions, runes or BRC20.                                                                                                                   |
| specialSatsOutput<mark style="color:red;">\*</mark> | String | <p>UTXO that contains the special/rare sat that will inscribed on. This should be in <code>txid:vout</code> format for example:<br><code>bab2074844dbf62264e2bcf4298ee90d135973e2fe43ae7e33923e7e0c2d1884:0</code></p> |
| feeRate<mark style="color:red;">\*</mark>           | Number | Target Fee rate that should be used in sats/vB                                                                                                                                                                         |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    // PSBT to be signed and published by user's wallet
    "psbtBase64": "cHNi...AAAAA",
    // same PSBT in hex format (for leather wallet)
    "psbtHex": "70736274ff01...47dc200000000",
    // Payment inputs to sign with the payment address
    "paymentInputIndices": [
        1
    ]
    // Ordinal inputs to sign with the ordinal address
    "ordinalInputIndices": [
        0
    ]
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to check data'
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Get in touch for any feedback regarding this service in **#developers** channel on our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}

## Pay for Parent Child Direct inscribe order

Use this endpoint to create a PSBT from user's wallet, that would pay a direct inscription order for multi parent direct inscribe order. This transaction will pay the charge in btc and also transfer the multiple parents:

{% hint style="warning" %}
Make sure to **carefully review any transactions you are signing** in order to avoid unexpected consequences. Most wallets show the inputs & outputs of a PSBT before you sign them.
{% endhint %}

### Create PSBT to pay for Parent Child order

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/create-parent-child-psbt`<br>

| Name                                               | Type   | Description                                                                                                                                                                                |
| -------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| orderId<mark style="color:red;">\*</mark>          | String | The ID of the parent child order. The PSBT will be created to pay the bitcoin fee as well as to transfer the parent inscriptions for this order                                            |
| paymentAddress<mark style="color:red;">\*</mark>   | String | Bitcoin payment address where common sats for fees and postage will be paid from.                                                                                                          |
| paymentPublicKey<mark style="color:red;">\*</mark> | String | Bitcoin payment public key where where common sats for fees and postage will be paid from.                                                                                                 |
| ordinalAddress<mark style="color:red;">\*</mark>   | String | Address for holding ordinals which is usually a taproot address for inscriptions, runes and BRC20.                                                                                         |
| ordinalPublicKey<mark style="color:red;">\*</mark> | String | The public key for the ordinals address which is a taproot address for inscriptions, runes or BRC20.                                                                                       |
| feeRate<mark style="color:red;">\*</mark>          | Number | Target Fee rate that should be used in sats/vB                                                                                                                                             |
| specialSatsOutput                                  | String | <p>(Optional) Special sat utxo you want to use for the inscription itself. </p><p></p><p>This utxo will be placed after parents, before any fee utxo pulled from your payment address.</p> |

{% hint style="info" %}
Get in touch for any feedback regarding this service in **#developers** channel on our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    // PSBT to be signed and published by user's wallet
    "psbtBase64": "cHNi...AAAAA",
    // same PSBT in hex format (for leather wallet)
    "psbtHex": "70736274ff01...47dc200000000",
    // Payment inputs to sign with the payment address
    "paymentInputIndices": [
        1
    ]
    // Ordinal inputs to sign with the ordinal address
    "ordinalInputIndices": [
        0
    ]
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to check data'
}
```

{% endtab %}
{% endtabs %}

**Below is an example of creating the PSBT and singing it using XVerse wallet:**

```javascript
/**
 * Create a PSBT for signing the transaction by calling /create-parent-child-psbt
 * API.
 * This returns a base64-encoded PSBT, PSBT Hex, sender ordinal, and 
 * payment and ordinal inputs that need to be signed.
 */
const {
  psbtBase64,
  paymentInputIndices,
  ordinalInputIndices,
  psbtHex
} = await axios({
  method: "post",
  url: "https://api.ordinalsbot.com/create-parent-child-psbt",
  data: {
    orderId, // The ID of the order for which to create the PSBT.
    paymentAddress, // The user's payment address.
    paymentPublicKey, // The user's payment address public key.
    ordinalAddress, // The user's ordinal address.
    ordinalPublicKey, // The user's ordinal address public key.
    feeRate, // The fee rate selected by the user in sats/vB.
  },
});

// input to sign
const inputsToSign = [
  {
    address: ordinalsAddress,
    signingIndexes: ordinalInputIndices,
  },
  {
    address: paymentAddress,
    signingIndexes: paymentInputIndices,
  },
];

// When using XVerse Wallet
// Create the payload for signing the transaction
const payload = {
  network: { type: "Mainnet" },
  message: "Sign Transaction",
  psbtBase64: psbtBase64, // PSBT returned by the API
  broadcast: true,
  inputsToSign: inputsToSign,
};

// Make signing request
await signTransaction({
  payload,
  onFinish: async (response) => {
    try {
      console.log({ response });
      console.log(`Payment successful: ${response?.txId}`);
    } catch (saveError) {
      console.error("Error Payment:", saveError);
    }
  },
  onCancel: () => console.log("Payment canceled"),
});
```

## Order States

Direct inscription orders go through below states, note that some of them are optional.

```json
'prep' // commit address is being generated
'waiting-parent' // optional - order is waiting for the parent inscription to hit the wallet
'waiting-payment' // order is waiting for a payment to be detected
'mempool' // payment tx is seen and reveal tx is broadcasted into the mempool
'completed' // reveal tx received 1 confirmation, order is finalized.
```


# Get Order Status

Use this endpoint to check the status of an order.

{% hint style="warning" %}
The GET /order endpoint has a rate limit of maximum 300 requests a minute.
{% endhint %}

## Get Order Status

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/order`

Check an inscription order status.

#### Query Parameters

| Name                                 | Type   | Description                                    |
| ------------------------------------ | ------ | ---------------------------------------------- |
| id<mark style="color:red;">\*</mark> | String | Order ID returned by the `/bulkorder` endpoint |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    status: 'ok', 
    paid: true, // order payment successfully received
    underpaid: true, // order is underpaid => user needs to complete the payment.
    expired: true, // order payment is not received in the allocated time,
    tx: {
        "commit": "edc...be9",
        "fees": 157840,
        "inscription": "dff...5i0",
        "reveal": "dff...0c5"
    }, // inscription data as returned by ord wallet
    sent: '4axxxdeadbeef', // order is inscribed and sent to the provided address
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```json
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server Side Error" %}

```json
{
    status: 'error',
    reason: 'unable to save data'
}
```

{% endtab %}
{% endtabs %}


# Create a Collection

Use these endpoints to create a collection that other users will be able to create orders on and inscribe on demand.

{% hint style="warning" %}
All collections must be approved by the ordinalsbot.com team before they go live.

Collections with over 1000 items need to be manually uploaded.

Get in touch with us on [Discord](https://discord.ordinalsbot.com).

The `/order` endpoint has a rate limit of 2 requests per 10 seconds.A
{% endhint %}

## Create Collection

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/collection-create`

Use this method to create a collection, if your files are already on a publicly accessible URL.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

<table><thead><tr><th width="282">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>files</td><td>Object</td><td><p>An array of objects that includes:</p><p>name:string; => name of the file including extension.</p><p>size:number; => size of the file in bytes</p><p><strong>url:string; => publicly accessible image URL</strong></p><p>You can also provide files manually after contacting us.</p></td></tr><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td><p>URL safe unique collection slug.</p><p>Will be used as mint URL.</p></td></tr><tr><td>name<mark style="color:red;">*</mark></td><td>String</td><td>Collection Display Name</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>String</td><td>Collection description</td></tr><tr><td>creator<mark style="color:red;">*</mark></td><td>String</td><td>Collection creator</td></tr><tr><td>totalCount<mark style="color:red;">*</mark></td><td>Number</td><td>Max supply of the collection.</td></tr><tr><td>price</td><td>Number</td><td><p>Inscription price per file (for collection creator)</p><p>set to 0 for free mints</p></td></tr><tr><td>altPrices</td><td>Object</td><td><p>Price item in collection with rune tokens. Any rune token can be used.</p><p></p><p>Parameters:<br><strong>rune => rune price object</strong><br><strong>rune price object => amount</strong></p><p><strong>rune price object => token</strong><br></p><p>example:</p><pre class="language-json"><code class="lang-json">{
        "rune": {
            "amount": 1,
            "token": "SHITCOIN•PARADISE"
        }
}
</code></pre></td></tr><tr><td>twitter</td><td>String</td><td>Collection twitter account</td></tr><tr><td>website</td><td>String</td><td>Collection website</td></tr><tr><td>banner</td><td>String</td><td>Collection banner image URL</td></tr><tr><td>cover</td><td>String</td><td>Collection cover image URL</td></tr><tr><td>creator-address</td><td>String</td><td>Bitcoin address to receive payouts from inscriptions</td></tr><tr><td>allowList</td><td>Object</td><td><p>allowList object in this format</p><p></p><p>{</p><p>  "address1": {</p><p>    "allocation": 5</p><p>  },</p><p>  "address2": {</p><p>    "allocation": 3</p><p>  },</p><p>}</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    status: 'ok',
    ..., // input parameters
    createdAt: 1675785959855, // timestamp in ms,
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
As a collection creator, if you need access to inscription IDs from your collection you can access them here: <https://api.ordinalsbot.com/get-collection-json?id=>\<collection-id>
{% endhint %}

## Get Collection JSON

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/get-collection-json`

Use this method to get a collection json, that is usable by marketplaces for secondary market listing.

#### Request Parameters

<table><thead><tr><th width="288">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td>URL safe unique collection ID of the collection on OrdinalsBot</td></tr><tr><td>onchainFormat</td><td>Boolean</td><td>Set to <code>true</code> if you prefer to have the collection json in EVM friendly format.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
[
    {
        "id": "0c3d76bfbe081ffe3c447348b1f45e373a60b267ca3de96a46ab59473dab2c2bi0",
        "meta": {
            "attributes": {
                "inscribed_by": "OrdinalsBot"
            },
            "name": "Pixlbot Test 1 #1"
        }
    },
    ...
]
```

{% endtab %}

{% tab title="200: OK" %}

```json
// onchainFormat=true
[
    {
        "id": "0c3d76bfbe081ffe3c447348b1f45e373a60b267ca3de96a46ab59473dab2c2bi0",
        "meta": {
            "inscribed_by": "OrdinalsBot",
            "name": "Pixlbot Test 1 #1"
        }
    },
    {
        "id": "568d0c679af7f9c6304c55841b781eb72c4e5535fb8451322ed3e243b52e1584i0",
        "meta": {
            "inscribed_by": "OrdinalsBot",
            "name": "Pixlbot Test 1 #2"
        }
    },
    ...
]
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create a Collection Order

Use this endpoint to create an inscription order that will inscribe a file from an existing collection.

{% hint style="info" %}
You need an API KEY to create collection orders. You can reach out to us via [discord](https://discord.ordinalsbot.com) to get one.

API KEYs are separate for testnet and mainnet.
{% endhint %}

{% hint style="warning" %}

* The /collectionorder endpoint has a rate limit of maximum 2 requests every 10 seconds.
* If pricing of the collection is in runes then `charge` will be null. Instead, `tokenPayCharge` will be available. User needs to send `tokenPayCharge.feeCharge.amount` of BTC to `tokenPayCharge.feeCharge.address` and `tokenPayCharge.tokenCharge.amount` of  tokens to `tokenPayCharge.tokenCharge.address`
  {% endhint %}

## Create Collection Order

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/collectionorder`

#### Headers

| Name                                        | Type   | Description                                                     |
| ------------------------------------------- | ------ | --------------------------------------------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | <p>API Key</p><p>Required if no turnstile token is present.</p> |

#### Request Body

| Name                                         | Type   | Description                                                                                                                                                                                                                                                                                                                                                         |         |       |          |       |         |                                                                                                                       |
| -------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----- | -------- | ----- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| collection<mark style="color:red;">\*</mark> | Object | <p>Object including</p><p>id: Collection slug to be inscribed</p><p>count: number of inscriptions being ordered.</p>                                                                                                                                                                                                                                                |         |       |          |       |         |                                                                                                                       |
| receiveAddress                               | String | Bitcoin address to receive the inscriptions for the whole order                                                                                                                                                                                                                                                                                                     |         |       |          |       |         |                                                                                                                       |
| token<mark style="color:red;">\*</mark>      | String | <p>Cloudflare turnstile token</p><p>Required if no x-api-key header is present.</p>                                                                                                                                                                                                                                                                                 |         |       |          |       |         |                                                                                                                       |
| rareSats                                     | String | <p>One of following options: </p><p>block9                                                                                                                                                                                                                                                                                                                          | block78 | pizza | uncommon | black | vintage | random<br></p><p>Check <code>/inventory</code> endpoint for all available options and their current availability.</p> |
| fee<mark style="color:red;">\*</mark>        | Number | Mining fee to be paid for this collection inscription (sats/vB)                                                                                                                                                                                                                                                                                                     |         |       |          |       |         |                                                                                                                       |
| additionalFee                                | Number | <p>Amount of satoshis to charge extra for this order that will be added to "referral" account.</p><p>Needs to be used together with "referral" parameter.</p><p></p><p><mark style="color:red;"><strong>Note: additionalFee is added PER FILE!</strong></mark></p>                                                                                                  |         |       |          |       |         |                                                                                                                       |
| referral                                     | String | Referral code to earn up to %15 of the order service fee.                                                                                                                                                                                                                                                                                                           |         |       |          |       |         |                                                                                                                       |
| timeout                                      | Number | <p>Order timeout in minutes. Must be a multiple of 10. </p><p></p><p>Generated payment invoice will be valid for this duration only. Payments that are sent after this will not be processed.</p><p></p><p>Refrain from using too short timeout values and instead use <a data-mention href="#cancel-an-order">#cancel-an-order</a></p><p></p><p>(default=4320)</p> |         |       |          |       |         |                                                                                                                       |
| webhookUrl                                   | String | <p>webhook url to receive a POST payload for order updates</p><p></p><p>Refer to <a data-mention href="/api/webhooks">/pages/JTttvvY9TijDbZ3AzmDH</a> for format of the webhook payload</p>                                                                                                                                                                         |         |       |          |       |         |                                                                                                                       |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json">{
    status: 'ok',
    ..., // input parameters
<strong>    charge: {
</strong>        ...
        "id": "815xxx-xxx-xxx-xxx79",
        "address": "3P...Vu",
        "amount": 1218725,
        "lightning_invoice": {
            "expires_at": 1675786558,
            "payreq": "lnbc1218...7qz9v"
        },
        "created_at": 1677176476,
    },
    paylink: {
        "id": "66xxx16", // visit https://app.hel.io/pay/66xxx16 to pay
    },
    chainFee: 718725 // in satoshis
    serviceFee: 100000, // in satoshis
    orderType: 'bulk',
    createdAt: 1675785959855, // timestamp in ms,
}
</code></pre>

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create Text Inscription Order

Use this endpoint to create an inscription order that will inscribe some text string.

{% hint style="warning" %}
The /textorder endpoint has a rate limit of maximum 2 requests every 10 seconds.
{% endhint %}

## Create Text Order

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/textorder`

#### Request Body

| Name                                    | Type   | Description                                                                                   |
| --------------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| texts<mark style="color:red;">\*</mark> | Array  | An array of strings to be inscribed                                                           |
| receiveAddress                          | String | Bitcoin address to receive the inscriptions for the whole order                               |
| fee                                     | Number | Miner fee that will be paid while inscribing the ordinals in sats/byte. (default=2 sats/byte) |
| referral                                | String | Referral code to earn up to 15% of the order service fee.                                     |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json">{
    status: 'ok',
    ..., // input parameters
<strong>    charge: {
</strong>        ...
        "id": "815xxx-xxx-xxx-xxx79",
        "address": "3P...Vu",
        "amount": 1218725,
        "lightning_invoice": {
            "expires_at": 1675786558,
            "payreq": "lnbc1218...7qz9v"
        },
        "created_at": 1677176476,
    },
    chainFee: 718725 // in satoshis
    serviceFee: 100000, // in satoshis
    orderType: 'bulk',
    createdAt: 1675785959855, // timestamp in ms,
}
</code></pre>

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Search Inscriptions

Search millions of inscriptions for any text. Check if a hash of any data has been inscribed before.

{% hint style="success" %}
As of January 2024, access to search endpoints are restricted to API Keys and allowlisted domains, if you need access to these endpoints please reach out to us on [discord](https://discord.ordinalsbot.com).

All results are as ***sorted earliest first by inscription numbers***, so they can be used to check which inscription is first for a certain hash.
{% endhint %}

### Search all inscriptions for any text value

## Text Search

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/search`

You can search for any text string against all existing inscriptions.

Pagination options can be specified by adding `itemsPerPage` and `page`\
values in the query parameters. Response provides an array of results as well as information on current page, total page numbers and total items available for the search criteria.\
\
Response structure:

`{` \
&#x20;         `results: [{},{},{},{}], // array of restults` \
&#x20;         `count: 0, // number of Ordinals in the current results array`\
&#x20;         `currentPage: page, // current page number` \
&#x20;         `totalPages: 0, // total pages that can be returned for the current search criteria` \
&#x20;         `totalItems: 0 // total items in the database for the current search criteria` \
`}`

#### Query Parameters

| Name                                   | Type   | Description                                                                                                                                                                                                                                                               |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| text<mark style="color:red;">\*</mark> | String | <p>The text you want to search</p><p></p><p><strong>Note</strong>: text field can also accept a list of comma separated strings such that it will do a search where ALL of these strings exist in the inscription content.</p><p><code>?text=some,random,words</code></p> |
| page                                   | Number | The page number in the list of pages to return by default the first page is returned                                                                                                                                                                                      |
| itemsPerPage                           | Number | The number of iterms to return in each page, this defaults to 100                                                                                                                                                                                                         |

#### Headers

| Name      | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| x-api-key | String | <p>API Key</p><p>Required if domain is not on allowlist.</p> |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    "status":"ok",
    "count": 1,
    "currentPage": 3,
    "totalPages": 3,
    "totalItems": 102
    "itemsPerPage": 100,
    "results":
   [
      {
         "txid":"87a1d452d2dcc89c66018a897c9910629d6c3173820979a740730e195433fd26",
         "inputindex":"0",
         "inscriptionid":"87a1d452d2dcc89c66018a897c9910629d6c3173820979a740730e195433fd26i0",
         "inscriptionnumber":"181258",
         "blockheight":"778281",
         "contentstr":"{\"p\":\"sns\",\"op\":\"reg\",\"name\":\"ordinalsbot.sats\"}",
         "contenttypestr":"text/plain;charset=utf-8",
         "contenthash":"c987a51dc14fb8e9e909b8482c1c62df246904442e851f41d6891e7af3042b23",
         "contentlength":"30",
         "metadatastr": "{\"integer\":123,\"float\":123.456,\"string\":\"hello world\",\"array\":[1,2,3],\"object\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"boolean\":true,\"null\":null,\"undefined\":\"undefined\",\"byteString\":\"48656c6c6f20576f726c64\",\"taggedData\":{\"tag\":1,\"value\":\"2022-12-31T23:59:59Z\"}}",
         "createdat":"2023-03-08T21:05:16.349Z"
      }
   ]
}
```

{% endtab %}

{% tab title="200: OK Response with Error" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'server error'
}
```

{% endtab %}
{% endtabs %}

### Search for an existing Image or File

Use this endpoint to check if a certain image was inscribed before. We call this a "hash check".

{% hint style="info" %}
Image Search is done by hashing the image file and checking against previous inscriptions' hashes.

To use this endpoint you need to sha256 hash the image file content as below:
{% endhint %}

```javascript
const base64encodedimage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAoElEQVR42u2VMQ6AMAhFe0fT1d3V3cv0ojUxaoBSBEo3Sf7S6n+UIqb0R2BUoHjjnPOrSBAyphqFiOajEJW5F9KrdyMvBL10lK0r+qwJ8GVOIVoAm/26L5eg8bNmPQWbfb1rzq3B+3ADaPZwzQJoukZ7B1qICkD3wgHTTzAVwO1ZOwlBep3DQc1tqimR1Vz8FqSB55qmEmD0fyACmBEuxglnHBu4i1egeQAAAABJRU5ErkJggg=='
const buff = Buffer.from(base64encodedimage.split(";base64,")[1], 'base64');
const imageHash = bitcoin.crypto.sha256(buff).toString('hex')
```

## Search for Image

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/search`

Check for previous occurrences of an image in inscriptions. Results array will be sorted by ascending block height.\
\
Pagination parameters are the same as text search

#### Query Parameters

<table><thead><tr><th width="106">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>hash<mark style="color:red;">*</mark></td><td>String</td><td>sha256 hash of an image buffer in hex</td></tr><tr><td>page</td><td>Number</td><td>The page number in the list of pages to return by default the first page is returned</td></tr><tr><td>itemsPerPage</td><td>Number</td><td>The number of iterms to return in each page, this defaults to 100</td></tr></tbody></table>

#### Headers

| Name      | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| x-api-key | String | <p>API Key</p><p>Required if domain is not on allowlist.</p> |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    "status":"ok",
    "count": 1,
    "currentPage": 3,
    "totalPages": 3,
    "totalItems": 102
    "itemsPerPage": 100,
    "results":
    [
        {
            "txid":"ea0d...a8",
            "inputindex":"0",
            "inscriptionid":"ea0d....8i0",
            "blockheight":"775528",  // use blockheight as timestamp
            "contenttypestr":"image/png",
            "contenthash":"59edca9...a9ca4c80d",
            "contentlength":"217",
            "createdat":"2023-03-08T16:30:38.690Z" // this is when record is parsed - not the block timestamp
        },
        ...
    ]
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'server error'
}
```

{% endtab %}
{% endtabs %}

### Search all inscriptions for any metadata value

## Metadata Search

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/indexer/metadata`

You can search for any text inside metadata fields of all existing inscriptions.

Pagination options can be specified by adding `itemsPerPage` and `page`\
values in the query parameters. Response provides an array of results as well as information on current page, total page numbers and total items available for the search criteria.\
\
Response structure:

`{` \
&#x20;         `results: [{},{},{},{}], // array of restults` \
&#x20;         `count: 0, // number of Ordinals in the current results array`\
&#x20;         `currentPage: page, // current page number` \
&#x20;         `totalPages: 0, // total pages that can be returned for the current search criteria` \
&#x20;         `totalItems: 0 // total items in the database for the current search criteria` \
`}`

#### Query Parameters

| Name                                   | Type   | Description                                                                                                                                                                                                                                                                          |
| -------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| text<mark style="color:red;">\*</mark> | String | <p>The text you want to search inside <strong>metadata</strong> fields of all inscriptions. </p><p></p><p>This can be a list of strings separated by comma if you want to search for multiple strings at once (<strong>AND</strong> search) i.e.:</p><p>?text=donot,trust,verify</p> |
| page                                   | Number | The page number in the list of pages to return by default the first page is returned                                                                                                                                                                                                 |
| itemsPerPage                           | Number | The number of iterms to return in each page, this defaults to 100                                                                                                                                                                                                                    |

#### Headers

| Name      | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| x-api-key | String | <p>API Key</p><p>Required if domain is not on allowlist.</p> |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    "status":"ok",
    "count": 1,
    "currentPage": 3,
    "totalPages": 3,
    "totalItems": 102
    "itemsPerPage": 100,
    "results":
   [
      {
         "txid":"87a1d452d2dcc89c66018a897c9910629d6c3173820979a740730e195433fd26",
         "inputindex":"0",
         "inscriptionid":"87a1d452d2dcc89c66018a897c9910629d6c3173820979a740730e195433fd26i0",
         "inscriptionnumber":"181258",
         "blockheight":"778281",
         "contentstr":"{\"p\":\"sns\",\"op\":\"reg\",\"name\":\"ordinalsbot.sats\"}",
         "contenttypestr":"text/plain;charset=utf-8",
         "contenthash":"c987a51dc14fb8e9e909b8482c1c62df246904442e851f41d6891e7af3042b23",
         "contentlength":"30",
         "metadatastr": "{\"integer\":123,\"float\":123.456,\"string\":\"hello world\",\"array\":[1,2,3],\"object\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"boolean\":true,\"null\":null,\"undefined\":\"undefined\",\"byteString\":\"48656c6c6f20576f726c64\",\"taggedData\":{\"tag\":1,\"value\":\"2022-12-31T23:59:59Z\"}}",
         "createdat":"2023-03-08T21:05:16.349Z"
      }
   ]
}
```

{% endtab %}

{% tab title="200: OK Response with Error" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'server error'
}
```

{% endtab %}
{% endtabs %}

## Search for Inscription ID

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/indexer/inscription`

Check for an inscription in our indexer. This endpoint allows you to see if an inscription is indexed by our indexer and will return content hash and content string.

#### Query Parameters

<table><thead><tr><th width="106">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td>Inscription id i.e. <code>98e0f396ecff2eef7914e35a90a44e3bb7601c7071985cfacfd2d5f29c5207e7i0</code></td></tr></tbody></table>

#### Headers

| Name      | Type   | Description                                                  |
| --------- | ------ | ------------------------------------------------------------ |
| x-api-key | String | <p>API Key</p><p>Required if domain is not on allowlist.</p> |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    "status": "ok",
    "results": [
        {
            "txid": "98e0f396ecff2eef7914e35a90a44e3bb7601c7071985cfacfd2d5f29c5207e7",
            "inputindex": "0",
            "inscriptionid": "98e0f396ecff2eef7914e35a90a44e3bb7601c7071985cfacfd2d5f29c5207e7i0",
            "inscriptionnumber": "45652",
            "blockheight": "222945",
            "contenttypestr": "video/mp4",
            "owner": null,
            "content": "000000206674797069736f6d0000020069736f6d69736f32617663316d703431000000086672656500000a756d646174000002ae0605ffffaadc45e9bde6d948b7962cd820d923eeef78323634202d20636f7265203136342072333130382033316531396639202d20482e3236342f4d5045472d342041564320636f646563202d20436f70796c65667420323030332d32303233202d20687474703a2f2f7777772e766964656f6c616e2e6f72672f783236342e68746d6c202d206f7074696f6e733a2063616261633d31207265663d33206465626c6f636b3d313a303a3020616e616c7973653d3078333a3078313133206d653d686578207375626d653d37207073793d31207073795f72643d312e30303a302e3030206d697865645f7265663d31206d655f72616e67653d3136206368726f6d615f6d653d31207472656c6c69733d31203878386463743d312063716d3d3020646561647a6f6e653d32312c313120666173745f70736b69703d31206368726f6d615f71705f6f66667365743d2d3220746872656164733d34206c6f6f6b61686561645f746872656164733d3120736c696365645f746872656164733d30206e723d3020646563696d6174653d3120696e7465726c616365643d3020626c757261795f636f6d7061743d3020636f6e73747261696e65645f696e7472613d3020626672616d65733d3320625f707972616d69643d3220625f61646170743d3120625f626961733d30206469726563743d3120776569676874623d31206f70656e5f676f703d3020776569676874703d32206b6579696e743d323530206b6579696e745f6d696e3d3235207363656e656375743d343020696e7472615f726566726573683d302072635f6c6f6f6b61686561643d34302072633d637266206d62747265653d31206372663d32332e302071636f6d703d302e36302071706d696e3d302071706d61783d3639207170737465703d342069705f726174696f3d312e34302061713d313a312e30300080000002ab658884003bfffef74ebf029b45976a0392570af6caa42659fdd28e1d9e92a8270e6d6aa52ce3d7a7b04aa00b6ca6d7c4f54315dcd164242960764aafcbb4cf97b20af1ad3ead8dcd324c4de45ceb06e413cf3c164dc1daeac2e391af678e58f356bccaf8bfe8280c04a65bff52bc3b29eeb7cb3a7608263f7fcf7279e79b29637d8583f62d4e42a791ed8b548ec2e1557ec559e331565a1712da253fb44e77fa99939ac26ed85a6bc9c43edc44e70ea395ac81d2a27e108ea4333146d2c4303202f3f700a70fbbf9fc9b2e7fa9571d307fe3f959ac8bf1f6da68ea7c5c1d1b57b456af389bbea3708deb9508ea98a0d47430df81dd035cd2d49a646450bb2c18f05cc97747763874faf95c0e22ce353b1211a126a1cdace2b3857578e54958a598b656a855485d2756a95bd2b866b4bae2c0697bb8651d0e295a12beba927da9b39d099d6319669a84c1e9e4bd5cc29785b429f13153d1cd778e86f0175fc96d43d40bea19343bf9629a487f22f62e949283bca903809ee912a1b34ef3191dd1365f81d46a8898d83fd90191d820c0beb550617d24dee16bcc3f96b1afdf059e72a84ff1f745e121d294610f4241af5a1c4b4b6280e119c0bb2aabc0c5eca9e037bd55274bf196344c4bc52ee57daa3aba56cfcb51c6af8f07bc48a506e451dcc3fe66a6d0dc495aed3c98aaae1f08ff2167e284bd45f96c6e2629599a8eddf6f96f3ea7bf896a4997f692c033e34479d7b480f8c5ac1df57cb8e322c43f6349c9e0adfbdd7e4e199309cae86fd5845b362d9be8549066e3cef64e0ec9eb13e9946f56b497d8752c457088b8939cc2eb3dcd25c31f62088e14ea32663d815ea1c4628f35a918ae2998eabeb2dec22ec33f1286cf5305b7e554d53afb4a2edf21a1f34c820a44f77ae49daf71f1bf42b61dbde8fa73688e13b389040ed1bf6fe978dd096f218120fa06aa7700000011419a246c43bffea996085f105a5dd90e38000000c1419e4278857fd55ff9141fffc7f55189ce22c8a1caf384806e209d74d9c176c6a5a29aef5d3f2bcc83b2d40093725db545277faf66bfd0206d86e5f82884fb3d2dd0eff79eee0be90ec51854bf2baee2c5c80094af36e5cd006dfd97de760bb5843f9a424c5ce6e4737c59f6b1c15deb6f31d5652cd0e65486f54cbacb5e390e07873e96aeca2d3bce44dc4d08734ffb5934aa43c27edf02c09547e55bcfc9e083d947ca2fc694d744e8c01ce265e180bc4ecec7ea72f672de9ff4584b534aeb3b00000010019e6174427ff75f20c0653681ea8cf000000021019e636a427ff5f690916542f15dc8dafb0d7b38b0f35db5ac4726a711d55a285d00000012419a6849a84168994c0877fffea99600c48100000024419e8645112c2bfff64427732d9057f588a36bfc7ef8ca25c45db97faf353dfd151cd6290000000d019ea574427ff75f20bde7f57d0000000b019ea76a427ff5f690588400000012419aac49a8416c994c0877fffea99600c4800000000e419eca45152c2bfff64427692d810000000d019ee974427ff75f20bde7f57d0000000b019eeb6a427ff5f690588400000012419af049a8416c994c0877fffea99600c4810000000e419f0e45152c2bfff64427692d810000000d019f2d74427ff75f20bde7f57d0000000b019f2f6a427ff5f690588400000012419b3449a8416c994c0877fffea99600c4800000000e419f5245152c2bfff64427692d810000000d019f7174427ff75f20bde7f57d0000000b019f736a427ff5f690588400000012419b7849a8416c994c0877fffea99600c4810000000e419f9645152c2bfff64427692d800000000d019fb574427ff75f20bde7f57d0000000b019fb76a427ff5f690588500000012419bbc49a8416c994c0877fffea99600c4800000000e419fda45152c2bfff64427692d810000000d019ff974427ff75f20bde7f57d0000000b019ffb6a427ff5f690588500000012419be049a8416c994c0877fffea99600c4810000000e419e1e45152c2bfff64427692d800000000d019e3d74427ff75f20bde7f57d0000000b019e3f6a427ff5f690588500000012419a2449a8416c994c0877fffea99600c4800000000e419e4245152c2bfff64427692d810000000d019e6174427ff75f20bde7f57d0000000b019e636a427ff5f690588500000011419a6849a8416c994c086ffffea78401830000000e419e8645152c2bfff64427692d810000000d019ea574427ff75f20bde7f57d0000000b019ea76a427ff5f690588400000011419aac49a8416c994c086ffffea78401830000000e419eca45152c2bfff64427692d810000000d019ee974427ff75f20bde7f57d0000000b019eeb6a427ff5f690588400000011419af049a8416c994c086ffffea78401830000000e419f0e45152c2bfff64427692d810000000d019f2d74427ff75f20bde7f57d0000000b019f2f6a427ff5f690588400000011419b3449a8416c994c086ffffea78401830000000e419f5245152c2bfff64427692d810000000d019f7174427ff75f20bde7f57d0000000b019f736a427ff5f690588400000011419b7849a8416c994c085ffffe8cb005ed0000000e419f9645152c2bfff64427692d800000000d019fb574427ff75f20bde7f57d0000000b019fb76a427ff5f690588500000017419bbb4ba842105b208c06f1101bc80213fffdf10037a000000010419fd945152c27fff5f6905ef0c731810000000d019ffa6a427ff34920bdd584e7000005f06d6f6f760000006c6d766864000000000000000000000000000003e8000007d000010000010000000000000000000000000100000000000000000000000000000001000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000020000051b7472616b0000005c746b68640000000300000000000000000000000100000000000007d000000000000000000000000000000000000100000000000000000000000000000001000000000000000000000000000040000000008000000080000000000024656474730000001c656c73740000000000000001000007d00000040000010000000004936d646961000000206d64686400000000000000000000000000003c000000780055c400000000002d68646c72000000000000000076696465000000000000000000000000566964656f48616e646c6572000000043e6d696e6600000014766d68640000000100000000000000000000002464696e660000001c6472656600000000000000010000000c75726c2000000001000003fe7374626c000000ae7374736400000000000000010000009e61766331000000000000000100000000000000000000000000000000008000800048000000480000000000000001144c61766336312e332e313030206c69627832363400000000000000000000000018ffff00000034617663430164000bffe100176764000bacd942046840000003004000000f03c50a658001000668ebe3cb22c0fdf8f800000000146274727400000000000029b4000029b4000000187374747300000000000000010000003c000002000000001473747373000000000000000100000001000001e863747473000000000000003b00000001000004000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a000000000100000400000000010000000000000001000002000000000100000a00000000010000040000000001000000000000000100000200000000010000080000000002000002000000001c737473630000000000000001000000010000003c00000001000001047374737a00000000000000000000003c0000056100000015000000c500000014000000250000001600000028000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001600000012000000110000000f0000001500000012000000110000000f0000001500000012000000110000000f0000001500000012000000110000000f0000001500000012000000110000000f0000001500000012000000110000000f0000001b0000001400000011000000147374636f0000000000000001000000300000006175647461000000596d657461000000000000002168646c7200000000000000006d6469726170706c0000000000000000000000002c696c737400000024a9746f6f0000001c6461746100000001000000004c61766636312e312e313030",
            "contentstr": "",
            "contenthash": "9de52e1e280173e07081ec095b675e4d7b8854b705bc195037b3574cdc016082",
            "contentlength": "4237",
            "createdat": "2024-11-21T05:39:39.230Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


# Check Rare Sats Inventory

Use this endpoint to check any rare, special, vintage sats available to be used in individual or collection inscriptions.

## Check Rare Sats Inventory

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/inventory`

Check for available special sats that are available to be inscribed on. This endpoint will return their available count, price and max file size that can be handled.

Each property can be used as input when creating inscription orders, for instance: `rareSats: block9`

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
  "black": {
    "amount": 42609880,
    "baseFee": 40000,
    "commonCount": 135,
    "count": 152,
    "maxSize": 5000000,
    "minSize": 546
  },
  "block286": {
    "amount": 24424386,
    "baseFee": 1000,
    "commonCount": 110,
    "count": 58,
    "maxSize": 5000000,
    "minSize": 1003
  },
  "block78": {
    "amount": 50639419,
    "baseFee": 5000,
    "commonCount": 116,
    "count": 61,
    "maxSize": 5000000,
    "minSize": 865
  },
  "block9": {
    "amount": 44980304,
    "baseFee": 10000,
    "commonCount": 156,
    "count": 49,
    "maxSize": 5000000,
    "minSize": 1003
  },
  "block9450x": {
    "amount": 107593233,
    "baseFee": 10000,
    "commonCount": 136,
    "count": 76,
    "maxSize": 5000000,
    "minSize": 1001
  },
  "block999": {
    "amount": 61977315,
    "baseFee": 10000,
    "commonCount": 169,
    "count": 52,
    "maxSize": 5000000,
    "minSize": 400
  },
  "hitman": {
    "amount": 60275513,
    "baseFee": 5000,
    "commonCount": 199,
    "count": 138,
    "maxSize": 5000000,
    "minSize": 586
  },
  "jpeg": {
    "amount": 34628652,
    "baseFee": 5000,
    "commonCount": 98,
    "count": 94,
    "maxSize": 5000000,
    "minSize": 543
  },
  "legacy": {
    "amount": 10500000,
    "baseFee": 5000,
    "commonCount": 44,
    "count": 0,
    "maxSize": 5000000,
    "minSize": 100000
  },
  "nakamoto": {
    "amount": 61662759,
    "baseFee": 5000,
    "commonCount": 185,
    "count": 524,
    "maxSize": 5000000,
    "minSize": 553
  },
  "pizza": {
    "amount": 107901654,
    "baseFee": 2500,
    "commonCount": 379,
    "count": 156,
    "maxSize": 5000000,
    "minSize": 839
  },
  "silkroad": {
    "amount": 11011389,
    "baseFee": 5000,
    "commonCount": 48,
    "count": 10,
    "maxSize": 5000000,
    "minSize": 1000
  },
  "uncommon": {
    "amount": 75441924,
    "baseFee": 80000,
    "commonCount": 98,
    "count": 2,
    "maxSize": 5000000,
    "minSize": 546
  },
  "vintage": {
    "amount": 75494656,
    "baseFee": 9000,
    "commonCount": 136,
    "count": 65,
    "maxSize": 5000000,
    "minSize": 878
  }
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'server error'
}
```

{% endtab %}
{% endtabs %}


# Referral Scheme

## Getting Referral Earnings

{% hint style="success" %}
Remember you can always earn referral commissions without using the API.

Just share your referral link <https://ordinalsbot.com/?ref=your-referral-code> with your community, visitors or followers and you'll automatically earn referral commissions from the inscriptions they make.
{% endhint %}

Use this endpoint to check earnings for your referrals code:

## Get Referral Status

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/referrals`

Check referral earning status.

Your referral earning is calculated as

`paidCount * baseFee * 0.15`

`(e.g. 100 * 9000 (sats) * %15 commission)`

#### Query Parameters

| Name                                       | Type   | Description                                      |
| ------------------------------------------ | ------ | ------------------------------------------------ |
| referral<mark style="color:red;">\*</mark> | String | Your referral code                               |
| address<mark style="color:red;">\*</mark>  | String | Your bitcoin address that you've set for payouts |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```
{
    "address":"bc1qxxx",
    "orderCount":962, // how many orders were created with your reflink
    "paidCount":305 // how many paid orders were processed.
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to check data'
}
```

{% endtab %}
{% endtabs %}

## Saving Referral Code

Use this endpoint to set a unique referral code for yourself.

## Set referral code and payout address

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/referrals`

Use this endpoint to set your referral code and payout address. Your address allows you to query your referral earnings.

#### Request Body

| Name                                       | Type   | Description                                               |
| ------------------------------------------ | ------ | --------------------------------------------------------- |
| referral<mark style="color:red;">\*</mark> | String | Your unique referral code                                 |
| address<mark style="color:red;">\*</mark>  | String | Your bitcoin address that you want to receive payouts to. |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```
{
    "status":"ok" // your information is saved.
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'referral code already exists - pick another one'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to set data'
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Get in touch for any questions regarding referral setup in our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}


# Transaction Accelerator

OrdinalsBot offers a non-custodial transaction accelerator service for inscriptions stuck in mempool with low fee.

## Creating a CPFP PSBT

{% hint style="warning" %}
This service is highly experimental.&#x20;

Make sure to **carefully review any transactions you are signing** in order to avoid unexpected consequences. Most wallets show the inputs & outputs of a PSBT before you sign them.

Parameters and fees are subject to change.

Currently limited to taproot outputs only.

This service is ideal to bump fee of a [reveal transaction](https://docs.ordinals.com/inscriptions.html#inscriptions).
{% endhint %}

Use this endpoint to create a trustless CPFP (Child pays for parent) transaction to speed up your stuck output.

## Create CPFP PSBT

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/cpfp`

Create a child transaction that pays extra fees for a stuck ancestor.

#### Request Body

| Name                                                    | Type   | Description                                                                                                                                                                                   |
| ------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| utxos<mark style="color:red;">\*</mark>                 | Array  | <p>Array of transaction outputs to be accelerated in the following format</p><p><code>\[ "430901147831e41111aced3895ee4b9742cf72ac3cffa132624bd38c551ef379:0"</code></p><p><code>]</code></p> |
| buyerPaymentAddress<mark style="color:red;">\*</mark>   | String | Bitcoin payment address where extra fees will be paid from.                                                                                                                                   |
| buyerPaymentPublicKey<mark style="color:red;">\*</mark> | String | Bitcoin payment public key where extra fees will be paid from.                                                                                                                                |
| buyerOrdinalAddress<mark style="color:red;">\*</mark>   | String | Ordinals address where stuck inscription is destined for and will be sent to.                                                                                                                 |
| buyerOrdinalPublicKey<mark style="color:red;">\*</mark> | String | Ordinals public key where stuck inscription is destined for and will be sent to.                                                                                                              |
| feeRate<mark style="color:red;">\*</mark>               | Number | Target Fee rate that stuck transaction should be bumped to in sats/vB                                                                                                                         |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    // PSBT to be signed and published by user's wallet
    "psbt": "cHNi...AAAAA",
    // same PSBT in hex format (for leather wallet)
    "hex": "70736274ff01...47dc200000000",
    // input indices user will need to sign to create the transaction
    "buyerInputIndices": [
        0, 
        1
    ]
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to check data'
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Get in touch for any feedback regarding this service in **#developers** channel on our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}


# Burning Assets

### Burning BRC20 tokens

You can use endpoints available in our API to create PSBTs that can burn brc20 tokens and brc20prog contract deployment inscriptions.

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/create-burn-psbt`

Create a ready to sign PSBT that will burn a BRC20 transfer inscription (or BRC20PROG contract deploy inscription) and make the burned transfer amount unspendable.

#### Request Body

| Name                                               | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| utxo<mark style="color:red;">\*</mark>             | String  | <p>Utxo that includes the inscription to be burned at the 0th sat location. <br>- For BRC20, this would be a <code>transfer inscription</code> </p><p>- For BRC20PROG, this would be a <code>contract deploy</code> inscription</p><p>Transaction output should be in the following format<br><code>"507d20a8db517abff4a3558e15f392ac4a7774f7d25c02fe6ec5ff6ca9df4ad2:0"</code><br><code>asd</code><br><strong>Note</strong>: Ensure utxo being burned has enough postage to cover the burn transaction fees + changeAmount. Recommended size: 10000 sats.</p> |
| burnAmount<mark style="color:red;">\*</mark>       | Integer | <p>Amount of sats being burned in the OP\_RETURN output<br><code>min: 1, max: 10000</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| changeAmount<mark style="color:red;">\*</mark>     | Integer | <p>Amount of sats being sent back to "paymentAddress" in the burn transaction.<br><code>min: 330</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| burnType<mark style="color:red;">\*</mark>         | Enum    | "BRC20" or "BRC20PROG" based on what type of inscription is being burned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| paymentAddress<mark style="color:red;">\*</mark>   | String  | Bitcoin payment address where changeAmount will be sent back to.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| paymentPublicKey<mark style="color:red;">\*</mark> | String  | Bitcoin payment public key where changeAmount will be sent back to.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ordinalPublicKey<mark style="color:red;">\*</mark> | String  | Ordinals address of the wallet where the inscription being burned is sent from.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ordinalAddress<mark style="color:red;">\*</mark>   | String  | Ordinals public key of the wallet where the inscription being burned is sent from.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tabs %}
{% tab title="200: OK Normal Response" %}

```json
{
    // PSBT to be signed and published by user's wallet
    "psbtBase64": "cHNi...AAAAA",
    // same PSBT in hex format (for leather wallet)
    "psbtHex": "70736274ff01...47dc200000000",
    // input indices user will need to sign to create the transaction
    "paymentInputIndices": [],
    "ordinalInputIndices": [
        0
    ]
}
```

{% endtab %}

{% tab title="200: OK Error Response with Cause" %}

```
{
    status: 'error', 
    error: 'error reason'
}
```

{% endtab %}

{% tab title="500: Internal Server Error Server side error" %}

```
{
    status: 'error',
    reason: 'unable to check data'
}
```

{% endtab %}
{% endtabs %}

Here are sample burned BRC20 tokens on signet:

Burn transaction: <https://mempool.space/signet/tx/05ab98b45fbaf41b62d1c678f27f0d8acf6d64c65a0a09be1dedc37f31fa04b9#vin=0>

Burned inscription: <https://signet-explorer.ordinalsbot.com/inscription/507d20a8db517abff4a3558e15f392ac4a7774f7d25c02fe6ec5ff6ca9df4ad2i0>

Burned supply as seen on BRC20 indexer [OPI API](/brc20-brc2.0prog/opi-api)

```
/v1/brc20/ticker_info?ticker=trio
{
    "error": null,
    "result": {
        "id": "62",
        "original_tick": "TRIO",
        "tick": "trio",
        "max_supply": "21000000000000000000000000",
        "decimals": 18,
        "limit_per_mint": "21000000000000000000000000",
        "remaining_supply": "0",
        "burned_supply": "30000000000000000000", <<<---
        "is_self_mint": false,
        "deploy_inscription_id": "a2c59a69a75e619000e95679eeda3e1f3a7a5cfb696ba4a6bf7e5c631ef2f332i0",
        "block_height": 199892
    }
}
```

### Burning Inscriptions & Runes

You can use endpoints available in our [Token Pay](/token-pay/what-is-tokenpay) product to create PSBTs that can [burn inscriptions](/token-pay/api-docs/api-reference/create-burn-inscription-psbt) and [runes](/token-pay/api-docs/api-reference/create-burn-rune-psbt). It's also possible to add metadata while burning inscriptions and runes.

Here's [a test transaction on signet](https://mempool.space/signet/tx/826b3604b21cd00f7b5daddb7a94868038afb620b5a0fc50da444f1cab3313ec#vin=0) that burns in the same tx:

**1-** 1000 tokens of rune: [OB•CZTGOXTKHHHEE](https://signet-explorer.ordinalsbot.com/rune/OB%E2%80%A2CZTGOXTKHHHEE)

**2-** Inscription id: [5b09700e89333d4a986281a6e8a1261c72039f3daedbc0399f6cd5aa9da88e5di0](https://signet-explorer.ordinalsbot.com/inscription/5b09700e89333d4a986281a6e8a1261c72039f3daedbc0399f6cd5aa9da88e5di0)&#x20;

**3-** Adds some metadata that does certain things as [per the destination protocol](https://ordinalsbot.gitbook.io/bitcoin-meta-protocol-bridge).

Resulting inscription will look like this:

<figure><img src="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FQeOj0ftDlwmYmlqsFroa%2FScreenshot%202025-03-19%20at%2010.16.41%E2%80%AFAM.png?alt=media&amp;token=922b205a-d781-4658-b5d3-4d5cd02d297a" alt=""><figcaption><p>Burned Rune and Inscription with Metadata</p></figcaption></figure>

{% embed url="<https://signet-explorer.ordinalsbot.com/inscription/5b09700e89333d4a986281a6e8a1261c72039f3daedbc0399f6cd5aa9da88e5di0>" %}

You can also use the [Utils](/token-pay/api-docs/api-reference/utils) endpoints to finalize a psbt and broadcast with a higher than zero `maxburnamount` , this is required for any protocol based on burning bitcoin digital assets.

{% hint style="info" %}
By default, you can not use a standard node to broadcast an OP\_RETURN output that has bitcoin in it. Our nodes have maxburnamount=0.01 (1 million satoshis) pre-configured.

Developers should save signed psbt, finalize and submit via tokenpay endpoints.
{% endhint %}

{% hint style="info" %}
Get in touch for any feedback regarding this service in **#developers** channel on our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}


# Webhooks

## Receiving Webhooks

While creating an inscription order using [Create a Direct Inscription Order](/api/create-a-direct-inscription-order) or [Create a Collection Order](/api/create-a-collection-order) you can provide a webhook URL and you can receive updates on your orders sent directly to a publicly reachable endpoint you provide.

Here are the regular states an inscription order will go through and the format of the `body` of `POST` request your `webhookUrl` will receive:

#### Payment seen on mempool, pending confirmation

```json
{
    "id":"4fc7b183-b06f-4cb0-b592-7bc9e9cd05ff",
    "state":"waiting-confirmation"
}
```

#### Payment confirmed, inscription data is being prepared

```json
{
    "id":"4fc7b183-b06f-4cb0-b592-7bc9e9cd05ff",
    "state":"prep"
}
```

#### Inscription queued for processing

```json
{
    "id":"4fc7b183-b06f-4cb0-b592-7bc9e9cd05ff",
    "state":"queued"
}
```

#### File inscribed

Note that you will get below data for each file in your order

```json
{
    "id":"4fc7b183-b06f-4cb0-b592-7bc9e9cd05ff",
    "index":0,
    "file":{
        "iqueued":true,
        "iqueuedAt":1705530878658,
        "name":"test-ordinalsbot.com.txt",
        "s3Key":"d6642396-38eb-4578-b41f-355718723d71_test-ordinalsbot.com.txt",
        "size":15,
        "type":"text/plain",
        "url":"https://ordinalsbot-testnet.s3.amazonaws.com/d6642396-38eb-4578-b41f-355718723d71_test-ordinalsbot.com.txt"
    },
    "tx":{
        "commit":"db3f40a9a5850a7edef8cdd020743273239dbdadd4abaa5c03bf74ff6e2ea269",
        "parent":null,
        "reveal":"b0ae586b6e7d4defb6cd54c5fb87f4311cf1595a5e6674ade31c42a5011b70e0",
        "total_fees":295,
        "inscription":"b0ae586b6e7d4defb6cd54c5fb87f4311cf1595a5e6674ade31c42a5011b70e0i0",
        "updatedAt":"2024-01-17T22:34:40.766Z"
    }
}
```

{% hint style="info" %}
Get in touch for any feedback/questions/issues regarding this in **#developers** channel on our discord: [https://discord.ordinalsbot.com](https://discord.ordinalsbot.com/)
{% endhint %}


# Order States

Every order has a consistent `state` field. That is the only correct way to check the progress of your order. The possible order states are the following:

```javascript
const WAITING_PAYMENT = 'waiting-payment'; // order is waiting for a payment to be detected
const WAITING_CONFIRMATION = 'waiting-confirmation'; // payment is detected, waiting for confirmations
const WAITING_PARENT = 'waiting-parent'; // order is waiting for the parent inscription to hit the wallet
const PREP = 'prep'; // order files are being downloaded
const QUEUED = 'queued'; // order is queued for inscription
const ERROR = 'error'; // order has an error
const CANCELED = 'cancelled'; // order is cancelled
const WAITING_REFUND = 'waiting-refund'; // collection order is waiting refund
const REFUNDED = 'refunded'; // collection order was refunded
const EXPIRED = 'expired'; // open node invoice expired
const WAITING_REVEAL = 'waiting-reveal'; // order is waiting to broadcast the inscription reveal
const WAITING_RUNE_BALANCE = 'waiting-rune-balance'; // order is waiting for the rune balance to confirm
const COMPLETED = 'completed'; // order is complted, files are inscribed
```


# Order Types

We have the following order types.

```javascript
const RUNE_ETCH = 'rune-etch';
const RUNE_MINT = 'rune-mint';
const BULK = 'bulk';
const DIRECT = 'direct';
const BRC20 = 'brc20';
const RUNE_LAUNCHPAD_MINT = 'rune-launchpad-mint';
```

Each order type corresponds to an endpoint. Here is the full table:

| order type          | endpoint                                            |
| ------------------- | --------------------------------------------------- |
| bulk                | [/order](broken://pages/DZ49lzL7RFQn0H2WdHE1)       |
| brc20               | [/order](broken://pages/DZ49lzL7RFQn0H2WdHE1)       |
| direct              | [/inscribe](/api/create-a-direct-inscription-order) |
| rune-etch           | [/runes/etch](/runes/etch)                          |
| rune-mint           | [/runes/mint](/runes/mint)                          |
| rune-launchpad-mint | [/runes/launchpad/mint](/runes/launchpad/mint)      |


# Etch

Use this endpoint to create a rune as defined in <https://docs.ordinals.com/runes.html>

{% hint style="info" %}

* Runes are available on **testnet only** until block height 840000.
* Currently rune etching requires inscribing a file, file can be anything and has no impact on the etched rune.
* Rune names become available over time. Refer to [official documentation](https://docs.ordinals.com/runes/specification.html#executing-the-runestone) for details.
* Rune `supply` must equal `premine + terms.cap * terms.amount`
* After the order is paid an `etchingTx` object will apper. The object will have a `commit` and a `reveal` field: `commit` is the txid of the commit transaction, `reveal` is the the txid of the reveal transaction
* Rune orders take six blocks due to the commit-reveal protocol. After a rune is committed, the order will enter state `waiting-reveal`, six blocks later when the reveal is broadcast the order will be in state `completed`
  {% endhint %}

### `POST` a new rune order

## Create Rune

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/etch`

#### Request Body

<table><thead><tr><th width="168">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>rune<mark style="color:red;">*</mark></td><td>String</td><td>Rune name</td></tr><tr><td>supply<mark style="color:red;">*</mark></td><td>Number</td><td>Supply of the rune token</td></tr><tr><td>symbol<mark style="color:red;">*</mark></td><td>String</td><td>Single letter symbol for the rune</td></tr><tr><td>divisibility<mark style="color:red;">*</mark></td><td>Number</td><td>Number of decimal points one unit of rune can be divided into.</td></tr><tr><td>premine<mark style="color:red;">*</mark></td><td>Number</td><td>Number of rune tokens the etching mints for the etcher.</td></tr><tr><td>files<mark style="color:red;">*</mark></td><td>Array</td><td><p>An array of objects that includes:</p><p></p><p><strong>Mandatory</strong></p><p><strong>name</strong>:string; => name of the file including extension.</p><p><strong>size</strong>:number; => size of the file in bytes</p><p><strong>url</strong>:string; => file URL hosted on OrdinalsBot buckets</p><p></p><p><strong>Optional</strong></p><p><strong>metadataUrl</strong>:string; => metadata json file URL hosted on OrdinalsBot buckets</p><p><strong>metadataSize</strong>:number; => size of the metadata file in bytes</p><p><strong>metaprotocol</strong>:string; => Metaprotocol field to be included in the inscription data</p><p></p><p><em><strong>Note:</strong> you can send any dataURL text/json/image/video data in a parameter called <strong><code>dataURL</code></strong> instead of <strong>url</strong> for files</em></p><p><em><strong><code>metadataDataURL</code></strong> instead of <strong>metadataUrl</strong> for metadata json files</em><br><br><em><strong>"files" or "delegates" array is mandatory.</strong></em></p></td></tr><tr><td>delegates<mark style="color:red;">*</mark></td><td>Array</td><td><p>An array of objects that includes:</p><p></p><p><strong>Mandatory</strong></p><p><strong>delegateId</strong>:string; => inscription ID of the delegate that will be inscribed.</p><p></p><p><strong>Optional</strong></p><p><strong>metadataUrl</strong>:string; => metadata json file URL hosted on OrdinalsBot buckets</p><p><strong>metadataSize</strong>:number; => size of the metadata file in bytes</p><p><strong>metaprotocol</strong>:string; => Metaprotocol field to be included in the inscription data</p></td></tr><tr><td>receiveAddress<mark style="color:red;">*</mark></td><td>String</td><td>A single Bitcoin address to receive the inscriptions for the whole order</td></tr><tr><td>terms</td><td>Object</td><td><p>Required only if <code>premine !== supply</code></p><p></p><p>If supplied, <code>supply</code> must equal <code>premine + terms.cap * terms.amount</code></p><p></p><p>An object that includes:<br><strong>amount</strong>: <em>(number, required)</em> amount of runes each mint transaction receives<br><strong>cap</strong>: <em>(number, required)</em> allowed number of mints<br></p><p><strong>offset</strong>: <em>(object, optional)</em> object with required fields <code>start</code> and <code>end</code></p><p></p><p><strong>height:</strong> <em>(object, optional)</em> object with required fields <code>start</code> and <code>end</code></p></td></tr><tr><td>turbo</td><td>Boolean</td><td>True by default. This flag indicates whether the rune opts-in for protocol changes, whatever they might be.</td></tr><tr><td>fee</td><td>Number</td><td><p>Miner fee that will be paid while inscribing the ordinals in sats/byte.</p><p></p><p>(default=2 sats/byte)</p></td></tr><tr><td>referral</td><td>String</td><td>Referral code to earn up to %15 of the order service fee.</td></tr><tr><td>additionalFee</td><td>Number</td><td><p>Amount of satoshis to charge extra for this order that will be added to "referral" account.</p><p>Needs to be used together with "referral" parameter.</p><p></p><p><mark style="color:red;"><strong>Note: additionalFee is added PER FILE!</strong></mark></p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "runeProperties": {
        "rune": "ORDINALSBOTD",
        "supply": 100000,
        "symbol": "$",
        "divisibility": 8,
        "premine": 0,
        "terms": {
            "cap": 1,
            "amount": 100000
        }
    },
    "fee": 8,
    "files": [
        {
            "url": "https://ordinalsbot-dev.s3.amazonaws.com/",
            "size": 860,
            "name": "somerandomfilename.jpg",
            "type": "image/jpeg"
        }
    ],
    "charge": {
        "id": "1c1b9327-e3ed-4315-91f6-97eccd746986",
        "address": "2MvLE2pRLFymaXmJBc3bee2By21jD4CSKGj",
        "metadata": {},
        "chain_invoice": {
            "address": "2MvLE2pRLFymaXmJBc3bee2By21jD4CSKGj"
        },
        "uri": "bitcoin:2MvLE2pRLFymaXmJBc3bee2By21jD4CSKGj?amount=0.00010501&label=1c1b9327-e3ed-4315-91f6-97eccd746986&lightning=lntb105010n1pnpppp3pp5uesfwexnaerj76dy9raa3m9q2ret6qwkru3kjufugnu79dqcrs2qdp6x93nzc3exverwtt9xdjkgtf5xvcn2tfex9nrvtfexajkxcmyxu6rvwfcxccqzzsxqy8ayqsp5kfdggyth6qawlzv43qzt9mmqc0mjdd5nh6p958ke4rnm8zy2kkus9qyyssq6z0v0z90gc2ng2wsvxa75tjy6svgaynvnnxqwvwpynwlpwgfg0f32wf2gtdhdd95n4z2t8nscug4s3638vn237up0sa9hyp2vs9l8gqpad3h7g",
        "ttl": 4320,
        "lightning_invoice": {
            "expires_at": 1712617650,
            "payreq": "lntb105010n1pnpppp3pp5uesfwexnaerj76dy9raa3m9q2ret6qwkru3kjufugnu79dqcrs2qdp6x93nzc3exverwtt9xdjkgtf5xvcn2tfex9nrvtfexajkxcmyxu6rvwfcxccqzzsxqy8ayqsp5kfdggyth6qawlzv43qzt9mmqc0mjdd5nh6p958ke4rnm8zy2kkus9qyyssq6z0v0z90gc2ng2wsvxa75tjy6svgaynvnnxqwvwpynwlpwgfg0f32wf2gtdhdd95n4z2t8nscug4s3638vn237up0sa9hyp2vs9l8gqpad3h7g"
        }
    },
    "chainFee": 7232,
    "serviceFee": 3269,
    "additionalFee": null,
    "receiveAddress": "tb1qwejhagpav9rkrwpk55ul6pes6f89glpkpds487",
    "baseFee": 2000,
    "rareSatsFee": 0,
    "postage": 546,
    "id": "1c1b9327-e3ed-4315-91f6-97eccd746986",
    "orderType": "rune-etch",
    "state": "waiting-payment",
    "createdAt": {
        ".sv": "timestamp"
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

{% hint style="success" %}
Supported file extensions may change. If you include any unsupported files order creation will fail.

Currently Supported files:\
\
`'apng', 'flac', 'gif', 'html', 'jpg','jpeg', 'mp3', 'pdf', 'png', 'svg', 'txt', 'wav', 'webm', 'webp', 'mp4', 'stl', 'glb', 'avif', 'yaml' , 'yml', 'asc', 'json', 'js', 'css', 'gz'`
{% endhint %}

```json
// Here's a sample payload you can POST to create a rune order
{
    "files": [
        {
            "url": "https://ordinalsbot-dev.s3.amazonaws.com/7b7b3b37-792b-4f29-bd37-7436fd461453",
            "size": 860,
            "name": "btc-skull-2.jpg",
            "type": "image/jpeg"
        }
    ],
    "rune": "SHIT•MEGA•COIN",
    "supply": 100000,
    "symbol": "$",
    "divisibility": 8,
    "fee": 8,
    "premine": 50000,
    "receiveAddress": "tb1pqwh3dxhg3k4szt9zm5kt8p0m97nl7k7zlmplehmr6alc4ut8xd5qams63p",
    "terms": {
        "amount": 1,
        "cap": 50000,
        "offset": {
            "start": 1,
            "end": 10000
        }
    }
}
```


# Mint

Use this endpoint to mint an existing rune as defined in <https://docs.ordinals.com/runes.html#minting>

{% hint style="info" %}

* Runes are available on **testnet only** until block height 840000.
* We allow the execution of `n` mints per order, dictated by the field `numberOfMints`
* `n` mints will create `n` transactions
* Minting transaction ids will appear in the order in the field `mintingTxs`
* For every mint transaction the counter `executedMints` will be incremented
  {% endhint %}

### `POST` a new rune mint order

## Mint Rune

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/mint`

#### Request Body

<table><thead><tr><th width="174">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>rune<mark style="color:red;">*</mark></td><td>String</td><td>Rune name</td></tr><tr><td>receiveAddress<mark style="color:red;">*</mark></td><td>String</td><td>A single Bitcoin address to receive the rune balance for the whole order</td></tr><tr><td>fee<mark style="color:red;">*</mark></td><td>Number</td><td>Miner fee that will be paid while inscribing the ordinals in sats/byte.</td></tr><tr><td>numberOfMints</td><td>Number</td><td>Number of times provided rune should be minted to receive address.<br>(default=1)</td></tr><tr><td>referral</td><td>String</td><td>Referral code to earn up to %15 of the order service fee.</td></tr><tr><td>additionalFee</td><td>Number</td><td><p>Amount of satoshis to charge extra for this order that will be added to "referral" account.</p><p>Needs to be used together with "referral" parameter.</p></td></tr><tr><td>postage</td><td>Number</td><td><p>Set custom postage for the order's asset: minimum 330 sats, maximum 10,000 sats.</p><p></p><p>(default=546)</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "charge": {
        "id": "0128d9cd-5821-4f2e-b042-9124f8027b0f",
        "description": "e3124086-4f86-4b73-be2b-f5bcceea7d0b",
        "desc_hash": false,
        "created_at": 1713286060,
        "status": "unpaid",
        "amount": 24200,
        "success_url": null,
        "hosted_checkout_url": "https://checkout.dev.opennode.com/0128d9cd-5821-4f2e-b042-9124f8027b0f",
        "order_id": null,
        "currency": "BTC",
        "source_fiat_value": 24200,
        "fiat_value": 15.03,
        "auto_settle": false,
        "notif_email": null,
        "address": "2NG1xF8STPUhwtaTJyKUdGMai8GXs5mK8sy",
        "metadata": {},
        "chain_invoice": {
            "address": "2NG1xF8STPUhwtaTJyKUdGMai8GXs5mK8sy"
        },
        "uri": "bitcoin:2NG1xF8STPUhwtaTJyKUdGMai8GXs5mK8sy?amount=0.000242&label=e3124086-4f86-4b73-be2b-f5bcceea7d0b&lightning=lntb242u1pnpa2avpp5jh0f855vgg2zakshfce6zua8q7jfj3dkejwak93d52073c7vjevqdp6v5enzv35xqurvtf5vcurvtf5vgmnxttzv5exyttxx43xxcm9v4snwepsvgcqzzsxqy8ayqsp5ug9pp67ed0tq3064vu8fjhghmwwvq7w3zwyjk5mnmqukgjxjayws9qyyssq8kgsw4d6drsy346kag3jsxlzmzlkqr0fnpp0gy6f27kj9nmss4wx40r9qrmafc64kexe8tat6lj94y39cezay8drg9qtw4qyx57mg9qq4nfknr",
        "ttl": 4320,
        "lightning_invoice": {
            "expires_at": 1713545260,
            "payreq": "lntb242u1pnpa2avpp5jh0f855vgg2zakshfce6zua8q7jfj3dkejwak93d52073c7vjevqdp6v5enzv35xqurvtf5vcurvtf5vgmnxttzv5exyttxx43xxcm9v4snwepsvgcqzzsxqy8ayqsp5ug9pp67ed0tq3064vu8fjhghmwwvq7w3zwyjk5mnmqukgjxjayws9qyyssq8kgsw4d6drsy346kag3jsxlzmzlkqr0fnpp0gy6f27kj9nmss4wx40r9qrmafc64kexe8tat6lj94y39cezay8drg9qtw4qyx57mg9qq4nfknr"
        }
    },
    "paylink": {
        "id": "66xxx16", // visit https://app.hel.io/pay/66xxx16 to pay
    },
    "rune": "BITCOIN•HAS•A•CAT",
    "receiveAddress": "tb1qwejhagpav9rkrwpk55ul6pes6f89glpkpds487",
    "fee": 10,
    "chainFee": 2000,
    "serviceFee": 22200,
    "baseFee": 12000,
    "rareSatsFee": 0,
    "postage": 546,
    "additionalFee": null,
    "numberOfMints": 1,
    "id": "e3124086-4f86-4b73-be2b-f5bcceea7d0b",
    "orderType": "rune-mint",
    "state": "waiting-payment",
    "createdAt": {
        ".sv": "timestamp"
    },
    "executedMints": 0,
    "mintingTxs": []
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

```json
// Here's a sample payload you can POST to create a rune mint order
{
    "rune": "MEGA•MEME•COIN",
    "fee": 8,
    "receiveAddress": "tb1pqwh3dxhg3k4szt9zm5kt8p0m97nl7k7zlmplehmr6alc4ut8xd5qams63p",
    "numberOfMints": 2,
}
```


# Direct Mint

Direct Rune Minting is done in 2 steps:&#x20;

1. Call `runes/direct-mint` to generate the bootstrap PSBT

   [1. Generate Direct Mint PSBT](/runes/direct-mint/1.-generate-direct-mint-psbt)
2. Send the signed PSBT and orderId to `runes/direct-mint-psbt` to complete the order

   [2. Direct Rune Mint Process PSBT](/runes/direct-mint/2.-direct-rune-mint-process-psbt)

We allow the execution of 25 mints per order, dictated by the field count `mintCount`


# 1. Generate Direct Mint PSBT

## Direct Mint PSBT

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/direct-mint`

#### Request Body

<table><thead><tr><th width="174">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>runeName<mark style="color:red;">*</mark></td><td>String</td><td>Rune name to mint</td></tr><tr><td>minterAddress<mark style="color:red;">*</mark></td><td>String</td><td>A Bitcoin address to pay order and receive the rune balance</td></tr><tr><td>feeRate<mark style="color:red;">*</mark></td><td>Number</td><td>Miner fee that will be paid while inscribing the ordinals in sats/byte.</td></tr><tr><td>mintCount<mark style="color:red;">*</mark></td><td>Number</td><td>Number of times provided rune should be minted to receive address.</td></tr><tr><td>sendAddress</td><td>String</td><td>(Optional) Address that will receive the rune mint. If not set <code>minterAddress</code> is the default value</td></tr><tr><td>simulateFee</td><td>Boolean</td><td>(Optional) If true, only fee information will be returned and no order will be created. Default is <code>false</code></td></tr></tbody></table>

#### Example request body:

```json
{
    "runeName": "RUNE•NAME",
    "minterAddress": "bc1q...",
    "feeRate": 3,
    "mintCount": 2,
    "sendAddress": "bc1q...",
    "simulateFee": false
}
```

Example response:

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "orderId": "21c7ea58-b568-4a2b-a9e6-2ff380bf3a18",
    "psbt": "cHNidP8...",
    "chainFee": 1337,
    "serviceFee": 1337
}
```

{% endtab %}

{% tab title="200: OK simulate fee" %}

```json
{
    "chainFee": 1337,
    "serviceFee": 1337
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    "status": "error",
    "error": "error reason"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}


# 2. Direct Rune Mint Process PSBT

## Direct Mint send PSBT

Send the signed PSBT and orderID obtained in the [previous step](/runes/direct-mint/1.-generate-direct-mint-psbt) to the following endpoint to&#x20;

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/direct-mint-psbt`

#### Request Body

<table><thead><tr><th width="174">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>orderId<mark style="color:red;">*</mark></td><td>String</td><td>Order id obtained in the previous step</td></tr><tr><td>psbt<mark style="color:red;">*</mark></td><td>String</td><td>base64 string containing a fully signed PSBT</td></tr></tbody></table>

#### Example request body:

```json
{
    "orderId": "048534a2-f0b6-4e50-9ab8-6ce8784de098",
    "psbt": "cHNid..."
}
```

Example response:

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "createdAt": 1747731071531,
    "feeRate": 3,
    "id": "2bc3e26d-bcb3-498e-b3f3-eb0c15004ca7",
    "mintCount": 2,
    "minterAddress": "tb1q...",
    "orderType": "rune-direct-mint",
    "runeName": "RUNENAME",
    "sendAddress": "tb1pg...",
    "state": "completed",
    "status": "ok",
    "txs": [
        "e40b6087ad5c5d165cd22...",
        "9e065ab4a2e210dcbf779..."
    ],
    "updatedAt": 1747731125806
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}


# Launchpad

Docs for rune launchpad


# Create

Use this endpoint to create a rune launchpad

{% hint style="info" %}

* Creating a rune launchpad requires a pre-payment for splitting the rune tokens
* The pre-payment details are in the `charge` field returned by the endpoint
* You will also need to send us the premined tokens, the address and amount for the premined tokens are in the `tokenCharge` field
* Make sure to send the bitcoin pre-payment in a **single** transaction and UTXO
* Make sure to send the rune transfer in a **single** transfer transaction
* After bitcoin payment and the rune tokens are received, we will initiate a splitting transaction. The details of this transaction are available in the `runeSplitParameters` field, the txid will appear in the `txid` field there
* Only after this splitting transaction is confirmed the launchapd will enter into a state `ready`. This means that the launchapd is ready and waiting to be started.
* Ask an ordinalsbot team member to start the launchpad by moving it into state `minting` or `allowlist`
  {% endhint %}

{% hint style="warning" %}

* As of right now `salesCap` is limited to 10,000, ask us privately if you need an increase
  {% endhint %}

### `POST` a new rune launchpad order

## Create a rune launchpad

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/launchpad/create`

#### Request Body

<table><thead><tr><th width="168">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td>Human-readable launchpad id</td></tr><tr><td>rune<mark style="color:red;">*</mark></td><td>String</td><td>The name of rune you want to sell (with spacers)</td></tr><tr><td>creatorAddress<mark style="color:red;">*</mark></td><td>String</td><td>The bitcoin address where we will send the proceeds from the sale</td></tr><tr><td>saleSize<mark style="color:red;">*</mark></td><td>Number</td><td>We will sell this many tokens per batch (equivalent to terms.amount in runestone)</td></tr><tr><td>salesCap<mark style="color:red;">*</mark></td><td>Number</td><td>The number of available batches for sale (equivalent to terms.cap in runestone)  </td></tr><tr><td>totalTokensForSale<mark style="color:red;">*</mark></td><td>Number</td><td>The total amount of tokens that are available for sale on the launchpad. Must equal <code>saleSize * salesCap</code> </td></tr><tr><td>price<mark style="color:red;">*</mark></td><td>Number</td><td>Price per token</td></tr><tr><td>splittingFee<mark style="color:red;">*</mark></td><td>Number</td><td>Chain fee in sat/vb for the splitting transaction required before starting the launchpad</td></tr><tr><td>publicAllocation</td><td>Number</td><td>Publicly available allocation of tokens</td></tr><tr><td>allowList</td><td>Object</td><td>The allowlist</td></tr><tr><td>accessRules</td><td>Array</td><td>Array of objects that set rules on who can claim tokens from the launchpad.<br><br>e.g. [{"api": "brc20", "token": "TRIO", "allocation":10}]<br>This will check user address balance for brc20 TRIO tokens and allow them to claim 10 rune launchpad tokens per TRIO they hold. </td></tr><tr><td>metadata</td><td>Object</td><td>Any metatada you wish for your collection you can pass it as any type of JS object here. Max size 10kb.</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "id": "f5c055a5-05c7-4208-b911-beb6191a8068",
    "charge": {
        "address": "bc1qrt6u67my3ucgjj0lmvvtwgkvcnx3dq3yeupdz0",
        "amount": 5450200
    },
    "tokenCharge": {
        "address": "bc1qcqpyymhqq5sqpxz3c9ws20lqg6t2gxsnt83jpa",
        "amount": 1000000,
        "rune": "TRIO•ORDINALSBOT"
    },
    "runeSplitParameters": {
        "rune": "TRIO•ORDINALSBOT",
        "splitsNumber": 1000,
        "splitSize": 1000,
        "fee": 5450200,
        "executed": false
    },
    "rune": "TRIO•ORDINALSBOT",
    "creatorAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3",
    "saleSize": 1000,
    "salesCap": 1000,
    "totalTokensForSale": 1000000,
    "price": 1,
    "publicAllocation": 0,
    "state": "waiting-prepayment",
    "paidItemCount": 0,
    "allocatedItemCount": 0,
    "mintedItemCount": 0,
    "createdAt": {
        ".sv": "timestamp"
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

```json
// Here's a sample payload you can POST to create a rune order
{
    "splittingFee": 100,
    "rune": "TRIO•ORDINALSBOT",
    "creatorAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3",
    "price": 1,
    "saleSize": 1000,
    "salesCap": 1000,
    "totalTokensForSale": 1000000
}
```


# Mint

Use this endpoint to mint from a launchpad

{% hint style="info" %}

* During high demand mints it is possible that we cannot mint the requested `count` due to orders that came before you. In this case we will mint less than the requested count.
* The final mint count will always be contained in the field finalMintCount, refer to this field to see how much of your order has completed
* In high demand scneraios, if your order was paid but the launchpad minted out before processing your order we will add the `error` `rune minted out to your order`. Reach out for refund in this scenario.
  {% endhint %}

### `POST` a new mint order

## Mint from launchpad

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/launchpad/mint`

#### Request Body

<table><thead><tr><th width="168">Name</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>String</td><td>The launchpad id</td></tr><tr><td>count<mark style="color:red;">*</mark></td><td>Number</td><td>How many items you want to mint</td></tr><tr><td>fee<mark style="color:red;">*</mark></td><td>Number</td><td>The chain fee per vbyte for the order</td></tr><tr><td>receiveAddress<mark style="color:red;">*</mark></td><td>String</td><td>Address to send the minted runes</td></tr><tr><td>referral</td><td>String</td><td>Referral code to earn up to %15 of the order base fee.</td></tr><tr><td>additionalFee</td><td>Number</td><td><p>Amount of satoshis to charge extra for this order that will be added to "referral" account.</p><p>Needs to be used together with "referral" parameter.</p><p><strong>Note: additionalFee is added per saleMultiplier.</strong></p></td></tr><tr><td>webhookUrl</td><td>String</td><td><p>Webhook URL to receive a POST payload for order updates.</p><p>Refer to <a href="https://docs.ordinalsbot.com/api/webhooks">Webhooks</a> for format of the webhook payload.</p></td></tr><tr><td>postage</td><td>Number</td><td><p>Set custom postage for the order's asset: minimum 330 sats, maximum 10,000 sats.</p><p></p><p>(default=546)</p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "charge": {
        "id": "41d6df1a-ca2b-4915-84f8-757d8fa80f7d",
        "description": "shitcoin•paradise",
        "desc_hash": false,
        "created_at": 1714736914,
        "status": "unpaid",
        "amount": 124376,
        "success_url": null,
        "hosted_checkout_url": "https://checkout.opennode.com/41d6df1a-ca2b-4915-84f8-757d8fa80f7d",
        "order_id": null,
        "currency": "BTC",
        "source_fiat_value": 124376,
        "fiat_value": 68.46,
        "auto_settle": false,
        "notif_email": null,
        "address": "3QxHEA3qS4pQXCk17b9Kuhuh5MRxtiLAzy",
        "metadata": {},
        "chain_invoice": {
            "address": "3QxHEA3qS4pQXCk17b9Kuhuh5MRxtiLAzy"
        },
        "uri": "bitcoin:3QxHEA3qS4pQXCk17b9Kuhuh5MRxtiLAzy?amount=0.00124376&label=shitcoin%E2%80%A2paradise&lightning=lnbc1243760n1pnrfncjpp5j2vtfylxrn88v2cskms9nyezgccq8j7x6aq3en727chxrk8cv9xqdqlwd5xjarrda5kac5q5fcxzunpv35hxegcqzzsxqy8ayqsp55ej6qufnfm78f4wp2h8hj8q98vq7wj3tfe4hhk5kwyv69jga53ts9qyyssq4f2258nazp0y5nr8hsz0rdypuxsep5m59tke0g8el422cfpkelz8s2ywhclglnd30gwfe0qn0xclapt4kl433u9tev437cj9s36e0ecpk89jh4",
        "ttl": 4320,
        "lightning_invoice": {
            "expires_at": 1714996114,
            "payreq": "lnbc1243760n1pnrfncjpp5j2vtfylxrn88v2cskms9nyezgccq8j7x6aq3en727chxrk8cv9xqdqlwd5xjarrda5kac5q5fcxzunpv35hxegcqzzsxqy8ayqsp55ej6qufnfm78f4wp2h8hj8q98vq7wj3tfe4hhk5kwyv69jga53ts9qyyssq4f2258nazp0y5nr8hsz0rdypuxsep5m59tke0g8el422cfpkelz8s2ywhclglnd30gwfe0qn0xclapt4kl433u9tev437cj9s36e0ecpk89jh4"
        }
    },
    "launchpadId": "shitcoin•paradise",
    "fee": 30,
    "serviceFee": 9000,
    "price": 1,
    "count": 800,
    "postage": 546,
    "chainFee": 48000,
    "amount": 124376,
    "receiveAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3",
    "orderType": "rune-launchpad-mint",
    "id": "fc7f852d-31ff-4c32-a2c3-e8f6f47e797d",
    "additionalFee": null,
    "referral": null,
    "webhookUrl": null,
    "status": "ok",
    "state": "waiting-payment",
    "createdAt": {
        ".sv": "timestamp"
    }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

```json
// Here's a sample payload you can POST to create a launchpad mint order
{
    "fee": 30,
    "count": 800,
    "id": "shitcoin•paradise",
    "receiveAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3"
}
```


# Get Launchpad

Use this endpoint to get an existing rune launchpad

### `GET` a launchpad

## Get launchpad

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/runes/launchpad/:id`

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "allocatedItemCount": 1000,
    "charge": {
        "address": "bc1q3rzc2jfpwa0j73s7u0e6luqfl9uxq0hg6k38zr",
        "amount": 22470,
        "confirmed": true,
        "output": "696e5a3091a8e3f1069d1a6634bfa8a0188e7e8cdc51d64c2407c00e85b6400a:1",
        "paid": true
    },
    "completed": true,
    "createdAt": 1714728088301,
    "creatorAddress": "bc1pgnwmg7wplc09cm9fctgmgalu7l4synjh7khwzre9qlcvg5xy0k5qz9mwe3",
    "id": "shitcoin•paradise",
    "mintedItemCount": 1000,
    "paidItemCount": 1000,
    "price": 1,
    "publicAllocation": 0,
    "rune": "SHITCOIN•PARADISE",
    "runeSplitParameters": {
        "confirmed": true,
        "executed": true,
        "fee": 22470,
        "feeOutput": "696e5a3091a8e3f1069d1a6634bfa8a0188e7e8cdc51d64c2407c00e85b6400a:1",
        "feeVByte": 30,
        "receiverAddress": "bc1pdwvm6agr3eytkmcmcwmas2p5tkzgg93ktztzddu5ud8m9x37ufwqh0ajkk",
        "rune": "SHITCOIN•PARADISE",
        "runeOutput": "e83cdffe5866717e29a02e8669fdfe36a74f4e426c271517168e9c7e241f95d1:1",
        "splitSize": 100,
        "splitsNumber": 10,
        "txid": "3c7e6337cc429db81a0142cc83add40c276ddbb7514845f9ec74bcc25f40c736"
    },
    "saleSize": 100,
    "salesCap": 10,
    "serviceFee": 9000,
    "state": "minted",
    "tokenCharge": {
        "address": "bc1qkddf25klyyf0xxue3ax4tgv3lcxujtf5vlpx2z",
        "amount": 1000,
        "confirmed": true,
        "output": "e83cdffe5866717e29a02e8669fdfe36a74f4e426c271517168e9c7e241f95d1:1",
        "paid": true,
        "rune": "SHITCOIN•PARADISE"
    },
    "totalTokensForSale": 1000
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```
{
    "error": [
        {
            "msg": "Launchpad does not exist"
        }
    ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Airdrop

The airdrop consists of two steps:&#x20;

1. PSBT construction
2. Order creation & broadcast

## 1. PSBT Construction

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/airdrop`

Receives the airdrop data and returns the PSBT to be signed

**Headers**

**Body**

| Name                                                | Type                              | Description                                                                      |
| --------------------------------------------------- | --------------------------------- | -------------------------------------------------------------------------------- |
| runeName<mark style="color:red;">\*</mark>          | String                            | Rune name with spacers                                                           |
| perAddressAmount<mark style="color:red;">\*</mark>  | Number                            | Amount to distribute to each address                                             |
| runeSenderAddress<mark style="color:red;">\*</mark> | String                            | Bitcoin address containing the necessary rune amount                             |
| runeSenderPublicKey                                 | String                            | Public key corresponding to the runeSenderAddress (needed for taproot)           |
| btcSenderAddress<mark style="color:red;">\*</mark>  | String                            | Bitcoin address containing the necessary btc amount for network fees and postage |
| btcSenderPublicKey                                  | String                            | Public key corresponding to the btcSenderAddress (needed for taproot)            |
| receiverAddresses<mark style="color:red;">\*</mark> | Array                             | Array of addresses to receive the airdrop (max 2000 addresses)                   |
| feeRate<mark style="color:red;">\*</mark>           | Number                            | Fee rate in sats/vB                                                              |
| excludeUTXOs                                        | Array of outpoints \["txid:vout"] | Array containing UTXOs not to spend                                              |
| simulateFee                                         | Boolean                           | If true, only return fee estimation (Default = false)                            |

**Response**

{% tabs %}
{% tab title="200: OK" %}

```json
{
    "psbt":"cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK...",
    "chainFee": 1000,
    "serviceFee": 100
}
```

{% endtab %}

{% tab title="500: Internal Server Error" %}

```json
{
    "status": "error",
    "error": "error reason"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

{% endtab %}
{% endtabs %}

## 2. Order creation & broadcast

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/runes/airdrop-psbt`

Receives the signed PSBTs, creates an order and broadcasts the transaction

**Body**

| Name     | Type   | Description                                  |
| -------- | ------ | -------------------------------------------- |
| `psbt`   | String | Signed PSBTs in base64 to broadcast          |
| runeName | String | Valid rune name corresponding to the airdrop |

**Response**

{% tabs %}
{% tab title="200: OK" %}

<pre class="language-json"><code class="lang-json">{
<strong>    "runeName": "RuneName",
</strong>    "psbts": [
        "cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK..."
    ],
    "orderType": "rune-airdrop",
    "id": "76d1a25b-1e56-4476-8a98-d248f1ab5f95",
    "status": "ok",
    "state": "queued",
    "createdAt": {
        ".sv": "timestamp"
    }
}
</code></pre>

{% endtab %}

{% tab title="500: Internal Server Error" %}

```json
{
    "status": "error",
    "error": "error reason"
}
```

{% endtab %}

{% tab title="400: Bad Request" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


# What is TokenPay?

TokenPay is an Ordinals-native payment processor for Runes and BRC20.

Contact our [support](https://discord.ordinalsbot.com) to get an API key.


# API Docs

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/order/rune" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/utils/checktx" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/order/{orderId}" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/account/withdraw" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/withdrawal/{withdrawalId}" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/create-payment-psbt" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/account/balance" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# API reference


# Order

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/order/{orderId}" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Create payment psbt

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/create-payment-psbt" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Create burn rune psbt

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/create-burn-rune-psbt" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Validate burn rune tx

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/validate-burn-rune-tx" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Create burn inscription psbt

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/create-burn-inscription-psbt" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Utils


# Checktx

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/utils/checktx" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Submittx

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/utils/submittx" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Finalize psbt

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/utils/finalize-psbt" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# User


# Withdrawal

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/withdrawal/{withdrawalId}" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Order


# Rune

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/order/rune" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Account


# Withdraw

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/account/withdraw" method="post" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# Balance

{% openapi src="<https://api.ordinalsbot.com/tokenpay/docs.json>" path="/user/account/balance" method="get" %}
<https://api.ordinalsbot.com/tokenpay/docs.json>
{% endopenapi %}


# User Guide: Pre-Inscribed Launchpad API

This document provides detailed instructions for implementing the Pre-Inscribed Launchpad API, covering the steps required to create a launchpad and make offers.

## 1. Creating a Pre-Inscribed Launchpad

### Overview

The Pre-Inscribed Launchpad API enables you to create and manage pre-inscribed launchpads for pre inscribed inscriptions.\
\
Here is a sequence of API calls for creating a Launchpad:

<figure><img src="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FA6oEDNxNOUyPEoGvMBPu%2Fcreate-launchpad.png?alt=media&amp;token=d8a99145-ec92-46ed-9c06-f9ad543fd64b" alt=""><figcaption></figcaption></figure>

### Implementation Steps

#### Step 1: Create Launchpad

Make an API call to create a new Pre-Inscribed Launchpad:

```
POST https://api.ordinalsbot.com/marketplace/launchpads/create
```

Request body:

```json
{
  "slug": "satoshibles-the-ordinals",
  "makerPaymentAddress": "2N6ZePLQrKtix9bJBfznsykxKX1XtirnbKL",
  "makerPaymentPublicKey": "033528dc4c9fd062e63d2a8d5f8b2e3c3b8312ae7c1d3c4a41a9dc4eefa4205c05",
  "makerOrdinalAddress": "bc1q...",
  "makerOrdinalPublicKey": "e581edf3a948470930171a3e676490a8f7953a3698044c14b4d75ffeabc88a26",
  "data": [
    {
      "id": "8e7ba76e0c06ff5f43f50371bce849ae4e88dd36e1c0629e1a6f4383d1b0e679i0",
      "meta": {
        "attributes": [
          {
            "trait_type": "background",
            "value": "orange"
          }
        ],
        "name": "Satoshibles: The Ordinals #1"
      }
    }
  ],
  "meta": {
    "description": "Satoshi has come home to Bitcoin! The Ordinals collection by OG NFT project Satoshibles are a limited edition collection of 100 ordinals, featuring all new traits from the original artist Ayyoub Bouzerda. This collection is a tribute to Satoshi and the enduring legacy of Bitcoin. Don't miss your chance to own a piece of history!",
    "discord_link": "https://discord.com/invite/7Wm9Jg8MkW",
    "icon": "https://turbo.ordinalswallet.com/inscription/preview/3542f12dbe5fe3bd7fd622d1bb54994432e9a9184d24ff62ceb83234383b558ei0",
    "inscription_icon": "https://example.com/icon.png",
    "name": "Satoshibles: The Ordinals",
    "slug": "satoshibles-the-ordinals",
    "twitter_link": "https://twitter.com/satoshibles",
    "website_link": "https://satoshibles.com",
    "banner_image": "https://example.com/banner.png"
  },
  "phases": [
    {
      "name": "Whitelist Sale",
      "startDate": 1712044800,
      "endDate": 1712131200,
      "price": 100000,
      "isPublic": false,
      "allowList": [
        {
          "address": "bc1q...",
          "allocation": 5
        }
      ]
    }
  ]
}
```

Response:

```json
{
  "launchpadId": 123
}
```

#### Step 2: Monitor Launchpad Status by calling launchpad info endpoint /launchpads/{id}

Poll the Launchpad info API until the launchpad status changes:

* **"initializing"**: Lanchpad creation has started and still in progress
* **"pending\_psbt\_signature"**: All inscriptions processed and all PSBTs ready for requires signature
* **"active"**: No pending PSBTs to sign
* **"failed"**: Creation process failed failed\_reason will have reason for failure

```
GET https://api.ordinalsbot.com/marketplace/launchpads/{id}
```

Response:

```json
{
  "id": 99,
  "marketplace_id": "string",
  "status": "string",
  "failed_reason": "string",
  "total_inscriptions": 1000,
  "remaining_inscriptions": 1000,
  "meta_data": "string",
  "phases": [
    {
      "id": 0,
      "launchpad_id": 0,
      "name": "string",
      "phase_number": 0,
      "start_date": 1729621800,
      "end_date": 1729621810,
      "status": "string",
      "is_public": true,
      "price": 0,
      "psbts": [
        {
          "id": 207,
          "status": "unsigned",
          "phase_id": 132,
          "batch_number": 1,
          "inscription_count": 500
        },
        {
          "id": 208,
          "status": "unsigned",
          "phase_id": 132,
          "batch_number": 2,
          "inscription_count": 500
        }
      ]
    }
  ]
}
```

#### Step 3: Poll launchpad info&#x20;

Poll launchpad info till the status changes to "pending\_psbt\_signature", this indicates that all inscriptions have been processed. A set of PSBTs have been created and need to be signed.

#### Step 4: Fetch PSBT Details

Use the psbt id for each PSBT object from launchpad if. Call the `/marketplace/launchpads/psbt/{id}` API endpoint to fetch PSBT details for each psbt id:

```
GET https://api.ordinalsbot.com/marketplace/launchpads/psbt/{id}
```

Response:

```json
{
  "id": 207,
  "phase_id": 132,
  "batch_number": 1,
  "status": "unsigned",
  "inscription_count": 500,
  "psbt": "cHNi.....ZUEAAA=="
}
```

#### Step 5: Sign the PSBT

The PSBT needs to be signed by the inscription owner address on the frontend. Configure seller input and sign the transaction:

```js
try {
  // Configure seller inputs for the seller's wallet to sign
  const sellerInput = {
    address: ordinalsAddress, // Seller's ordinal wallet address
    signingIndexes: [0 to inscription_count], // Some walle api require this others done
    sigHash: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY, // Specify sigHash type
  };
  
  // Prepare signing payload
  const payload = {
    network: { type: "Mainnet" },
    message: "Sign Seller Transaction",
    psbtBase64: psbt, // PSBT returned by the /marketplace/launchpads/psbt/{id} API
    broadcast: false,
    inputsToSign: [sellerInput],
  };
  
  // Sign transaction
  await signTransaction({
    payload,
    onFinish: async ({ psbtBase64 }) => {
      // Step 6: Call the confirm endpoint with the signed PSBT
    },
    onCancel: () => {
      console.error("User canceled the signing request");
    },
  });
} catch (error) {
  console.error("Error creating listing:", error);
}
```

#### Step 6: Confirm Signed PSBT

Call the `/marketplace/launchpads/psbt/{id}/confirm` endpoint to update with the signed PSBT:

```
PUT https://api.ordinalsbot.com/marketplace/launchpads/psbt/{id}/confirm
```

Request body:

```json
{
  "signedPSBT": "cHNi.....ZUEAAA=="
}
```

Response:

```json
{
  "message": "Signed PSBT is updated successfully"
}
```

#### Step 7: Complete Process

Repeat steps 2-6 until all required PSBTs are signed and the launchpad status becomes "active".

## 2. Creating a Pre-Inscribed Launchpad Offer

### Overview

This process allows users to buy(mint) from a pre-inscribed launchpad.

Here is a sequence of API calls for buying from a Launchpad:

<figure><img src="https://796103842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FO24IAeCgrVaXB6ds99Ew%2Fuploads%2FL3KVvpm3KmiDMXlfTtff%2Fcreate-launchpad-offer.png?alt=media&amp;token=d82bc4c6-f7a5-4545-a775-7fe6674a6854" alt=""><figcaption></figcaption></figure>

### Implementation Steps

#### Step 1: Set Up Padding Outputs

if padding outputs dont exist in the buyers payment address then padding outputs will need to be created by calling:

Call the Setup Padding Output API:

```
POST https://api.ordinalsbot.com/marketplace/launchpads/offers/setup-padding
```

Request body:

```json
{
  "launchpadId": 123,
  "paymentAddress": "2N6ZePLQrKtix9bJBfznsykxKX1XtirnbKL",
  "paymentPublicKey": "033528dc4c9fd062e63d2a8d5f8b2e3c3b8312ae7c1d3c4a41a9dc4eefa4205c05"
}
```

Response:

```json
{
  "psbt": "cHNi.....ZUEAAA==",
  "inputIndices": [0, 1]
}
```

Sign the padding output transaction:

```js
try {
  const setupPaddingPayload = {
    network: {
      type: "Mainnet",
    },
    message: 'Sign Padding Outputs Transaction',
    psbtBase64: psbt, // PSBT returned by the Setup Padding Output API
    broadcast: true,
    inputsToSign: [{
      address: paymentAddress,
      signingIndexes: inputIndices, // Payment input indices returned by the Setup Padding Output API
    }],
  };
  
  await signTransaction({
    payload: setupPaddingPayload,
    onFinish: async ({ txId }) => {
      console.log("Signed Padding Outputs Transaction: " + txId);
    },
    onCancel: () => {
      console.error("User canceled the transaction");
    },
  });
} catch (error) {
  console.error("Error:", error);
}
```

Wait for transaction confirmation before making a purchase

#### Step 2: Create the Offer

Call the `/marketplace/launchpads/offers` API:

```
POST https://api.ordinalsbot.com/marketplace/launchpads/offers
```

Request body:

```json
{
  "launchpadId": 123,
  "items": [1, 2],
  "paymentAddress": "2N6ZePLQrKtix9bJBfznsykxKX1XtirnbKL",
  "paymentPublicKey": "033528dc4c9fd062e63d2a8d5f8b2e3c3b8312ae7c1d3c4a41a9dc4eefa4205c05",
  "ordinalAddress": "tb1q..."
}
```

Response:

```json
{
  "offerId": 456,
  "psbt": "cHNi.....ZUEAAA==",
  "inputIndices": [0, 1]
}
```

#### Step 3: Sign the Offer Transaction

```js
try {
  const createOfferPayload = {
    network: {
      type: "Mainnet",
    },
    message: 'Sign Create Offer Transaction',
    psbtBase64: psbt, // PSBT returned by the Create Offer API
    broadcast: false,
    inputsToSign: [{
      address: paymentAddress,
      signingIndexes: inputIndices, // Payment input indices returned by the Create Offer API
    }],
  };
  
  await signTransaction({
    payload: createOfferPayload,
    onFinish: async ({ psbtBase64 }) => {
      // Step 4: Submit the signed offer
    },
    onCancel: () => {
      console.error("User canceled the transaction");
    },
  });
} catch (error) {
  console.error("Error:", error);
}
```

#### Step 4: Submit the Offer

Call the `/marketplace/launchpads/offers/{id}/submit` API to complete the purchase and broadcast the transaction:

```
PUT https://api.ordinalsbot.com/marketplace/launchpads/offers/{id}/submit
```

Request body:

```json
{
  "signedPSBT": "cHNi.....ZUEAAA=="
}
```

Response:

```json
{
  "txId": "aa1c27........2767",

}
```

*


# API Docs

Marketplace for inscriptions, runes, brc20 and everything else!

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/collection/onboard" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/collection/{slug}" method="get" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/marketplaces/create" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/marketplaces" method="get" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/create" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/confirm" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/{id}/relist" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/{id}/confirm-relist" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/{id}" method="delete" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/{id}/confirm-delist" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/offers" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/offers/{id}/submit" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/listings/broadcast" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/inscriptions/transfer" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/inscriptions/confirm-padding" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/inscriptions/select-padding" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/inscriptions/setup-padding" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/create" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/psbt/{id}" method="get" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/psbt/{id}/confirm" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/offers" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/offers/{id}/submit" method="put" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/{id}/allocation/{takerOrdinalAddress}" method="get" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads/{id}" method="get" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}


# Data API

Api for getting marketplace data stats

## Get collection activity

> Retrieves trading activity history for a specific collection based on its slug

```json
{"openapi":"3.0.0","info":{"title":"Ordinalsbot Marketplace API","version":"0.0.1"},"servers":[{"url":"https://api.ordinalsbot.com/marketplace","description":"Production server"},{"url":"https://testnet-api.ordinalsbot.com/marketplace","description":"Testnet server"},{"url":"https://signet-api.ordinalsbot.com/marketplace","description":"Signet server"}],"paths":{"/data/collections/activity":{"get":{"summary":"Get collection activity","description":"Retrieves trading activity history for a specific collection based on its slug","parameters":[{"in":"query","name":"slug","required":true,"schema":{"type":"string"},"description":"The slug identifier of the collection"},{"in":"query","name":"startDate","required":false,"schema":{"type":"string","format":"date","nullable":true},"description":"Filter activities from this date (format YYYY-MM-DD). By default, it will filter activities from the last 7 days.\n"},{"in":"query","name":"page","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Page number for pagination"},{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":20,"maximum":100,"default":100},"description":"Number of records to return per page (between 20 and 100)"},{"in":"query","name":"order","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Sort order for activities (ascending or descending)"}],"responses":{"200":{"description":"Successfully retrieved collection activity","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"inscription_id":{"type":"string","description":"ID of the inscription involved in the activity"},"inscription_name":{"type":"string","description":"Name of the inscription"},"maker_address":{"type":"string","description":"Seller/maker address"},"taker_address":{"type":"string","nullable":true,"description":"Buyer/taker address (can be null)"},"collection_slug":{"type":"string","description":"Slug of the collection"},"collection_name":{"type":"string","description":"Name of the collection"},"price":{"type":"number","description":"Price in satoshis"},"trade_timestamp":{"type":"string","format":"date-time","description":"Timestamp when the trade occurred"},"transaction_id":{"type":"string","description":"Bitcoin transaction ID"},"thumbnail_url":{"type":"string","description":"URL to the inscription thumbnail image"}}}}}}},"400":{"description":"Bad request - validation error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"msg":{"type":"string"},"param":{"type":"string"},"location":{"type":"string"}}}}}}}}}}}}}}
```


# Editions Launchpad

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/editions/create" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/editions/mint" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}

{% openapi src="<https://api.ordinalsbot.com/marketplace/docs.json/>" path="/launchpads" method="post" %}
<https://api.ordinalsbot.com/marketplace/docs.json/>
{% endopenapi %}


# Creating a Marketplace

{% hint style="info" %}
An API Key is required to interact with MarketPlace APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to register a new Marketplace. Having a marketplace registered allows the marketplace to specify marketplace fees and launchpad fees for buying and selling ordinals. Marketplace fees are paid out when an ordinal is sold. Fees are transferred to the address specified in a trustless way as part of the purchase transaction. This endpoint can also be used to specify launchpad configuration to create a launchpad. marketplace fees and launchpad fees are separate<br>

### `POST` Create a new marketplace

## Create Marketplace

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/create-marketplace`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`\
\
Example Request Body:\
\
`{`\
&#x20;   `"name" : "Marketplace Name",`\
&#x20;   `"sellerFee" : 500,`\
&#x20;   `"buyerFee" : 500,`\
&#x20;   `"`btcFeePayoutAddress`" : "3En...38L",`\
&#x20;   `"url" : "https://www.marketplace.com",`\
&#x20;   `"launchpadBuyerFee": 100,`\
&#x20;   `"launchpadSellerFee": 500,`\
&#x20;   `"launchpadBtcFeePayoutAddress": "2Mx...Erx"`\
&#x20;   `"description" : "This is a test marketPlace"`\
&#x20;\
`}`

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                             |
| -------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sellerFee                              | Number | Fees to be charged to the seller when listing an ordinal for sale on the marketplace. Fees should be specified in basis points for example 10% would be 1000            |
| buyerFee                               | Number | <p>Fees that will be charged to the buyer when an ordinal is sold on the marketplace. Fees should be specified in basis points for example 10% would be 1000</p><p></p> |
| btcFeePayoutAddress                    | String | The address for paying out marketplace fees                                                                                                                             |
| name<mark style="color:red;">\*</mark> | String | Name for the marketplace                                                                                                                                                |
| url                                    | String | URL for the marketplace                                                                                                                                                 |
| description                            | String | Short description for the marketplace                                                                                                                                   |
| launchpadBuyerFee                      | Number | Fees that will be charged to the buyer when buying from launchpad. Fees should be specified in basis points for example 10% would be 1000                               |
| launchpadSellerFee                     | Number | Fees that will be charged to the seller when an inscription is listed on launchpad. Fees should be specified in basis points for example 10% would be 1000              |
| launchpadBtcFeePayoutAddress           | String | The address for paying out launchpad fees                                                                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "marketPlaceId": "123abce79a817d55d0e7123", // your new marketplace id
    "apiKey": "366e7416-9e95-459f-bee9-fe8abbf4591b" // the api key you provided
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Update a Marketplace

Update details of an existing marketplace

{% hint style="info" %}
An API Key is required to interact with MarketPlace APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to update a previously created Marketplace.<br>

### `POST` Update a marketplace

## Update Marketplace

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/update-marketplace`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`\
\
One or more of the values to be updated can be provided in the body.\
\
Example Request Body, this will update the `launchpadBtcFeePayoutAddress`and `description`:\
\
`{`\
&#x20;   `"launchpadBtcFeePayoutAddress": "2Mx...Erx"`\
&#x20;   `"description": "This is a test marketPlace"`\
&#x20;\
`}`

#### Request Body

| Name                         | Type   | Description                                                                                                                                                             |
| ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sellerFee                    | Number | Fees to be charged to the seller when listing an ordinal for sale on the marketplace. Fees should be specified in basis points for example 10% would be 1000            |
| buyerFee                     | Number | <p>Fees that will be charged to the buyer when an ordinal is sold on the marketplace. Fees should be specified in basis points for example 10% would be 1000</p><p></p> |
| btcFeePayoutAddress          | String | The address for paying out marketplace fees                                                                                                                             |
| name                         | String | Name for the marketplace                                                                                                                                                |
| url                          | String | URL for the marketplace                                                                                                                                                 |
| description                  | String | Short description for the marketplace                                                                                                                                   |
| launchpadBuyerFee            | Number | Fees that will be charged to the buyer when buying from launchpad. Fees should be specified in basis points for example 10% would be 1000                               |
| launchpadSellerFee           | Number | Fees that will be charged to the seller when an inscription is listed on launchpad. Fees should be specified in basis points for example 10% would be 1000              |
| launchpadBtcFeePayoutAddress | String | The address for paying out launchpad fees                                                                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "marketPlaceId": "123abce79a817d55d0e7123", // your new marketplace id
    "apiKey": "366e7416-9e95-459f-bee9-fe8abbf4591b" // the api key you provided
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# List ordinals for sale

This endpoint is used to list one or more ordinals for sale on the marketplace. The endpoint returns a Partially Signed Bitcoin Transaction (PSBT) which the owner must sign. If someone buys the ordinal, the buyer must supply the unspent transaction output (UTXO) covering the ordinal's price and any applicable fees. The seller's signature is required only during the initial listing, while only the buyer's signature is necessary for completing the purchase.\
\
**Platform Cost:** \
A platform fee is applied only when an ordinal is sold. It is not charged for listing an ordinal. The current fee is 1% of sale amount charged to the seller.

The response from this endpoint is a PSBT, encoded in base64, which the Ordinal owner's wallet needs to sign.

Here's an example of how you can sign a listing transaction with the Xverse wallet:<br>

```javascript
      
      // XVerse Wallet example of creating a signing request 
      // when listing an Ordinal for sale
      const sellerInput = {
        address: ordinalsAddress, // Seller's ordinal wallet address
        signingIndexes: [0], // always [0] when listing
        // Specify sigHash type as SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
        sigHash: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY,
      };

      // Create the listing PSBT by calling /marketplace/create-listing API
      // This returns a base64 PSBT in string format which needs to be signed
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/create-listing',
        data: {
          sellerOrdinals
          sellerPaymentAddress,
          sellerOrdinalPublicKey
        },
        headers: {
        'x-api-key': API_KEY,
      });

      // When using XVerse Wallet
      // Create the payload for signing the seller transaction
      const payload = {
        network: { type: "Mainnet" },
        message: "Sign Seller Transaction",
        psbtBase64: data.psbt, // PSBT returned by the clear-listing API
        broadcast: false,
        inputsToSign: [sellerInput],
      };

      // Make signing request
      await signTransaction({
        payload,
        onFinish: async (response) => {
          try {
            // signed succesffully

            // Save the listing with the signed PSBT
            const updateListingData = {
              signedListingPSBT: response.psbtBase64,
            };

            // Save the listing PSBT by calling /marketplace/save-listing API
            // This saves the signed PSBT
            const saveResponse= await axios({
              method: 'patch'
              url: 'https://api.ordinalsbot.com/marketplace/save-listing' + sellerOrdinals[0].id,
              data: {
                ordinalId: sellerOrdinals[0].id,
                updateListingData
              },
              headers: {
              'x-api-key': API_KEY,
              }
           });
      
          } catch (Error) {
            // error handling
          }
        },
        onCancel: () => { // User cancelled signing request }
      });

```

### `POST` List a new ordinal for sale

## List a Ordinal for sale

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/create-listing`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                             | Type   | Description                                                                                                                                               |                                                   |
| ------------------------------------------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| sellerOrdinals<mark style="color:red;">\*</mark> | Array  | <p>An array with one or more objects. The object should include:</p><p>id:string; => Ordinal id for the ordinal to be listed for sale.</p><p>price:number | string; => Sale price of the ordinal in Sats.</p> |
| sellerPaymentAddress                             | String | The address to receive the sale proceeds when the ordinal is sold. This will be part of the sale transaction that the buyer will sign.                    |                                                   |
| sellerOrdinalPublicKey                           | String | The public key for the wallet address that owns the ordinal being listed for sale                                                                         |                                                   |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "psbt": "cHNidP1BAP15AQIAAAAE1K5...........", // base64 transaction to be signed
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Save listing

Save listing is part of the create listing process. create-listing end point returns a psbt which is signed by the client wallet, once signed the signed psbt needs to be saved in the listing database by calling /save-listing end point.

Here's an example of how you can sign a listing transaction with the Xverse wallet and then save it by calling /save-listing:<br>

```javascript
      
      // XVerse Wallet example of creating a signing request 
      // when listing an Ordinal for sale
      const sellerInput = {
        address: ordinalsAddress, // Seller's ordinal wallet address
        signingIndexes: [0], // always [0] when listing
        // Specify sigHash type as SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
        sigHash: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY,
      };

      // Create the listing PSBT by calling /marketplace/create-listing API
      // This returns a base64 PSBT in string format which needs to be signed
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/create-listing',
        data: {
          sellerOrdinals
          sellerPaymentAddress,
          sellerOrdinalPublicKey
        },
        headers: {
        'x-api-key': API_KEY,
      });

      // When using XVerse Wallet
      // Create the payload for signing the seller transaction
      const payload = {
        network: { type: "Mainnet" },
        message: "Sign Seller Transaction",
        psbtBase64: data.psbt, // PSBT returned by the clear-listing API
        broadcast: false,
        inputsToSign: [sellerInput],
      };

      // Make signing request
      await signTransaction({
        payload,
        onFinish: async (response) => {
          try {
            // signed succesffully

            // Save the listing with the signed PSBT
            const updateListingData = {
              signedListingPSBT: response.psbtBase64,
            };

            // Save the listing PSBT by calling /marketplace/save-listing API
            // This returns a base64 PSBT in string format which needs to be signed
            const saveResponse= await axios({
              method: 'patch'
              url: 'https://api.ordinalsbot.com/marketplace/save-listing' + sellerOrdinals[0].id,
              data: {
                sellerOrdinals: [sellerOrdinals[0].id],
                updateListingData
              },
              headers: {
              'x-api-key': API_KEY,
              }
            });
      
          } catch (Error) {
            // error handling
          }
        },
        onCancel: () => { // User cancelled signing request }
      });

```

### `POST` Save listing data for ordinal

## Save listing details

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/save-listing/`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                                | Type   | Description                                                                                                                                                                                                                                                     |
| --------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| updateListingData<mark style="color:red;">\*</mark> | Object | <p>json object with a string signedListingPSBT.<br>Ex:<br></p><p>{ <br>     sellerOrdinals: \["0c9...ai0"],</p><p>     updateListingData: {</p><p>           signedListingPSBT:</p><p>                        "cHNidP8...AAA"</p><p>      } </p><p>}</p><p></p> |
| sellerOrdinals<mark style="color:red;">\*</mark>    | Array  | Array of ordinal Ids. The ids should be the same as ordinals ids used with /create-listing endpoint                                                                                                                                                             |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "_id": "7354826c46a5856b972795d7",
    "ordinalId": "8dc4e.....6ce70260i0",
    "price": 12345,
    "sellerPaymentAddress": "3Ny......yc4q",
    "sellerOrdinalPublicKey": "4fa4.....118fad4e476541",
    "status": "Active",
    "sellerOutputValue": 21111,
    "ordinalUtxoTxId": "3362....61449ef",
    "ordinalUtxoVout": 0,
    "marketPlaceMakerFee": 0,
    "marketPlaceTakerFee": 0,
    "platformMakerFee": 1000,
    "platformTakerFee": 1000,
    "signedListingPSBT": "cHNid......1rARj61OR2VBAAA="
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Delete Listing

This endpoint deletes an existing marketplace listing.

This endpoint can be used to delete an ordinal listing from the marketplace. Deleting a listing requires the seller to create a transaction by calling `/delist` sign the transaction and then need to send the signed transaction by making a call to `/confirm-delist` , the signed transaction transfers the ordinal to the seller so that the original ordinal UTXO is consumed and not valid anymore. This is to ensure that the old, signed transaction cannot be used anymore to buy the ordinal.<br>

### `POST` Delete Listing

<mark style="color:green;">`POST`</mark> `https://testnet-api.ordinalsbot.com/marketplace/delist`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example: Here's an example of executing a delete listing with Xverse wallet

```
// XVerse Wallet example of delete a listing request
// Create the delete listing PSBT by calling /marketplace/delist API
// This returns a base64 PSBT, sender ordinal and payment inputs which needs to be signed

const { psbtBase64, senderOrdinalInputs, senderPaymentInputs } = await axios({
  method: "post",
  url: "https://api.ordinalsbot.com/marketplace/delist",
  data: {
    ordinalId,    //ordinal id to be deleted from listing
    senderPaymentAddress,
    senderPaymentPublicKey,
  },
  headers: {
    "x-api-key": API_KEY,
  },
});

// input to sign
const inputsToSign = [
  {
    address: ordinalsAddress, // Seller's ordinal wallet address
    signingIndexes: senderOrdinalInputs,
    sigHash: bitcoin.Transaction.SIGHASH_ALL,
  },
  {
    address: senderPaymentAddress, // Seller's ordinal wallet address
    signingIndexes: senderPaymentInputs,
    sigHash: bitcoin.Transaction.SIGHASH_ALL,
  },
];

// Create the payload for signing the seller transaction
const payload = {
  network: { type: "Mainnet" },
  message: "Sign Seller Transaction",
  psbtBase64: psbtBase64, // PSBT returned by the delist API
  broadcast: true,
  inputsToSign: inputsToSign,
};

// Make signing request
await signTransaction({
  payload,
  onFinish: async (response) => {
    try {
      // make a call to /confirm-delist
      await axios({
        method: "post",
        url: "https://api.ordinalsbot.com/marketplace/confirm-delist",
        data: {
          ordinalId,
          sellerPaymentAddress: senderPaymentAddress,
        },
        headers: {
          "x-api-key": API_KEY,
        },
      });
      console.error('Signed transaction id:', {response?.txId})
    } catch (error) {
      console.error('Error delisted ordinal:', error)
    }
  },
  onCancel: () => {
    /* User cancelled signing request */
  },
});
```

#### Request Body

| Name                                                     | Type   | Description                                                                                                                    |
| -------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| ordinalId<mark style="color:red;">\*</mark>              | String | Id of the ordinal to buy.                                                                                                      |
| senderPaymentAddress<mark style="color:red;">\*</mark>   | String | Sender's payment wallet address. The sender will need to pay the cost of the transaction from UTXOs belonging to this address. |
| senderPaymentPublicKey<mark style="color:red;">\*</mark> | String | Public Key for sender's payment wallet address.                                                                                |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "psbtBase64": "cHNidP8BA............z730AAAAAAAAAAA==",
    "senderOrdinalInputs": [ 0 ],
    "senderPaymentInputs": [ 1 ]
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Update Listing

Update an existing marketplace listing

{% hint style="info" %}
An API Key is required to interact with MarketPlace APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint updates an existing marketplace listing with a new price. Calling the endpoint returns a psbt which needs to be signed by the seller's ordinal wallet address. Once signed the signed psbt needs to be returned by calling `/marketplace/confirm-relist`. if confirm-relist is not called then the existing ordinal listing remains unchanged.

### `POST` Update a Listing

## Update a marketplace listing

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/relist`

Example using Xverse Wallet:

```javascript
// XVerse Wallet example of creating a signing request 
// updating an ordinal by calling relist
// Create the relist PSBT by calling /marketplace/relist API
// This returns a base64 PSBT in string format which needs to be signed

const { data } = await axios({
  method: 'post',
  url: 'https://api.ordinalsbot.com/marketplace/relist',
  data: {
    ordinalId,
    price:1200,   // updated price
    sellerPaymentAddress,
    sellerOrdinalPublicKey
  },
  headers: {
  'x-api-key': API_KEY,
  }
});

// When using XVerse Wallet
// Create the payload for signing the seller transaction
const sellerInput = {
  address: ordinalsAddress, // Seller's ordinal wallet address
  signingIndexes: [0], // always [0] when listing/relisting
  // Specify sigHash type as SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
  sigHash: bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY,
};
const payload = {
  network: { type: "Mainnet" },
  message: "Sign Seller Transaction",
  psbtBase64: data.psbt, // PSBT returned by the clear-listing API
  broadcast: false,
  inputsToSign: [sellerInput],
};

// Make signing request
await signTransaction({
  payload,
  onFinish: async (response) => {
    try {
      // signed succesffully

      // Save the relist PSBT by calling /marketplace/confirm-relist API
      // This saves the signed PSBT
      const saveResponse= await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/confirm-relist',
        data: {
          ordinalId,
          signedListingPSBT: response.psbtBase64
        },
        headers: {
        'x-api-key': API_KEY,
        }
    });
    } catch (Error) {
      // error handling
    }
  },
  onCancel: () => { /* User cancelled signing request */}
});
```

#### Request Body

| Name                                        | Type   | Description                                                                                             |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------- |
| sellerOrdinalPublicKey                      | String | The public key for the wallet address that owns the ordinal                                             |
| ordinalId<mark style="color:red;">\*</mark> | String | Ordinal id to update                                                                                    |
| price                                       | Number | The listing price for the ordinal                                                                       |
| sellerPaymentAddress                        | String | Payment wallet address for the seller, this wallet address will receive the payment the ordinal is sold |

{% tabs %}
{% tab title="200: OK " %}

```json

{
{
    "psbt": "cHNidP1BAP15AQIAAAAE1K5...........", // base64 transaction to be signed
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Get List of Ordinals

This end point returns a list of ordinals. By default it returns all ordinals available for sale. The returned list of ordinals can also be filtered by status. The following status values are available:<br>

```typescript
'Sold', // Ordinals that have been sold
'Active', // Ordinals still available for sale
'Inactive', // Ordinals that have been marked as not available for sale by admin
'Pending Buyer Confirmation', // Ordinals where buyer has initiated purchase but not completed the sign and broadcast part of the process
'Pending Seller Confirmation', // Ordinals where seller has initiated listing but not completed the sign and save part of the process
```

Pagination and sorting options can be specified by adding `itemsPerPage` , `page` and `sort`\
values in the request body. By default results are sorted by listing time.\
Response provides an array of ordinals as well as information on current page and total ordinals for the specified search filter.\
\
Response structure:

```typescript
{
      results: [{},{},{},{}], // array of Ordinal listings
      count: 0, // number of Ordinals in the current results array
      currentPage: page, // current page number
      totalPages: 0, // total pages that can be returned for the current search results
      totalItems: 0 // total items in the database for the current search results
}
```

Here's an example of a call to get the 3rd page of all sold Ordinals sorted by time:

<pre class="language-javascript"><code class="lang-javascript">      

  const LISTING_STATUS = {
    sold: 'Sold',
    active: 'Active',
    inactive: 'Inactive',
    pending_buyer_confirmation: 'Pending Buyer Confirmation',
    pending_seller_confirmation: 'pending Seller Confirmation',
  }


      // Call /get-listing end point to get all Ordinals available for sale
      // by default only available ordinals are returned
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/get-listing',
        headers: {
        'x-api-key': API_KEY,
      });


      // Call /get-listing end point to get all Ordinals that have been sold
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/get-listing',
        data: {
          filter: {
            status: LISTING_STATUS.sold
          },
<strong>        page: 3,
</strong>        itemsPerPage: 50,
        sort: "time"
        }
        headers: {
        'x-api-key': API_KEY,
      });

</code></pre>

### `POST` Get List of Ordinals

## Get List of Ordinals

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/get-listing`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name         | Type   | Description                                                                                                                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter       | Object | <p>An object with status or any other fields to filter<br>example<br>{ "status":"Sold" }</p>                                                                                  |
| page         | Number | The page number in the list of pages to return by default the first page is returned                                                                                          |
| itemsPerPage | Number | The number of Ordinals to return in each page, this defaults to 100                                                                                                           |
| sort         | String | The sort field. This can be '`time`' or '`date`' to sort by listing time. this can also by any other field in the Ordinal data like '`price`' or '`sellerPaymentAddress`' etc |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json">{
      results: [
                {
                    "_id": "7354826c46a5856b972795d7",
                    "ordinalId": "8dc4e.....6ce70260i0",
                    "price": 12345,
                    "sellerPaymentAddress": "3Ny......yc4q",
                    "sellerOrdinalPublicKey": "4fa4.....118fad4e476541",
<strong>                    "status": "Active",
</strong>                    "sellerOutputValue": 21111,
                    "ordinalUtxoTxId": "3362....61449ef",
                    "ordinalUtxoVout": 0,
                    "marketPlaceMakerFee": 0,
                    "marketPlaceTakerFee": 0,
                    "platformMakerFee": 1000,
                    "platformTakerFee": 1000,
                    "__v": 0,
                    "signedListingPSBT": "cHNid......1rARj61OR2VBAAA="
                },
                {
                    "_id": "1835526c46a5856b972795d7",
                    "ordinalId": "1dc4e.....6ce70260i0",
                    "price": 12345,
                    "sellerPaymentAddress": "3Ny......yc2a",
                    "sellerOrdinalPublicKey": "4fa4.....118fad4e476541",
                    "status": "Active",
                    "sellerOutputValue": 21111,
                    "ordinalUtxoTxId": "3362....61449ef",
                    "ordinalUtxoVout": 0,
                    "marketPlaceMakerFee": 0,
                    "marketPlaceTakerFee": 0,
                    "platformMakerFee": 1000,
                    "platformTakerFee": 1000,
                    "__v": 0,
                    "signedListingPSBT": "cHNid......1rARj61OR2VBAAA="
                },
            ],
      count: 2, // number of Ordinals in the current results array
      currentPage: 3, // current page number
      totalPages: 3, // total pages that can be returned for the current query
      totalItems: 102 // total items for the current search query
}


</code></pre>

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create buy offer

This endpoint is designed for creating an transaction to purchase an ordinal listed for sale on the marketplace.\
\
**Platform Cost:** \
A platform fee is applied only when an ordinal is sold. It is not charged for listing an ordinal. The current fee is 1% of sale amount charged to the seller.

Upon usage, it generates a Partially Signed Bitcoin Transaction (PSBT) encoded in base64. This PSBT must be signed by the individual intending to buy the ordinal.

Here's an example of executing a purchase transaction with Xverse wallet:<br>

```javascript
      
      // XVerse Wallet example of creating a signing request 
      // when buying an Ordinal

      // Create the purchase PSBT by calling /marketplace/create-offer
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/create-offer',
        data: {
          ordinalId: id,
          buyerPaymentAddress: paymentAddress,
          buyerOrdinalAddress: ordinalsAddress,
          buyerPaymentPublicKey: paymentPublicKey
        },
        headers: {
        'x-api-key': API_KEY,
      });

      // returned response has a base64 encoded psbt to sign and an array of input
      // indices which the buyer needs to sign with the payment address wallet
      const buyerInput = {
        address: paymentAddress, // Buyer's payment wallet address
        signingIndexes: data.buyerInputIndices
      };

      // When using XVerse Wallet
      // Create the payload for signing the buyer transaction
      const payload = {
        network: { type: "Mainnet" },
        message: "Sign Buyer Transaction",
        psbtBase64: data.psbt,
        broadcast: false,
        inputsToSign: [buyerInput],
      };

      // Make signing request
      await signTransaction({
        payload,
        onFinish: async (response) => {
          try {
            // Here make a call to /submit-offer
            // Things to do after successful signing
          } catch (Error) {
            // error handling
          }
        },
        onCancel: () => { // User cancelled signing request }
      });

```

### `POST` Buy an ordinal

## Buy a listed ordinal

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/create-offer`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                                    | Type   | Description                                                                                                                                                               |
| ------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ordinalId<mark style="color:red;">\*</mark>             | String | Id of the ordinal to buy.                                                                                                                                                 |
| buyerPaymentAddress<mark style="color:red;">\*</mark>   | String | Buyer's payment wallet address. The buyer will need to pay the cost of the transaction from UTXOs belonging to this address.                                              |
| buyerPaymentPublicKey<mark style="color:red;">\*</mark> | String | Public Key for buyer's payment wallet address.                                                                                                                            |
| buyerOrdinalAddress<mark style="color:red;">\*</mark>   | String | Buyer's Ordinal wallet address. The purchased Ordinal will be transferred to this address.                                                                                |
| feeRateTier                                             | String | <p>Transaction fee rate should be one of the following. Defaults to fastestFee if not specified:<br><br>fastestFee<br>halfHourFee<br>hourFee<br>minimumFee</p><p><br></p> |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "psbt": "cHNidP8BA............z730AAAAAAAAAAA==",
    "buyerInputIndices": [ 0, 1, 3, 4, 5, 6 ]
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Submit buy offer

This endpoint is designed for completing the purchase of an ordinal.\
\
**Platform Cost:** \
A platform fee is applied only when an ordinal is sold. It is not charged for listing an ordinal. The current fee is 1% of sale amount charged to the seller.

This requires the signed psbt from /create-offer end point. Which is a  psbt signed by the buyer and base64 encoded. This returns a transaction id for the ordinal sale transaction.

### `POST` Submit offer

## Submit buy offer for a an odinal

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/submit-offer`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                                    | Type   | Description                                                                                                                                                 |
| ------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ordinalId<mark style="color:red;">\*</mark>             | String | Id of the ordinal being purchased.                                                                                                                          |
| signedBuyerPSBTBase64<mark style="color:red;">\*</mark> | String | Signed psbt transaction in base64 encoding. This is the output of the creating an offer using /create-offer and singing it using the buyer's payment wallet |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "txId": "aa1c27........2767", // transaction id for the purchase transaction
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Check for padding outputs

This endpoint helps you find out if the buyer's payment address has the necessary extra outputs, called "padding outputs" in their UTXO set. These extra outputs are used for setting up a buying transaction safely. They are part of a special security method called the 2-Dummy UTXO algorithm. This technique makes sure the Ordinal stays safe and isn't mixed up with other less important or dummy outputs. It also prevents the Ordinal from being mistakenly used up in transaction fees. The system follows common rules, creating a UTXO for the NFT at a specific starting point and setting aside 10,000 satoshis (sats) as postage. This careful approach keeps the transaction secure.\
\
This end point is to check if there are padding UTXOs available in the buyers UTXO set. If these are not then <https://api.ordinalsbot.com/marketplace/setup-padding-ouputs> can be used to create padding outputs.\
\
More info on utxos: <https://docs.ordinalsbot.com/knowledge-base/bitcoin/unspent-transaction-output-utxo>

### `POST` Check for padding outputs

## Check for padding outputs

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/confirm-padding-outputs`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                      | Type   | Description                                                                                                                  |
| ----------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Buyer's payment wallet address. The buyer will need to pay the cost of the transaction from UTXOs belonging to this address. |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "paddingOutputsExist": true, // boolean, if padding outputs exist
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create padding outputs

Use this endpoint to create a transaction that will create padding outputs for the buyer.\
\
This returns a PSBT in base64 format which needs to be signed and broadcast by the buyer's payment wallet address.

### `POST` Create padding outputs for buyer

## Create a transaction to setup padding outputs for buyer

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/setup-padding-ouputs`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name                                        | Type   | Description                                                                                                                                                               |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address<mark style="color:red;">\*</mark>   | String | Buyer's payment wallet address. The buyer will need to pay the cost of the transaction from UTXOs belonging to this address.                                              |
| publicKey<mark style="color:red;">\*</mark> | String | Public Key for buyer's payment wallet address.                                                                                                                            |
| feeRateTier                                 | String | <p>Transaction fee rate should be one of the following. Defaults to fastestFee if not specified:<br><br>fastestFee<br>halfHourFee<br>hourFee<br>minimumFee</p><p><br></p> |
| numOfOutPuts                                | number | Number of dummy padding outputs to create. This defaults to 3 if not specified                                                                                            |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "psbt": "cHNidP1BAP15AQIAAAAE1K5...........", // base64 transaction to be signed
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Transfer Ordinals

Transfer ordinal to another address

{% hint style="info" %}
An API Key is required to interact with MarketPlace APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint creates a psbt to transfer one or more ordinals. Calling the endpoint returns a psbt which needs to be signed and broadcast by the seller's ordinal wallet address.<br>

### `POST` Transfer one or more Ordinals

## Transfer one or more ordinals

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/transfer-ordinals`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`<br>

`transfer` is an array with one or more objects. Each object needs an ordinal Id and receiver address.\
\
Example Request Body:\
\
`{`\
&#x20;  `"transfer": [`\
&#x20;      `{`\
&#x20;          `"ordinalId": "5f251...b9i0",`\
&#x20;          `"receiverOrdinalAddress": "tb1...yk3"`\
&#x20;      `},`

&#x20;      `{`\
&#x20;          `"ordinalId": "2a920...c0i0",`\
&#x20;          `"receiverOrdinalAddress": "tb1...ze2"`\
&#x20;      `}`\
&#x20;  `],`\
&#x20;  `"senderPaymentAddress": "2N6Z...bKL",`\
&#x20;  `"senderPaymentPublicKey": "0335...c05",`\
&#x20;  `"senderOrdinalPublicKey": "e581...a26"`\
&#x20;`}`

\
This will return a PSBT. The PSBT has to be signed and broadcast.

#### Request Body

| Name                                                     | Type   | Description                                                                                                         |
| -------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| sellerOrdinalPublicKey<mark style="color:red;">\*</mark> | String | The public key for the wallet address that owns the ordinal                                                         |
| transfer<mark style="color:red;">\*</mark>               | Array  | An array of objects. Each object should have an id for the ordinal and an address for the receiver of that ordinal. |
| sellerPaymentAddress<mark style="color:red;">\*</mark>   | String | Payment wallet address for the seller, this wallet address will receive the payment the ordinal is sold             |
| senderPaymentPublicKey<mark style="color:red;">\*</mark> | String | The public key for the payment wallet, this will be used for fees                                                   |

{% tabs %}
{% tab title="200: OK " %}

```json

{
   "psbtBase64": "cHNidP8BA…yzcAAAAAAA==",
   "senderOrdinalInputs": [
       0,
       1
   ],
   "senderPaymentInputs": [
       2
   ]
}


```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create Marketplace

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to register a new Marketplace. Having a marketplace registered allows the marketplace to specify marketplace fees and launchpad fees for buying and selling ordinals. Marketplace fees are paid out when an ordinal is sold. Fees are transferred to the address specified in a trustless way as part of the purchase transaction. This endpoint can also be used to specify launchpad configuration to create a launchpad. marketplace fees and launchpad fees are separate<br>

### `POST` Create a new marketplace

## Create Marketplace

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/legacy-marketplace/create-marketplace`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`\
\
Example Request Body:\
\
`{`\
&#x20;   `"name" : "Marketplace Name",`\
&#x20;   `"sellerFee" : 500,`\
&#x20;   `"buyerFee" : 500,`\
&#x20;   `"btcFeePayoutAddress" : "3En...38L",`\
&#x20;   `"url" : "https://www.marketplace.com",`\
&#x20;   `"launchpadBuyerFee": 100,`\
&#x20;   `"launchpadSellerFee": 500,`\
&#x20;   `"launchpadBtcFeePayoutAddress": "2Mx...Erx"`\
&#x20;   `"description" : "This is a test marketPlace"`\
&#x20;\
`}`

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                             |
| -------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sellerFee                              | Number | Fees to be charged to the seller when listing an ordinal for sale on the marketplace. Fees should be specified in basis points for example 10% would be 1000            |
| buyerFee                               | Number | <p>Fees that will be charged to the buyer when an ordinal is sold on the marketplace. Fees should be specified in basis points for example 10% would be 1000</p><p></p> |
| btcFeePayoutAddress                    | String | The address for paying out marketplace fees                                                                                                                             |
| name<mark style="color:red;">\*</mark> | String | Name for the marketplace                                                                                                                                                |
| url                                    | String | URL for the marketplace                                                                                                                                                 |
| description                            | String | Short description for the marketplace                                                                                                                                   |
| launchpadBuyerFee                      | Number | Fees that will be charged to the buyer when buying from launchpad. Fees should be specified in basis points for example 10% would be 1000                               |
| launchpadSellerFee                     | Number | Fees that will be charged to the seller when an inscription is listed on launchpad. Fees should be specified in basis points for example 10% would be 1000              |
| launchpadBtcFeePayoutAddress           | String | The address for paying out launchpad fees                                                                                                                               |

{% tabs %}
{% tab title="200: OK " %}

```json

{
    "marketPlaceId": "123abce79a817d55d0e7123", // your new marketplace id
    "apiKey": "366e7416-9e95-459f-bee9-fe8abbf4591b" // the api key you provided
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create a new Launchpad

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.

A Marketplace is required to create a new launchpad as it'll inherit fees from it.&#x20;
{% endhint %}

Use this endpoint to create a new launchpad.\
To create a new launchpad ids for all the preinscribed inscriptions along with other launchpad related data including allowlst and phases needs to be provided to the create launch endpoint. This initiates the launchpad creation and creates a partially signed bitcoin transaction(PSBT) which needs to be signed by the wallet that has all the pre inscribed inscriptions.

### `POST` /launchpad/create-launch

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/create-launch`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body, this will create a new `launch`:

```json
{
  "sellerPaymentAddress": "3NyCZefqHSYiQRQdqaxYkaHnuFED1vyc4q",
  "sellerOrdinalPublicKey": "4fa4865e593f24fbf0852ca94039e68cdaae783098918ed6b0118fad4e476541",
  "phases": [
    {
      "ordinals": [
        "8f46149faff54a7efe0c5c73a633077a8009b374ebcf6d80609807eab8d73218i0"
      ],
      "allowList": {
        "bc1pdtkxdpunmu9rfj7tcglt4kcg2qya8w4y4cxhqcy9fscqnwdk8c7q6ec2w3": {
          "allocation": 5
        }
      },
      "isPublic": 0, // has to be 0 for false, 1 for true
      "price": 6000,
      "startDate": 1715754339,
      "endDate": 1715840739,
      "name": "Allowlist Phase 1"
    }
  ],
  // stringified metadata object
  "metaData": "{\"title\":\"This is amazing\",\"description\":\"This is amazing Description\",\"imageURL\":\"https://example.com/image.jpg\"}"
}
```

#### Request Body

| Name                   | Type   | Description                                                                                                      |
| ---------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| sellerPaymentAddress   | String | Creator or launchpad owner address to receive all bitcoin proceeds from launchpad sales                          |
| sellerOrdinalPublicKey | String | <p>The public key for the wallet address that owns all the inscriptions to be listed on the launchpad</p><p></p> |
| phases                 | Array  | An array of Phase objects each containing details about each phase of the launch                                 |

### Phase Object

| Name      | Type    | Description                                                                                                                                                                        |
| --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ordinals  | Array   | An array of ordinal IDs in string format                                                                                                                                           |
| allowlist | Object  | Mapping of addresses to their allocations.                                                                                                                                         |
| isPublic  | Boolean | Whether the phase is public or private. Public is open to everyone without the need for an allowlist                                                                               |
| price     | number  | Price for this phase for each inscription in sats                                                                                                                                  |
| startDate | number  | Start timestamp for the phase.                                                                                                                                                     |
| endDate   | number  | End timestamp for the phase.                                                                                                                                                       |
| metaData  | String  | Stringified Object with key value pairs. Properties for the launchpad like name description image links etc any launchpad specific key value properties can be stored in metaData. |

{% tabs %}
{% tab title="200: OK " %}

```json
// Response has the the launchpd id and the status
// status is pending while the psbt is being created
// Once psbt is ready status will change to pending confirmation
 
{
  "launchpadId": "65a123b789cdef0123456789",
  "status": "pending"
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Retrieve Launch PSBT

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to retrieve the PSBT. If PSBT is not ready a pending status will be returned. When the psbt is ready, the psbt to be signed is returned along with a pending confirmation status.

The PSBT needs to be signed by the wallet that owns all the pre inscribed inscriptions.

### `POST` /launchpad/get-launch-psbt/:launchpadId

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/launchpad/get-launch-psbt/:launchpadId`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

{% tabs %}
{% tab title="200: OK " %}

```json
// Response has the unsigned psbt and the status
// status is pending while the psbt is being created
// Once psbt is ready status will change to pending confirmation
 
{
  "status": "pending_buyer_confirmation",
  "psbt": "cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK..."
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Confirm Launch

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to confirm and save the new launch.\
Once unsigned psbt is available from get-launch-psbt endpoint, the psbt needs to be signed by the PSBT needs to be signed by the wallet that owns all the pre inscribed inscriptions.  The signed psbt needs to be submitted to /save-launch endpoint for the launch to be confirmed.

### `POST` /launchpad/save-launch

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/save-launch`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body, this will confirm and save a new `launch`:

```json
{
  "launchpadId": "65a123b789cdef0123456789",
  "updateLaunchData": {
    "signedListingPSBT": "cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK..."
  }
}
```

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>launchpadId
</code></pre></td><td>String</td><td>launchpad id returned by the create launch api</td></tr><tr><td><pre><code>signedListingPSBT
</code></pre></td><td>String</td><td><p>The signed PSBT </p><p></p></td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
  "message": "Launchpad listing is updated successfully"
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Check Allocation

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to check a wallet's allocation and claims for the launch.

### `POST` /launchpad/get-allocation

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/get-allocation`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body, this will get the allocation and claimed details for a buyer:

```json
{
  "launchpadId": "65a123b789cdef0123456789",
  "buyerOrdinalAddress": "bc1pdtkxdpunmu9rfj7tcglt4kcg2qya8w4y4cxhqcy9fscqnwdk8c7q6ec2w3"
}
```

#### Request Body

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>launchpadId
</code></pre></td><td>String</td><td>Launchpd id</td></tr><tr><td><pre><code>buyerOrdinalAddress
</code></pre></td><td>String</td><td><p>Wallet address of a prospective buyer</p><p></p></td></tr></tbody></table>

### Response

Response contains an array of phases with allocation count as well as clained count for that phase.

{% tabs %}
{% tab title="200: OK " %}

```json

 {
  "phases": [
    {
      "id": "65a123b789cdef0123456790",
      "public": false,
      "allocation": "5",
      "inscriptionsClaimed": 1
    },
    {
      "id": "65a123b789cdef0123456791",
      "public": true
    }
  ]
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Check for Padding Outputs

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint helps you find out if the buyer's payment address has the necessary extra outputs, called "padding outputs" in their UTXO set. These extra outputs are used for setting up a buying transaction safely. They are part of a special security method called the 2-Dummy UTXO algorithm. This technique makes sure the Ordinal stays safe and isn't mixed up with other less important or dummy outputs. It also prevents the Ordinal from being mistakenly used up in transaction fees. The system follows common rules, creating a UTXO for the NFT at a specific starting point and setting aside 10,000 satoshis (sats) as postage. This careful approach keeps the transaction secure. This end point is to check if there are padding UTXOs available in the buyers UTXO set. If these are not then [https://testnet-api.ordinalsbot.com/launchpad/setup-padding-ouputs](#post-launchpad-confirm-padding-outputs) can be used to create padding outputs. More info on utxos: <https://docs.ordinalsbot.com/knowledge-base/bitcoin/unspent-transaction-output-utxo>

### `POST` /launchpad/confirm-padding-outputs

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/confirm-padding-outputs`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name    | Type   | Description                                                                                                                  |
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| address | String | Buyer's payment wallet address. The buyer will need to pay the cost of the transaction from UTXOs belonging to this address. |

{% tabs %}
{% tab title="200: OK " %}

```json
// true if padding outputs exist
{
  "paddingOutputsExist": true
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Setup Padding Outputs

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

Use this endpoint to create a transaction that will create padding outputs for the buyer.

This returns a PSBT in base64 format which needs to be signed and broadcast by the buyer's payment wallet address.

### `POST` /launchpad/setup-padding-outputs

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/setup-padding-outputs`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body, this will create a new `launch`:

```json
{
  "address": "3NyCZefqHSYiQRQdqaxYkaHnuFED1vyc4q",
  "publicKey": "4fa4865e593f24fbf0852ca94039e68cdaae783098918ed6b0118fad4e476541",
  "feeRateTier": "fastestFee"
}
```

#### Request Body

| address\*    | String | Buyer's payment wallet address. The buyer will need to pay the cost of the transaction from UTXOs belonging to this address.            |
| ------------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| publicKey\*  | String | Public Key for buyer's payment wallet address.                                                                                          |
| feeRateTier  | String | Transaction fee rate should be one of the following. Defaults to fastestFee if not specified: fastestFee halfHourFee hourFee minimumFee |
| numOfOutPuts | number | Number of dummy padding outputs to create. This defaults to 3 if not specified                                                          |

{% tabs %}
{% tab title="200: OK " %}

```json
// Response has to be signed the the payment wallet
{
    "buyerInputIndices": [
        0
    ],
    "psbt": "cHNidP1BAP15AQIAAAAE1K5...........", // base64 transaction to be signed
    "psbtHex": "70736..."
}


```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Create buy offer

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint creates transaction to purchase an inscription from an active phase of a launchpad. **Platform Cost:** A platform fee is applied only when an ordinal is sold. It is not charged for listing an ordinal. The current fee is 1% of sale amount charged to the seller.\
A marketplace can also configure marketplace fee and/or launchpad fee for each sale, these are 0% by default.

Upon usage, it generates a Partially Signed Bitcoin Transaction (PSBT) encoded in base64. This PSBT must be signed by the payment wallet.\
\
The PSBT will only be created and returned for an active launchpad and only  if the ordinal address of the buyer has an available allocation to buy in the currently active phase.

### `POST` /launchpad/create-launch

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/create-launch-offer`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body:

```json
{
  "launchpadId": "65a123b789cdef0123456789",
  "buyerOrdinalAddress": "bc1p84ec5hn4asw90slszeje3yrnmzgapj0s9ern85zgh4kc9frqcl3q422dc2",
  "buyerPaymentAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
  "buyerPaymentPublicKey": "03a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd",
  "launchpadPhaseId": "65a123b789cdef0123456790"
}
```

#### Request Body

| Name                  | Type   | Description                                                                                                      |
| --------------------- | ------ | ---------------------------------------------------------------------------------------------------------------- |
| launchpadId           | String | Launchpad id                                                                                                     |
| launchpadPhaseId      | String | The phaseid of the active phase from which the buyer is buying an inscription                                    |
| buyerOrdinalAddress   | String | <p>The ordinal address of the buyer, this address should also be in the allowlist of the active phase</p><p></p> |
| buyerPaymentAddress   | String | The payment wallet address of the buyer                                                                          |
| buyerPaymentPublicKey | String | The Payment public key of the buyer payment wallet address                                                       |

{% tabs %}
{% tab title="200: OK " %}

```json
// Returns phase and launch info along with a unsigned PSBT

 {
  "phase": {
    "_id": "65a123b789cdef0123456790",
    "isPublic": false,
    "price": 6000,
    "startDate": "1234123432",
    "endDate": "1234923432"
  },
  "ordinalId": "8f46149faff54a7efe0c5c73a633077a8009b374ebcf6d80609807eab8d73218i0",
  "launchpadPhase": "65a123b789cdef0123456790",
  "buyerInputIndices": [0, 1],
  "psbt": "cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK...",
  "psbtHex": "70736..."
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Confirm buy offer

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint completes the purchase of an inscription.

This requires the signed psbt from /create-launch-offer end point. Which is a psbt signed by the buyer and base64 encoded. This returns a transaction id for the ordinal sale transaction.\
\
The PSBT will only be created and returned for an active launchpad and only  if the ordinal address of the buyer has an available allocation to buy in the currently active phase.

### `POST` /launchpad/submit-launch-offer

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/launchpad/submit-launch-offer`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

Example Request Body:

```json
{
  "launchpadPhase": "65a123b789cdef0123456789",
  "ordinalId": "8f46149faff54a7efe0c5c73a633077a8009b374ebcf6d80609807eab8d73218i0",
  "signedPsbt": "cHNidP8BAHECAAAAAfPQ0OTWpSxwRJK..."
}
```

#### Request Body

| Name        | Type   | Description                                                                                       |
| ----------- | ------ | ------------------------------------------------------------------------------------------------- |
| launchpadId | String | Launchpad id                                                                                      |
| ordinalId   | String | The ordinal id being purchased from the launchpad, this is available in the create offer response |
| signedPsbt  | String | <p>The PSBT signed by the buyer's payment wallet</p><p></p>                                       |

{% tabs %}
{% tab title="200: OK " %}

```json
// Returns transaction id

{
  "txId": "2c8e7ec23d8b4f91e98034b288721b9b7d0eb14d618bef59fe238b5023a4a34a"
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Get Launch Info

{% hint style="info" %}
An API Key is required to interact with Launchpad APIs. Please contact us to get an API Key and get started.
{% endhint %}

This endpoint returns launchpad information

### `GET` /launchpad/get-launch-stats

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/launchpad/get-launch-stats/:launchpadId`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

{% tabs %}
{% tab title="200: OK " %}

```json
// Returns Launchpad information and stats
{
    "_id": "671897436f9ae1623cad4d29",
    "sellerPaymentAddress": "2N6ZePLQrKtix9bJBfznsykxKX1XtirnbKL",
    "sellerOrdinalPublicKey": "e581edf3a948470930171a3e676490a8f7953a3698044c14b4d75ffeabc88a26",
    "marketPlaceId": "65e6f865fbdbaaa3d7f1bc9f",
    "metaData": "{\"title\":\"test 01\",\"description\":\"test launchpad 01\"}",
    "createdAt": "2024-10-23T06:27:15.869Z",
    "updatedAt": "2024-10-23T06:27:34.189Z",
    "phases": [
        {
            "_id": "671897436f9ae1623cad4d2c",
            "ordinals": 5,
            "available": 4,
            "isPublic": false,
            "price": 1500,
            "startDate": 1729621800,
            "endDate": 1729708200
        },
        {
            "_id": "671897476f9ae1623cad4d42",
            "ordinals": 5,
            "available": 5,
            "isPublic": false,
            "price": 1200,
            "startDate": 1729708200,
            "endDate": 1729794600
        }
    ],
    "totalOrdinals": 10,
    "available": 9
}

```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Find Special Ranges

Find special sats for the given bitcoin address

## Find special sats in the given bitcoin adddress

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/satscanner/find-special-ranges`

#### Path Parameters

| Name                                      | Type    | Description                                                                                                                                                                                                                     |
| ----------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| address<mark style="color:red;">\*</mark> | String  | The bitcoin address                                                                                                                                                                                                             |
| excludeCommonRanges                       | Boolean | <p>If set to true the response will contain ONLY the special ranges.</p><p></p><p>This is useful when you have a popular address with too many common ranges and you are not interested in them or the response is too big.</p> |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK The ranges and special ranges for the address" %}

```javascript
{
    "result": {
        "inscriptions": [
            {
                "output": "5c647ddc974d3f116093995a1cf8ac8ade10ed4f255bb3c4baf6435c5fb073d5:2",
                "inscriptions": [
                    "8ba8e1c2cf89413d94d6423032495c879435b2cde2c9fa1580d7f8dd7949e6a8i0"
                ]
            },
            {
                "output": "e3dd6ed7324c5df96206f91dc43deabc6fc6fdc1692d8f4a91efc5724fddd6b7:2",
                "inscriptions": [
                    "f7664e7e746df85704f71c3f7fbe6bcaa5b8626d82b5268d637a26889d42df22i0"
                ]
            }
        ],
        "ranges": [
            {
                "output": "5c647ddc974d3f116093995a1cf8ac8ade10ed4f255bb3c4baf6435c5fb073d5:2",
                "start": 1183905505897907,
                "end": 1183905505898453,
                "size": 546,
                "offset": 0,
                "rarity": "common"
            },
            {
                "output": "e3dd6ed7324c5df96206f91dc43deabc6fc6fdc1692d8f4a91efc5724fddd6b7:2",
                "start": 305377150438027,
                "end": 305377150442477,
                "size": 4450,
                "offset": 0,
                "rarity": "common"
            }
        ],
        "specialRanges": [
            {
                "start": 229634999999999,
                "output": "f69fc1bea9225b6077af7afd2f2d756b9f173e420c2f7b767435fba9b020b178:0",
                "size": 1,
                "offset": 0,
                "satributes": [ "black" ]
            }
      ]
    }
}
```

{% endtab %}
{% endtabs %}


# Find Special Ranges UTXO

Find special sats for the given UTXOs

## Find special sats in the given UTXOs

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/satscanner/find-special-ranges-utxo`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                    | Type      | Description            |
| --------------------------------------- | --------- | ---------------------- |
| utxos<mark style="color:red;">\*</mark> | String\[] | Array of utxos to scan |

{% tabs %}
{% tab title="200: OK The ranges and special ranges for the address" %}

```javascript
{
    "result": {
        "inscriptions": [
            {
                "output": "5c647ddc974d3f116093995a1cf8ac8ade10ed4f255bb3c4baf6435c5fb073d5:2",
                "inscriptions": [
                    "8ba8e1c2cf89413d94d6423032495c879435b2cde2c9fa1580d7f8dd7949e6a8i0"
                ]
            }
        ],
        "ranges": [
            {
                "output": "5c647ddc974d3f116093995a1cf8ac8ade10ed4f255bb3c4baf6435c5fb073d5:2",
                "start": 1183905505897907,
                "end": 1183905505898453,
                "size": 546,
                "offset": 0,
                "rarity": "common"
            }
        ],
        "specialRanges": [
            {
                "start": 229634999999999,
                "output": "5c647ddc974d3f116093995a1cf8ac8ade10ed4f255bb3c4baf6435c5fb073d5:2",
                "size": 1,
                "offset": 0,
                "satributes": [ "black" ]
            }
      ]
    }
}
```

{% endtab %}
{% endtabs %}


# Supported Satributes

List supported satributes

## Get list all supported satributes

<mark style="color:blue;">`GET`</mark> `https://api.ordinalsbot.com/satscanner/supported-satributes`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK List of satributes" %}

```javascript
{
    "result": [
        "uncommon",
        "rare",
        "epic",
        "legendary",
        "mythic",
        "block-9",
        "block-78",
        "block-286",
        "block-666",
        "block-999",
        "vintage",
        "number-palindrome",
        "pizza",
        "hitman",
        "first-transaction",
        "nakamoto",
        "black",
        "legacy",
        "jpeg"
    ]
}
```

{% endtab %}
{% endtabs %}


# Extract

List supported satributes

## Build an unsigned transaction to extract the special sats in your address

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/satextractor/extract`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

#### Request Body

| Name                                                       | Type      | Description                                                                                                                                                                                                                                                                                 |
| ---------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| scanAddress<mark style="color:red;">\*</mark>              | String    | The bitcoin address to scan                                                                                                                                                                                                                                                                 |
| addressToSendSpecialSats<mark style="color:red;">\*</mark> | String    | The address where we will send the special sats                                                                                                                                                                                                                                             |
| addressToSendCommonSats<mark style="color:red;">\*</mark>  | String    | The address where we will send all of the rest of the bitcoin in the given address                                                                                                                                                                                                          |
| feePerByte<mark style="color:red;">\*</mark>               | Integer   | The fee per byte for the transaction: make sure you use an up-to date fee per byte!                                                                                                                                                                                                         |
| filterSatributes                                           | String\[] | <p>Array of strings, if supplied we will only detect the selected satributes; Everything else will be sent to the common sats address.</p><p></p><p>You can get a list of supported satributes on the <a href="/sat-scanner-api/supported-satributes">Supported Satributes</a> endpoint</p> |

{% tabs %}
{% tab title="200: OK Transaction hex" %}

```javascript
{
    "specialRanges": [
        {
            "start": 280810779975733,
            "output": "826fe75c2e9d567baa6bee11160ae265b3007814ecca79299c5bd8338298b5d5:0",
            "size": 1,
            "offset": 0,
            "satributes": [
                "pizza"
            ]
        }
    ],
    "tx": "0200000001d5b5988233d85b9c2979caec147800b365e20a1611ee6baa7b569d2e5ce76f820000000000fdffffff02220200000000000022512044ddb479c1fe1e5c6ca9c2d1b477fcf7eb024e57f5aee10f2507f0c450c47da85c1100000000000016001402b3df8c029274deabfac0ace62f9fddae7dbfca00000000"
}
```

{% endtab %}
{% endtabs %}


# OPI API

OPI API endpoints are available to use with an API Key or from allow-listed domains.

**Mainnet:** [**https://api.ordinalsbot.com/opi**](https://api.ordinalsbot.com/opi)

**Testnet:** <https://testnet-api.ordinalsbot.com/opi>

You can refer to official OPI documentation for all available endpoints.

{% embed url="<https://github.com/bestinslot-xyz/OPI/blob/main/modules/brc20_api/api.js>" %}

## Get BRC20 Ticker Info

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/opi/v1/brc20/ticker_info`

#### Query Parameters

| Name                                     | Type   | Description                   |
| ---------------------------------------- | ------ | ----------------------------- |
| ticker<mark style="color:red;">\*</mark> | String | Ticker to get information for |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "error": null,
    "result": {
        "id": "10228",
        "original_tick": "TRIO",
        "tick": "trio",
        "max_supply": "21000000000000000000000000",
        "decimals": 18,
        "limit_per_mint": "10000000000000000000000",
        "remaining_supply": "0",
        "burned_supply": "0",
        "is_self_mint": false,
        "deploy_inscription_id": "c409d95ec5d858dcac9ef2e7b6bb57752b2e213f4e5443a252bdcc74625ec674i0",
        "block_height": 788143
    }
}
```

{% endtab %}
{% endtabs %}

## Get BRC20 Wallet Balance

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/opi/v1/brc20/get_current_balance_of_wallet`

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Bitcoin address to check balance |
| ticker                                    | String | Ticker to get balance            |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "error": null,
    "result": [
        {
            "overall_balance": "550000000000000000000",
            "available_balance": "50000000000000000000",
            "block_height": 840857,
            "tick": "trio"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get BRC20 Index Block Height

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/opi/v1/brc20/block_height`

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK " %}

```json
838346
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Bitcoin Remix

₿itcoin Remix is a remix-project fork adapted to work with BRC2.0 Programmable Module.

**Mainnet:** Will go live before BRC2.0 mainnet release.

**Signet:** <https://signet.bitcoin-remix.com/>

You can refer to official BRC2.0 Programmable Module documentation for all available endpoints.

{% embed url="<https://github.com/bestinslot-xyz/brc20-programmable-module>" %}

## JSON-RPC endpoint

<mark style="color:green;">`GET`</mark> `https://signet-api.ordinalsbot.com/brc20/rpc`

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "status": "0x1",
        "txResult": "Success",
        "reason": "Return",
        "logs": [],
        "gasUsed": "0x2074b",
        "from": "0x9daaff6e8a107b794199c48bdd1feec5348da1bf",
        "to": null,
        "contractAddress": "0x25536bd1375f5f1f95823ddd2d5e6dae238cdabd",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "blockHash": "0x000000067189d944e8cf60ea16ca9a7f849b3e0aea0b42c108b9395f17797098",
        "blockNumber": "0x3d7cd",
        "blockTimestamp": "0x68224344",
        "transactionHash": "0x313e9e74674a4927db0def6c8b038399773dc1349fc4e28860e8f7e9f09358c4",
        "transactionIndex": "0x0",
        "cumulativeGasUsed": "0x2074b",
        "effectiveGasPrice": "0x0",
        "type": "0x0",
        "nonce": "0x4",
        "output": "0x608060405234801561000f575f80fd5b506004361061003f575f3560e01c806320965255146100435780633fa4f24514610061578063552410771461007f575b5f80fd5b61004b61009b565b60405161005891906100c9565b60405180910390f35b6100696100a3565b60405161007691906100c9565b60405180910390f35b61009960048036038101906100949190610110565b6100a8565b005b5f8054905090565b5f5481565b805f8190555050565b5f819050919050565b6100c3816100b1565b82525050565b5f6020820190506100dc5f8301846100ba565b92915050565b5f80fd5b6100ef816100b1565b81146100f9575f80fd5b50565b5f8135905061010a816100e6565b92915050565b5f60208284031215610125576101246100e2565b5b5f610132848285016100fc565b9150509291505056fea26469706673582212200ba99065cff7fb0f3eaf90e326c902879cd740d92d50f8165bc0de9c13dda95b64736f6c634300081a0033"
    }
}
```

{% endtab %}
{% endtabs %}


# SNS API

OPI SNS API endpoints are available to use with an API Key or from allow-listed domains.

**Mainnet:** [**https://api.ordinalsbot.com/sns**](https://api.ordinalsbot.com/sns)

**Testnet:** [**https://testnet-api.ordinalsbot.com/sns**](https://testnet-api.ordinalsbot.com/sns)

You can refer to official OPI documentation for all available endpoints.

{% embed url="<https://github.com/bestinslot-xyz/OPI/blob/main/modules/sns_api/api.js>" %}

## Get SNS Info

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_info_of_sns`

#### Query Parameters

| Name                                   | Type   | Description                             |
| -------------------------------------- | ------ | --------------------------------------- |
| name<mark style="color:red;">\*</mark> | String | SNS to get info for (e.g. satoshi.sats) |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "error": null,
    "result": {
        "inscription_id": "26d5ad9f79aeb7f787e040e40f193e0d4f4e4bbf12fb5f7977bade6cb910ab5di0",
        "inscription_number": 207,
        "domain": "sats",
        "sns_name": "satoshi.sats"
    }
}
```

{% endtab %}
{% endtabs %}

## Get SNS Owned by Address

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_sns_of_address`

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Bitcoin address to check balance |

#### Headers

<table><thead><tr><th width="170">Name</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td>x-api-key<mark style="color:red;">*</mark></td><td>String</td><td>API Key</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "error": null,
    "result": [
        {
            "inscription_id": "26d5ad9f79aeb7f787e040e40f193e0d4f4e4bbf12fb5f7977bade6cb910ab5di0",
            "inscription_number": 207,
            "sns_name": "satoshi.sats"
        },
         ...
        {
            "inscription_id": "d2e34bd00eb1bf7d0f88acfccc31e8ca68a45097279ad07eafd06910bd1fa8a6i0",
            "inscription_number": 391,
            "sns_name": "d.sats"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get SNS Count of Address

<mark style="color:green;">`GET`</mark> `https://api.ordinalsbot.com/sns/v1/sns/get_sns_count_of_address`

#### Query Parameters

| Name                                      | Type   | Description                      |
| ----------------------------------------- | ------ | -------------------------------- |
| address<mark style="color:red;">\*</mark> | String | Bitcoin address to check balance |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "error": null,
    "result": [
        {
            "count": "16"
        }
    ]
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Mempool API

Mempool.Space API endpoints are available to use with an API Key or from allow-listed domains.

**Mainnet:** <https://api.ordinalsbot.com/mempool>

**Signet:** <https://signet-api.ordinalsbot.com/mempool>

**Testnet:** <https://testnet-api.ordinalsbot.com/mempool>

You can refer to official mempool.space API documentation for all available endpoints.

{% embed url="<https://mempool.space/docs/api/rest>" %}

## Get Block Height

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/mempool/api/block-height/:height`

#### Path Parameters

| Name                                     | Type   | Description                                          |
| ---------------------------------------- | ------ | ---------------------------------------------------- |
| height<mark style="color:red;">\*</mark> | Number | Returns the hash of the block currently at `:height` |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK " %}

```json
000000000000000000067bea442af50a91377ac796e63b8d284354feff4042b3
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Titan HTTP API

Titan API endpoints are available to use with an API Key or from allow-listed domains.

"Titan is a next-gen Bitcoin indexer by Saturn, designed for real-time blockchain access, optimized queries, and seamless Runes protocol integration. It delivers superior performance with minimal resource consumption."

**Mainnet:** [https://titan.ordinalsbot.com](https://titan.ordinalsbot.com/)

**Signet:** [https://signet-titan.ordinalsbot.com](https://signet-titan.ordinalsbot.com/)

**Testnet:** [https://testnet-titan.ordinalsbot.com](https://testnet-titan.ordinalsbot.com/)

You can refer to official Titan API documentation for all available endpoints.

{% embed url="<https://github.com/SaturnBTC/Titan/blob/master/ts-sdk/README.md#http-client-titanhttpclient>" %}

## Get Status

<mark style="color:green;">`GET`</mark> `https://signet-titan.ordinalsbot.com/status`

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "block_tip": {
        "height": 256858,
        "hash": "00000004c27b74087550febc56b093837c44f5323afef7b745337dc61da5ef66"
    },
    "runes_count": 1936,
    "mempool_tx_count": 88323
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Tap Reader API

Tap Protocol API endpoints are available to use with an API Key or from allow-listed domains.

**Mainnet:** <https://api.ordinalsbot.com/tapreader>

**Testnet:** <https://testnet-api.ordinalsbot.com/tapreader>

You can refer to official TAP documentation for all available endpoints.

{% embed url="<https://github.com/Trac-Systems/tap-reader/tree/main?tab=readme-ov-file#tap-protocol-api>" %}

## Get TAP Token Deployment

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/tapreader/getDeployment/:ticker`

#### Path Parameters

| Name                                     | Type   | Description                              |
| ---------------------------------------- | ------ | ---------------------------------------- |
| ticker<mark style="color:red;">\*</mark> | String | Ticker to get deployment inscription for |

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| x-api-key<mark style="color:red;">\*</mark> | String | API Key     |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "result": {
        "tick": "tap",
        "max": "21000000000000000000000000",
        "lim": "21000000000000000000000000",
        "dec": 18,
        "blck": 801996,
        "tx": "cbc1900b8b0f02fdf481137c587896781a721a35369d4eae47c7445622ecb671",
        "ins": "cbc1900b8b0f02fdf481137c587896781a721a35369d4eae47c7445622ecb671i0",
        "num": 21953432,
        "ts": 1691356378,
        "addr": "bc1pcf4jawvk9gjhjske5mch045szhtgsgpt4df5ftnqpxlc27qtaxyqxxmjsf",
        "crsd": false,
        "dmt": false,
        "elem": null,
        "prj": null,
        "dim": null,
        "dt": null
    }
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}


# Split

## Split UTXO

<mark style="color:green;">`POST`</mark> `/utxo/split`&#x20;

This endpoint handles the creation of a PSBT that splits a Bitcoin address's UTXOs into smaller ones. It validates the request, constructs the transaction, and returns the result.

* Splits UTXOs into the specified number of outputs with equal value.
* Returns the unsigned PSBT (base64) ready for signing and broadcasting.

**Body**

| Name                                        | Type                                                 | Description                                                                         |
| ------------------------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------- |
| inAddress<mark style="color:red;">\*</mark> | string                                               | Bitcoin address to get the UTXOs from                                               |
| outAddress (optional)                       | string                                               | Bitcoin address to send the splits. If not set then UTXOs will be sent to inAddress |
| splits<mark style="color:red;">\*</mark>    | <p>array:</p><p>{ value: number, count: number }</p> | Array containing split objects                                                      |
| value<mark style="color:red;">\*</mark>     | number                                               | Value of each UTXO split                                                            |
| feeRate<mark style="color:red;">\*</mark>   | number                                               | Fee rate in sats/vByte                                                              |
| publicKey                                   | string                                               | Address associated public key, needed for p2sh only                                 |
| excludeUTXOs                                | array of outpoints ("txid:vout")                     | Array containing UTXOs not to spend                                                 |
| ignorePadding                               | boolean                                              | If true padding outputs (600sats) will be ignored (Default = true)                  |

**Example:**

```json
{
  "inAddress": "tb1qr4...",
  "outAddress": "tb1qr4sw...",
  "splits": [
    {
        "value": 600,
        "count": 2
    },
    {
        "value": 1000,
        "count": 3
    }
  ],
  "feeRate": "10",
  "publicKey": "03725d3f189...",
  "excludeUTXOs": [
    "b591b8b5ba6c54ce65bc72ea20a9e0ed4f50eccaaa8669b542932b8687b2ef37:0",
    "b591b8b5ba6c54ce65bc72ea20a9e0ed4f50eccaaa8669b542932b8687b2ef37:0"
  ],
  "ignorePadding": true
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "psbt": "cHNidP8BAJACAAAA..."
}
```

{% endtab %}

{% tab title="500" %}

```
{
  "error": "Internal server error"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}


# Inscribe your first Ordinal

Coming Soon...


# Receiving Payments

Creators and developers may earn bitcoin by selling their collections, referring others to the service or creating applications that utilize OrdinalsBot API.

### Payout Frequency

Payouts are done every day at 00:00 UTC and is managed through a daily batch run for eligible creators.

### Eligibility Criteria

To be eligible for inclusion in the daily batch run, the total accumulated earnings must be at least 200k sats. These earnings can be a combination of the following:&#x20;

• Mint Price&#x20;

• Referral Earnings&#x20;

• Additional Fees (by using `additionalFee` parameter when [creating orders](/api/create-a-direct-inscription-order#create-order))&#x20;

Please ensure that your combined earnings meet or exceed the **200k sats** threshold to be included in the daily batch payment.&#x20;

These minimums do not apply if you prefer to use a [Lightning Address](http://lightningaddress.com) to receive payouts instantly over Lightning Network.

### Checking Your Earnings

{% hint style="info" %}
Note that since service fees are dynamic it may not be possible to forecast or list exact earnings in satoshis/bitcoin.

The number of created orders with a specific referral code and paid orders are tracked as inscriptions are completed by the platform.
{% endhint %}

• Accumulated Earnings: You can check your current accumulated earnings by visiting [Referral Scheme](/api/referral-scheme#get-referral-status).

• Last Payment: To view the details of the last payment made to you by visiting [Referral Scheme](/api/referral-scheme)and checking `payments` elements.


# Ordinals

### What is Ordinal Theory?

The Ordinal theory introduces a unique numbering scheme for satoshis, facilitating the tracking and transferring of individual sats. These numbers, aptly called ordinal numbers, are assigned to satoshis in the order they are mined and transferred from transaction inputs to transaction outputs following a first-in-first-out methodology. This numbering scheme hinges on the order in which satoshis are mined, while the transfer scheme relies on the order of transaction inputs and outputs, hence the term "ordinals."

What's intriguing about the Ordinal theory is that it operates independently, requiring no separate token, another blockchain, or any modifications to Bitcoin. In essence, it's a concept that is readily applicable in the current Bitcoin environment.

### Ordinal numbers can be represented in various ways:

* **Integer notation:** This is simply the ordinal number, assigned according to the sequence in which the satoshi was mined. An example would be 2099994106992659.
* **Decimal notation:** This representation includes the block height where the satoshi was mined, along with the offset of the satoshi within the block. An example would be 3891094.16797.
* **Degree notation:** This takes a unique form, for example, 3°111094′214″16797‴.&#x20;
* **Percentile notation:** This expresses the satoshi's position in Bitcoin's supply as a percentage. An example would be 99.99971949060254%.
* **Name:** This is an encoding of the ordinal number using the characters a through z, like 'satoshi'.

Using ordinal numbers as stable identifiers, arbitrary assets such as NFTs, security tokens, accounts, or stablecoins can be attached to satoshis.

### Bitcoin Improvement Proposal

The Bitcoin Improvement Proposal (BIP) provides more technical details about the Ordinal theory. The Ordinals project is an open-source initiative developed on [GitHub](https://github.com/bitcoin/bips), which includes a BIP describing the ordinal scheme, an index that interacts with a Bitcoin Core node to track all satoshis, a wallet for making ordinal-aware transactions, and a block explorer for interactive exploration of the blockchain. The project also offers functionalities for inscribing satoshis with digital artifacts and a comprehensive manual.


# What is an Ordinal?

Ordinals are a revolutionary concept in the world of cryptocurrencies that have gained significant traction since their inception. Developed by Casey Rodarmor, the term "Ordinal" refers to a unique form of data inscription onto Bitcoin, effectively turning the smallest unit of Bitcoin - the satoshi - into a unique digital artifact. A recent phenomenon, this concept leverages the Bitcoin blockchain and became feasible with the launch of the Taproot upgrade in November 2021.

### The Creation of Ordinals <a href="#the-creation-of-ordinals-0" id="the-creation-of-ordinals-0"></a>

The creation of an Ordinal entails the inscription of content data into the witness of a Bitcoin transaction, a process that has been likened to creating non-fungible tokens (NFTs). This unique data inscription system builds upon the 2017 SegWit upgrade, which fixed bugs and laid the groundwork for Layer 2 payment channels like the Bitcoin Lightning Network.

\
The Taproot upgrade played a crucial role in making the Ordinals system possible. It combined all parties' public keys in a transaction to create a new public key and used Schnorr signatures to do so. This method enhanced privacy by obscuring transaction inputs on the Bitcoin blockchain and reduced the amount of data needed for transactions, thereby lowering transaction costs.

### Bitcoin Ordinals: The NFTs of Bitcoin&#x20;

Often dubbed the NFTs of the Bitcoin blockchain, Bitcoin Ordinals are units of Bitcoin that have been inscribed with data such as text or images. Unlike conventional NFTs, the value of an Ordinal is not tied to the Satoshi it represents but the information inscribed onto it. The Ordinals Protocol, launched by Rodarmor in January 2023, enabled Bitcoin users to create Ordinals by linking data with individual units of Bitcoin. This protocol leveraged the 2021 Taproot upgrade, which enhanced privacy, security, scalability, and increased the data capacity for each Bitcoin unit to 4MB.

Each Ordinal is assigned a unique, sequential number based on the time it is mined, with a numbering system that ranges from 0 to 2,100,000,000,000,000. The timing of its mining and inscription determines the rarity of an Ordinal, with coins minted and inscribed during significant periods deemed collectible.

### How Do Ordinals Differ from Traditional NFTs? <a href="#how-do-ordinals-differ-from-traditional-nfts-2" id="how-do-ordinals-differ-from-traditional-nfts-2"></a>

Ordinals and traditional NFTs have several differences. First, Ordinals are not tokens but inscriptions on Bitcoin. Second, unlike NFTs that use smart contracts to enable a range of future behaviors, Ordinals do not have this feature. Lastly, Ordinals store their data entirely on-chain, meaning all information is held within the blockchain itself. This contrasts with many NFTs that use off-chain storage networks like IPFS to store their metadata. Although this on-chain storage approach might be slower and potentially more costly, it is completely unchangeable.

The creation of an Ordinal involves two steps: creating a taproot output with the inscription content and then spending the output to reveal the inscription content on the blockchain. This content is wrapped in an envelope that doesn't alter the script. The data are inscribed directly into the Bitcoin blockchain, unlike many NFTs which often just contain reference points to off-chain data. The Bitcoin block size is capped at 4MB, which puts a limit on the number of Ordinals that can be created.


# Satoshi Rarity

The intricate world of Bitcoin is replete with technical nuances and fascinating insights. One area of particular interest is the notion of satoshi rarity, derived from the Ordinal theory that provides a framework for classifying and numbering Bitcoin's smallest unit, the satoshi.

Named after the enigmatic founder of Bitcoin, Satoshi Nakamoto, a satoshi is the smallest indivisible unit of a Bitcoin, with one Bitcoin containing 100 million satoshis. Applying Ordinal Theory to this unit, each satoshi is numbered, resulting in what are known as "Ordinals."

### Identifying Unique Satoshis

Several factors could make an ordinal, or satoshi, unique. It might have been held by Satoshi Nakamoto themselves, been part of the historic "Pizza Transaction," or carry significance because of its position within Bitcoin's blockchain. The possibilities are diverse and intriguing.

### The Rodarmor Rarity Index

Casey Rodarmor, the inventor of Ordinal Theory, introduced a compelling method for identifying unique satoshis. Rodarmor's approach relies on natural, pre-programmed events within Bitcoin's blockchain to classify satoshis into rarity categories. This classification has become popularly known as the "Rodarmor Rarity Index."

This index identifies six categories of satoshis based on rarity:

* **Common:** These are regular satoshis, excluding the first sat of a block. Over 99% of all satoshis fall into this category.
* **Uncommon:** The first satoshi of a block is labeled as "uncommon." As new blocks are mined approximately every 10 minutes, an uncommon satoshi is created in every such event.
* **Rare:** This category includes the first satoshi of each difficulty adjustment period, which happens every 2,016 blocks or roughly every two weeks.
* **Epic:** This rare breed is the first satoshi of each halving epoch, a phenomenon that occurs every 210,000 blocks, approximately every four years.
* **Legendary:** Legendary sats are the first sat of each "cycle." As explained by Rodarmor, "Every six halvings, something magical happens: the halving and the difficulty adjustment coincide. This is called a conjunction, and the time period between conjunctions is a cycle." This event occurs roughly every 24 years, with the first conjunction expected around 2032.
* **Mythic:** The first satoshi of the genesis block, the first satoshi ever created, holds this mythical status. Unspendable and unattainable, this is a special category as Satoshi Nakamoto made the first block unspendable.

### Beyond the Rodarmor index

As the Rodarmor Rarity Index gains wider recognition, rarity categories such as "Pizza Sats" and "Block 78 Sats" have surfaced, further highlighting the exciting narrative embedded in Bitcoin's intricate blockchain. Here are some other popular rare sats:

* **Pizza Sats:** Commemorates a significant event in Bitcoin history. On May 22, 2010, Laszlo Hanyecz, a programmer, bought two Papa John's pizzas with 10,000 Bitcoins, a value today that would be in the hundreds of millions of dollars. The satoshis involved in this transaction are known as "Pizza Sats." They carry historical importance, adding an additional dimension of value beyond their monetary worth. This transaction, one of Bitcoin's first real-world uses, is celebrated annually on Bitcoin Pizza Day.
* **Palindrome Sats:** Refers to satoshis whose number can be read the same way backward or forward. An example is the number 2708111118072, taken from block 541.
* **Block 9 Sats:** Are the oldest satoshis currently in circulation.
* **Block 78 Sats:** Signifies satoshis mined from the first block by Hal Finney, who was the second Bitcoin miner after Satoshi Nakamoto. Block 78 is a pivotal point in Bitcoin's history, marking the first occasion a block was mined by someone other than Nakamoto. This signaled the start of Bitcoin network's broader decentralization and the expansion of Bitcoin mining. As a result, these satoshis, known as Block 78 Sats occupy a special spot in the historical evolution of Bitcoin.
* **Vintage Sats:** Are the satoshis that were mined from the first 10,000 blocks.
* **First Transaction Sats:** Denotes the satoshis involved in the inaugural transaction made by Satoshi to Hal Finney on January 12, 2009, within block 170.
* **Nakamoto Sats:** Satoshis mined by Satoshi Nakamoto

### The Future of Satoshi Rarity

The classification of satoshis into rarities introduces a new dimension to the Bitcoin world, adding value beyond the purely monetary aspect. The market might attribute additional worth to these "Uncommon," "Rare," "Epic," "Legendary," and "Mythic" satoshis due to their unique histories and symbolic significance within the blockchain.


# What are BRC-20 Tokens?

The [BRC-20 token standard](https://domo-2.gitbook.io/brc-20-experiment/) represents an intriguing milestone in the realm of cryptocurrency.[ Launched by Twitter user @domodata on March 8th, 2023](https://twitter.com/domodata/status/1633658974686855168), BRC-20 tokens have quickly gained attention within the crypto community. Despite sharing a similar name with [Ethereum's ERC-20 token standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/), BRC-20 is quite distinct, both in its mechanism and purpose.

### Understanding BRC-20 Tokens

BRC-20 is a fungible token standard developed specifically for the Bitcoin blockchain. It uses Ordinal inscriptions of [JavaScript Object Notation (JSON)](https://en.wikipedia.org/wiki/JSON) to deploy token contracts, mint, and transfer tokens. In essence, it's a way to attach a script file to bitcoin and use that file to attribute tokens to satoshis, the smallest unit of Bitcoin. These tokens can then be transferred from one user to another.

Unlike the token standards on [EVM (Ethereum Virtual Machine) chains](https://medium.com/eligma-blog/what-are-evm-compatible-blockchains-64f91c97038e), which deploy smart contracts to govern token standards and rules, BRC-20 doesn't interact with smart contracts. Instead, BRC-20 tokens rely on the underlying Bitcoin protocol, utilizing its proof-of-work mechanism for operations.

The BRC-20 token standard uses JSON inscriptions on satoshis to create tokens. JSON, a lightweight data-interchange format, houses executable code bits that define every aspect of the token, including supply, minting limit, and the token's identity. Once successfully deployed, any Bitcoin ordinal wallet can connect to the network, mint the token, and transact with it like any other cryptocurrency.

Although BRC-20 tokens might seem similar to smart contract tokens, they possess an essential difference. While smart contracts allow the conditions to be changed, BRC-20 inscriptions are immutable, being directly inscribed to a satoshi, they cannot be modified by any counterparty.

### Advantages of BRC-20 Tokens

BRC-20 tokens, although in their early stages, offer several notable benefits.

* **Fungibility:** BRC-20 tokens are fungible, meaning they are interchangeable and can be easily traded on exchanges. This presents an opportunity to interact with the Bitcoin blockchain without necessarily trading Bitcoin itself.
* **Security:** Being built on the Bitcoin protocol, BRC-20 tokens inherit the high level of security and resistance to hacking attempts characteristic of Bitcoin.
* **Compatibility:** BRC-20 tokens integrate seamlessly with the Bitcoin protocol, which means they can be easily assimilated into the Bitcoin ecosystem.
* **Decentralization:** Benefiting from Bitcoin's decentralized network, BRC-20 tokens can be sent between peers just like any other cryptocurrency.

### BRC-20 vs. ERC-20 Tokens

While both BRC-20 and ERC-20 tokens run on a parent blockchain network, they differ significantly in their mechanisms and features.ERC-20 tokens are created through a smart contract code written in languages such as [Solidity](https://soliditylang.org/) and deployed on the Ethereum Virtual Machine. In contrast, BRC-20 tokens are created through ordinal inscriptions on satoshis using JSON. Unlike BRC-20 tokens that operate parallel to Bitcoin, activities on the ERC-20 protocol are in sync with the Ethereum network. Also, the distribution of ERC-20 tokens can be centrally managed by a single entity, which can lead to potential manipulation, while BRC-20 tokens foster a more decentralized and inclusive token generation process.

In summary, BRC-20 represents a unique approach to fungible tokens on the Bitcoin blockchain. While they don't have the ability to interact with smart contracts like the Ethereum-based ERC-20 tokens, BRC-20 tokens provide a secure, fungible, and decentralized alternative for tokenization on the Bitcoin network. As the Bitcoin ecosystem continues to evolve, it will be exciting to see how BRC-20 tokens and similar innovations contribute to the blockchain's future.


# Image Optimisation

Image optimisation is the process of reducing file size and dimensions of digital images without compromising their quality. The main aim is to create the lightest image possible, in terms of file size, to make the page load quickly and smoothly, providing an optimal user experience.

In the context of blockchain, image optimisation takes on new layers of significance. Blockchain technology, with its growing use in various fields including digital art and Non-Fungible Tokens (NFTs), relies heavily on image optimisation. Because every transaction (including image inscription) on the blockchain involves a cost, the size of the image can significantly impact the transaction fees. The larger the image, the higher the cost of storing it on-chain.

### How to Optimise Images

Image optimisation involves several techniques and steps. Here are the most common methods:

* **Resize the Images:** Reducing the dimensions of an image will reduce its file size. This can be done using image editing tools like [Adobe Photoshop](https://www.adobe.com/uk/products/photoshop/landpa.html?gclid=Cj0KCQjwqs6lBhCxARIsAG8YcDhiqfjDDPAR3F5ETjJCjQoFyWt3dPdIH7mpJ7JRfyMMeoFDreuyMjgaAqqDEALw_wcB\&mv=search\&mv=search\&sdid=LZ32SYVR\&ef_id=Cj0KCQjwqs6lBhCxARIsAG8YcDhiqfjDDPAR3F5ETjJCjQoFyWt3dPdIH7mpJ7JRfyMMeoFDreuyMjgaAqqDEALw_wcB:G:s\&s_kwcid=AL!3085!3!441664377297!e!!g!!adobe%20photoshop!1422700211!58647953511\&gad=1), [GIMP](https://www.gimp.org/), etc.
* **Compress the Images:** Compression reduces the file size by removing the extra data. There are two types of image compression: lossless and lossy. Lossless compression reduces file size without affecting the image quality, while lossy compression reduces file size significantly, but compromises image quality to some extent.
* **Choose the Right File Format:** JPEG, PNG, GIF, and WebP are common image formats. JPEG is good for photographs and detailed images, PNG is suitable for images with transparent backgrounds, and GIF is suitable for simple animations. [WebP](https://developers.google.com/speed/webp#:~:text=WebP%20is%20a%20modern%20image,that%20make%20the%20web%20faster.) is a newer format that provides superior compression and quality characteristics.
* **Use Image Optimisation Tools:** Many online tools and software are available for image optimisation. Some popular tools are [TinyPNG](https://tinypng.com/), [ImageOptim](https://imageoptim.com/mac), and [Photoshop's 'Save for Web' ](https://www.lifewire.com/photoshop-save-for-web-tool-tutorial-1697537)option.

For on-chain images, due to the cost associated with transactions, it becomes even more crucial to optimise images before uploading them onto the blockchain. However, one must ensure to keep a balance between the image quality and its size to maintain the integrity of the image while minimising the transaction fees.

### Impact of Image Optimisation and Importance of Retaining Image Integrity <a href="#impact-of-image-optimisation-and-importance-of-retaining-image-integrity-1" id="impact-of-image-optimisation-and-importance-of-retaining-image-integrity-1"></a>

Image optimisation can greatly enhance the user experience on any website or app. Optimised images lead to faster page loading times, reduced bounce rates, improved [SEO](https://en.wikipedia.org/wiki/Search_engine_optimization) ranking, and lower usage of disk space and bandwidth.

In the context of blockchain, image optimisation helps reduce the transaction fees and the storage requirements on the chain. It makes it feasible to include high-quality images in blockchain transactions, which can be especially important in areas like digital art, NFTs, or any other application where images are stored on-chain.

However, it's important not to lose the integrity of the image during optimisation. Over-optimisation can lead to degradation of image quality, causing pixelation, blur, or loss of detail, which could undermine the purpose of using the image in the first place.

For blockchain-based images, this is especially important, as once an image is stored on the blockchain, it cannot be altered or removed due to the immutable nature of the technology. Therefore, image optimisation must be done carefully to ensure the image remains visually appealing and true to its original intent after it is stored on-chain.

### Conclusion

Image optimisation is a critical aspect of modern digital technology and is especially relevant in the evolving field of blockchain. By effectively optimising images without losing their integrity, developers and users can save costs, improve user experience, and make full use of the exciting possibilities offered by blockchain technology. However, care must be taken to ensure that optimisation does not compromise the quality and value of the images being used.


# Pixel Art

Pixel art is a digital art form that harks back to the early days of computer and video game graphics. From the iconic [Super Mario Bros.](https://www.mariowiki.com/Super_Mario_Bros.) to the modern pixel-based indie games like "[Celeste](https://www.celestegame.com/)," pixel art has carved out a unique and enduring place in the digital art world. This art form has experienced a resurgence in popularity due to the rise of NFTs, or non-fungible tokens, which use blockchain technology to offer proof of ownership for digital assets. One of the best examples of this is [CryptoPunks](https://www.larvalabs.com/cryptopunks), a series of 10,000 uniquely generated characters.

### What is Pixel Art?

Pixel art is a form of digital art where images are created using raster graphics software that allows images to be edited on the pixel level. Each pixel acts as a building block for the larger image, much like how a single tile contributes to the overall mosaic.

Pixel art has a characteristic aesthetic, defined by the minimalistic, blocky, and abstract nature of the images created. Artists must skillfully manipulate these limited pixels to create discernable images, often requiring creative use of color, shade, and minimalistic design to suggest detail rather than depict it outright.

### The Power of Scaling in Pixel Art

An important attribute of pixel art is its scalability. Despite their initial small size, pixel art images often look fantastic when scaled up. This is because pixel art graphics are resolution independent. When you scale up a pixel art image, you're simply making each block (pixel) larger. If the aspect ratio is kept the same, the image retains its sharpness because the pixel grid scales along with the image, unlike traditional raster images which can become blurry when scaled up due to the interpolation of pixels.

CryptoPunks, one of the first NFTs on the Ethereum blockchain, are a prime example of pixel art’s scalability. Each CryptoPunk is a 24x24 pixel art character. Despite the incredibly small canvas, the creators, software developers Matt Hall and John Watkinson, were able to design 10,000 unique characters, each with a distinctive combination of features.

Even when viewed at significantly larger sizes, CryptoPunks maintain their visual coherence. The 24x24 pixel grid just becomes a grid of larger blocks. It's the same image, but the pixels are larger. The lines remain crisp and the colors remain vivid, maintaining the charm of the original design.

This scalability has made CryptoPunks adaptable to various digital displays and formats, from smartphone screens to gigantic billboards. It’s a testament to the power of minimalist design and the creative use of a limited medium.

There is a CSS trick that most NFT explorers use to maintain the pixel sharpness called pixelated image rendering. The CSS looks like this:&#x20;

```
.nft-image {
  image-rendering: pixelated;
}
```

When this style is applied to an element/image, all pixels are rounded to even numbers. This then has the effect that edges are displayed very sharply avoiding interpolation of pixels.

### The Magic of Pixel Art

So, why does pixel art, and by extension CryptoPunks, continue to captivate audiences? Part of it certainly lies in the nostalgia that pixel art evokes, reminding us of the early days of digital graphics and video games. But it also lies in its minimalist aesthetic and how much can be expressed with so little.

The artistic constraints that define pixel art compel artists to pare down their subjects to their most fundamental forms, focusing on the essential elements that capture a subject's character. This simplicity, far from being a limitation, can be a boon to creativity.

Pixel art's capacity to scale up while retaining its charm also gives it a versatile utility in our increasingly digital world. Whether it's on the screen of a retro gaming console, a modern smartphone, or represented as a unique piece of blockchain art, pixel art continues to thrive and adapt, securing its place in the annals of digital art.

In conclusion, the rise of projects like CryptoPunks underscores the enduring appeal and adaptability of pixel art. As we continue to push the boundaries of digital art and technology, we can expect to see this art form continue to evolve, inspire, and remind us that, sometimes, less can indeed be more.


# Bitcoin

The Bitcoin Mempool, Fee Market, and Transaction Confirmation

The Bitcoin blockchain's decentralized architecture rests upon a series of complex processes that validate and confirm transactions. Key to these processes is the [mempool](https://mempool.space/), which acts as a waypoint for pending transactions. This article delves deeper into the role of the [mempool](https://mempool.space/) and its critical function within the Bitcoin fee market and transaction confirmation process.

### Decoding the Mempool

In Bitcoin parlance, the [mempool](https://mempool.space/)—short for 'memory pool'—is a holding area for Bitcoin transactions that have been broadcast to the network but are yet to be included in the blockchain. Each Bitcoin node houses its own [mempool ](https://mempool.space/)and the size of these mempools varies as they are operator-defined.

A Bitcoin transaction, upon its initiation, lands in the [mempool](https://mempool.space/), waiting for confirmation. Transactions do not remain in the [mempool](https://mempool.space/) indefinitely; those not picked up within a certain period (typically 14 days) are usually dropped. This doesn't mean the transaction has been cancelled or that the bitcoins are lost. Instead, the transaction is just no longer in that specific node's mempool. This situation typically happens when the network is congested, and there are more transactions than the block space allows. However, if the transaction is dropped from all nodes' mempools and still not picked up by a miner, it's as if the transaction never happened. The bitcoins never leave the sender's wallet. The sender can then choose to resend the transaction with a higher fee, increasing the likelihood of it being picked up by miners. Some Bitcoin wallets support a feature called Replace-by-Fee (RBF), which allows users to easily increase the fee on a transaction that's taking too long to confirm.

### Casting Bitcoin Transactions

The initiation of a Bitcoin transaction occurs in the user's wallet. Here, the user defines the recipient's address and the amount to be transferred. The wallet then constructs a transaction message, which includes the sender's and recipient's details, the transfer amount, a transaction fee, and the sender's digital signature.

The transaction fee plays a pivotal role in this process. It acts as a monetary incentive for miners to prioritize the user's transaction when mining new blocks. Hence, the higher the fee, the more likely the transaction is to be processed quickly. This is the first hint at the fee market that develops around Bitcoin transactions.

Once constructed and signed, this transaction message is broadcast to the Bitcoin network. The mempool then steps into the equation.

### The Mempool's Role in the Fee Market and Transaction Confirmation

Upon reaching the network, Bitcoin transactions are added to the [mempool](https://mempool.space/) of Bitcoin nodes. Nodes validate these transactions, verifying the sufficiency of the sender's Bitcoin balance and the authenticity of the digital signature.

Post-validation, transactions reside in the mempool, awaiting their turn to be included in a block. This is where the 'fee market' comes into play. Miners select transactions from the [mempool](https://mempool.space/) for the blocks they mine, typically prioritizing those with higher fees, leading to a competitive marketplace for transaction fees. This competition intensifies during periods of network congestion, with users ramping up transaction fees to secure faster transaction processing.

Once a miner mines a block containing the transaction, the transaction is confirmed, and the mined block becomes part of the blockchain. The nodes then update their version of the ledger, which simultaneously removes the confirmed transactions from the mempool, clearing space for new transactions.

### Confirming Transactions: The Final Step

Once a transaction has been included in a block and that block has been added to the blockchain, we say that the transaction has one confirmation. Additional confirmations come as more blocks are added on top of the block containing the transaction, further securing it within the blockchain's history.

Most recipients require multiple confirmations before considering a transaction as fully validated, typically around six confirmations. This process ensures the finality and irreversibility of the transaction, further enhancing Bitcoin's robustness and security.

### Wrapping Up

The [mempool](https://mempool.space/) plays an instrumental role within the Bitcoin network, acting as a waiting area for transactions and a driver of the Bitcoin fee market. The dynamics of the mempool and miners' preferences contribute to the emergence of the fee market, thus impacting transaction costs and timings.

Furthermore, the [mempool's](https://mempool.space/) role extends to the transaction confirmation process, a key security feature of Bitcoin transactions. Understanding the mempool's function allows users to better anticipate potential transaction fees and wait times, particularly during high network activity periods.

As the intersection between miners, wallets, and the blockchain, the mempool encapsulates the decentralized, secure, and transparent nature of Bitcoin, enabling the seamless operation of the Bitcoin fee market and transaction confirmation process.


# Unspent Transaction Output (UTXO)

In the realm of Bitcoin (BTC), the term Unspent Transaction Output (UTXO) is a crucial building block. It pertains to transaction outputs that haven't been used, readily available for future transactions as inputs. The significance of UTXOs becomes clearer in the context of Ordinals, a system that operates within UTXOs.

### Bitcoin Transactions and UTXOs

To grasp UTXOs, you need to understand Bitcoin transactions first. A Bitcoin transaction moves value by taking one or more inputs (referencing UTXOs from previous transactions) and turning them into one or more outputs, which in turn create new UTXOs for future transactions.

UTXOs are akin to pieces of Bitcoin 'cash'. When you acquire Bitcoin, you're essentially receiving a collection of UTXOs. Your Bitcoin 'balance' is the aggregate value of these UTXOs.

### Utilizing UTXOs

Sending Bitcoin involves your wallet picking out UTXOs as transaction inputs. These chosen UTXOs are 'spent' and hence cannot be used in future transactions.

In cases where the cumulative value of input UTXOs exceeds the amount you want to transfer, your transaction generates a 'change' output. This is a new UTXO returned to your wallet. For instance, if you aim to transfer 0.5 BTC to someone and use a 1 BTC UTXO as an input, the transaction produces two outputs: one sends 0.5 BTC to the recipient and the other sends 0.5 BTC back to your wallet as ‘change’.

### The Importance of understanding UTXOs within the context of Ordinals

Ordinals are essentially inscriptions stored inside UTXOs. A single satoshi (sat) contains the Ordinal inscription, while the rest serve as padding (generally 10,000 sats which creates a buffer when transacting with the ordinal). Wallet users, particularly those of Sparrow,  benefit from understanding UTXOs; To avoid inadvertently spending the UTXO holding their Ordinal in transactions, miner fees, or transfers,. Therefore it is imperative to apply UTXO Management, also known as ‘Coin Control’. Many individuals have unfortunately lost their Ordinals through spending the UTXO and thus this inattention to this detail.&#x20;

However, for most users, wallets like Xverse and Unisat handle the management and mechanics of the UTXO containing your ordinal for you, eliminating the need to worry about this.


