> For the complete documentation index, see [llms.txt](https://api.dataloy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.dataloy.com/api-release-8.25/user-guides/accounting-integration-api/accruals.md).

# Accruals

## **Prerequisites**

Before setting up and testing an invoice integration other integrations need to be in place:

* [Invoice Integration](/api-release-8.25/user-guides/accounting-integration-api/invoicing.md)
* [Actuals Integration](/api-release-8.25/user-guides/accounting-integration-api/actuals-1.md)

## **Integration Set-Up**

When accruals have been verified and posted in Dataloy VMS, the document status is set to *Ready-for-Posting*.

More information, go to Accruals and Period-End-Closing.

## **Data Transactions**

### **Get accruals and accrual reversals that are ready for posting to accounting**

To get accruals that are ready for posting in [Webhooks](/api-release-8.25/dataloy-rest-api/webhooks.md) the following subscription can be created:

```
{
    "eventType":"U",
    "user": the user code to be used in the subscription,
    "objectType":"Document",
    "expression": "dlpObject.getInvoicingStatus() != null && dlpObject.getInvoicingStatus().getStatusTypeCode().equals(\"RFP\") && (dlpObject.getDocumentType().getDocumentType().equals(\"ACR\") || dlpObject.getDocumentType().getDocumentType().equals(\"ACP\"))",
    "url":"your webhook url"
}
```

Alternativel&#x79;**,** a scheduled job can be setup to use the following request:

| `GET /Document?filter=invoicingStatus.statusTypeCode(EQ)RFP&filter=documentType.documentType(IN)ACP,ACR,CAP,CAR` |
| ---------------------------------------------------------------------------------------------------------------- |

### **Test Data**

Test data for accruals integration can be generated in the Accruals module in Dataloy VMS. Generate and batch post the accruals.

### **Post Transaction** &#x20;

When an accrual is successfully transferred to an accounting system, the accrual status must to be updated to *Posted* in Dataloy VMS. This is done in a PUT request:&#x20;

**Update status to posted for a specific invoice**

```
PUT /Document/{key}
  
{
    "invoicingStatus": "POS"
}
```


---

# 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, and the optional `goal` query parameter:

```
GET https://api.dataloy.com/api-release-8.25/user-guides/accounting-integration-api/accruals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
