> ## Documentation Index
> Fetch the complete documentation index at: https://learn.servitly.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Approve order [PROVIDER]
> The order status is updated from PENDING_APPROVAL to PENDING_ACCEPTANCE (if the back-office has made changes to prices and quantities) or to PENDING_SHIPPING.
Required permissions: READ_ORDER, WRITE_ORDER.
## OpenAPI
````json POST /inventory/storeOrders/{orderId}/approve
{
"openapi": "3.1.0",
"info": {
"title": "Servitly DPS API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.servitly-sandbox.com",
"description": "[AWS SANDBOX]"
},
{
"url": "https://api.servitly.com",
"description": "[AWS PRODUCTION Ireland]"
},
{
"url": "https://api-ap.servitly.com",
"description": "[AWS Hong Kong]"
},
{
"url": "https://azapi.servitly-dev.com",
"description": "[AZURE DEV Frankfurt]"
},
{
"url": "https://azapi.servitly-staging.com",
"description": "[AZURE STAGING Frankfurt]"
},
{
"url": "https://azapi.servitly.com",
"description": "[AZURE PRODUCTION Frankfurt]"
}
],
"security": [
{
"bearerAuth": []
}
],
"tags": [
{
"name": "ACTIONS"
},
{
"name": "ALERTS"
},
{
"name": "API GATEWAY"
},
{
"name": "AUTHENTICATION"
},
{
"name": "AUTHORIZATIONS"
},
{
"name": "CUSTOMERS"
},
{
"name": "DATA IMPORT / EXPORT"
},
{
"name": "EVENTS"
},
{
"name": "LOCATIONS"
},
{
"name": "MAINTENANCE"
},
{
"name": "MAPPING"
},
{
"name": "METRIC DATA"
},
{
"name": "MOBILE APP"
},
{
"name": "ORGANIZATION"
},
{
"name": "PARTNERS"
},
{
"name": "PRODUCT MODELS"
},
{
"name": "SPARE PARTS"
},
{
"name": "STATISTICS"
},
{
"name": "STORE ORDERS"
},
{
"name": "SUBSCRIPTIONS"
},
{
"name": "SUBSCRIPTIONS (OLD)"
},
{
"name": "THING CONTROL"
},
{
"name": "THING DEFINITIONS"
},
{
"name": "THING MANAGEMENT"
},
{
"name": "THINGS"
},
{
"name": "TICKETS"
},
{
"name": "USER TYPES"
},
{
"name": "USERS"
},
{
"name": "WORK SESSIONS"
}
],
"paths": {
"/inventory/storeOrders/{orderId}/approve": {
"post": {
"summary": "Approve order [PROVIDER]",
"description": "The order status is updated from PENDING_APPROVAL to PENDING_ACCEPTANCE (if the back-office has made changes to prices and quantities) or to PENDING_SHIPPING.
Required permissions: READ_ORDER, WRITE_ORDER.",
"tags": [
"STORE ORDERS"
],
"parameters": [
{
"$ref": "#/components/parameters/tenantNameHeader"
}
],
"requestBody": {
"description": "The optional order items including missing/changed prices or changed quantities.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StoreOrderItems"
}
}
}
},
"responses": {
"204": {
"description": "Order approved or to be accepted."
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/NotAuthenticated"
},
"403": {
"$ref": "#/components/responses/NotAuthorized"
},
"429": {
"$ref": "#/components/responses/ApiLimit"
},
"500": {
"$ref": "#/components/responses/IntError"
}
}
}
}
},
"components": {
"parameters": {
"tenantNameHeader": {
"in": "header",
"name": "X-Servitly-Tenant",
"required": "true",
"schema": {
"type": "string",
"example": "{{tenantName}}"
},
"description": "The name of the tenant (e.g. acme)."
}
},
"schemas": {
"StoreOrderItems": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OrderItem"
},
"description": "The list of items included in the order."
}
}
},
"OrderItem": {
"type": "object",
"required": [
"type",
"name",
"code",
"quantity",
"unitPrice"
],
"properties": {
"type": {
"type": "string",
"enum": [
"SPARE_PART"
],
"example": "SPARE_PART",
"description": "The type of the item."
},
"itemId": {
"type": "string",
"example": "66310cb2d8cab311e86d05d6",
"description": "The id of the item (e.g. a spare part)."
},
"name": {
"type": "string",
"example": "Bi-metal band saw blade 8 TPI",
"description": "The name of the item."
},
"code": {
"type": "string",
"example": "SP-140506",
"description": "The public code of the order item (e.g. spare part serial)."
},
"quantity": {
"type": "integer",
"minimum": "1",
"example": "2",
"description": "The quantity of the item."
},
"unitPrice": {
"type": "number",
"format": "double",
"minimum": "0",
"example": "14.9",
"description": "The item unit price."
}
}
}
},
"responses": {
"BadRequest": {
"description": "Request data not valid.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Bad request"
}
}
}
}
}
},
"NotAuthenticated": {
"description": "User not authenticated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authenticated"
}
}
}
}
}
},
"NotAuthorized": {
"description": "User not authorized.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "User not authorized"
}
}
}
}
}
},
"ApiLimit": {
"description": "API call rate limit exceeded.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "API call rate limit exceeded"
}
}
}
}
}
},
"IntError": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The error response.",
"example": "Internal Server Error"
}
}
}
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}
````