--- openapi: 3.0.1 info: title: Query Inventory description: "The Query Inventory is a simple query tool, to retrieve information\ \ about inventory using location code(s) and itemNumber(s).\n\n## Security\n\n\ Depending on the scope held, more or less functionality is available at an endpoint.\ \ There are further access controls in place to ensure the scope of the inventory\ \ lookup functionality is within a bounds suitable for the client making the request.\n\ \nGet basic inventory information back pertaining to\n\nThe inventory\ \ API is built following the HATEOAS guidelines. When using the API, the client\ \ should start by\nfirst calling the `discovery` operation to get a list of possible\ \ links these links can then be followed\nto perform functions. If no correlation\ \ token is provided when using this service, it will generate a token for you\ \ in the header response." termsOfService: "http://developer.bunnings.com.au/terms" contact: name: Developer Support email: developer@bunnings.com.au version: "1.0" servers: - url: https://inventory.sandbox.api.bunnings.com.au/inventory description: BASE URL - For sandbox access (mock data) - url: https://inventory.stg.api.bunnings.com.au/inventory description: BASE URL - For test access (test data) - url: https://inventory.api.bunnings.com.au/inventory description: BASE URL - For production access (live data) paths: /discovery: get: tags: - "Discovery" summary: Provides an overview to current functionality offered by the API description: "Returns a set of links that are valid operational roots in this API.\ \ These end points can be used for application interaction. Please keep in\ \ mind that some of these link URIs may be templates that will need to be filled\ \ in to be called." operationId: "INV:001/Discovery/GET" parameters: - name: "x-version-api" in: "header" description: "The API version the client is calling this endpoint at. When\ \ calling this API the client must provided the version of the API they\ \ have been written against this allows the API to correctly support the\ \ calling clients. Clients are still required to support non breaking changes\ \ within the same version" required: true schema: type: "string" example: "1.0" responses: "200": description: "Success" headers: ETag: description: "An ETag of the resource" schema: type: "string" description: "An ETag of the resource" format: "" content: application/json: schema: $ref: "#/components/schemas/EntryPoint" example: _meta: _objectUuid: "acef471b-9093-4e3e-8cf6-78f1006a0642" _objectVersion: "1" _links: - rel: "INV:001/Discovery/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/discovery" methods: - "GET" - rel: "INV:002/itemstockbyitemandlocation/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/{countryCode}/{locationCode}/{itemNumber}" methods: - "GET" - rel: "INV:003/itemstock/inventory/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/inventory/{countryCode}" methods: - "GET" links: INV:001/Discovery/GET: operationId: "INV:001/Discovery/GET" description: "Initial discovery endpoint ascertain new entry link availabilities." INV:002/itemstockbyitemandlocation/GET: operationId: "INV:002/itemstockbyitemandlocation/GET" description: "Retrieves item stock by location code and item number." INV:003/itemstock/inventory/GET: operationId: "INV:003/itemstock/inventory/GET" description: "Retrieves item stock by multiple location codes and item\ \ numbers." "400": description: "There was a problem with the request. The details are in an\ \ RFC 7807 compliant problem. [RFC 7807](https://tools.ietf.org/html/rfc7807)" content: application/problem+json: schema: $ref: "#/components/schemas/ProblemDetails" "401": description: "Unauthorized" "403": description: "Forbidden" "429": description: "Too many request back off and try again later" "500": description: "Server Error" content: application/json: schema: $ref: "#/components/schemas/ServerErrorProblemDetails" example: type: "https://httpstatuses.com/500" title: "Server Error" status: 500 detail: "An error occurred processing your request. We are sorry for\ \ the trouble and please try again in a moment." instance: "" extensions: {} "5XX": description: "An unexpected error has occurred" security: - oauth2: - "inv:pub" - bearer: - "inv:pub" /itemStock/inventory/{countryCode}: get: tags: - "StockLevels" summary: "Retrieves the inventory details based on location ids and item numbers.\ \ (Auth inv:pub)" description: "retrieves ItemNumber,Store Code,StockCount,LevelIndicator,LevelIndMinStock,TopStockCount,ExpectedStockAvailable,CountryCode." operationId: "INV:003/itemstock/inventory/GET" parameters: - name: "countryCode" in: "path" description: "" required: true schema: $ref: "#/components/schemas/CountryCode" - name: "locationCodes" in: "query" description: "" required: true schema: type: "string" description: "" - name: "itemNumbers" in: "query" description: "" required: true schema: type: "string" description: "" - name: "x-version-api" in: "header" description: "The API version the client is calling this endpoint at. When\ \ calling this API the client must provided the version of the API they\ \ have been written against this allows the API to correctly support the\ \ calling clients. Clients are still required to support non breaking changes\ \ within the same version" required: true schema: type: "string" example: "1.0" - name: "$select" in: "query" description: "Select can optionally be used to project only the required properties\ \ of the entity/entities from the server.\n- list required properties separated\ \ with a ','.\n- property names are case insensitive.\n- '\\\\*' can be\ \ used as a wild card for any property.\n- use '/' to address complex type\ \ properties.\n\nexample: $select=name,address/state,contact/*/phoneNumber" schema: type: "string" - name: "$orderby" in: "query" description: "Order By can be optionally used to control the sequence the\ \ entities of the collection are returned in.\nThis collection can have\ \ a maximum of 1 order properties separated by a ',' character.\nSorting\ \ can be done in asc or desc order by following the property name by a space\ \ and then the key words asc or desc.\nIf no direction is specified then\ \ asc is assumed.\nThis collection can be sorted by the following properties:\n\ \ - topStockCount\n - stockCount\nexample: $orderby=name desc,address/state\ \ asc.\ndefault: stockCount" schema: type: "string" responses: "200": description: "Success" headers: ETag: description: "An ETag of the resource" schema: type: "string" description: "An ETag of the resource" format: "" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/ItemLocationStockLevel" example: - itemNumber: "1234567" countryCode: "AU" locationCode: "2010" levelIndicator: "GREEN" expectedStockAvailable: - "2020-11-15T07:25:14.1501466+00:00" _meta: _objectUuid: "7d2af473-1216-4390-963d-f38969807642" _objectVersion: "0" _links: - rel: "INV:002/itemstockbyitemandlocation/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/{countryCode}/{locationCode}/{itemNumber}" methods: - "GET" - rel: "INV:003/itemstock/inventory/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/inventory/{countryCode}" methods: - "GET" "400": description: "Bad Request" content: application/json: schema: $ref: "#/components/schemas/ValidationErrorsProblemDetails" example: errors: ItemNumbers[0]: - "'Item Numbers' must be between 7 and 7 characters. You entered\ \ 8 characters." LocationCodes[0]: - "'Location Codes' must be between 4 and 4 characters. You entered\ \ 5 characters." type: "https://bunnings.com.au/validation-error" title: "Bad Request" status: 400 detail: "Please refer to the errors for additional details." instance: null extensions: {} "401": description: "Unauthorized" "403": description: "Forbidden" content: application/json: schema: $ref: "#/components/schemas/ForbiddenRequestsProblemDetails" example: type: "https://httpstatuses.com/403" title: "Forbidden" status: 403 detail: "The server understood the request, but is refusing to authorize\ \ it. The user isn't authorized to request for the resource." instance: "" extensions: {} "404": description: "Not Found" content: application/json: schema: $ref: "#/components/schemas/MissingResourceProblemDetails" example: type: "https://bunnings.com.au/resource-missing" title: "InventoryLocation not found" status: 404 detail: "Inventory id: 12345" instance: null extensions: {} "429": description: "Client Error" content: application/json: schema: $ref: "#/components/schemas/TooManyRequestsProblemDetails" example: type: "https://httpstatuses.com/429" title: "Too Many Requests" status: 429 detail: "The user has sent too many requests in a given amount of\ \ time. Please retry after 60 seconds." instance: "" extensions: {} "500": description: "Server Error" content: application/json: schema: $ref: "#/components/schemas/ServerErrorProblemDetails" example: type: "https://httpstatuses.com/500" title: "Server Error" status: 500 detail: "An error occurred processing your request. We are sorry for\ \ the trouble and please try again in a moment." instance: "" extensions: {} "5XX": description: "An unexpected error has occurred" security: - oauth2: - "inv:pub" - bearer: - "inv:pub" /itemStock/{countryCode}/{locationCode}/{itemNumber}: get: tags: - "StockLevel" summary: "Retrieves the inventory details based on country code, location code\ \ and item number. (Auth inv:pub)" description: "retrieves ItemNumber,Location Code,StockCount,LevelIndicator,LevelIndMinStock,TopStockCount,ExpectedStockAvailable,CountryCode" operationId: "INV:002/itemstockbyitemandlocation/GET" parameters: - name: "countryCode" in: "path" description: "country code" required: true schema: $ref: "#/components/schemas/CountryCode" - name: "locationCode" in: "path" description: "store Identifier" required: true schema: type: "string" description: "store Identifier" - name: "itemNumber" in: "path" description: "Bunnings unique identifier for Items. This is a 7 digit numerical." required: true schema: type: "string" description: "Bunnings unique identifier for Items. This is a 7 digit numerical." - name: "x-version-api" in: "header" description: "The API version the client is calling this endpoint at. When\ \ calling this API the client must provided the version of the API they\ \ have been written against this allows the API to correctly support the\ \ calling clients. Clients are still required to support non breaking changes\ \ within the same version" required: true schema: type: "string" example: "1.0" - name: "$select" in: "query" description: "Select can optionally be used to project only the required properties\ \ of the entity/entities from the server.\n- list required properties separated\ \ with a ','.\n- property names are case insensitive.\n- '\\\\*' can be\ \ used as a wild card for any property.\n- use '/' to address complex type\ \ properties.\n\nexample: $select=name,address/state,contact/*/phoneNumber" schema: type: "string" responses: "200": description: "Success" headers: ETag: description: "An ETag of the resource" schema: type: "string" description: "An ETag of the resource" format: "" content: application/json: schema: $ref: "#/components/schemas/ItemLocationStockLevel" example: itemNumber: "1234567" countryCode: "AU" locationCode: "2010" levelIndicator: "GREEN" expectedStockAvailable: - "2020-11-15T07:25:14.1678343+00:00" _meta: _objectUuid: "a0024c72-3579-4d45-9e96-25a57d454973" _objectVersion: "0" _links: - rel: "INV:002/itemstockbyitemandlocation/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/{countryCode}/{locationCode}/{itemNumber}" methods: - "GET" - rel: "INV:003/itemstock/inventory/GET" href: "https://inventory.uat.api.bunnings.com.au/inventory/itemstock/inventory/{countryCode}" methods: - "GET" links: INV:002/itemstockbyitemandlocation/GET: operationId: "INV:002/itemstockbyitemandlocation/GET" description: "Retrieves item stock by location code and item number." INV:003/itemstock/inventory/GET: operationId: "INV:003/itemstock/inventory/GET" description: "Retrieves item stock by multiple location codes and item\ \ numbers." "400": description: "Bad Request" content: application/json: schema: $ref: "#/components/schemas/ValidationErrorsProblemDetails" example: errors: ItemNumbers[0]: - "'Item Numbers' must be between 7 and 7 characters. You entered\ \ 8 characters." LocationCodes[0]: - "'Location Codes' must be between 4 and 4 characters. You entered\ \ 5 characters." type: "https://bunnings.com.au/validation-error" title: "Bad Request" status: 400 detail: "Please refer to the errors for additional details." instance: null extensions: {} "401": description: "Unauthorized" "403": description: "Forbidden" content: application/json: schema: $ref: "#/components/schemas/ForbiddenRequestsProblemDetails" example: type: "https://httpstatuses.com/403" title: "Forbidden" status: 403 detail: "The server understood the request, but is refusing to authorize\ \ it. The user isn't authorized to request for the resource." instance: "" extensions: {} "404": description: "Not Found" content: application/json: schema: $ref: "#/components/schemas/MissingResourceProblemDetails" example: type: "https://bunnings.com.au/resource-missing" title: "InventoryLocation not found" status: 404 detail: "Inventory id: 12345" instance: null extensions: {} "429": description: "Client Error" content: application/json: schema: $ref: "#/components/schemas/TooManyRequestsProblemDetails" example: type: "https://httpstatuses.com/429" title: "Too Many Requests" status: 429 detail: "The user has sent too many requests in a given amount of\ \ time. Please retry after 60 seconds." instance: "" extensions: {} "500": description: "Server Error" content: application/json: schema: $ref: "#/components/schemas/ServerErrorProblemDetails" example: type: "https://httpstatuses.com/500" title: "Server Error" status: 500 detail: "An error occurred processing your request. We are sorry for\ \ the trouble and please try again in a moment." instance: "" extensions: {} "5XX": description: "An unexpected error has occurred" security: - oauth2: - "inv:pub" - bearer: - "inv:pub" components: schemas: HateOasLinks: type: "object" properties: rel: type: "string" description: "Gets or sets the rel." nullable: true href: type: "string" description: "Gets or sets the href." nullable: true methods: type: "array" items: type: "string" description: "Gets or sets the methods." nullable: true description: "Hypermedia links" EntryPoint: type: "object" properties: _meta: type: "object" additionalProperties: type: "string" description: "Gets or sets the meta." nullable: true _links: type: "array" items: $ref: "#/components/schemas/HateOasLinks" description: "The links." nullable: true readOnly: true description: "Entry points for API Domain" ServerErrorProblemDetails: type: "object" properties: type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "ServerErrorProblemDetails" ProblemDetails: type: "object" properties: type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "A machine-readable format for specifying errors in HTTP API responses\ \ based on https://tools.ietf.org/html/rfc7807." CountryCode: enum: - "Unknown" - "AU" - "NZ" type: "string" description: "Valid country code" ItemLocationStockLevel: type: "object" properties: itemNumber: type: "string" description: "Item number" nullable: true countryCode: $ref: "#/components/schemas/CountryCode" locationCode: type: "string" description: "Location Code" nullable: true levelIndicator: type: "string" description: "Level Indicator" nullable: true expectedStockAvailable: type: "array" items: type: "string" format: "date-time" example: "2020-11-15T07:11:14Z" description: "Expected available stock" nullable: true _meta: type: "object" additionalProperties: type: "string" description: "Gets or sets the meta." nullable: true _links: type: "array" items: $ref: "#/components/schemas/HateOasLinks" description: "The links." nullable: true readOnly: true description: "ItemLocationStockLevel" ValidationErrorsProblemDetails: type: "object" properties: errors: type: "object" additionalProperties: type: "array" items: type: "string" description: "Gets the validation errors associated with this instance of\ \ Microsoft.AspNetCore.Mvc.ValidationProblemDetails." nullable: true readOnly: true type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "A machine-readable format for specifying validation errors in\ \ HTTP API responses based on https://tools.ietf.org/html/rfc7807" MissingResourceProblemDetails: type: "object" properties: type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "A machine-readable format for specifying resource not found errors\ \ in HTTP API responses based on https://tools.ietf.org/html/rfc7807" TooManyRequestsProblemDetails: type: "object" properties: type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "TooManyRequestsProblemDetails" ForbiddenRequestsProblemDetails: type: "object" properties: type: type: "string" description: "A URI reference [RFC3986] that identifies the problem type.\ \ This specification encourages that, when\r\ndereferenced, it provide\ \ human-readable documentation for the problem type\r\n(e.g., using HTML\ \ [W3C.REC-html5-20141028]). When this member is not present, its value\ \ is assumed to be\r\n\"about:blank\"." nullable: true title: type: "string" description: "A short, human-readable summary of the problem type.It SHOULD\ \ NOT change from occurrence to occurrence\r\nof the problem, except for\ \ purposes of localization(e.g., using proactive content negotiation;\r\ \nsee[RFC7231], Section 3.4)." nullable: true status: type: "integer" description: "The HTTP status code([RFC7231], Section 6) generated by the\ \ origin server for this occurrence of the problem." format: "int32" nullable: true detail: type: "string" description: "A human-readable explanation specific to this occurrence of\ \ the problem." nullable: true instance: type: "string" description: "A URI reference that identifies the specific occurrence of\ \ the problem.It may or may not yield further information if dereferenced." nullable: true additionalProperties: type: "object" description: "The request contained valid data and was understood by the server,\ \ but the server is refusing action. This may be due to the user not having\ \ the necessary permissions for a resource or needing an account of some sort,\ \ or attempting a prohibited action (e.g. creating a duplicate record where\ \ only one is allowed). This code is also typically used if the request provided\ \ authentication via the WWW-Authenticate header field, but the server did\ \ not accept that authentication. The request should not be repeated." securitySchemes: oauth2: type: "oauth2" flows: clientCredentials: tokenUrl: "https://connect.sandbox.api.bunnings.com.au/connect/token" bearer: type: "http" description: "JWT Authorization header using the Bearer scheme." scheme: "bearer" bearerFormat: "JWT" tags: - name: "Discovery" description: "Query API's endpoints"