> For the complete documentation index, see [llms.txt](https://metapath.gitbook.io/metapath-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metapath.gitbook.io/metapath-api/upload-gas-free-orders.md).

# Upload gas free orders

### Interface Call Graph

![](https://2618925675-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvKZb9H0fI8f0PVUwaWn5%2Fuploads%2F4daqJ0IF5aVsS7n8kV5J%2Fimage.png?alt=media\&token=ee745eaa-d51a-49d1-af7f-d299f876e719)

### Timing Diagram

![](https://2618925675-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvKZb9H0fI8f0PVUwaWn5%2Fuploads%2F2fQWebVVDbDRfX2cJRHR%2Fimage.png?alt=media\&token=e7216f33-150d-4ce9-b784-94fdef340c7f)

### remark

* Call the "[Get Rate Interface](/metapath-api/cross-platform-aggregator-api/request-quote.md)" to obtain the return value isSupportNoGas, where Y indicates support for gas free exchange
* Call the "[Create Order Interface](/metapath-api/cross-platform-aggregator-api/swap.md)" and pass the isSupportNoGas field. If successful, the noGasTxInfo field will be returned as the call to be signed\_ Data
* For call\_ Sign data to obtain signed data such as r, s, v, rawTransaction
* Call the "[Upload gas free orders](/metapath-api/upload-gas-free-orders.md)", pass r, s, v, rawTransaction, and the orderId returned by the "Create Order Interface" to complete the process

Step 3 Example Code

```javascript
 const privateKey = ''; // private key
 const transactionData = '{
  gasLimit: 100000,
  data: '0xaxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  chainId: 56,
  to: '0x0000000000000xxxxx',
  nonce: 50,
  gasPrice: '3150000000'
}'
 const account = web3.eth.accounts.privateKeyToAccount(privateKey);
 const signedTx = await account.signTransaction(transactionData);
 const r = signedTx.r;
 const s = signedTx.s;
 const v = signedTx.v;
 const rawTransaction = signedTx.rawTransaction;
```

1\. Call Url:

```
https://www.swftc.info/gt/swap/v1/noGasSwap
```

2\. Request parameter instance

| parameter      | whether | explain                                 |
| -------------- | ------- | --------------------------------------- |
| orderId        | Yes     | eg：5d3b383f-5b58-4a35-87b6-2de8d23a492e |
| r              | Yes     | eg：0xxxxxxx                             |
| s              | Yes     | eg：0xxxxxxx                             |
| v              | Yes     | eg: 0xxx                                |
| rawTransaction | Yes     | eg: 0xxxxxxx                            |

3\. Example of request parameters

```

{
    //orderId
    "orderId": "5d3b383f-xxxx-xxxx-xxxx-2de8d23a492e",
    "r": "0xxxx",
    "s": "0xxxxx",
    "v": "0xxx",
    "rawTransaction": "0xxxxxxxxx"
}

```

4.Example of returned results

```
{
    "orderId": "5d3b383f-xxxx-xxxx-xxxx-2de8d23a492e",
    "transactionHash": "0xxxxxxxxxxxxxx"
}
```

5.Return Parameter Description

| field name | field           | type   | remark  |
| ---------- | --------------- | ------ | ------- |
| orderId    | orderId         | String | orderId |
| tx hash    | transactionHash | String | tx hash |
