{"openapi":"3.1.0","info":{"title":"arakhne agent API","description":"arakhne.in sells one-of-a-kind printed merch: tees, oversized tees, hoodies, sweatshirts, kids' wear, posters and more, printed on demand in India and shipped across India. Every design is a 1 of 1: it sells once, then retires.\n\nHow to order:\n1. Search designs (GET /designs) or list products (GET /products).\n2. Price the cart with POST /quote and tell the buyer the total.\n3. Check the pincode with GET /delivery/{pincode}.\n4. With the buyer's OK, POST /phone-codes texts a code to the parcel's phone.\n5. The buyer reads the code back; POST /orders places the order.\n6. Cash on delivery for a trusted buyer is confirmed at once. Anything due online comes back as pay_link on arakhne.in: give it to the buyer. Never collect card or UPI details yourself.","version":"1.0.0"},"paths":{"/agent/v1":{"get":{"tags":["agent"],"summary":"What this API is and how to order","operationId":"index_agent_v1_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/v1/products":{"get":{"tags":["agent"],"summary":"Product types you can buy, with sizes, colours and prices","operationId":"products_agent_v1_products_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}}}}},"/agent/v1/designs":{"get":{"tags":["agent"],"summary":"Search live designs","operationId":"designs_agent_v1_designs_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What the buyer wants, in plain words: 'tiger', 'minimal line art', 'Diwali'","title":"Q"},"description":"What the buyer wants, in plain words: 'tiger', 'minimal line art', 'Diwali'"},{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Product id from /products","title":"Product"},"description":"Product id from /products"},{"name":"color","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only designs offered in this colour","title":"Color"},"description":"Only designs offered in this colour"},{"name":"max_price","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Highest price in rupees","title":"Max Price"},"description":"Highest price in rupees"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":12,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignSearch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/designs/{design_id}":{"get":{"tags":["agent"],"summary":"One design: products, colours, sizes, mockups, price","operationId":"design_agent_v1_designs__design_id__get","parameters":[{"name":"design_id","in":"path","required":true,"schema":{"type":"integer","title":"Design Id"}},{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignCard"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/designs/{design_id}/mockup":{"get":{"tags":["agent"],"summary":"A mockup image of a design on a product and colour","operationId":"mockup_agent_v1_designs__design_id__mockup_get","parameters":[{"name":"design_id","in":"path","required":true,"schema":{"type":"integer","title":"Design Id"}},{"name":"product","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product"}},{"name":"color","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"}},{"name":"view","in":"query","required":false,"schema":{"type":"string","description":"Front or Back","default":"Front","title":"View"},"description":"Front or Back"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mockup"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/delivery/{pincode}":{"get":{"tags":["agent"],"summary":"Whether we deliver to an Indian pincode","operationId":"delivery_agent_v1_delivery__pincode__get","parameters":[{"name":"pincode","in":"path","required":true,"schema":{"type":"string","title":"Pincode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delivery"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/quote":{"post":{"tags":["agent"],"summary":"Exact price of a cart, the same number the site charges","operationId":"quote_agent_v1_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/phone-codes":{"post":{"tags":["agent"],"summary":"Text a one-time code to the buyer's phone, to confirm an order","operationId":"phone_code_agent_v1_phone_codes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeSent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/orders":{"post":{"tags":["agent"],"summary":"Place an order, once the buyer has read back their SMS code","operationId":"place_order_agent_v1_orders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPlaced"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/v1/orders/{order_id}":{"get":{"tags":["agent"],"summary":"Status of an order placed through this API","operationId":"order_status_agent_v1_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}},{"name":"key","in":"query","required":true,"schema":{"type":"string","description":"order_key from POST /orders","title":"Key"},"description":"order_key from POST /orders"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CodeRequest":{"properties":{"phone":{"type":"string","title":"Phone","description":"The parcel's 10-digit Indian mobile number"}},"type":"object","required":["phone"],"title":"CodeRequest"},"CodeSent":{"properties":{"code_request":{"type":"string","title":"Code Request","description":"Pass back to /orders with the code the buyer reads out"},"sent_to":{"type":"string","title":"Sent To"},"code_length":{"type":"integer","title":"Code Length"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"},"note":{"type":"string","title":"Note"}},"type":"object","required":["code_request","sent_to","code_length","expires_in_seconds","note"],"title":"CodeSent"},"Color":{"properties":{"name":{"type":"string","title":"Name"},"hex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hex"}},"type":"object","required":["name"],"title":"Color"},"Delivery":{"properties":{"pincode":{"type":"string","title":"Pincode"},"serviceable":{"type":"boolean","title":"Serviceable"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"cash_on_delivery":{"type":"boolean","title":"Cash On Delivery"},"note":{"type":"string","title":"Note"}},"type":"object","required":["pincode","serviceable","cash_on_delivery","note"],"title":"Delivery"},"DesignCard":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description","default":""},"url":{"type":"string","title":"Url","description":"The design's page on arakhne.in"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image","description":"Mockup of the design on its product"},"mockups":{"items":{"type":"string"},"type":"array","title":"Mockups","default":[]},"product":{"type":"string","title":"Product","description":"The product the price is for"},"product_name":{"type":"string","title":"Product Name"},"price_inr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Inr","description":"Price in rupees, tax included, before cart discounts"},"colors":{"items":{"type":"string"},"type":"array","title":"Colors","default":[]},"default_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Color"},"sizes":{"items":{"type":"string"},"type":"array","title":"Sizes","default":[]},"sizes_by_color":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Sizes By Color","default":{}},"products":{"items":{"$ref":"#/components/schemas/DesignProduct"},"type":"array","title":"Products","description":"Every product this design can be printed on","default":[]},"one_of_one":{"type":"boolean","title":"One Of One","description":"Every design sells once, then retires","default":true}},"type":"object","required":["id","title","url","product","product_name"],"title":"DesignCard"},"DesignProduct":{"properties":{"product":{"type":"string","title":"Product"},"name":{"type":"string","title":"Name"},"price_inr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Inr"}},"type":"object","required":["product","name"],"title":"DesignProduct"},"DesignSearch":{"properties":{"designs":{"items":{"$ref":"#/components/schemas/DesignCard"},"type":"array","title":"Designs"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"},"note":{"type":"string","title":"Note"}},"type":"object","required":["designs","note"],"title":"DesignSearch"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Item":{"properties":{"design_id":{"type":"integer","title":"Design Id"},"product":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product","description":"Product id from /products; default: the design's main product"},"color":{"type":"string","title":"Color"},"size":{"type":"string","title":"Size"},"qty":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Qty","default":1}},"type":"object","required":["design_id","color","size"],"title":"Item"},"Mockup":{"properties":{"design_id":{"type":"integer","title":"Design Id"},"product":{"type":"string","title":"Product"},"color":{"type":"string","title":"Color"},"view":{"type":"string","title":"View"},"url":{"type":"string","title":"Url"}},"type":"object","required":["design_id","product","color","view","url"],"title":"Mockup"},"OrderPlaced":{"properties":{"order_id":{"type":"integer","title":"Order Id"},"order_ids":{"items":{"type":"integer"},"type":"array","title":"Order Ids"},"order_key":{"type":"string","title":"Order Key","description":"Pass to GET /orders/{order_id}?key= to check status"},"status":{"type":"string","enum":["confirmed","awaiting_payment"],"title":"Status"},"payment":{"type":"string","title":"Payment"},"total_inr":{"type":"integer","title":"Total Inr"},"pay_now_inr":{"type":"integer","title":"Pay Now Inr","description":"Due online now, at pay_link"},"pay_on_delivery_inr":{"type":"integer","title":"Pay On Delivery Inr"},"pay_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pay Link"},"status_url":{"type":"string","title":"Status Url"},"message":{"type":"string","title":"Message"}},"type":"object","required":["order_id","order_ids","order_key","status","payment","total_inr","pay_now_inr","pay_on_delivery_inr","status_url","message"],"title":"OrderPlaced"},"OrderRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Item"},"type":"array","maxItems":10,"minItems":1,"title":"Items"},"shipping":{"$ref":"#/components/schemas/ShippingAddress"},"payment":{"type":"string","enum":["prepaid","cod"],"title":"Payment","default":"prepaid"},"code_request":{"type":"string","title":"Code Request"},"code":{"type":"string","title":"Code","description":"The code the buyer received by SMS"}},"type":"object","required":["items","shipping","code_request","code"],"title":"OrderRequest"},"OrderStatus":{"properties":{"order_id":{"type":"integer","title":"Order Id"},"status":{"type":"string","title":"Status"},"summary":{"type":"string","title":"Summary"},"payment":{"type":"string","title":"Payment"},"total_inr":{"type":"integer","title":"Total Inr"},"pay_on_delivery_inr":{"type":"integer","title":"Pay On Delivery Inr"},"pay_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pay Link"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["order_id","status","summary","payment","total_inr","pay_on_delivery_inr","items"],"title":"OrderStatus"},"ProductList":{"properties":{"products":{"items":{"$ref":"#/components/schemas/ProductType"},"type":"array","title":"Products"},"note":{"type":"string","title":"Note"}},"type":"object","required":["products","note"],"title":"ProductList"},"ProductType":{"properties":{"product":{"type":"string","title":"Product","description":"Product id to pass as `product` elsewhere, e.g. classic_tee"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"},"price_from_inr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price From Inr","description":"Lowest price of a design on this product, in rupees, tax included"},"price_to_inr":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price To Inr"},"sizes":{"items":{"type":"string"},"type":"array","title":"Sizes"},"colors":{"items":{"$ref":"#/components/schemas/Color"},"type":"array","title":"Colors"},"sizes_by_color":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Sizes By Color","description":"In-stock sizes per colour"},"specs":{"additionalProperties":true,"type":"object","title":"Specs","default":{}}},"type":"object","required":["product","name","category","sizes","colors","sizes_by_color"],"title":"ProductType"},"Quote":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/QuoteLine"},"type":"array","title":"Lines"},"payment":{"type":"string","title":"Payment"},"subtotal_inr":{"type":"integer","title":"Subtotal Inr"},"discount_inr":{"type":"integer","title":"Discount Inr","description":"Bundle, online-payment and first-order discounts together"},"fees_inr":{"type":"integer","title":"Fees Inr","description":"Cash-on-delivery and other fees together"},"total_inr":{"type":"integer","title":"Total Inr"},"breakdown":{"additionalProperties":true,"type":"object","title":"Breakdown"},"orderable":{"type":"boolean","title":"Orderable"},"problems":{"items":{"type":"string"},"type":"array","title":"Problems","default":[]}},"type":"object","required":["lines","payment","subtotal_inr","discount_inr","fees_inr","total_inr","breakdown","orderable"],"title":"Quote"},"QuoteLine":{"properties":{"design_id":{"type":"integer","title":"Design Id"},"title":{"type":"string","title":"Title"},"product":{"type":"string","title":"Product"},"color":{"type":"string","title":"Color"},"size":{"type":"string","title":"Size"},"qty":{"type":"integer","title":"Qty"},"unit_price_inr":{"type":"integer","title":"Unit Price Inr"},"orderable":{"type":"boolean","title":"Orderable"},"problem":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Problem"}},"type":"object","required":["design_id","title","product","color","size","qty","unit_price_inr","orderable"],"title":"QuoteLine"},"QuoteRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Item"},"type":"array","maxItems":10,"minItems":1,"title":"Items"},"payment":{"type":"string","enum":["prepaid","cod"],"title":"Payment","default":"prepaid"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Buyer's 10-digit Indian mobile, if known: first-order discounts depend on it"}},"type":"object","required":["items"],"title":"QuoteRequest"},"ShippingAddress":{"properties":{"name":{"type":"string","title":"Name"},"phone":{"type":"string","title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"address1":{"type":"string","title":"Address1"},"address2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address2"},"city":{"type":"string","title":"City"},"state":{"type":"string","title":"State"},"pincode":{"type":"string","title":"Pincode"}},"type":"object","required":["name","phone","address1","city","state","pincode"],"title":"ShippingAddress"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"servers":[{"url":"https://api.arakhne.in"}],"externalDocs":{"url":"https://www.arakhne.in/agents"}}