XUMM SDK: 3. Your first payload 🔔
Published: 2020-10-23 12:43:51

_Previous: [2. Prepare your project and start coding 🔨](https://dev.to/wietse/xumm-sdk-2-prepare-your-project-and-start-coding-a8m)_

Now that we have established a connection to the XUMM platform using the XUMM SDK, it is time to actually send something that we can sign. We will send a "transaction template" to the XUMM platform, called a `Payload`. The lifecycle of a payload is explained [in more detail](https://xumm.readme.io/docs/payload-workflow) in the XUMM API documentation.

Some things to consider:

1. A payload (sign request) sent to the XUMM platform should be formatted as per [XRP ledger transaction specifications](https://xrpl.org/transaction-types.html), but some fields may be omitted as XUMM will automatically fill them in if able to do so.
2. Usually, a payload sent to the XUMM platform will be signed by the end user (e.g., for a sign in, subscription, payment, ...). For this tutorial, you will be the initiator and the end user, either signing or rejecting the payload.
3. The **first sign request** from a specific XUMM app will **always** have to be **scanned using a QR** code on the desktop **or redirected in the case of a smartphone**. Once an end user trusts your application, by signing your request, your application can obtain a user specific `user token` to deliver future sign requests using push notifications.
4. This tutorial is running on your own computer, from the terminal so we will need to copy then paste a sign request URL to our browser. In a real life application, a nicer flow for end users can be created with redirects / [live status updates](https://xumm.readme.io/docs/payload-status#websocket) / [push and fallback QR codes](https://xumm.readme.io/docs/pushing-sign-requests), etc.

Our first payload will be a `Payment` transaction type. A basic `Payment` payload you can send to the XUMM platform would be as per the following example:

{% gist https://gist.github.com/WietseWind/d6e20688389a02f351e3486f1f381779/04ef5c2a0f916baa5d1b5d15458e3a1d7b549150 file=simple-payment.json %}

If, like in the minimal example above, no amount is entered, the end user will be able to select the currency and amount to send in XUMM after opening the sign request. You could also add more details to your payload, as per the following example:

{% gist https://gist.github.com/WietseWind/d6e20688389a02f351e3486f1f381779/04ef5c2a0f916baa5d1b5d15458e3a1d7b549150 file=payment.json %}

This sample specifies an amount in Drops (one XRP is one million Drops, the featured **ten thousand drops** represents 0.01 XRP) and a Memo ([HEX encoded](https://gist.github.com/WietseWind/5cbcc8d15fa2be3ae7d4c20962af0a8e) string). We will use this example in our code.

_Please change the destination account to an account that you own (remember to use your destination tag if this is required), or if you wish, you can test by sending a small amount of XRP to the XRPL Labs team by using the account in the example. _

We are going to use the `Sdk.payload.create()` code to do this. We will provide **two** arguments to the `Sdk.payload.create(..., ...)` code.

The first argument will be our payload (like in our previous example above) and in the second argument we will provide a flag (boolean, `true`) telling the code to return an error, if one occurs.

Our code now looks like this:

{% gist https://gist.github.com/WietseWind/d6e20688389a02f351e3486f1f381779 file=index.js %}

Let's run the code. In the terminal panel, type the previously issued command to run our code: `node index.js`. This should get you your very first XUMM sign request 🎉

![Your first payload!](https://dev-to-uploads.s3.amazonaws.com/i/oi1etslmure3qdj0114z.gif)

**Next:**
#### [4. Verify the results ⛑ and push 🚀](https://dev.to/wietse/xumm-sdk-4-verify-the-results-and-push-381)
[5. Security & finishing touch 🎉](https://dev.to/wietse/xumm-sdk-5-security-finishing-touch-3335)

## Resources 📚
If you want to learn more about the XUMM SDK, platform, documentation, etc., make sure to check out:

- The XUMM SDK [readme](https://www.npmjs.com/package/xumm-sdk)
- The XUMM SDK [source code](https://github.com/XRPL-Labs/XUMM-SDK)
- The XUMM API [documentation](https://xumm.readme.io/docs) & API [reference](https://xumm.readme.io/reference/about)
- XUMM (end user) [support docs](https://support.xumm.app/)
- In case of questions: [support@xumm.app](mailto:support@xumm.app?subject=XUMM+SDK+-+dev.to)