{"openapi":"3.1.0","info":{"title":"Pi Australia Public API","description":"A free, open API for browsing products, collections, and stock availability. No authentication required for browsing. Rate limited to 60 requests/minute. Customer-scoped endpoints (orders, quotes, cart, wishlist, addresses) use a bearer token from the email-code sign-in flow — see /auth.md for the agent walkthrough.","version":"1.0.0","contact":{"email":"team@littlebirdelectronics.com.au"},"license":{"name":"MIT"}},"servers":[{"url":"https://piaustralia.com.au/public-api/v1"}],"paths":{"/products":{"get":{"summary":"List products","operationId":"listProducts","parameters":[{"name":"q","in":"query","schema":{"type":"string"},"description":"Search query"},{"name":"in_stock","in":"query","schema":{"type":"string","enum":["true"]},"description":"Filter to in-stock only"},{"name":"vendor","in":"query","schema":{"type":"string"},"description":"Filter by vendor/brand"},{"name":"product_type","in":"query","schema":{"type":"string"},"description":"Filter by product type"},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Paginated list of products","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}}}}},"/products/{handle}":{"get":{"summary":"Get product details","operationId":"getProduct","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string"},"description":"Product URL handle (slug)"}],"responses":{"200":{"description":"Product details with variants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDetail"}}}},"404":{"description":"Product not found"}}}},"/collections":{"get":{"summary":"List collections","operationId":"listCollections","responses":{"200":{"description":"All published collections","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionList"}}}}}}},"/collections/{handle}":{"get":{"summary":"Get collection with products","operationId":"getCollection","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100}}],"responses":{"200":{"description":"Collection details with paginated products"}}}},"/checkouts":{"post":{"summary":"Create an agent checkout (free quote)","operationId":"createCheckout","description":"Prices a basket for delivery to an Australian or New Zealand address against live carrier rates and locks the postage. Nothing is charged. Pay it with POST /checkouts/{id}/pay within 30 minutes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"201":{"description":"Priced checkout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"422":{"description":"Invalid items, address or shipping method (problem+json with field errors)"}}}},"/checkouts/{id}":{"get":{"summary":"Get a checkout and, once paid, its order","operationId":"getCheckout","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The checkout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"404":{"description":"No such checkout"}}}},"/checkouts/{id}/pay":{"post":{"summary":"Pay for a checkout and place the order","operationId":"payCheckout","description":"Returns 402 Payment Required with an MPP challenge (WWW-Authenticate: Payment) for the checkout total in AUD, one per accepted method. Retry the same request with the payment credential to place the order; the response carries the order and a Payment-Receipt header. The `piaustralia` method bills a company's standing purchase order: its credential payload is {\"key\": \"piapk_…\"}, an agent payment key a company admin issues at https://piaustralia.com.au/account/company/agent-keys. The order is placed as that admin and invoiced against the purchase order; nothing is charged at payment time.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","description":"No body is required."}}}},"responses":{"201":{"description":"Paid — the order was placed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"200":{"description":"Already paid — the existing order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Checkout"}}}},"402":{"description":"Payment Required"},"403":{"description":"The credential is valid but refused: the order is over the agent payment key's limits, or the purchase order can't take it"},"409":{"description":"The quote went stale (prices, stock or postage moved) — create a new checkout"},"422":{"description":"Can't be paid this way (under the card minimum, or large enough to need review), or the order couldn't be placed and the charge was refunded"},"410":{"description":"The checkout expired — create a new one"},"503":{"description":"Agent payments are not enabled, or the payment outcome is unknown — resend the same credential"}},"x-payment-info":{"offers":[{"intent":"charge","method":"piaustralia","amount":null,"currency":"aud","description":"The checkout total in AUD cents (GST inclusive), billed to a company's standing purchase order with an agent payment key issued by a company admin."}]}}}},"components":{"schemas":{"ProductSummary":{"type":"object","properties":{"handle":{"type":"string"},"title":{"type":"string"},"vendor":{"type":"string"},"product_type":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"in_stock":{"type":"boolean"},"price":{"type":"number"},"compare_at_price":{"type":"number","nullable":true},"price_currency":{"type":"string","example":"AUD"},"url":{"type":"string"},"image_url":{"type":"string","nullable":true},"variant_count":{"type":"integer"},"published_at":{"type":"string","format":"date-time"}}},"Variant":{"type":"object","properties":{"sku":{"type":"string"},"mpn":{"type":"string","nullable":true},"title":{"type":"string"},"price":{"type":"number"},"compare_at_price":{"type":"number","nullable":true},"price_currency":{"type":"string"},"in_stock":{"type":"boolean"},"available_quantity":{"type":"integer"},"option1":{"type":"string","nullable":true},"option2":{"type":"string","nullable":true},"option3":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"weight":{"type":"number","nullable":true},"weight_unit":{"type":"string","nullable":true}}},"Document":{"type":"object","description":"A datasheet, guide, code sample or other resource attached to the product. `link: true` means the URL is a page on another site rather than a file to download.","properties":{"title":{"type":"string"},"type":{"type":"string"},"type_label":{"type":"string"},"url":{"type":"string"},"link":{"type":"boolean"},"file_extension":{"type":"string","nullable":true},"file_size":{"type":"integer","nullable":true},"description":{"type":"string","nullable":true}}},"ProductDetail":{"type":"object","properties":{"product":{"type":"object","properties":{"handle":{"type":"string"},"title":{"type":"string"},"description_html":{"type":"string"},"vendor":{"type":"string"},"product_type":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"in_stock":{"type":"boolean"},"url":{"type":"string"},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"images":{"type":"array","items":{"type":"string"}},"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"average_rating":{"type":"number","nullable":true},"reviews_count":{"type":"integer"}}}}},"ProductList":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/ProductSummary"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}},"CollectionList":{"type":"object","properties":{"collections":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string"},"title":{"type":"string"},"description_html":{"type":"string","nullable":true},"url":{"type":"string"},"product_count":{"type":"integer"}}}}}},"PaginationMeta":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"total_pages":{"type":"integer"}}},"CheckoutRequest":{"type":"object","required":["email","items","shipping_address"],"properties":{"email":{"type":"string","format":"email","description":"Where the order confirmation is sent"},"items":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"object","properties":{"sku":{"type":"string","description":"Variant SKU from GET /products/{handle}"},"variant_id":{"type":"integer"},"quantity":{"type":"integer","minimum":1,"default":1}}}},"shipping_address":{"type":"object","required":["first_name","last_name","address1","city","zip","phone"],"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string","description":"State/territory code, e.g. NSW"},"zip":{"type":"string","description":"Postcode"},"country":{"type":"string","enum":["AU","NZ"],"default":"AU"},"phone":{"type":"string","description":"Mobile number the carrier can SMS (required for AU/NZ delivery)"}}},"shipping_method":{"type":"string","description":"Carrier rate code; the cheapest is used when omitted"},"delivery_instructions":{"type":"string","maxLength":128}}},"Checkout":{"type":"object","required":["id","status","currency","total","total_cents"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["awaiting_payment","complete","expired"]},"currency":{"type":"string","example":"AUD"},"email":{"type":"string"},"items":{"type":"array","items":{"type":"object"}},"shipping":{"type":"object"},"subtotal":{"type":"string"},"shipping_total":{"type":"string"},"total":{"type":"string","description":"Decimal AUD, GST inclusive"},"total_cents":{"type":"integer"},"tax_included":{"type":"string","description":"The GST component of the total"},"expires_at":{"type":"string","format":"date-time"},"order":{"type":["object","null"]},"links":{"type":"object"}}}}},"x-service-info":{"categories":["shopping","electronics"],"docs":{"homepage":"https://piaustralia.com.au/help/public-api","llms":"https://piaustralia.com.au/llms.txt","apiReference":"https://piaustralia.com.au/public-api/v1/openapi.json"}}}