API ReferenceEndpointsCustomersCreate inquiry

Create inquiry

Submits a contact-form message to the merchant. Two payload shapes are accepted. The modern one is formKey plus a fields object keyed by the field keys returned by GET /contact-forms/{formKey} — every value is re-validated against that schema server-side and unknown keys are stripped. The legacy flat shape (name, email, subject, message, phone) is still accepted for older storefronts. A request may send both; fields wins and the flat fields fill in whatever it omits.

No authentication. Include the honeypot field in your markup as a hidden, empty input — any non-empty value rejects the request. Rate limited to 3 submissions per minute, which is deliberately tight: this route mails the merchant.

POST
/vc/{connectionId}/inquiries
X-Sales-Channel-Origin<token>

For /api/vc/{connectionId}/* routes the connectionId (vc_*) is in the URL path — not a header. Live-mode requests must also send a matching Origin header.

In: header

Path Parameters

connectionIdstring

Sales channel ID (vc_*), the canonical salesChannelId. connectionId is the deprecated name of the same value and is still the literal path segment.

Header Parameters

originstring

Origin of the storefront page making the call, for example https://shop.example.com. Required: a request with no Origin header is refused with 403. On a LIVE channel its host must equal the channel's registered domain (or one of its subdomains) or match an allowed origin. A TEST channel with no domain accepts any origin; once a domain is set it is matched as on LIVE.

X-SDK-Version?string

Version of the calling SDK (the Brainerce SDK sends it automatically). Informational: it is recorded on the channel and never changes the response.

name?string

Sender name. Legacy flat shape — prefer fields keyed by the form schema. Mirrored onto the same column fields.name writes, so sending both is redundant, not additive.

Length1 <= length <= 120
email?string

Sender email, so the merchant can reply. Legacy flat shape — prefer fields.

Lengthlength <= 254
subject?string

Subject line. Legacy flat shape — prefer fields.

Length1 <= length <= 200
message?string

Message body. Legacy flat shape — prefer fields.

Length1 <= length <= 10000
phone?string

Sender phone number, when the form collects one. Legacy flat shape.

Lengthlength <= 40
formKey?string

Which contact form this submission belongs to, as listed by GET /contact-forms. Defaults to main. Lowercase letters, digits, _ and -; must start with a letter.

Match^[a-z][a-z0-9_-]{0,39}$
fields?object

The submitted values, keyed by the field keys from GET /contact-forms/{formKey}. Every value is re-validated against that form's schema server-side and any key the schema does not declare is STRIPPED SILENTLY — a form built from a stale schema loses those values without an error. This is the preferred shape; the flat fields above exist only for older storefronts.

locale?string

Storefront locale at submission time (e.g. "he"). Sets the language of the confirmation email and how the inquiry is displayed to the merchant. Falls back to the store language.

Lengthlength <= 10
sourceMetadata?object

Free-form JSON object of your own choosing: referrer, UTM parameters, the page the form sat on. Stored as JSON for your own reporting, never interpreted.

customerId?string

Logged-in customer this inquiry belongs to, when the storefront knows one. Optional — contact forms are open to guests.

Lengthlength <= 120
metadata?object

Free-form JSON object of your own choosing, stored alongside the inquiry and never interpreted.

honeypot?string

Anti-bot honeypot. Render it hidden and leave it empty; a filled value rejects the request. Bots complete every text input, humans never see this one.

curl -X POST "https://api.brainerce.com/api/vc/string/inquiries" \  -H "origin: string" \  -H "X-SDK-Version: string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "clinq_abc123",
  "status": "NEW",
  "createdAt": "2026-01-15T10:30:00.000Z"
}

{
  "statusCode": 400,
  "code": "VALIDATION_FAILED",
  "message": "name should not be empty, price must be a positive number",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/inquiries"
}

{
  "statusCode": 403,
  "code": "INSUFFICIENT_SCOPE",
  "message": "API key does not have the required scope: products:write",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/inquiries"
}

{
  "statusCode": 404,
  "code": "RESOURCE_NOT_FOUND",
  "message": "Resource not found",
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/inquiries"
}

{
  "statusCode": 429,
  "code": "RATE_LIMITED",
  "message": "Too many requests",
  "details": {
    "retryAfterSeconds": 12
  },
  "timestamp": "2026-08-23T10:15:00.000Z",
  "path": "/api/vc/{connectionId}/inquiries"
}