# Payments/Receipts

## **Integration Set-Up**

When a payment is registered in the accounting system, it should be transferred as applicable to the *Posted* sections of either the Accounts Payable or the Accounts Receivable modules (where the matching invoice(s) can be found) in Dataloy VMS.

Since a payment in accounting systems may cover multiple Dataloy VMS payments/receipts, extracting payments from accounting means extracting invoices matching to a payment. Only payments/receipts records with a matching invoice in the applicable accounting system and with a required reference to a Dataloy invoice are to be extracted.

In Dataloy VMS all payments must match with the referenced invoice. To insert a payment/receipt in Dataloy VMS use the request under Data Transaction (below).

## **Data Transaction**

* A payment record should ONLY ever have one document line. Never more.

## **Amount Prefix**

This matrix is showing which prefix the payment amount should have for the various cases.

| <p><br></p>   | Accounts Payable and Hire Payable | Accounts Receivable |
| ------------- | --------------------------------- | ------------------- |
| Receipt (PMI) | Positive Amount                   | Negative amount     |
| Payment (PMO) | Negative Amount                   | Positive Amount     |

## **To Post a Payment/Receipt to Dataloy VMS:**

```
{
    "documentAmount": 10000.00,
    "companyCurrencyAmount": 10000.00,
    "sourceCurrencyAmount": 10000.00,
    "documentCurrency": "USD",
    "documentDate": "2014-01-01T00:00:00",
    "documentType": "PMO",
    "documentNo": "111111199",
    "externalDocumentNo": "50300",
    "company": "01",
    "businessPartner": "60526",
    "invoicingStatus": "POS",   
    "documentText": "text here",
    "documentLines":
    [
        {
            "documentAmount": 10000.00,
            "companyCurrencyAmount": 10000.00,
            "sourceCurrencyAmount": 10000.00,
            "documentCurrency": "USD",
            "invoicingStatus": "POS",
            "documentLineText": "text here",
            "businessPartner": "BPCODE",
            "isAccountsPayable": true,
            "refDocument": "71800125"
        }
    ]   
}
```


---

# Agent Instructions: 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://api.dataloy.com/api-release-8.25/user-guides/accounting-integration-api/invoicing-1.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.
