# Models

## The coreErrorMessage object

```json
{"openapi":"3.0.0","info":{"title":"Approval 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."},"errorCode":{"type":"string","description":"code of the error."},"details":{"description":"Details information.","type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}}}}}}
```

## The basicApproval object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"basicApproval":{"title":"basicApproval","description":"Base schema for an approval.","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"action":{"$ref":"#/components/schemas/approvalAction"},"approver":{"type":"object","description":"User who can approve the approval request.","properties":{"userId":{"type":"string","description":"Identifier of the user."}}},"comment":{"type":"string","description":"A comment from the requestor to the approver."},"details":{"type":"object","title":"additional information","description":"additional information required for approval process.","properties":{"shipping":{"$ref":"#/components/schemas/shipping"},"payment":{"$ref":"#/components/schemas/payment"},"paymentMethods":{"description":"Methods chosen to process the payment for the order.","type":"array","items":{"$ref":"#/components/schemas/paymentMethod"}},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard."},"addresses":{"type":"array","uniqueItems":true,"minItems":1,"description":"List of addresses associated with the order.","items":{"$ref":"#/components/schemas/address"}}}}},"required":["resourceType","action","approver"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]},"shipping":{"type":"object","title":"Shipping information","description":"Information about the shipping.","additionalProperties":false,"properties":{"methodId":{"type":"string","description":"Shipping method's unique identifier.","minLength":0},"zoneId":{"type":"string","description":"Shipping zone identifier.","minLength":0},"methodName":{"type":"string","description":"Shipping method chosen by the customer.","minLength":0},"amount":{"type":"number","minimum":0,"description":"Shipping net cost."},"shippingTaxCode":{"type":"string","description":"The tax code of the shipping."}}},"payment":{"type":"object","description":"Information about the payment.","title":"Payment information","additionalProperties":false,"properties":{"paymentId":{"type":"string","minLength":0},"customAttributes":{"type":"object"}}},"paymentMethod":{"type":"object","additionalProperties":false,"properties":{"provider":{"type":"string","description":"Payment provider, possible values: \n  * `payment-gateway` - When the Emporix Payment-Gateway service should be used to handle a payment. For details about custom attributes that are required for a particular payment mode, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments. \n  * `custom` - When a custom provider is used. In this case the created order has the `IN_CHECKOUT` status.\n  * `none` - For payment by cash or invoice.\n","minLength":0},"customAttributes":{"type":"object","description":"Additional information about the payment method.","properties":{"token":{"type":"string","description":"Payment token used for the tokenized credit card flows. The field is used when provider type is `payment-gateway`. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"modeId":{"type":"string","description":"Identifier of a payment mode. The payment mode has to be configured in the Emporix Payment Gateway service beforehand. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"paymentType":{"type":"string","description":"Payment type chosen by the customer, for example `paymentByCredit` or `paymentByDebit`."}}},"method":{"type":"string","description":"Payment method chosen by the customer, for example `invoice` or `cash-on-delivery`."},"amount":{"type":"number","description":"Amount to be paid by the customer."}}},"address":{"type":"object","description":"Information about the customer address.","properties":{"contactName":{"type":"string","minLength":0},"companyName":{"type":"string"},"street":{"type":"string","minLength":0},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zipCode":{"type":"string","maxLength":11,"minLength":0},"city":{"type":"string","minLength":0},"country":{"type":"string","minLength":1},"state":{"type":"string"},"contactPhone":{"type":"string"},"type":{"type":"string","description":"Type of the address data, for example `BILLING` or `SHIPPING`.","enum":["SHIPPING","BILLING"]}}}}}}
```

## The address object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"address":{"type":"object","description":"Information about the customer address.","properties":{"contactName":{"type":"string","minLength":0},"companyName":{"type":"string"},"street":{"type":"string","minLength":0},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zipCode":{"type":"string","maxLength":11,"minLength":0},"city":{"type":"string","minLength":0},"country":{"type":"string","minLength":1},"state":{"type":"string"},"contactPhone":{"type":"string"},"type":{"type":"string","description":"Type of the address data, for example `BILLING` or `SHIPPING`.","enum":["SHIPPING","BILLING"]}}}}}}
```

## The shipping object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"shipping":{"type":"object","title":"Shipping information","description":"Information about the shipping.","additionalProperties":false,"properties":{"methodId":{"type":"string","description":"Shipping method's unique identifier.","minLength":0},"zoneId":{"type":"string","description":"Shipping zone identifier.","minLength":0},"methodName":{"type":"string","description":"Shipping method chosen by the customer.","minLength":0},"amount":{"type":"number","minimum":0,"description":"Shipping net cost."},"shippingTaxCode":{"type":"string","description":"The tax code of the shipping."}}}}}}
```

## The payment object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"payment":{"type":"object","description":"Information about the payment.","title":"Payment information","additionalProperties":false,"properties":{"paymentId":{"type":"string","minLength":0},"customAttributes":{"type":"object"}}}}}}
```

## The paymentMethod object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"paymentMethod":{"type":"object","additionalProperties":false,"properties":{"provider":{"type":"string","description":"Payment provider, possible values: \n  * `payment-gateway` - When the Emporix Payment-Gateway service should be used to handle a payment. For details about custom attributes that are required for a particular payment mode, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments. \n  * `custom` - When a custom provider is used. In this case the created order has the `IN_CHECKOUT` status.\n  * `none` - For payment by cash or invoice.\n","minLength":0},"customAttributes":{"type":"object","description":"Additional information about the payment method.","properties":{"token":{"type":"string","description":"Payment token used for the tokenized credit card flows. The field is used when provider type is `payment-gateway`. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"modeId":{"type":"string","description":"Identifier of a payment mode. The payment mode has to be configured in the Emporix Payment Gateway service beforehand. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"paymentType":{"type":"string","description":"Payment type chosen by the customer, for example `paymentByCredit` or `paymentByDebit`."}}},"method":{"type":"string","description":"Payment method chosen by the customer, for example `invoice` or `cash-on-delivery`."},"amount":{"type":"number","description":"Amount to be paid by the customer."}}}}}}
```

## The user object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"user":{"title":"user schema","type":"object","properties":{"userId":{"type":"string","description":"An identifier of the user."},"firstName":{"type":"string","description":"First name of the user."},"lastName":{"type":"string","description":"Last name of the user."}},"required":["userId","firstName","lastName"]}}}}
```

## The resourceType object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]}}}}
```

## The approvalAction object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]}}}}
```

## The approvalStatus object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"approvalStatus":{"title":"A status of the approval","description":"Base schema for the approval status.","type":"string","enum":["PENDING","APPROVED","CLOSED","EXPIRED","DECLINED"]}}}}
```

## The expiryDate object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"expiryDate":{"title":"An expiration date","description":"An expiration date which defines when the approval will expire. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}}
```

## The getApprovalResponse object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"getApprovalResponse":{"title":"An approval response","allOf":[{"$ref":"#/components/schemas/basicApproval"},{"type":"object","description":"Base schema for an approval response.","properties":{"id":{"type":"string","description":"An identifier of the approval document."},"approverComment":{"type":"string","description":"A comment from an approver user."},"resource":{"$ref":"#/components/schemas/resourceResponse"},"requestor":{"$ref":"#/components/schemas/user"},"approver":{"$ref":"#/components/schemas/user"},"status":{"$ref":"#/components/schemas/approvalStatus"},"expiryDate":{"$ref":"#/components/schemas/expiryDate"},"metadata":{"$ref":"#/components/schemas/metadata"}}}]},"basicApproval":{"title":"basicApproval","description":"Base schema for an approval.","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"action":{"$ref":"#/components/schemas/approvalAction"},"approver":{"type":"object","description":"User who can approve the approval request.","properties":{"userId":{"type":"string","description":"Identifier of the user."}}},"comment":{"type":"string","description":"A comment from the requestor to the approver."},"details":{"type":"object","title":"additional information","description":"additional information required for approval process.","properties":{"shipping":{"$ref":"#/components/schemas/shipping"},"payment":{"$ref":"#/components/schemas/payment"},"paymentMethods":{"description":"Methods chosen to process the payment for the order.","type":"array","items":{"$ref":"#/components/schemas/paymentMethod"}},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard."},"addresses":{"type":"array","uniqueItems":true,"minItems":1,"description":"List of addresses associated with the order.","items":{"$ref":"#/components/schemas/address"}}}}},"required":["resourceType","action","approver"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]},"shipping":{"type":"object","title":"Shipping information","description":"Information about the shipping.","additionalProperties":false,"properties":{"methodId":{"type":"string","description":"Shipping method's unique identifier.","minLength":0},"zoneId":{"type":"string","description":"Shipping zone identifier.","minLength":0},"methodName":{"type":"string","description":"Shipping method chosen by the customer.","minLength":0},"amount":{"type":"number","minimum":0,"description":"Shipping net cost."},"shippingTaxCode":{"type":"string","description":"The tax code of the shipping."}}},"payment":{"type":"object","description":"Information about the payment.","title":"Payment information","additionalProperties":false,"properties":{"paymentId":{"type":"string","minLength":0},"customAttributes":{"type":"object"}}},"paymentMethod":{"type":"object","additionalProperties":false,"properties":{"provider":{"type":"string","description":"Payment provider, possible values: \n  * `payment-gateway` - When the Emporix Payment-Gateway service should be used to handle a payment. For details about custom attributes that are required for a particular payment mode, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments. \n  * `custom` - When a custom provider is used. In this case the created order has the `IN_CHECKOUT` status.\n  * `none` - For payment by cash or invoice.\n","minLength":0},"customAttributes":{"type":"object","description":"Additional information about the payment method.","properties":{"token":{"type":"string","description":"Payment token used for the tokenized credit card flows. The field is used when provider type is `payment-gateway`. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"modeId":{"type":"string","description":"Identifier of a payment mode. The payment mode has to be configured in the Emporix Payment Gateway service beforehand. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"paymentType":{"type":"string","description":"Payment type chosen by the customer, for example `paymentByCredit` or `paymentByDebit`."}}},"method":{"type":"string","description":"Payment method chosen by the customer, for example `invoice` or `cash-on-delivery`."},"amount":{"type":"number","description":"Amount to be paid by the customer."}}},"address":{"type":"object","description":"Information about the customer address.","properties":{"contactName":{"type":"string","minLength":0},"companyName":{"type":"string"},"street":{"type":"string","minLength":0},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zipCode":{"type":"string","maxLength":11,"minLength":0},"city":{"type":"string","minLength":0},"country":{"type":"string","minLength":1},"state":{"type":"string"},"contactPhone":{"type":"string"},"type":{"type":"string","description":"Type of the address data, for example `BILLING` or `SHIPPING`.","enum":["SHIPPING","BILLING"]}}},"resourceResponse":{"title":"Resource","description":"Resource of the approval.","type":"object","properties":{"id":{"type":"string","description":"The identifier of the resource."},"items":{"type":"array","items":{"$ref":"#/components/schemas/resourceItem"}},"totalPrice":{"$ref":"#/components/schemas/price"},"subTotalPrice":{"$ref":"#/components/schemas/price"},"subtotalAggregate":{"$ref":"#/components/schemas/taxablePrice"},"amount":{"type":"number","description":"Value of the price."},"siteCode":{"type":"string","description":"Name of the site."},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"}}},"resourceItem":{"title":"Resource item","description":"Item of the resource.","type":"object","properties":{"quantity":{"type":"number","description":"Quantity of the given item."},"itemPrice":{"$ref":"#/components/schemas/price"},"itemYrn":{"type":"string","description":"YRN which identifies the product."}}},"price":{"title":"Price value","description":"Price value with the currency.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"amount":{"type":"number","description":"Value of the price."}}},"taxablePrice":{"title":"Taxable price value","description":"Price value with the currency and tax information.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"netValue":{"type":"number","description":"Net value of the price."},"grossValue":{"type":"number","description":"Gross value of the price."},"taxValue":{"type":"number","description":"Tax value of the price."}}},"deliveryWindow":{"title":"Delivery Window","description":"delivery window required for order.","type":"object","properties":{"id":{"type":"string","description":"Identifier of the delivery window."},"slotId":{"type":"string","description":"Identifier of the slot."},"deliveryDate":{"type":"string","description":"Delivery date."}}},"user":{"title":"user schema","type":"object","properties":{"userId":{"type":"string","description":"An identifier of the user."},"firstName":{"type":"string","description":"First name of the user."},"lastName":{"type":"string","description":"Last name of the user."}},"required":["userId","firstName","lastName"]},"approvalStatus":{"title":"A status of the approval","description":"Base schema for the approval status.","type":"string","enum":["PENDING","APPROVED","CLOSED","EXPIRED","DECLINED"]},"expiryDate":{"title":"An expiration date","description":"An expiration date which defines when the approval will expire. The value is approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"},"metadata":{"allOf":[{"$ref":"#/components/schemas/basicMetadata"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved 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 approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}],"required":["createdAt","modifiedAt","version"]},"basicMetadata":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]}}}}
```

## The approvalPermittedResponse object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"approvalPermittedResponse":{"title":"approval permitted response","allOf":[{"type":"object","description":"Base schema for approval permitted response.","properties":{"action":{"$ref":"#/components/schemas/approvalAction"},"status":{"$ref":"#/components/schemas/approvalStatus"},"permitted":{"type":"boolean","description":"Indicates if the operation is permitted."},"approvalId":{"type":"string","description":"Identifier of the approval."}},"required":["permitted","action"]}]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]},"approvalStatus":{"title":"A status of the approval","description":"Base schema for the approval status.","type":"string","enum":["PENDING","APPROVED","CLOSED","EXPIRED","DECLINED"]}}}}
```

## The resourceResponse object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"resourceResponse":{"title":"Resource","description":"Resource of the approval.","type":"object","properties":{"id":{"type":"string","description":"The identifier of the resource."},"items":{"type":"array","items":{"$ref":"#/components/schemas/resourceItem"}},"totalPrice":{"$ref":"#/components/schemas/price"},"subTotalPrice":{"$ref":"#/components/schemas/price"},"subtotalAggregate":{"$ref":"#/components/schemas/taxablePrice"},"amount":{"type":"number","description":"Value of the price."},"siteCode":{"type":"string","description":"Name of the site."},"deliveryWindow":{"$ref":"#/components/schemas/deliveryWindow"}}},"resourceItem":{"title":"Resource item","description":"Item of the resource.","type":"object","properties":{"quantity":{"type":"number","description":"Quantity of the given item."},"itemPrice":{"$ref":"#/components/schemas/price"},"itemYrn":{"type":"string","description":"YRN which identifies the product."}}},"price":{"title":"Price value","description":"Price value with the currency.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"amount":{"type":"number","description":"Value of the price."}}},"taxablePrice":{"title":"Taxable price value","description":"Price value with the currency and tax information.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"netValue":{"type":"number","description":"Net value of the price."},"grossValue":{"type":"number","description":"Gross value of the price."},"taxValue":{"type":"number","description":"Tax value of the price."}}},"deliveryWindow":{"title":"Delivery Window","description":"delivery window required for order.","type":"object","properties":{"id":{"type":"string","description":"Identifier of the delivery window."},"slotId":{"type":"string","description":"Identifier of the slot."},"deliveryDate":{"type":"string","description":"Delivery date."}}}}}}
```

## The resourceItem object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"resourceItem":{"title":"Resource item","description":"Item of the resource.","type":"object","properties":{"quantity":{"type":"number","description":"Quantity of the given item."},"itemPrice":{"$ref":"#/components/schemas/price"},"itemYrn":{"type":"string","description":"YRN which identifies the product."}}},"price":{"title":"Price value","description":"Price value with the currency.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"amount":{"type":"number","description":"Value of the price."}}}}}}
```

## The price object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"price":{"title":"Price value","description":"Price value with the currency.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"amount":{"type":"number","description":"Value of the price."}}}}}}
```

## The taxablePrice object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"taxablePrice":{"title":"Taxable price value","description":"Price value with the currency and tax information.","type":"object","properties":{"currency":{"type":"string","description":"Currency of the price."},"netValue":{"type":"number","description":"Net value of the price."},"grossValue":{"type":"number","description":"Gross value of the price."},"taxValue":{"type":"number","description":"Tax value of the price."}}}}}}
```

## The deliveryWindow object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"deliveryWindow":{"title":"Delivery Window","description":"delivery window required for order.","type":"object","properties":{"id":{"type":"string","description":"Identifier of the delivery window."},"slotId":{"type":"string","description":"Identifier of the slot."},"deliveryDate":{"type":"string","description":"Delivery date."}}}}}}
```

## The approvalSearchUsersResponse object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"approvalSearchUsersResponse":{"title":"Search approval users response","description":"Base schema search approval users response.","type":"array","items":{"$ref":"#/components/schemas/user"}},"user":{"title":"user schema","type":"object","properties":{"userId":{"type":"string","description":"An identifier of the user."},"firstName":{"type":"string","description":"First name of the user."},"lastName":{"type":"string","description":"Last name of the user."}},"required":["userId","firstName","lastName"]}}}}
```

## The createApprovalRequest object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"createApprovalRequest":{"title":"Create an approval","allOf":[{"$ref":"#/components/schemas/basicApproval"},{"type":"object","description":"Base schema for an approval creation.","properties":{"id":{"type":"string","description":"An identifier of the approval document."},"resourceId":{"type":"string","description":"An identifier of the approval resource."}}}]},"basicApproval":{"title":"basicApproval","description":"Base schema for an approval.","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"action":{"$ref":"#/components/schemas/approvalAction"},"approver":{"type":"object","description":"User who can approve the approval request.","properties":{"userId":{"type":"string","description":"Identifier of the user."}}},"comment":{"type":"string","description":"A comment from the requestor to the approver."},"details":{"type":"object","title":"additional information","description":"additional information required for approval process.","properties":{"shipping":{"$ref":"#/components/schemas/shipping"},"payment":{"$ref":"#/components/schemas/payment"},"paymentMethods":{"description":"Methods chosen to process the payment for the order.","type":"array","items":{"$ref":"#/components/schemas/paymentMethod"}},"currency":{"type":"string","description":"Three-letter currency code, compliant with the ISO 4217 standard."},"addresses":{"type":"array","uniqueItems":true,"minItems":1,"description":"List of addresses associated with the order.","items":{"$ref":"#/components/schemas/address"}}}}},"required":["resourceType","action","approver"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]},"shipping":{"type":"object","title":"Shipping information","description":"Information about the shipping.","additionalProperties":false,"properties":{"methodId":{"type":"string","description":"Shipping method's unique identifier.","minLength":0},"zoneId":{"type":"string","description":"Shipping zone identifier.","minLength":0},"methodName":{"type":"string","description":"Shipping method chosen by the customer.","minLength":0},"amount":{"type":"number","minimum":0,"description":"Shipping net cost."},"shippingTaxCode":{"type":"string","description":"The tax code of the shipping."}}},"payment":{"type":"object","description":"Information about the payment.","title":"Payment information","additionalProperties":false,"properties":{"paymentId":{"type":"string","minLength":0},"customAttributes":{"type":"object"}}},"paymentMethod":{"type":"object","additionalProperties":false,"properties":{"provider":{"type":"string","description":"Payment provider, possible values: \n  * `payment-gateway` - When the Emporix Payment-Gateway service should be used to handle a payment. For details about custom attributes that are required for a particular payment mode, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments. \n  * `custom` - When a custom provider is used. In this case the created order has the `IN_CHECKOUT` status.\n  * `none` - For payment by cash or invoice.\n","minLength":0},"customAttributes":{"type":"object","description":"Additional information about the payment method.","properties":{"token":{"type":"string","description":"Payment token used for the tokenized credit card flows. The field is used when provider type is `payment-gateway`. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"modeId":{"type":"string","description":"Identifier of a payment mode. The payment mode has to be configured in the Emporix Payment Gateway service beforehand. For more details, check https://developer.emporix.io/user-guides/system-management/payment-gateway/payments"},"paymentType":{"type":"string","description":"Payment type chosen by the customer, for example `paymentByCredit` or `paymentByDebit`."}}},"method":{"type":"string","description":"Payment method chosen by the customer, for example `invoice` or `cash-on-delivery`."},"amount":{"type":"number","description":"Amount to be paid by the customer."}}},"address":{"type":"object","description":"Information about the customer address.","properties":{"contactName":{"type":"string","minLength":0},"companyName":{"type":"string"},"street":{"type":"string","minLength":0},"streetNumber":{"type":"string"},"streetAppendix":{"type":"string"},"zipCode":{"type":"string","maxLength":11,"minLength":0},"city":{"type":"string","minLength":0},"country":{"type":"string","minLength":1},"state":{"type":"string"},"contactPhone":{"type":"string"},"type":{"type":"string","description":"Type of the address data, for example `BILLING` or `SHIPPING`.","enum":["SHIPPING","BILLING"]}}}}}}
```

## The updateApprovalRequest object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"updateApprovalRequest":{"type":"array","description":"Approval partial update operation list.","items":{"type":"object","properties":{"op":{"anyOf":[{"enum":["ADD","REMOVE","REPLACE"]}],"type":"string"},"path":{"anyOf":[{"enum":["/status","/details*","/comment","/approverComment","/resource/deliveryWindow*"]}],"type":"string"},"value":{"anyOf":[{"$ref":"#/components/schemas/approvalStatus"},{"type":"string","description":"Value of the string type."},{"type":"object","description":"Any part of the details object."},{"type":"object","description":"Any part of the delivery window object."}]}},"required":["op","path"]}},"approvalStatus":{"title":"A status of the approval","description":"Base schema for the approval status.","type":"string","enum":["PENDING","APPROVED","CLOSED","EXPIRED","DECLINED"]}}}}
```

## The basicMetadata object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"basicMetadata":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]}}}}
```

## The metadata object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"metadata":{"allOf":[{"$ref":"#/components/schemas/basicMetadata"},{"type":"object","properties":{"createdAt":{"description":"Date and time when the object was created. The value is approved 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 approved as an ISO-8601 representation of an Instant. For example: `2022-04-31T13:18:02.379Z`","type":"string"}}}],"required":["createdAt","modifiedAt","version"]},"basicMetadata":{"type":"object","properties":{"version":{"minimum":1,"type":"integer","description":"Version of the object. The version is required during the update operation because of the optimistic locking mechanism."}},"required":["version"]}}}}
```

## The approvalId object

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

## The approvalPermittedRequest object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"approvalPermittedRequest":{"title":"approval permitted request","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"resourceId":{"type":"string","description":"An identifier of the resource for approval."},"action":{"$ref":"#/components/schemas/approvalAction"}},"required":["resourceType","resourceId","action"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]}}}}
```

## The searchUsersRequest object

```json
{"openapi":"3.0.0","info":{"title":"Approval Service","version":"0.0.1"},"components":{"schemas":{"searchUsersRequest":{"title":"Search approver users request","type":"object","properties":{"resourceType":{"$ref":"#/components/schemas/resourceType"},"resourceId":{"type":"string","description":"An identifier of the resource for approval."},"action":{"$ref":"#/components/schemas/approvalAction"}},"required":["resourceType","resourceId","action"]},"resourceType":{"title":"A type of a resource","description":"Base schema for an approval resource type.","type":"string","enum":["CART"]},"approvalAction":{"title":"An approval action","description":"Base schema for an approval action type.","type":"string","enum":["CHECKOUT"]}}}}
```


---

# 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://developer.emporix.io/api-references-1/readme/approval-api-reference/models.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.
