# 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"
        }
    ]   
}
```
