{"uid":"cap_dai811EgH3paXXlOlFnL5","slug":"writerslogic-pack-size-quantity-optimizer-7d52540b","name":"WritersLogic Pack Size & Quantity Optimizer","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/pack-size?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"options":{"type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"type":"string","maxLength":80,"minLength":1},"moq":{"type":"integer","maximum":1000000000,"minimum":1,"description":"Minimum order quantity in units."},"increment":{"type":"integer","maximum":1000000000,"minimum":1,"description":"Orders must be a multiple of this many units (default: the pack size)."},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Base price per unit."},"innerUnits":{"type":"integer","maximum":1000000,"minimum":1,"description":"Units per inner pack, for notations that count inner packs."},"breakpoints":{"type":"array","items":{"type":"object","required":["minQty","unitPrice"],"properties":{"minQty":{"type":"integer","maximum":1000000000,"minimum":1},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."}},"additionalProperties":false},"maxItems":20,"description":"Price per unit from minQty units upward (the highest breakpoint reached applies)."},"packNotation":{"type":"string","maxLength":40,"minLength":1,"description":"e.g. \"6x100\", \"case of 12\", \"12/case\", \"case of 6 inners\"."},"unitsPerPack":{"type":"integer","maximum":1000000000,"minimum":1,"description":"Settles an ambiguous packNotation; a value that matches no reading of the notation fails."}},"additionalProperties":false},"maxItems":50,"minItems":1},"requested":{"type":"integer","maximum":1000000000,"minimum":1,"description":"Units needed."},"overbuyCapPercent":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Reject orders exceeding the request by more than this percent."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_PZ1xbAp-_o3x-TNe0WVur","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Finds the cheapest valid order quantity across up to 50 supplier options, accounting for pack sizes, minimum order quantities, order increments, and price breakpoints.","exampleAgentPrompt":"I need 500 units of that fastener — compare these three suppliers: Supplier A sells in packs of 12 at $0.80/unit with a 60-unit MOQ, Supplier B sells in cases of 25 at $0.75/unit with no MOQ, and Supplier C does 6x100 packs at $0.70/unit but has a 100-unit MOQ and volume price of $0.65/unit from 600 units. Don't let me overbuy by more than 15%. Which is cheapest?","exampleUseCases":[{"title":"Cheapest consumable supplier for production run","prompt":"I need to order 1,200 latex gloves for a production run. Supplier A sells boxes of 100 at $8.50/unit with a 200-unit MOQ; Supplier B sells cases of 50 at $9.00/unit, no MOQ, but drops to $8.00/unit over 500 units; Supplier C sells cases of 200 at $7.75/unit with a 400-unit MOQ. Keep overbuy under 10%. Which supplier gives me the cheapest valid order?"},{"title":"Electronic components with pack and increment constraints","prompt":"I need 750 resistors. Option 1 is sold in strips of 25, $0.05/unit, 100-unit MOQ, 25-unit increment. Option 2 is sold in reels of 500 at $0.04/unit. Option 3 is in packs of 10 at $0.06/unit, drops to $0.045/unit from 500 units. No overbuy cap. What's the cheapest valid quantity and total cost across those options?"},{"title":"Catering supplies bulk order comparison","prompt":"I need 300 paper cups for an event. Supplier 1 sells sleeves of 50 at $0.12/unit, minimum 100 units. Supplier 2 sells cases of 100 at $0.10/unit, no minimum. Supplier 3 sells packs of 24 at $0.11/unit with a price break to $0.09/unit at 288 units. I can overbuy by up to 20%. Which option ends up cheapest after rounding to pack sizes?"}],"resultDescription":"Returns the cheapest valid order option including the rounded-up order quantity, total cost, the supplier option ID selected, the unit price tier applied, and the percentage of overbuy. Options with ambiguous pack notations that cannot be resolved to a fixed unit count are returned with unknown status. Options exceeding the overbuy cap are rejected.","failureModes":["Ambiguous pack notation (e.g. '6x100g') with no unitsPerPack provided returns unknown status for that option","unitsPerPack value that matches no valid reading of the packNotation causes a failure for that option","All options exceed the overbuyCapPercent threshold, resulting in no valid option returned","Invalid or negative prices in breakpoints or unitPrice","Requested quantity of zero or negative (schema minimum is 1)","More than 50 options submitted (schema maximum is 50)","JSON numbers used for price fields instead of decimal strings are rejected"],"whenToPreferThis":"Use this endpoint when an AI agent is purchasing parts or consumables from suppliers that sell in fixed pack sizes, have minimum order quantities, order increments, or volume price breakpoints, and you need to determine the cheapest compliant order quantity. It is specifically designed for the rounding-up logic inherent in pack-based procurement and multi-supplier comparison. It is not appropriate for real-time stock checks, lead time queries, or free-unit pricing without pack constraints.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:37:38.909Z","isFirstParty":false,"canonicalSlug":"writerslogic-pack-size-quantity-optimizer-7d52540b"}