> For the complete documentation index, see [llms.txt](https://obytejs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://obytejs.com/0.1.8/post/payment.md).

# Payment

### **Arguments**

* **asset** `string` *optional*\
  Hash of unit where the asset was defined.
* **outputs** `array` *required*\
  Outputs is an array of outputs that say who receives the money.
  * **address** `string` *required* \
    The Byteball address of the recipient.
  * **amount** `integrer` *required* \
    The amount he receives.

### Returns

Returns the unit hash.

### Examples

#### Spend bytes

```javascript
const params = {
  outputs: [
    { address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 1000 }
  ]
};

client.post.payment(params, wif, function(err, result) {
  console.log(result);
});
```

#### Send bytes to multiple recipients

```javascript
const params = {
  outputs: [
    { address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 1000 },
    { address: 'ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q', amount: 2000 }
  ]
};

client.post.payment(params, wif, function(err, result) {
  console.log(result);
});
```

#### Spend asset

```javascript
const params = {
  asset: 'Hh22Wmd+xAYhgjCBACAxKXWErh/zJuwGc2w2DCB9H24=',
  outputs: [
    { address: 'NX2BTV43XN6BOTCYZUUFU6TK7DVOC4LU', amount: 500 }
  ]
};

client.post.payment(params, wif, function(err, result) {
  console.log(result);
});
```

### **Learn more**

* "12. Unit structure" (page 15) <https://obyte.org/Byteball.pdf>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://obytejs.com/0.1.8/post/payment.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.
