POSTPath:
/api/price-requestsContent-Type:
multipart/form-data
This endpoint is rate-limited to 10 requests per 600 seconds per IP address using a local SQLite database (better-sqlite3). Exceeding the limit returns HTTP 429.
Request
The request body must bemultipart/form-data with the following parts:
Form parts
JSON-serialised object matching the payload schema below. Must be sent as a
text/plain or application/json multipart part named payload.Optional file attachment. Accepted MIME types:
application/pdf, image/jpeg, image/png, image/svg+xml, application/zip, application/postscript. Maximum size: 25 MB.Category of the uploaded file. One of:
design, brief, proof, final, other.Payload schema
Thepayload part must be a JSON string with the following fields:
Customer full name. Between 2 and 80 characters.
Customer email address. Maximum 120 characters.
Customer phone number. Optional.
Company or organisation name. Optional.
Free-text message or brief description of the job. Maximum 4,000 characters.
Slug of the product category (e.g.
gran-formato). Between 1 and 120 characters.Product information.
Arbitrary key-value pairs for product-specific form fields (e.g. dimensions, quantity). Defaults to
{}.Must be
true. The form requires explicit GDPR consent before submission.Full URL of the page where the form was submitted. Between 1 and 300 characters.
UTM tracking parameters (e.g.
utm_source, utm_medium). Optional.Initial status to write to the CRM list. Defaults to
"Nova" if not provided.Honeypot field. Leave empty. If this field has any value the server silently returns
200 OK without creating a record.Response
200 OK
true when the request was accepted.true if an identical request (same email + product) was already registered.SharePoint List item ID of the created (or existing) record.
Unique request key used to name the attachment folder (e.g.
pr-2026-03-abc123).File upload result, or
null if no file was attached.Human-readable confirmation message (in Catalan).
Error responses
| Status | Cause |
|---|---|
400 | Missing or invalid payload, failed Zod validation, or consent is false |
429 | Rate limit exceeded (10 requests per 600 s per IP) |
500 | Upstream SharePoint or email error |
Example
Vue composable
TheusePriceRequests composable wraps this endpoint and manages loading/error state:
FormData object and uses $fetch with method: "POST". Toast notifications (via vue-sonner) are shown automatically for loading, success, and error states.