# Get Transaction Payload

This get Transaction Payload using this method.

## API Specification

## Get Transaction Payload

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

Get Transaction Payload 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                                      |
| userAddress<mark style="color:red;">\*</mark>     | String | Wallet address of the user initiating the transaction                                 |
| contractAddress<mark style="color:red;">\*</mark> | String | Address of the contract that has been deployed and added to the whitelist             |
| contractAbi<mark style="color:red;">\*</mark>     | String | The ABI  of the contract, providing information about its methods and data structures |
| method<mark style="color:red;">\*</mark>          | String | The specific method of the contract for which the transaction payload is required     |
| args<mark style="color:red;">\*</mark>            | String | Additional arguments required for the specified contract method                       |

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

```javascript
{
    "dataToSign": {
        "domain": {
            "chainId": 80001,
            "name": "MinimalForwarder",
            "verifyingContract": "0xdB4dFB11b6B74487c744c251d017xxxxxxxxxx",
            "version": "0.0.1"
        },
        "message": {
            "data": "0x7698xxxx",
            "from": "0x313bA6399d60ff7c2ee8bCb01c2dcxxxxxxxxxx",
            "gas": 43562,
            "nonce": 0,
            "to": "0x362149525adee7A0B20212D76Fad073xxxxxxxxxx",
            "value": 0
        },
        "primaryType": "ForwardRequest",
        "types": {
            "EIP712Domain": [
                {
                    "name": "name",
                    "type": "string"
                },
                {
                    "name": "version",
                    "type": "string"
                },
                {
                    "name": "chainId",
                    "type": "uint256"
                },
                {
                    "name": "verifyingContract",
                    "type": "address"
                }
            ],
            "ForwardRequest": [
                {
                    "name": "from",
                    "type": "address"
                },
                {
                    "name": "to",
                    "type": "address"
                },
                {
                    "name": "value",
                    "type": "uint256"
                },
                {
                    "name": "gas",
                    "type": "uint256"
                },
                {
                    "name": "nonce",
                    "type": "uint256"
                },
                {
                    "name": "data",
                    "type": "bytes"
                }
            ]
        }
    },
    "request": {
        "data": "0x769xxxxx",
        "from": "0x313bA6399d60ff7c2ee8bCb01c2dc9C5e1xxxxxx",
        "gas": 43562,
        "nonce": 0,
        "to": "0x362149525adee7A0B20212D76Fad073CcDbxxxxx",
        "value": 0
    }
}
```

{% 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/getTransactionPayload' \
--header 'Authorization: 03374415-xxxx-xxxx-xxxx-1277d243034e' \
--header 'Content-Type: application/json' \
--data '{
    "dAppId": "DEV_DEMO_PACE_46_xxxxxxx",
    "chainId": 80001,
    "userAddress": "0x313bA6399d60ff7c2ee8bCbxxxxxxxxxxxxx",
    "contractAddress": "0x362149525adee7A0B2021xxxxxxxxxxxxxxxxxx",
    "contractAbi": "BASE64 ABI",
    "method": "mintNft",
    "args": []
}'
```

{% 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({
  "dAppId": "DEV_DEMO_PACE_46_xxxxxxx",
  "chainId": 80001,
  "userAddress": "0x313bA6399d60ff7c2ee8bCbxxxxxxxxxxxxx",
  "contractAddress": "0x362149525adee7A0B2021xxxxxxxxxxxxxxxxxx",
  "contractAbi": "BASE64 ABI",
  "method": "mintNft",
  "args": []
});

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

fetch("https://api.krypcore.com/api/v0/gasless/getTransactionPayload", 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/getTransactionPayload"

payload = json.dumps({
  "dAppId": "DEV_DEMO_PACE_46_xxxxxxx",
  "chainId": 80001,
  "userAddress": "0x313bA6399d60ff7c2ee8bCbxxxxxxxxxxxxx",
  "contractAddress": "0x362149525adee7A0B2021xxxxxxxxxxxxxxxxxx",
  "contractAbi": "BASE64 ABI",
  "method": "mintNft",
  "args": []
})
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/getTransactionPayload"
  method := "POST"

  payload := strings.NewReader(`{`+"
"+`
    "dAppId": "DEV_DEMO_PACE_46_xxxxxxx",`+"
"+`
    "chainId": 80001,`+"
"+`
    "userAddress": "0x313bA6399d60ff7c2ee8bCbxxxxxxxxxxxxx",`+"
"+`
    "contractAddress": "0x362149525adee7A0B2021xxxxxxxxxxxxxxxxxx",`+"
"+`
    "contractAbi": "BASE64 ABI",`+"
"+`
    "method": "mintNft",`+"
"+`
    "args": []`+"
"+`
}`)

  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 %}


---

# 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.krypcore.com/dev-docs/api-reference/core-service-apis/gasless-api/get-transaction-payload.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.
