Lantern
REST API/Forms API

Submit a Form

Submit an entry to a form. A customer must be logged in to submit a form.

POST
/form/{handle}

Path Parameters

handlestring

The unique handle of the form.

Query Parameters

locale?string | null

Optional. The locale for the submission (e.g., 'en-US'). Defaults to the browser's Accept-Language header or 'en-us'.

Defaultnull
profile:first-name?string

Example profile field for first name

profile:last-name?string

Example profile field for last name

profile:email?string

Example profile field for email

profile:phone?string

Example profile field for phone number in E.164 format.

profile:accepts-marketing?boolean

Example profile field for marketing consent

profile:birth-date?string

Example profile field for birth date in YYYY-MM-DD format.

attribute:favorite-color?string

Example attribute field for favorite color

custom-field?string

Example custom field

Response Body

curl -X POST "https://yourstore.myshopify.com/a/lantern/form/string" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "success": true,
  "eventId": "evt_12345abcde",
  "data": {
    "profile:first-name": "John",
    "profile:last-name": "Doe",
    "profile:email": "john.doe@example.com",
    "profile:phone": "+1234567890",
    "profile:accepts-marketing": true,
    "profile:birth-date": "1990-01-01",
    "attribute:favorite-color": "blue",
    "custom-field": "custom-value"
  }
}
{
  "error": "Invalid app proxy request"
}
{
  "error": "Handle is required"
}
{
  "success": false,
  "errors": {
    "GENERAL_ERROR": "The form submission failed due to an unknown error",
    "profile:email": "Please enter a valid email address.",
    "attribute:favorite-color": "This field is required."
  }
}