> 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/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](/user-guides/accounting-integration-api/invoicing.md)
* [Actuals Integration](/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](/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": "{"type":"group","id":"root","combine":"AND","items":[{"type":"condition","condition":{"id":"1782903975402-box7vo7","operator":"=","leftKind":"field","leftField":{"path":["invoicingStatus","statusTypeCode"],"type":"object","arrayFilters":[]},"leftSource":"current","rightKind":"literal","rightValue":"RFP"}},{"type":"group","id":"1782903976004-c70ukle","combine":"OR","items":[{"type":"condition","condition":{"id":"1782903976004-ncwqszm","operator":"=","leftKind":"field","leftField":{"path":["documentType","documentType"],"type":"object","arrayFilters":[]},"leftSource":"current","rightKind":"literal","rightValue":"ACP"}},{"type":"condition","condition":{"id":"1782903996392-x0fuak4","operator":"=","leftKind":"field","leftField":{"path":["documentType","documentType"],"type":"object","arrayFilters":[]},"leftSource":"current","rightKind":"literal","rightValue":"ACR"}}]}],"version":2}",
    "url":"your webhook url"
}
```

If you use the expression builder, create an expression like this: invoicingStatus.statusTypeCode = "RFP" AND (documentType.documentType = "ACP" OR documentType.documentType = "ACR")

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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
