> For the complete documentation index, see [llms.txt](https://docs.changeup.com/salesforce/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.changeup.com/salesforce/salesforce-b2c-commerce/setup-and-configuration/donation-reporting.md).

# Donation Reporting

ChangeUp requires donation data reporting after the order payment has been captured. For that, we have developed a job that will send order data to our API; below is an example of that job definition:

{% code lineNumbers="true" %}

```xml
    <job job-id="ChangeUp" priority="0">
        <description>Calls the ChangeUp donation api and flags the order as imported into ChangeUp.</description>
        <parameters/>
        <flow>
            <context site-id="ChangeUp"/>
            <step step-id="ChangeUpExportOrders" type="ExecuteScriptModule" enforce-restart="false">
                <description/>
                <parameters>
                    <parameter name="ExecuteScriptModule.Module">bm_changeup/cartridge/controllers/ChangeUp.js</parameter>
                    <parameter name="ExecuteScriptModule.FunctionName">SendDonations</parameter>
                    <parameter name="ExecuteScriptModule.Transactional">true</parameter>
                </parameters>
            </step>
        </flow>
        <rules>
            <on-running runtime-threshold="60m" enabled="false">
                <mark-job-as-hanging/>
            </on-running>
        </rules>
        <triggers>
            <run-recurring enabled="false">
                <recurrence>
                    <date-from>2023-01-19Z</date-from>
                    <start-time>14:36:53.000Z</start-time>
                    <interval>12M</interval>
                    <day-of-week/>
                </recurrence>
            </run-recurring>
        </triggers>
    </job>

</jobs>
```

{% endcode %}

### Commerce Cloud Injection

The merchant should point you to where they capture order payments in their code base. Within this code, you will need to construct an Object resembling the request example above from the orders being processed. To make the process more efficient, you could pre-flight a check on each order’s custom attribute **changeupAgreedToDonate** to see if it should be sent to the donation reporting code. After you have constructed the object, inject this line of code and pass the object to the constructor (**data** is the object in the example). The **result** can be used to throw errors or ensure the capture reporting is successful.

{% code overflow="wrap" lineNumbers="true" %}

```
var result=require('~/cartridge/scripts/changeup/services/captureReporting')(data);
```

{% endcode %}
