create_buy_request
Post a public buy request — an ad asking suppliers to reach out.
Use when the user wants others to know they're looking to buy
something. **Independent of personal inventory** — inventory is the
user's private workshop tracking; a buy request is a sales-facing
ad on the public demand feed at /wanted.
Authenticated. Required OAuth scope: ``inventory:write``.
**Not idempotent** — each call creates a new public post.
Args:
name: Short scannable headline ("Looking for X"). Required.
description: Plain text long-form — specs, constraints, delivery
preference. The supplier reads this to decide whether they
can fulfil.
quantity: How many units the poster wants. Default 1.
max_price: Optional ceiling per unit.
currency: Currency for max_price (default €).
contact: Free-form contact (email/phone/Telegram/etc.) shown
publicly. Optional. Without it, suppliers can only respond
via whatever channels you separately make available.
reference_url: Link to a sample/datasheet/manufacturer page.
product_id: Link to a canonical Partle product if asking for a
specific known SKU.
api_key: Optional API key (`pk_*`, generate at /account).
Used when there is no OAuth token, and also when the OAuth
token lacks the required scope — an explicitly passed key
overrides an ambient token that is scoped too narrowly.
An invalid or revoked token still fails regardless.
Returns:
The newly-created buy request, or ``{"error": ...}``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| api_key | No | ||
| contact | No | ||
| currency | No | € | |
| quantity | No | ||
| max_price | No | ||
| product_id | No | ||
| description | No | ||
| reference_url | No |