> For the complete documentation index, see [llms.txt](https://docs.toomuchmedia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_get_payment_breakdown.md).

# nats\_get\_payment\_breakdown

Alias: get\_payment\_breakdown

## Parameters

(*Required parameters in bold)*

| Parameter                                                                                                       | Description                                                                  | Possible Values                    | Default Value        | Example                          |
| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------- | -------------------- | -------------------------------- |
| paymentids                                                                                                      | the list of payment ids to get a breakdown for                               | any valid payment id values        | \<blank>             | paymentids="1,2,3"               |
| breakdown                                                                                                       | the breakdown you want                                                       | siteid, programid, site\_group\_id | siteid               | breakdown="programid"            |
| no\_details\_group\_name                                                                                        | the name for the group of payments that are not associated with transactions | any string                         | \*SPECIAL PAYMENTS\* | no\_details\_group\_name="Other" |
| [assign\_prefix](/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign_prefix.md) | the string to prefix output Smarty variables with                            | any string                         | \<blank>             | assign\_prefix="output\_"        |

## Output

A breakdown of the provided payment ids in the {$data} Smarty variable given the requested breakdown.

## Examples

A breakdown of the provided payment ids in the {$data} Smarty variable given the requested breakdown.

{% code overflow="wrap" %}

```
{get_payment_breakdown paymentids=$totals.all.payment_list breakdown="site_group_id"}
{foreach from=$data key=site_group item=amount}
	{$site_group}: {$amount/100|currency_format:2}
{/foreach}
```

{% endcode %}

To show the site group breakdown of all payments, you can use code like this in the 'Header' or the 'Footer' field.

```
{get_payment_breakdown paymentids=$total.payment_list breakdown="programid"}
{foreach from=$data key=program item=amount}
	{$program}: {$amount/100|currency_format:2}
{/foreach}
```

To show the program breakdown of all payments for each affiliate, you can use code like this in the 'Entry Header' or the 'Entry Footer' field.

```
{get_payment_breakdown paymentids=$entry.paymentid}
{foreach from=$data key=site item=amount}
	{$site}: {$amount/100|currency_format:2}
{/foreach}
```

To show the site breakdown of each individual payment, you can use code like this in the 'Entry' field.

You can use this function to output the breakdown of affiliate payments by site in your payment dumps.


---

# 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://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_get_payment_breakdown.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.
