# Models

## The coreErrorMessage object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"coreErrorMessage":{"type":"object","properties":{"code":{"type":"integer","description":"HTTP Status Code."},"status":{"type":"string","description":"HTTP Status."},"message":{"type":"string","description":"Error message."},"details":{"type":"array","description":"Error message details.","items":{"type":"object","properties":{"message":{"type":"string","description":"Detailed message of the error."}}}}}}}}}
```

## The returnErrorMessage object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"returnErrorMessage":{"allOf":[{"properties":{"returnId":{"type":"string","description":"Unique identifier of a return."}}},{"$ref":"#/components/schemas/coreErrorMessage"}]},"coreErrorMessage":{"type":"object","properties":{"code":{"type":"integer","description":"HTTP Status Code."},"status":{"type":"string","description":"HTTP Status."},"message":{"type":"string","description":"Error message."},"details":{"type":"array","description":"Error message details.","items":{"type":"object","properties":{"message":{"type":"string","description":"Detailed message of the error."}}}}}}}}}
```

## The calculatedPrice object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}}}}}
```

## The calculatedFinalPrice object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"calculatedFinalPrice":{"type":"object","description":"Wrapper for the calculated price containing the final price after discounts and fees.","properties":{"finalPrice":{"$ref":"#/components/schemas/calculatedPrice"}}},"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}}}}}
```

## The metadataCore object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The metadataUpdate object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The metadataResponse object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"metadataResponse":{"title":"metadataResponse","description":"Metadata fields returned by the API.  \nExtends `metadataUpdate` with timestamps indicating when the object\nwas created and last modified.\n","allOf":[{"$ref":"#/components/schemas/metadataUpdate"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}]},"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The basicReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The basicCustomerReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"basicCustomerReturn":{"title":"A return request created by a customer.","description":"Base schema for a return requested BY A CUSTOMER.","$ref":"#/components/schemas/basicReturn"},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The basicEmployeeReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"basicEmployeeReturn":{"title":"A return request created on behalf of a customer.","description":"Base schema for returns created by an employee FOR A REGISTERED CUSTOMER.","allOf":[{"$ref":"#/components/schemas/basicEmployeeReturnBase"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field can be set and updated only by an employee, that is a person who has a `returns.returns_manage` scope granted. For a customer, who has the `returns.returns_manage_own` scope granted, the value is populated automatically based on an auth token.","properties":{"customerId":{"type":"string","description":"Identifier of a customer to whom the order and return belong."}},"required":["customerId"]}}}]},"basicEmployeeReturnBase":{"title":"Base schema for returns created by an employee.","description":"Common structure for returns created by an employee on behalf of a customer.","allOf":[{"$ref":"#/components/schemas/basicReturn"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field can be set and updated only by an employee,\nthat is a person who has the `returns.returns_manage` scope granted.\nFor a customer with the `returns.returns_manage_own` scope, the value is populated\nautomatically based on an auth token.\n"},"submitter":{"type":"object","description":"Indicates who submitted the return. The return can be submitted by an employee\non behalf of a customer. In that case, the submitter and requestor are different entities.\nThis field can be set and updated only by an employee with the\n`returns.returns_manage` scope granted.\n","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Requestor first name."},"lastName":{"type":"string","description":"Requestor last name."},"email":{"type":"string","description":"Requestor email address."}}},"approver":{"type":"object","description":"Information about the approver of the return. The return can be approved\nby a particular user or a group of users. The field can be set and updated\nonly by an employee with the `returns.returns_manage` scope granted.\n\nThe provided value is validated against the `iam-service`:\n* If `type` is equal to `USER`, then the provided `id` must be a valid employee identifier\n* If `type` is equal to `GROUP`, then the provided `id` must be a valid employee group identifier\n","properties":{"type":{"type":"string","description":"Indicates whether the return must be approved by a user or a group. Possible values: `USER` or `GROUP`.","enum":["USER","GROUP"]},"id":{"type":"string","description":"Identifier of a user or a user group depending on the `type` value."}}},"expiryDate":{"type":"string","description":"'The date when a return expires. The field can be set and updated only by an employee\nwith the `returns.returns_manage` scope granted.\n\nIf the value is not provided, the default value is fetched from the\n`configuration-service` under the `return.defaultExpiryDate` key.\n\nIf the configuration does not exist, a fallback of 30 days is applied.\n"}},"required":["requestor","submitter"]}]},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The employeeReturnForAnonymousOrder object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"employeeReturnForAnonymousOrder":{"title":"A return request created on behalf of a customer FOR AN ANONYMOUS ORDER.","description":"Base schema for returns created by an employee for an ANONYMOUS ORDER.","allOf":[{"$ref":"#/components/schemas/basicEmployeeReturnBase"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field can be set and updated only by an employee, that is a person who has a `returns.returns_manage` scope granted. For a customer, who has the `returns.returns_manage_own` scope granted, the value is populated automatically based on an auth token.","required":["anonymous","email"],"properties":{"anonymous":{"type":"boolean","description":"Indicates that the request is related with anonymous orders"},"email":{"type":"string","description":"Email which has been used for anonymous order"},"customerId":{"type":"string","description":"Identifier of a customer to whom the order and return belong."}}}}}]},"basicEmployeeReturnBase":{"title":"Base schema for returns created by an employee.","description":"Common structure for returns created by an employee on behalf of a customer.","allOf":[{"$ref":"#/components/schemas/basicReturn"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field can be set and updated only by an employee,\nthat is a person who has the `returns.returns_manage` scope granted.\nFor a customer with the `returns.returns_manage_own` scope, the value is populated\nautomatically based on an auth token.\n"},"submitter":{"type":"object","description":"Indicates who submitted the return. The return can be submitted by an employee\non behalf of a customer. In that case, the submitter and requestor are different entities.\nThis field can be set and updated only by an employee with the\n`returns.returns_manage` scope granted.\n","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Requestor first name."},"lastName":{"type":"string","description":"Requestor last name."},"email":{"type":"string","description":"Requestor email address."}}},"approver":{"type":"object","description":"Information about the approver of the return. The return can be approved\nby a particular user or a group of users. The field can be set and updated\nonly by an employee with the `returns.returns_manage` scope granted.\n\nThe provided value is validated against the `iam-service`:\n* If `type` is equal to `USER`, then the provided `id` must be a valid employee identifier\n* If `type` is equal to `GROUP`, then the provided `id` must be a valid employee group identifier\n","properties":{"type":{"type":"string","description":"Indicates whether the return must be approved by a user or a group. Possible values: `USER` or `GROUP`.","enum":["USER","GROUP"]},"id":{"type":"string","description":"Identifier of a user or a user group depending on the `type` value."}}},"expiryDate":{"type":"string","description":"'The date when a return expires. The field can be set and updated only by an employee\nwith the `returns.returns_manage` scope granted.\n\nIf the value is not provided, the default value is fetched from the\n`configuration-service` under the `return.defaultExpiryDate` key.\n\nIf the configuration does not exist, a fallback of 30 days is applied.\n"}},"required":["requestor","submitter"]}]},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The basicEmployeeReturnBase object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"basicEmployeeReturnBase":{"title":"Base schema for returns created by an employee.","description":"Common structure for returns created by an employee on behalf of a customer.","allOf":[{"$ref":"#/components/schemas/basicReturn"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field can be set and updated only by an employee,\nthat is a person who has the `returns.returns_manage` scope granted.\nFor a customer with the `returns.returns_manage_own` scope, the value is populated\nautomatically based on an auth token.\n"},"submitter":{"type":"object","description":"Indicates who submitted the return. The return can be submitted by an employee\non behalf of a customer. In that case, the submitter and requestor are different entities.\nThis field can be set and updated only by an employee with the\n`returns.returns_manage` scope granted.\n","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Requestor first name."},"lastName":{"type":"string","description":"Requestor last name."},"email":{"type":"string","description":"Requestor email address."}}},"approver":{"type":"object","description":"Information about the approver of the return. The return can be approved\nby a particular user or a group of users. The field can be set and updated\nonly by an employee with the `returns.returns_manage` scope granted.\n\nThe provided value is validated against the `iam-service`:\n* If `type` is equal to `USER`, then the provided `id` must be a valid employee identifier\n* If `type` is equal to `GROUP`, then the provided `id` must be a valid employee group identifier\n","properties":{"type":{"type":"string","description":"Indicates whether the return must be approved by a user or a group. Possible values: `USER` or `GROUP`.","enum":["USER","GROUP"]},"id":{"type":"string","description":"Identifier of a user or a user group depending on the `type` value."}}},"expiryDate":{"type":"string","description":"'The date when a return expires. The field can be set and updated only by an employee\nwith the `returns.returns_manage` scope granted.\n\nIf the value is not provided, the default value is fetched from the\n`configuration-service` under the `return.defaultExpiryDate` key.\n\nIf the configuration does not exist, a fallback of 30 days is applied.\n"}},"required":["requestor","submitter"]}]},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}}}}}
```

## The updateCustomerReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"updateCustomerReturn":{"title":"A return updated by a customer","description":"Base schema for a return requested by a customer.","allOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a return."}}},{"$ref":"#/components/schemas/basicReturn"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/metadataUpdate"}},"required":["metadata"]}]},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}},"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}}}}}
```

## The updateEmployeeReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"updateEmployeeReturn":{"title":"A return updated on behalf of a customer.","description":"Base schema for a return requested by an employee.","allOf":[{"$ref":"#/components/schemas/updateCustomerReturn"},{"type":"object","properties":{"approvalStatus":{"type":"string","enum":["PENDING","APPROVED","REJECTED","CLOSED"],"description":"Indicates the current status of the order. When an order is being created, its status is automatically set to PENDING. An approver can change the status to `APPROVED` or `REJECTED`. A customer can change the status to `CLOSED`."},"received":{"type":"boolean","description":"Indicates whether the items from the return have been received."},"requestor":{"type":"object","description":"Indicates who requested the return. The field can be updated only by an employee, that is a person who has the `returns.returns_manage` scope granted.","required":["customerId"],"properties":{"customerId":{"type":"string","description":"Identifier of a customer to whom the order and return belong."}}},"submitter":{"type":"object","description":"Indicates who submitted the return. The return can be submitted by an employee on behalf of a customer. In that case, the submitter and requestor data is different. The field can be set and updated only by an employee, that is a person who has the `returns.returns_manage` scope granted. For a customer, who has the `returns.returns_manage_own` scope granted, the value is populated automatically based on an auth token.","required":["firstName","lastName","email"],"properties":{"firstName":{"type":"string","description":"Requestor first name."},"lastName":{"type":"string","description":"Requestor last name."},"email":{"type":"string","description":"Requestor email address."}}},"approver":{"type":"object","description":"Information about the approver of the return. The return can be approved by a particular user or a group of users. The field can be set and updated only by an employee, that is a person who has the `returns.returns_manage` scope granted. The provided value is validated agains the `iam-service`:\n* If `type` is equal to `USER`, then the provided `id` must be a valid employee identifier\n* If `type` is equal to `GROUP`, then the provided `id` must be a valid employee group identifier","properties":{"type":{"type":"string","description":"Indicates whether the return needs to be approved by a particular user or a user group. Possible values: `USER` or `GROUP`.","enum":["USER","GROUP"]},"id":{"type":"string","description":"Identifier of a user or a user group, depending on the `type` value."}}},"expiryDate":{"type":"string","description":"The date when the return expires. The field can be set and updated only by an employee, that is a person who has the `returns.returns_manage` scope granted. If the value is not provided, then the default value is fetched from the `configuration-service` under the `return.defaultExpiryDate` key. The value should be provided in the number format. The value specifies for how many days the return will be valid. If the configuration does not exist, then a `30` days offset is taken as a fallback."}},"required":["approvalStatus","requestor","submitter"]}]},"updateCustomerReturn":{"title":"A return updated by a customer","description":"Base schema for a return requested by a customer.","allOf":[{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a return."}}},{"$ref":"#/components/schemas/basicReturn"},{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/metadataUpdate"}},"required":["metadata"]}]},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}},"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}}}}}
```

## The fullCustomerReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"fullCustomerReturn":{"title":"A customer return object.","description":"Schema for retrieving returns by a customer.","allOf":[{"$ref":"#/components/schemas/basicCustomerReturn"},{"$ref":"#/components/schemas/assistedBuying"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a return, represented as a UUID string."},"metadata":{"$ref":"#/components/schemas/metadataResponse"},"received":{"type":"boolean","description":"Indicates whether the items from the return have been received."},"approvalStatus":{"type":"string","enum":["APPROVED","PENDING","REJECTED","CLOSED"]},"expiryDate":{"type":"string","description":"A date when the return will expire. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/fullReturnOrder"}},"total":{"type":"object","properties":{"value":{"type":"number"},"currency":{"type":"string"}}},"calculatedPrice":{"$ref":"#/components/schemas/calculatedFinalPrice","description":"Aggregated calculated price across all returned items. Derived from each order entry `calculatedPrice.finalPrice`. Null if no order entries have calculated prices."}}}]},"basicCustomerReturn":{"title":"A return request created by a customer.","description":"Base schema for a return requested BY A CUSTOMER.","$ref":"#/components/schemas/basicReturn"},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`.","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"metadataResponse":{"title":"metadataResponse","description":"Metadata fields returned by the API.  \nExtends `metadataUpdate` with timestamps indicating when the object\nwas created and last modified.\n","allOf":[{"$ref":"#/components/schemas/metadataUpdate"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}]},"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}},"fullReturnOrder":{"allOf":[{"$ref":"#/components/schemas/order"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/fullReturnItem"}}}}]},"fullReturnItem":{"allOf":[{"$ref":"#/components/schemas/orderItem"},{"type":"object","description":"Detailed information about a returned item within an order.","properties":{"name":{"type":"string","description":"Name of a product."},"unitPrice":{"type":"object","description":"The value represents a price (value and currency) of a single unit of the product.","properties":{"value":{"type":"number","description":"The value represents a price value of a single unit of the product."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"total":{"type":"object","description":"The value represents the total price (value and currency) of all returned products related to the order.","properties":{"value":{"type":"number","description":"The value represents the total price value of all returned products."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"}],"description":"Unit price derived from the order entry `calculatedPrice.finalPrice` divided by the order entry amount. Includes discounts and fees. Present only if the order entry has a valid `calculatedPrice.finalPrice`."},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedFinalPrice"}],"description":"Total calculated price for the returned quantity of this item. Computed as `calculatedUnitPrice` multiplied by the returned quantity. Present only if the order entry has a valid `calculatedPrice.finalPrice`."}}}]},"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}},"calculatedFinalPrice":{"type":"object","description":"Wrapper for the calculated price containing the final price after discounts and fees.","properties":{"finalPrice":{"$ref":"#/components/schemas/calculatedPrice"}}}}}}
```

## The fullEmployeeReturn object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"fullEmployeeReturn":{"title":"A return object for an employee","description":"Schema for retrieving returns by an employee.","allOf":[{"$ref":"#/components/schemas/fullCustomerReturn"},{"type":"object","properties":{"requestor":{"type":"object","description":"Indicates who requested the return. The field is visible only to an employee, that is a person who has the returns.returns_read scope.","properties":{"customerId":{"type":"string","description":"Identifier of a customer to whom the order and return belong."},"firstName":{"type":"string","description":"Requestor first name."},"lastName":{"type":"string","description":"Requestor's last name.\n"},"email":{"type":"string","description":"Requestor email."}}},"submitter":{"type":"object","description":"Indicates who submitted the return. The return can be submitted by an employee on behalf of a customer. In that case, the submitter and requestor data is different. The field can be retrieved only by an employee, that is a person who has the `returns.returns_manage scope` granted.","properties":{"userType":{"type":"string","description":"Indicates who sent the return request. Information whether the request has been sent by a customer or by someone else on behalf of a customer."},"firstName":{"type":"string","description":"Submitter first name."},"lastName":{"type":"string","description":"Submitter last name."},"email":{"type":"string","description":"Submitter email name."}}},"approver":{"type":"object","description":"Information about the approver of the return. The return can be approved by a particular user or a group of users. The field can be retrieved only by an employee, that is a person who has the `returns.returns_read` scope granted.","properties":{"type":{"type":"string","description":"Indicates whether the return needs to be approved by a particular user or user group.","enum":["USER","GROUP"]},"id":{"type":"string","description":"Identifier of a user or a user group, depending on the `type` value."}}}}}]},"fullCustomerReturn":{"title":"A customer return object.","description":"Schema for retrieving returns by a customer.","allOf":[{"$ref":"#/components/schemas/basicCustomerReturn"},{"$ref":"#/components/schemas/assistedBuying"},{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier of a return, represented as a UUID string."},"metadata":{"$ref":"#/components/schemas/metadataResponse"},"received":{"type":"boolean","description":"Indicates whether the items from the return have been received."},"approvalStatus":{"type":"string","enum":["APPROVED","PENDING","REJECTED","CLOSED"]},"expiryDate":{"type":"string","description":"A date when the return will expire. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/fullReturnOrder"}},"total":{"type":"object","properties":{"value":{"type":"number"},"currency":{"type":"string"}}},"calculatedPrice":{"$ref":"#/components/schemas/calculatedFinalPrice","description":"Aggregated calculated price across all returned items. Derived from each order entry `calculatedPrice.finalPrice`. Null if no order entries have calculated prices."}}}]},"basicCustomerReturn":{"title":"A return request created by a customer.","description":"Base schema for a return requested BY A CUSTOMER.","$ref":"#/components/schemas/basicReturn"},"basicReturn":{"title":"basicReturn","description":"Base schema for a return.","type":"object","properties":{"orders":{"type":"array","description":"A list of orders that contain items to be returned. All the orders must have the same currency.","items":{"$ref":"#/components/schemas/order"}},"reason":{"type":"object","description":"A reason why the return is created. One of the values needs to be provided: `code` or `details`.","properties":{"code":{"type":"string","description":"Code of a particular reason for return. A number which represents a reason why an order has been (fully or partially) returned."},"details":{"type":"string","description":"Details why an order has been (fully or partially) returned."}}},"mixins":{"type":"object","description":"The field contains mixins values.","additionalProperties":true},"metadata":{"$ref":"#/components/schemas/metadataCore"}},"required":["orders","reason"]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"metadataCore":{"title":"metadataCore","description":"Core metadata fields shared across multiple objects.","type":"object","properties":{"mixins":{"type":"object","description":"Links to the mixin schemas.","additionalProperties":{"type":"string"}}}},"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`.","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}},"metadataResponse":{"title":"metadataResponse","description":"Metadata fields returned by the API.  \nExtends `metadataUpdate` with timestamps indicating when the object\nwas created and last modified.\n","allOf":[{"$ref":"#/components/schemas/metadataUpdate"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"modifiedAt":{"description":"Date and time when the object was last modified. The value is returned as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}]},"metadataUpdate":{"title":"metadataUpdate","description":"Metadata fields required when updating an existing object.","allOf":[{"$ref":"#/components/schemas/metadataCore"}],"type":"object","required":["version"],"properties":{"version":{"type":"number","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism.","minimum":1}}},"fullReturnOrder":{"allOf":[{"$ref":"#/components/schemas/order"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/fullReturnItem"}}}}]},"fullReturnItem":{"allOf":[{"$ref":"#/components/schemas/orderItem"},{"type":"object","description":"Detailed information about a returned item within an order.","properties":{"name":{"type":"string","description":"Name of a product."},"unitPrice":{"type":"object","description":"The value represents a price (value and currency) of a single unit of the product.","properties":{"value":{"type":"number","description":"The value represents a price value of a single unit of the product."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"total":{"type":"object","description":"The value represents the total price (value and currency) of all returned products related to the order.","properties":{"value":{"type":"number","description":"The value represents the total price value of all returned products."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"}],"description":"Unit price derived from the order entry `calculatedPrice.finalPrice` divided by the order entry amount. Includes discounts and fees. Present only if the order entry has a valid `calculatedPrice.finalPrice`."},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedFinalPrice"}],"description":"Total calculated price for the returned quantity of this item. Computed as `calculatedUnitPrice` multiplied by the returned quantity. Present only if the order entry has a valid `calculatedPrice.finalPrice`."}}}]},"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}},"calculatedFinalPrice":{"type":"object","description":"Wrapper for the calculated price containing the final price after discounts and fees.","properties":{"finalPrice":{"$ref":"#/components/schemas/calculatedPrice"}}}}}}
```

## The fullReturnOrder object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"fullReturnOrder":{"allOf":[{"$ref":"#/components/schemas/order"},{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/fullReturnItem"}}}}]},"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"fullReturnItem":{"allOf":[{"$ref":"#/components/schemas/orderItem"},{"type":"object","description":"Detailed information about a returned item within an order.","properties":{"name":{"type":"string","description":"Name of a product."},"unitPrice":{"type":"object","description":"The value represents a price (value and currency) of a single unit of the product.","properties":{"value":{"type":"number","description":"The value represents a price value of a single unit of the product."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"total":{"type":"object","description":"The value represents the total price (value and currency) of all returned products related to the order.","properties":{"value":{"type":"number","description":"The value represents the total price value of all returned products."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"}],"description":"Unit price derived from the order entry `calculatedPrice.finalPrice` divided by the order entry amount. Includes discounts and fees. Present only if the order entry has a valid `calculatedPrice.finalPrice`."},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedFinalPrice"}],"description":"Total calculated price for the returned quantity of this item. Computed as `calculatedUnitPrice` multiplied by the returned quantity. Present only if the order entry has a valid `calculatedPrice.finalPrice`."}}}]},"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}},"calculatedFinalPrice":{"type":"object","description":"Wrapper for the calculated price containing the final price after discounts and fees.","properties":{"finalPrice":{"$ref":"#/components/schemas/calculatedPrice"}}}}}}
```

## The fullReturnItem object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"fullReturnItem":{"allOf":[{"$ref":"#/components/schemas/orderItem"},{"type":"object","description":"Detailed information about a returned item within an order.","properties":{"name":{"type":"string","description":"Name of a product."},"unitPrice":{"type":"object","description":"The value represents a price (value and currency) of a single unit of the product.","properties":{"value":{"type":"number","description":"The value represents a price value of a single unit of the product."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"total":{"type":"object","description":"The value represents the total price (value and currency) of all returned products related to the order.","properties":{"value":{"type":"number","description":"The value represents the total price value of all returned products."},"currency":{"type":"string","description":"The value represents the currency associated with the price. The currency is compliant with the ISO-4217 standard."}}},"calculatedUnitPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedPrice"}],"description":"Unit price derived from the order entry `calculatedPrice.finalPrice` divided by the order entry amount. Includes discounts and fees. Present only if the order entry has a valid `calculatedPrice.finalPrice`."},"calculatedPrice":{"allOf":[{"$ref":"#/components/schemas/calculatedFinalPrice"}],"description":"Total calculated price for the returned quantity of this item. Computed as `calculatedUnitPrice` multiplied by the returned quantity. Present only if the order entry has a valid `calculatedPrice.finalPrice`."}}}]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]},"calculatedPrice":{"type":"object","description":"Price calculation derived from the order entry `calculatedPrice.finalPrice`. The `finalPrice` reflects already applied discounts and fees.","properties":{"netValue":{"type":"number","format":"double","description":"Net value of the price."},"grossValue":{"type":"number","format":"double","description":"Gross value of the price."},"taxValue":{"type":"number","format":"double","description":"Tax value of the price."},"taxCode":{"type":"string","description":"Tax code applied to the price. Set to `null` when items with different tax codes are aggregated."},"taxRate":{"type":"number","format":"double","description":"Tax rate applied to the price. Set to `null` when items with different tax rates are aggregated."}}},"calculatedFinalPrice":{"type":"object","description":"Wrapper for the calculated price containing the final price after discounts and fees.","properties":{"finalPrice":{"$ref":"#/components/schemas/calculatedPrice"}}}}}}
```

## The order object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"order":{"type":"object","description":"Represents the order which is being (fully or partially) returned.","properties":{"id":{"type":"string","description":"Unique identifier of an order."},"items":{"type":"array","description":"Represents a list of items included in the order. In the `order` entity, the field is called `entries`.","items":{"$ref":"#/components/schemas/orderItem"}}},"required":["id","items"]},"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]}}}}
```

## The orderItem object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"orderItem":{"type":"object","description":"Represents an item included in the order.","properties":{"id":{"type":"string","description":"Unique identifier of an item. In the order entity, the field is called `order.entries[].id`."},"quantity":{"type":"integer","description":"Quantity of the items in the order. In the order entity, the field is called `order.entries[].amount`."},"reason":{"type":"object","description":"A reason why the item needs to be returned.","properties":{"code":{"type":"string","description":"Code representing the reason for return."},"details":{"type":"string","description":"Details why the item is being returned."}}}},"required":["id","quantity"]}}}}
```

## The returnId object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"returnId":{"title":"returnId","type":"object","properties":{"id":{"type":"string","description":"Unique identifier of the created return."}}}}}}
```

## The patchOperation object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"patchOperation":{"title":"patchRequest","type":"object","properties":{"op":{"type":"string","enum":["add","remove","replace"],"description":"Indicates an operation which should be done on a return. Available operations: `add` `remove` and `replace`"},"path":{"type":"string","description":"Indicates a path for which the value should be applied. For example: `/mixins/additionalAttributes/externalId`, `/approvalStatus`, `/requestor/customerId`"},"value":{"oneOf":[{"type":"object"},{"type":"string"}],"description":"Indicates a value that should be changed or added. The value can be of a primitive type, like string, number, boolean or it can be an object or an array."}},"required":["op","path"]}}}}
```

## The assistedBuyingEntry object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`.","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}}}}}
```

## The assistedBuying object

```json
{"openapi":"3.0.0","info":{"title":"Returns Service","version":"0.0.1"},"components":{"schemas":{"assistedBuying":{"title":"assistedBuying","type":"object","properties":{"entries":{"type":"array","description":"List of operations done by an employee on behalf of a customer.","items":{"$ref":"#/components/schemas/assistedBuyingEntry"}}},"description":"The field is populated only if an assisted buying operation was performed. The field is read-only. There is no possibility to update it by PUT/PATCH operation."},"assistedBuyingEntry":{"title":"AssistedBuyingEntry","type":"object","properties":{"employeeId":{"type":"string","description":"Identifier of an employee who performed an action on behalf of a customer."},"operation":{"type":"string","description":"Indicates an operation type done by an employee on behalf of a customer. Available options: `CREATE` and `UPDATE_STATUS`.","enum":["CREATE","UPDATE_STATUS"]},"timestamp":{"type":"string","description":"Indicates a timestamp when an operation was performed."}}}}}}
```
