{
    "openapi": "3.1.2",
    "info": {
        "title": "ASI Cloud Portal",
        "version": "1.0.0",
        "description": "Public product pricing API. Search by product name\/keyword or vendor part number. No authentication required."
    },
    "servers": [
        {
            "url": "https:\/\/cloud.asi.nz\/api\/v1\/products",
            "description": "Default"
        }
    ],
    "paths": {
        "\/price": {
            "post": {
                "operationId": "priceProducts",
                "summary": "Look up sell prices for one or more SKUs",
                "tags": [
                    "ProductPrice"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/search": {
            "get": {
                "operationId": "searchProducts",
                "description": "Part-number queries resolve the product in ASI's catalogue and return the\nbest available sell price. Keyword queries run a broad catalogue search\nand price each match the same way. Results are ASI pricing only; no\nsupply-channel information is returned.",
                "summary": "Search the product catalogue by keyword or vendor part number",
                "tags": [
                    "ProductSearch"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "vendor",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "minimum": 1,
                            "maximum": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ProductOfferResource"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string"
                                                },
                                                "last": {
                                                    "type": "string"
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta",
                                        "links"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "Service Unavailable"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "The product catalogue service is temporarily unavailable."
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "Validation Error"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/{sku}": {
            "get": {
                "operationId": "getProductBySku",
                "summary": "Retrieve a single product by SKU",
                "tags": [
                    "ProductSearch"
                ],
                "parameters": [
                    {
                        "name": "sku",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProductOfferResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "Not Found"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Product not found"
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "Service Unavailable"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "The product catalogue service is temporarily unavailable."
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "message"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ProductOfferResource": {
                "type": "object",
                "properties": {
                    "sku": {
                        "type": "string"
                    },
                    "vendor_part_number": {
                        "type": "string"
                    },
                    "manufacturer": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "uom": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "currency": {
                        "type": "string"
                    },
                    "sell_price": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "available_quantity": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "in_stock": {
                        "type": "boolean"
                    },
                    "discontinued": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "sku",
                    "vendor_part_number",
                    "manufacturer",
                    "description",
                    "category",
                    "uom",
                    "currency",
                    "sell_price",
                    "available_quantity",
                    "in_stock",
                    "discontinued"
                ],
                "title": "ProductOfferResource"
            }
        }
    }
}