# Usage place

This guide explains the functionality and messages used to update energy usage place information in the Ropo One system, such as updating whether a usage place is disconnected or reconnected. It outlines the Ropo One interface (REST API) and message format (JSON). If these capabilities do not align with the client’s system, alternative interfaces (e.g., SFTP) and message formats can be agreed upon, provided they meet Ropo One’s requirements. Such alternatives must be discussed and agreed upon separately during the implementation project.

### Services <a href="#id-23-services" id="id-23-services"></a>

#### Disconnected <a href="#id-231-disconnected" id="id-231-disconnected"></a>

When a usage place is disconnected on the client side after a disconnection request from Ropo One, the action must be reported to Ropo One.

**Example Message:**

```json
{
    "contract_no": "555555b",
    "customernumber": "A123456",
    "description": "Usage place disconnected",
    "id": "1a2b3c4d5",
    "invoices": [
        {
            "invoicenumber": "594294",
            "jobid": "1234"
        }
    ],
    "status": "disconnected",
    "time": "2024-01-04 10:41:40",
    "usageplacecode": "643007572062443672"
}
```

#### Connected <a href="#id-232-connected" id="id-232-connected"></a>

When a usage place is connected on the client side after a connection request from Ropo One, the action must be reported to Ropo One.

**Example Message:**

```json
{
    "contract_no": "555555b",
    "customernumber": "A123456",
    "description": "Usage place connected",
    "id": "1a2b3c4d5",
    "invoices": [
        {
            "invoicenumber": "594294",
            "jobid": "1234"
        }
    ],
    "status": "connected",
    "time": "2024-01-04 10:41:40",
    "usageplacecode": "643007572062443672"
}
```

#### Not Disconnected <a href="#id-233-not-disconnected" id="id-233-not-disconnected"></a>

When a usage place is not disconnected on the client side after a disconnection request from Ropo One, the action must be reported to Ropo One. The message must include a description explaining why the disconnection could not be completed.

**Example Message:**

```json
{
    "contract_no": "555555b",
    "customernumber": "A123456",
    "description": "Usage place not disconnected",
    "id": "1a2b3c4d5",
    "invoices": [
        {
            "invoicenumber": "594294",
            "jobid": "1234"
        }
    ],
    "status": "notdisconnected",
    "time": "2024-01-04 10:41:40",
    "usageplacecode": "643007572062443672"
}
```

## POST /usageplace/event

> API interface for delivering disconnection / reconnection events

```json
{"openapi":"3.1.0","info":{"title":"Ropo One","version":"1.0.0"},"tags":[{"name":"usageplace","description":"Usageplace events"}],"servers":[{"url":"/rest","description":"Ropo One"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","bearerFormat":"JWT","scheme":"bearer"}},"schemas":{"UsageplaceEvent":{"title":"UsageplaceEvent","description":"UsageplaceEvent","properties":{"id":{"description":"Unique id for the event","type":"string"},"usageplacecode":{"description":"Usageplacecode","type":"string"},"customernumber":{"description":"Customernumer","type":"string"},"contract_no":{"description":"Contractnumber","type":"string"},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/UEInvoice"}},"time":{"description":"Time of event","type":"string"},"status":{"description":"Type of event","type":"string"},"description":{"description":"Further description of the event","type":"string"}},"type":"object"},"UEInvoice":{"title":"UEInvoice","description":"Invoice","properties":{"jobid":{"description":"Ropo One jobid","type":"integer"},"invoicenumber":{"description":"Invoicenumber","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"]}},"type":"object"}}},"paths":{"/usageplace/event":{"post":{"tags":["usageplace"],"summary":"API interface for delivering disconnection / reconnection events","operationId":"usageplaceEventAction","requestBody":{"description":"Details of the usageplace","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageplaceEvent"}}}},"responses":{"200":{"description":"Successful operation"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpApiProblem"}}}},"401":{"description":"Unauthorized"}}}}}}
```

\ <br>


---

# 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://dev.ropo.com/guides/industry-specific-add-ons/usage-place.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.
