# PriceServiceController

## Overview

* [GET /](#get-)
* [POST /](#post-)
* [PUT /id](#put-id)

## Description

Path /v2/priceServices

Handles all requests regarding priceService: creating, updating, deleting.

Requirement: Super admin rights

### PriceService JSON Object

An example for a priceService JSON object.

```
{
    "id":"aGeneratedUUID",
    "active":true, 
    "owner":9,
    "type":"PriceServiceMock",
    "settings":"ThisCouldAlsoBeAValidJsonButAnythingWorksAswell",
    "usedFor":[{"catalog":"catalog1","country":"at", "active":true }, 
                {"catalog":"catalog1", "active":true} ] 
}
```

### fields

* id : identifies a price service (required)
* active : activate/deactivate a price service
* owner : tenant number of the price service (required)
* type : type of price service (required)
* settings : settings for the price service
* usedFor : list the catalog where this price service is used. (required)

## API Reference

### GET /

Generates: json

* type: of your price service, there is currently only GenericPriceService
* settings: a json as string serialized for your GenericPriceService, you have to add property method and url
* usedFor: an array of all catalog to country connections. If country is null, then this price service the default for this catalog.

```
{
    "priceServices": <priceServiceJsonObject>
}
```

### POST /

Accepts: json

Generates: json

Requires super admin rights, for creating a new price service which is used to query prices for a specific catalog and country. If you create a catalog to country connection without any country set or country = null, this will be used as default for all countries for this catalog. You can see in the GETs JSON example with "usedFor", how these connections can be created.

example:

```
{
    "priceService": <updatedPriceServiceJsonObject>
}
```

### PUT /:id

Accepts: json

Generates: json

for updating a specific price service. For the connections you have to append all needed "usedFor" entries, because any missing one will be deleted.


---

# 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://docs.roomle.com/rubens/rest-api/rest-api-reference/endpoints/priceservice.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.
