{
	"openapi": "3.1.0",
	"info": {
		"title": "PromoStandards APIs",
		"version": "1.0.0",
		"description": "Combined OpenAPI 3.1 specification for core PromoStandards services: Product Data, Inventory, Order Status, Pricing, Media, Purchase Order, and Invoice."
	},
	"servers": [
		{
			"url": "https://gateway.companystore.io/api/v1/spec"
		}
	],
	"paths": {
		"/productdata": {
			"get": {
				"summary": "Get Product Data",
				"parameters": [
					{
						"name": "ProductId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					}
				],
				"responses": {
					"200": {
						"description": "Product details retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Product" }
							}
						}
					}
				}
			}
		},
		"/inventory": {
			"get": {
				"summary": "Get Inventory Levels",
				"parameters": [
					{
						"name": "ProductId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					}
				],
				"responses": {
					"200": {
						"description": "Inventory data retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Inventory" }
							}
						}
					}
				}
			}
		},
		"/orderstatus": {
			"get": {
				"summary": "Check Order Status",
				"parameters": [
					{
						"name": "OrderId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					}
				],
				"responses": {
					"200": {
						"description": "Order status retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/OrderStatus" }
							}
						}
					}
				}
			}
		},
		"/pricing": {
			"get": {
				"summary": "Get Product Pricing",
				"parameters": [
					{
						"name": "ProductId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					},
					{
						"name": "Quantity",
						"in": "query",
						"required": false,
						"schema": { "type": "integer" }
					}
				],
				"responses": {
					"200": {
						"description": "Pricing information retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Pricing" }
							}
						}
					}
				}
			}
		},
		"/media": {
			"get": {
				"summary": "Get Media Content",
				"parameters": [
					{
						"name": "ProductId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					}
				],
				"responses": {
					"200": {
						"description": "Media content retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Media" }
							}
						}
					}
				}
			}
		},
		"/purchaseorder": {
			"post": {
				"summary": "Submit Purchase Order",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": { "$ref": "#/components/schemas/Order" }
						}
					}
				},
				"responses": {
					"201": {
						"description": "Purchase order submitted successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Order" }
							}
						}
					}
				}
			}
		},
		"/invoice": {
			"get": {
				"summary": "Retrieve Invoice",
				"parameters": [
					{
						"name": "InvoiceId",
						"in": "query",
						"required": true,
						"schema": { "type": "string" }
					}
				],
				"responses": {
					"200": {
						"description": "Invoice retrieved successfully",
						"content": {
							"application/json": {
								"schema": { "$ref": "#/components/schemas/Invoice" }
							}
						}
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"Product": {
				"type": "object",
				"properties": {
					"productId": { "type": "string" },
					"name": { "type": "string" },
					"description": { "type": "string" }
				}
			},
			"Inventory": {
				"type": "object",
				"properties": {
					"productId": { "type": "string" },
					"quantity": { "type": "integer" },
					"location": { "type": "string" }
				}
			},
			"Order": {
				"type": "object",
				"properties": {
					"orderId": { "type": "string" },
					"orderType": { "type": "string" },
					"orderDate": { "type": "string", "format": "date-time" },
					"status": { "type": "string" },
					"totalAmount": { "type": "number" },
					"paymentTerms": { "type": "string" },
					"rush": { "type": "boolean" },
					"currency": { "type": "string" },
					"termsAndConditions": { "type": "string" },
					"contacts": { "$ref": "#/components/schemas/OrderContactArray" },
					"shipments": { "$ref": "#/components/schemas/ShipmentArray" },
					"lineItems": { "$ref": "#/components/schemas/LineItemArray" }
				}
			},
			"OrderContactArray": {
				"type": "object",
				"properties": {
					"Contact": {
						"type": "array",
						"items": { "$ref": "#/components/schemas/OrderContact" }
					}
				}
			},
			"OrderContact": {
				"type": "object",
				"properties": {
					"contactType": { "type": "string" },
					"ContactDetails": { "$ref": "#/components/schemas/ContactDetails" },
					"accountName": { "type": ["string", "null"] },
					"accountNumber": { "type": ["string", "null"] }
				}
			},
			"ContactDetails": {
				"type": "object",
				"properties": {
					"attentionTo": { "type": "string" },
					"companyName": { "type": "string" },
					"address1": { "type": "string" },
					"address2": { "type": "string" },
					"city": { "type": "string" },
					"region": { "type": "string" },
					"postalCode": { "type": "string" },
					"country": { "type": "string" },
					"email": { "type": "string" },
					"phone": { "type": "string" },
					"comments": { "type": "string" }
				}
			},
			"ShipmentArray": {
				"type": "object",
				"properties": {
					"Shipment": {
						"type": "array",
						"items": { "$ref": "#/components/schemas/Shipment" }
					}
				}
			},
			"Shipment": {
				"type": "object",
				"properties": {
					"ShipTo": { "$ref": "#/components/schemas/ContactDetails" },
					"packingListRequired": { "type": "boolean" },
					"blindShip": { "type": "boolean" },
					"allowConsolidation": { "type": "boolean" },
					"FreightDetails": { "$ref": "#/components/schemas/FreightDetails" },
					"ThirdPartyAccount": { "type": ["string", "null"] },
					"shipReferences": { "type": ["string", "null"] },
					"comments": { "type": "string" }
				}
			},
			"FreightDetails": {
				"type": "object",
				"properties": {
					"carrier": { "type": "string" },
					"service": { "type": "string" }
				}
			},
			"LineItemArray": {
				"type": "object",
				"properties": {
					"LineItem": {
						"type": "array",
						"items": { "$ref": "#/components/schemas/LineItem" }
					}
				}
			},
			"LineItem": {
				"type": "object",
				"properties": {
					"lineNumber": { "type": "string" },
					"description": { "type": "string" },
					"lineType": { "type": "string" },
					"Quantity": { "$ref": "#/components/schemas/Quantity" },
					"fobId": { "type": "string" },
					"ToleranceDetails": { "$ref": "#/components/schemas/ToleranceDetails" },
					"allowPartialShipments": { "type": "boolean" },
					"unitPrice": { "type": "number" },
					"lineItemTotal": { "type": "number" },
					"requestedShipDate": { "type": "string", "format": "date" },
					"requestedInHandsDate": { "type": "string", "format": "date" },
					"referenceSalesQuote": { "type": ["string", "null"] },
					"Program": { "type": ["string", "null"] },
					"endCustomerSalesOrder": { "type": "string" },
					"productId": { "type": "string" },
					"customerProductId": { "type": "string" },
					"lineItemGroupingId": { "type": ["string", "null"] },
					"PartArray": { "$ref": "#/components/schemas/PartArray" },
					"Configuration": { "type": ["object", "null"] }
				}
			},
			"Quantity": {
				"type": "object",
				"properties": {
					"value": { "type": "number" },
					"uom": { "type": "string" }
				}
			},
			"ToleranceDetails": {
				"type": "object",
				"properties": {
					"tolerance": { "type": "string" },
					"value": { "type": "number" },
					"uom": { "type": "string" }
				}
			},
			"PartArray": {
				"type": "object",
				"properties": {
					"Part": {
						"type": "array",
						"items": { "$ref": "#/components/schemas/Part" }
					}
				}
			},
			"Part": {
				"type": "object",
				"properties": {
					"partId": { "type": "string" },
					"Quantity": { "$ref": "#/components/schemas/Quantity" },
					"partGroup": { "type": "string" },
					"customerPartId": { "type": "string" },
					"customerSupplied": { "type": "boolean" },
					"description": { "type": "string" },
					"locationLinkId": {
						"type": "array",
						"items": { "type": "integer" }
					},
					"unitPrice": { "type": "number" },
					"extendedPrice": { "type": "number" },
					"ShipmentLinkArray": { "$ref": "#/components/schemas/ShipmentLinkArray" }
				}
			},
			"ShipmentLinkArray": {
				"type": "object",
				"properties": {
					"ShipmentLink": {
						"type": "array",
						"items": { "$ref": "#/components/schemas/ShipmentLink" }
					}
				}
			},
			"ShipmentLink": {
				"type": "object",
				"properties": {
					"shipmentId": { "type": "integer" },
					"Quantity": { "$ref": "#/components/schemas/Quantity" }
				}
			},
			"Pricing": {
				"type": "object",
				"properties": {
					"productId": { "type": "string" },
					"quantity": { "type": "integer" },
					"price": { "type": "number" }
				}
			},
			"Media": {
				"type": "object",
				"properties": {
					"productId": { "type": "string" },
					"url": { "type": "string" },
					"type": { "type": "string" }
				}
			},
			"Invoice": {
				"type": "object",
				"properties": {
					"invoiceId": { "type": "string" },
					"orderId": { "type": "string" },
					"amount": { "type": "number" },
					"status": { "type": "string" }
				}
			},
			"OrderStatus": {
				"type": "object",
				"properties": {
					"orderId": { "type": "string" },
					"status": { "type": "string" },
					"lastModified": { "type": "string", "format": "date-time" }
				}
			}
		}
	}
}
