# Send Transaction

This Send Transaction using this method.

## API Specification

## Send Transaction

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/gasless/sendTransaction`

Send Transaction under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description            |
| ----------------------------------------------- | ------ | ---------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | User Auth key obtained |

#### Request Body

| Name                                        | Type   | Description                                                                                                              |
| ------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| dAppId<mark style="color:red;">\*</mark>    | String | The Dapp ID associated with the application                                                                              |
| chainId<mark style="color:red;">\*</mark>   | String | The Chain ID representing the blockchain network                                                                         |
| request<mark style="color:red;">\*</mark>   | object | Request data obtained by using the "getTransactionPayload" method. It includes the necessary details for the transaction |
| signature<mark style="color:red;">\*</mark> | String | EIP712 Signature generated for the transaction                                                                           |

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

```javascript
{
  message: 'Tx submitted to network successfully',
  txHash: '0x041e9a6b96ba6fc93460a91e87d3794f2ad497e91532ffad131xxxxxxxxxxxx'
}
```

{% endtab %}

{% tab title="401: Unauthorized Failure in authentication" %}

```
{
    "message": "Invalid API key in request"
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using our official libraries, or via `curl`

{% tabs %}
{% tab title="curl" %}

```bash
curl --location 'https://api.krypcore.com/api/v0/gasless/sendTransaction' \
--header 'Authorization: 03374415-xxxx-xxxx-xxxx-1277d243034e' \
--header 'Content-Type: application/json' \
--data '{
    "chainId": 80001,
    "dAppId": "DEV_DEMO_PACE_xx_xxxxxxxx",
    "request": {
        "data": "0x7698exxx",
        "from": "0x313bA6399d60ff7c2ee8bCb01c2dc9C5e1xxxxxx",
        "gas": 43562,
        "nonce": 0,
        "to": "0x362149525adee7Axxxxxxxxxxxxxxxxxxxxxx",
        "value": 0
    },
    "signature": "0x"
}'
```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "chainId": 80001,
  "dAppId": "DEV_DEMO_PACE_xx_xxxxxxxx",
  "request": {
    "data": "0x7698exxx",
    "from": "0x313bA6399d60ff7c2ee8bCb01c2dc9C5e1xxxxxx",
    "gas": 43562,
    "nonce": 0,
    "to": "0x362149525adee7Axxxxxxxxxxxxxxxxxxxxxx",
    "value": 0
  },
  "signature": "0x"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.krypcore.com/api/v0/gasless/sendTransaction", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Python " %}

```python
import requests
import json

url = "https://api.krypcore.com/api/v0/gasless/sendTransaction"

payload = json.dumps({
  "chainId": 80001,
  "dAppId": "DEV_DEMO_PACE_xx_xxxxxxxx",
  "request": {
    "data": "0x7698exxx",
    "from": "0x313bA6399d60ff7c2ee8bCb01c2dc9C5e1xxxxxx",
    "gas": 43562,
    "nonce": 0,
    "to": "0x362149525adee7Axxxxxxxxxxxxxxxxxxxxxx",
    "value": 0
  },
  "signature": "0x"
})
headers = {
  'Authorization': '03374415-xxxx-xxxx-xxxx-1277d243034e',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.krypcore.com/api/v0/gasless/sendTransaction"
  method := "POST"

  payload := strings.NewReader(`{`+"
"+`
    "chainId": 80001,`+"
"+`
    "dAppId": "DEV_DEMO_PACE_xx_xxxxxxxx",`+"
"+`
    "request": {`+"
"+`
        "data": "0x7698exxx",`+"
"+`
        "from": "0x313bA6399d60ff7c2ee8bCb01c2dc9C5e1xxxxxx",`+"
"+`
        "gas": 43562,`+"
"+`
        "nonce": 0,`+"
"+`
        "to": "0x362149525adee7Axxxxxxxxxxxxxxxxxxxxxx",`+"
"+`
        "value": 0`+"
"+`
    },`+"
"+`
    "signature": "0x"`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}
