> For the complete documentation index, see [llms.txt](https://dev.ropo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ropo.com/guides/basics/payment.md).

# Payment

Register a payment for an existing invoice.

Use this when the debtor paid outside Ropo’s settlement flow.

This is typical when the debtor pays to your own account.

{% hint style="warning" %}
Registering a payment can close or update the invoice state. Make sure you don’t double-register the same payment.
{% endhint %}

### Prerequisites

The invoice must already exist in Ropo One.

You must reference the invoice using one of these identifiers:

* `billcode` (preferred)
* `jobid`
* `billnum`

Send only one identifier when possible.

If you send multiple identifiers, Ropo uses this lookup order:

1. `billcode`
2. `jobid`
3. `billnum`

### Required fields

* `paydate` (format: `YYYY-MM-DD`)
* `amount`

### Optional fields

These fields are use case specific:

* `identifier`
* `type` (example: `directpayment`)
* `creditnotebillnum`
* `description`

### Example

```json
{
  "amount": "710.00",
  "billcode": "1234567",
  "billnum": "R1234567",
  "paydate": "2017-10-10",
  "identifier": "insurance",
  "type": "directpayment",
  "creditnotebillnum": "26251",
  "description": "Payment received to the client bank account"
}
```

## POST /jobs/payment

> Add payment to existing job.

```json
{"openapi":"3.1.0","info":{"title":"Ropo One","version":"1.0.0"},"tags":[{"name":"jobs","description":"Manage Jobs"}],"servers":[{"url":"/rest","description":"Ropo One"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","bearerFormat":"JWT","scheme":"bearer"}},"schemas":{"JobAddPayment":{"title":"JobAddPayment","description":"JobAddPayment","required":["amount","paydate"],"properties":{"amount":{"description":"Amount of payment","type":"number"},"billcode":{"description":"Reference of job. One of these required: 1.billcode, 2.jobid, 3. billnum (search order)","type":"string"},"billnum":{"description":"Billnum of job. One of these required: 1.billcode, 2.jobid, 3. billnum (search order)","type":"string"},"jobid":{"description":"Id of job. One of these required: 1.billcode, 2.jobid, 3. billnum (search order)","type":"integer"},"paydate":{"description":"Date of payment","type":"string"},"identifier":{"description":"Payment targeting identifier","type":"string"},"type":{"description":"Payment type","type":"string"},"creditnotebillnum":{"description":"Credit note invoice number","type":"string"},"description":{"description":"Description of payment","type":"string"}},"type":"object"},"JobAddPaymentResponse":{"title":"JobAddPaymentResponse","description":"JobAddPaymentResponse","properties":{"jobid":{"description":"Id of job","type":"integer"},"billnum":{"description":"Billnum of job","type":"string"},"billcode":{"description":"Reference of job","type":"string"},"paydate":{"description":"Date of payment","type":"string"},"amount":{"description":"Amount of payment","type":"number"},"capitalbefore":{"description":"Open capital before payment","type":"number"},"capitalafter":{"description":"Open capital after payment","type":"number"},"focusedtocapital":{"description":"Amount focused to opencapital","type":"number"},"interestbefore":{"description":"Amount before to interest","type":"number"},"interestafter":{"description":"Amount after to interest","type":"number"},"focusedtointerest":{"description":"Amount focused to interest","type":"number"},"noticefeebefore":{"description":"Amount after to customer notice fee","type":"number"},"noticefeeafter":{"description":"Amount before to customer notice fee","type":"number"},"focusedtonoticefee":{"description":"Amount focused to customer notice fee","type":"number"},"unfocused":{"description":"Unfocused amount","type":"number"},"statusid":{"description":"0 : UNDONE, 1 : FAIL, 2 : OLD, 3 : ROPO, 4 : ROPO Refund, 5 : CLOSE, 6 : OHISPAY, 8 : IGNORE, 9 : DIFFCID, 10 : NOT FOUND, 11 : CANCELLED. Only with value 6 Http-Responsecode is 201 other 400","type":"number"},"statustext":{"description":"additional information","type":"number"}},"type":"object"}}},"paths":{"/jobs/payment":{"post":{"tags":["jobs"],"summary":"Add payment to existing job.","operationId":"JobAddPaymentJobAction","requestBody":{"description":"JobAddPayment","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAddPayment"}}}},"responses":{"201":{"description":"Payment response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAddPaymentResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAddPaymentResponse"}}}},"401":{"description":"Unauthorized"}}}}}}
```


---

# 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://dev.ropo.com/guides/basics/payment.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.
