# Create Order

{% openapi src="/files/r4o4wn8MaaisuPe8MEqf" path="/v2/inscribe/order/create" method="post" %}
[swagger.yaml](https://3523236551-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ4NHAHIVnWQiEecvs1By%2Fuploads%2FwLGCSgZJ2x4Y5HBwMo4J%2Fswagger.yaml?alt=media\&token=41cf5a70-2499-4da5-ab33-0530fc3e2772)
{% endopenapi %}

## FAQ

### How to pay after create an order?

The order will start inscribing once the "payAddress" receives the "amount". For example, if an order requires 3000 satoshis, you have to send 3000 satoshis to payAddress. After that, the inscription will be inscribed.

### &#x20;How is the open-api order charged?

We charge a base service fee of 1999 for the first 25 inscriptions, along with an additional network service fee of 4.99%. We round down the final cost.&#x20;

### Are the orders on the open-api and the UniSat website interoperable?

No.

Open API and UniSat website inscribing service do not share data. This ensures the stability of the Open API interface and prevents it from being affected by frequent changes to website inscribing service. For similar reasons, the orders on open-api do not enjoy discounts from the OG card or .unisat domain.

### &#x20;How many files can I submit for each order?

An order supports a maximum of 2000 files, with each file having a maximum size of 390 KB

### How to estimate fee before create an order?

```javascript
const address = ''; // the receiver address
const inscriptionBalance = 546; // the balance in each inscription
const fileCount = 1000; // the fileCount
const fileSize = 1000; // the total size of all files
const contentTypeSize = 100; // the size of contentType
const feeRate = 10; // the feeRate
const feeFileSize = 100; // the total size of first 25 files
const feeFileCount = 25 // do not change this
const devFee = 1000; // the fee for developer

const balance = inscriptionBalance * fileCount;

let addrSize = 25+1; // p2pkh
if(address.indexOf('bc1q')==0 || address.indexOf('tb1q')==0){
    addrSize = 22+1;
}else if(address.indexOf('bc1p')==0 || address.indexOf('tb1p')==0){
    addrSize = 34+1;
}else if(address.indexOf('2')==0 || address.indexOf('3')==0){
    addrSize = 23+1;
}

const baseSize = 88;
let networkSats = Math.ceil(((fileSize+contentTypeSize) / 4 + ( baseSize+8+addrSize+8+23)) * feeRate);
if(fileCount>1){
    networkSats = Math.ceil(((fileSize+contentTypeSize) / 4 + (baseSize+8+addrSize+(35+8)*(fileCount-1)+ 8+23 +(baseSize+8+addrSize+0.5)*(fileCount-1) )) * feeRate);
}
let networkSatsByFeeCount = Math.ceil(((feeFileSize+contentTypeSize) / 4 + ( baseSize+8+addrSize+8+23)) * feeRate);
if(fileCount>1){
    networkSatsByFeeCount = Math.ceil(((( feeFileSize)+contentTypeSize*(feeFileCount/fileCount)) / 4 + (baseSize+8+addrSize+(35+8)*(fileCount-1)+ 8+23 +(baseSize+8+addrSize+0.5)*Math.min(fileCount-1,feeFileCount-1) )) * feeRate);
}

const baseFee = 1999 * Math.min(fileCount, feeFileCount); // 1999 base fee for top 25 files
const floatFee = Math.ceil(networkSatsByFeeCount * 0.0499); // 4.99% extra miner fee for top 25 transations
const serviceFee = Math.floor(baseFee + floatFee);

const total = balance + networkSats + serviceFee; 
const truncatedTotal = Math.floor((total) / 1000) * 1000; // truncate
const amount = truncatedTotal + devFee; // add devFee at the end

console.log("The final amount need to pay: ",amount)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.unisat.io/developer-support/open-api-documentation/api-for-bitcoin/unisat-inscribe/create-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
