In this example the **omquser** datasource connection will be used. Before it can be used tables should be prepared. To do that a user schema module can be used which is described in the next chapter.
**NOTE** You must create the `omquser` datasource in Qorus before you can deploy the user schema. The `omquser.qconn.yaml`
file contains a definition of an `omquser` datasource, however it assumes that there is an accessible PostgreSQL database already present called `omquser`. Ensure that this database is created or update the file to reference another accessible database with a user with read and write permissions on the DB.
This service exposes exchange method providing creation of exchange orders. The exchange method do nothing more then preparing order data and creating an order of **BASICS-EXCHANGE-CURRENCY-WORKFLOW**. It uses the `CreateOrder` building block, which allows users to implement workflow order creation logic without any need for coding. The building block inside calls [**createOrder()**](https://qoretechnologies.com/manual/qorus/latest/qorus/classOMQ_1_1UserApi_1_1UserApi.html#a6cadda1e1395c915f157c661dec76d3a) method and passes prepared order data. There is orders key in order data containing a list with one order received from a request. The hash order has the following format:
This service exposes exchange method providing creation of exchange orders. The exchange method do nothing more then preparing order data and creating an order of **BASICS-EXCHANGE-CURRENCY-WORKFLOW**. It uses the `BBM_CreateOrder` building block, which allows users to implement workflow order creation logic without any need for coding. The building block inside calls the [**createOrder()**](https://qoretechnologies.com/manual/qorus/latest/qorus/classOMQ_1_1UserApi_1_1UserApi.html#a6cadda1e1395c915f157c661dec76d3a) method and passes the prepared order data to it. There is an `orders` key in the order data containing a list with one order received from a request. The order hash has the following format:
```
"id": integer,
...
...
@@ -16,12 +16,14 @@ The service logic is implemented using `class-connections` (building block conne

As shown in the above animation one connection is created for connecting service's exchange method with the `createOrder` method of the building-block. Also the mappper that was created in the previous tutorial is used.
As shown in the above animation one connection is created for connecting service's exchange method with the `createOrder` method of the building-block. Also the mapper that was created in the previous tutorial is used.
The `CreateOrder` building block provides several configuration items in order to control its behaviour, at least the `create-workflow-name` configuration item should be set:

The mapper used to map the input to the workflow static data is `exchange-currency-api-mapper-1.0.qmapper.yaml`, using output type `/qorus-api/workflows/create-order/request` which is what the `BBM_CreateOrder` building block requires. The mapper creates custom fields under the `staticdata` key to give structure to the workflow's static data, and also uses custom fields for the input corresponding to the data provided by the call to the `exchange()` method. Open the mapper in the IDE to check its structure.
## Testing
Once the service is loaded to Qorus it can be tested in Qorus UI. To do that, in the **services** tab by click on the **detail** button of the item containing **basics-simple-service** name. It'll show the details of the service. Then click on the **execute** button in the **methods** tab and fill the arguments as in the screenshots below: