> 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/general-add-ons/invoice-query-by-ssn-or-customer-number.md).

# Invoice query by SSN or customer number

Retrieve open and/or paid invoices for an end customer by SSN or customer number.

For each matching invoice, the response includes invoice data and a MyRopoLink. MyRopoLink is included only if the MyRopoLink agreement is active in Ropo One.

Details of the invoice data can be found below.

* Additional information
  * Statuses are the same, which are used in MyRopo (myropo.com)
    * Invoicing
    * Due
    * Reminder
    * Collection
    * Paid (older that 2y from the pay date are not returned)

## POST /jobs/findbyendcustomer

> Find open jobs by end customer SSN or customer number

```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":{"JobsByEndCustomerRequest":{"properties":{"ssn":{"description":"Social security number (HETU). Either ssn or custnum is required.","type":"string"},"custnum":{"description":"Customer number. Either ssn or custnum is required.","type":"string"},"all_invoices":{"description":"0 = open invoices only (default), 1 = all invoices including paid.","type":"integer"}},"type":"object"},"JobsByEndCustomerResponse":{"properties":{"jobs":{"description":"List of jobs","type":"array","items":{"$ref":"#/components/schemas/JobByEndCustomer"}}},"type":"object"},"JobByEndCustomer":{"properties":{"case_number":{"description":"Case number (internal job ID)","type":"integer"},"invoice_number":{"description":"Invoice number","type":"string"},"original_invoice_date":{"description":"Original invoice date (origjobdate)","type":"string"},"status":{"description":"Current status (invoicing, due, reminder, collection, paid)","type":"string"},"open_amount":{"description":"Open amount","type":"number","format":"float"},"group_job":{"description":"Whether this is a group job (0=no, 1=yes)","type":"integer"},"group_invoice_numbers":{"description":"Invoice numbers of sub-jobs in the group (only when group_job=1)","type":"array","items":{"type":"string"}},"group_total_payable":{"description":"Total payable amount for the group (only when group_job=1)","type":"number","format":"float"},"my_ropo_link":{"description":"Direct MyRopo link for this invoice","type":"string"}},"type":"object"},"HttpApiProblem":{"title":"HttpApiProblem","description":"HttpApiProblem","properties":{"status":{"description":"The HTTP status code generated by the origin server for this occurrence of the problem","type":["integer","null"]},"type":{"description":"A URI reference that identifies the problem type","type":["string","null"]},"title":{"description":"A short, human-readable summary of the problem type","type":["string","null"]},"detail":{"description":"A human-readable explanation specific to this occurrence of the problem","type":["string","null"]},"errors":{"description":"An array of individual problems that caused this occurrence.","type":["array","null"],"items":{"$ref":"#/components/schemas/HttpApiProblemErrorDetail"}}},"type":"object"},"HttpApiProblemErrorDetail":{"title":"HttpApiProblemErrorDetail","description":"HttpApiProblemErrorDetail","properties":{"detail":{"description":"A human-readable explanation specific to this occurrence of the problem.","type":["string","null"]},"pointer":{"description":"A JSON Pointer to the value in the request document that caused the problem.","type":["string","null"]}},"type":"object"}}},"paths":{"/jobs/findbyendcustomer":{"post":{"tags":["jobs"],"summary":"Find open jobs by end customer SSN or customer number","operationId":"JobsFindByEndCustomerAction","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsByEndCustomerRequest"}}}},"responses":{"200":{"description":"Jobs found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobsByEndCustomerResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiProblem"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiProblem"}}}}}}}}}
```


---

# 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://dev.ropo.com/guides/general-add-ons/invoice-query-by-ssn-or-customer-number.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.
