Skip to content

Forms API

Create and manage custom forms for collecting data from your customers.

List Forms

http
GET /api/external/v1/forms

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 15, max: 100)
statusstringFilter: active, inactive
searchstringSearch in name and description
sort_bystringSort field: created_at, name, is_active
sort_dirstringSort order: asc, desc

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/forms?status=active&sort_by=name&sort_dir=asc" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Player Feedback Survey",
      "description": "Help us improve the server",
      "success_message": "Thank you for your feedback!",
      "is_active": true,
      "require_login": false,
      "recaptcha_enabled": true,
      "opens_at": null,
      "closes_at": null,
      "submission_limit": null,
      "status_label": "Active",
      "schedule_info": null,
      "remaining_submissions": null,
      "submissions_count": 42,
      "fields_count": 5,
      "fields": [
        {
          "id": 1,
          "label": "Your Name",
          "name": "player_name",
          "type": "text",
          "placeholder": "Enter your in-game name",
          "options": null,
          "is_required": true,
          "sort_order": 0
        },
        {
          "id": 2,
          "label": "Email Address",
          "name": "email",
          "type": "email",
          "placeholder": "your@email.com",
          "options": null,
          "is_required": true,
          "sort_order": 1
        }
      ],
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "total": 18
  }
}

Get Single Form

http
GET /api/external/v1/forms/{id}

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/forms/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Player Feedback Survey",
    "description": "Help us improve the server",
    "success_message": "Thank you for your feedback!",
    "is_active": true,
    "require_login": false,
    "recaptcha_enabled": true,
    "opens_at": null,
    "closes_at": "2025-02-28T23:59:59Z",
    "submission_limit": 100,
    "inherit_theme_styling": true,
    "styling": null,
    "status_label": "Active",
    "schedule_info": "Closes: Feb 28, 2025 11:59 PM",
    "remaining_submissions": 58,
    "submissions_count": 42,
    "fields": [
      {
        "id": 1,
        "label": "Your Name",
        "name": "player_name",
        "type": "text",
        "placeholder": "Enter your in-game name",
        "options": null,
        "is_required": true,
        "sort_order": 0
      },
      {
        "id": 2,
        "label": "Email Address",
        "name": "email",
        "type": "email",
        "placeholder": "your@email.com",
        "options": null,
        "is_required": true,
        "sort_order": 1
      },
      {
        "id": 3,
        "label": "How would you rate our server?",
        "name": "rating",
        "type": "select",
        "placeholder": null,
        "options": [
          { "value": "excellent", "label": "Excellent" },
          { "value": "good", "label": "Good" },
          { "value": "average", "label": "Average" },
          { "value": "poor", "label": "Poor" }
        ],
        "is_required": true,
        "sort_order": 2
      },
      {
        "id": 4,
        "label": "Additional Comments",
        "name": "comments",
        "type": "textarea",
        "placeholder": "Share your thoughts...",
        "options": null,
        "is_required": false,
        "sort_order": 3
      },
      {
        "id": 5,
        "label": "Subscribe to newsletter",
        "name": "subscribe",
        "type": "checkbox",
        "placeholder": null,
        "options": null,
        "is_required": false,
        "sort_order": 4
      }
    ],
    "fields_count": 5,
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z"
  }
}

Create Form

http
POST /api/external/v1/forms

Request Body

ParameterTypeRequiredDescription
namestringYesForm name (max 255 chars)
descriptionstringNoForm description (max 1000 chars)
success_messagestringNoMessage shown after submission (max 500 chars)
is_activebooleanNoWhether form is active (default: true)
require_loginbooleanNoRequire customer login to submit (default: false)
recaptcha_enabledbooleanNoEnable reCAPTCHA protection (default: false)
opens_atstringNoISO 8601 date when form opens
closes_atstringNoISO 8601 date when form closes (must be after opens_at)
submission_limitintegerNoMaximum number of submissions allowed
inherit_theme_stylingbooleanNoUse store theme styling (default: true)
stylingobjectNoCustom styling options
fieldsarrayYesArray of form fields (min 1)

Field Object

ParameterTypeRequiredDescription
labelstringYesField label (max 255 chars)
namestringYesField name for data storage (max 50 chars, alphanumeric with underscores)
typestringYesField type: text, email, number, textarea, select, checkbox, radio, date
placeholderstringNoPlaceholder text (max 255 chars)
optionsarrayNoOptions for select/radio/checkbox fields
is_requiredbooleanNoWhether field is required (default: false)
sort_orderintegerNoDisplay order (default: 0)

Styling Object

ParameterTypeDescription
background_colorstringHex color code (e.g., "#ffffff")
text_colorstringHex color code
accent_colorstringHex color code
button_colorstringHex color code
button_text_colorstringHex color code
button_textstringSubmit button text (max 50 chars)
border_radiusstringBorder radius value (e.g., "8px")

Example Request

bash
curl -X POST "https://yourstore.pixlpay.net/api/external/v1/forms" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Player Feedback Survey",
    "description": "Help us improve the server",
    "success_message": "Thank you for your feedback!",
    "is_active": true,
    "require_login": false,
    "recaptcha_enabled": true,
    "closes_at": "2025-02-28T23:59:59Z",
    "submission_limit": 100,
    "fields": [
      {
        "label": "Your Name",
        "name": "player_name",
        "type": "text",
        "placeholder": "Enter your in-game name",
        "is_required": true,
        "sort_order": 0
      },
      {
        "label": "Email Address",
        "name": "email",
        "type": "email",
        "placeholder": "your@email.com",
        "is_required": true,
        "sort_order": 1
      },
      {
        "label": "How would you rate our server?",
        "name": "rating",
        "type": "select",
        "options": [
          { "value": "excellent", "label": "Excellent" },
          { "value": "good", "label": "Good" },
          { "value": "average", "label": "Average" },
          { "value": "poor", "label": "Poor" }
        ],
        "is_required": true,
        "sort_order": 2
      }
    ]
  }'

Response

json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Player Feedback Survey",
    "description": "Help us improve the server",
    "success_message": "Thank you for your feedback!",
    "is_active": true,
    "require_login": false,
    "recaptcha_enabled": true,
    "opens_at": null,
    "closes_at": "2025-02-28T23:59:59Z",
    "submission_limit": 100,
    "status_label": "Active",
    "submissions_count": 0,
    "fields": [...],
    "created_at": "2025-01-20T14:30:00Z",
    "updated_at": "2025-01-20T14:30:00Z"
  },
  "message": "Form created successfully"
}

Update Form

http
PUT /api/external/v1/forms/{id}

Request Body

Same parameters as Create Form. All fields are optional - only include fields you want to update.

Example Request

bash
curl -X PUT "https://yourstore.pixlpay.net/api/external/v1/forms/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Feedback Survey",
    "is_active": false,
    "submission_limit": 200
  }'

Response

json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Updated Feedback Survey",
    "is_active": false,
    "submission_limit": 200,
    ...
  },
  "message": "Form updated successfully"
}

Delete Form

http
DELETE /api/external/v1/forms/{id}

Example Request

bash
curl -X DELETE "https://yourstore.pixlpay.net/api/external/v1/forms/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "message": "Form deleted successfully"
}

List Form Submissions

http
GET /api/external/v1/forms/{id}/submissions

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 20, max: 100)
fromstringStart date (YYYY-MM-DD or ISO 8601)
tostringEnd date (YYYY-MM-DD or ISO 8601)
searchstringSearch in submission data
sort_bystringSort field: created_at
sort_dirstringSort order: asc, desc

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/forms/1/submissions?from=2025-01-01&per_page=50" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": {
    "submissions": {
      "data": [
        {
          "id": 1,
          "form_id": 1,
          "customer": {
            "id": 5,
            "email": "player@example.com",
            "name": "Player123"
          },
          "data": {
            "player_name": "CoolPlayer99",
            "email": "player@example.com",
            "rating": "excellent",
            "comments": "Great server!"
          },
          "formatted_data": {
            "Your Name": "CoolPlayer99",
            "Email Address": "player@example.com",
            "How would you rate our server?": "Excellent",
            "Additional Comments": "Great server!"
          },
          "ip_address": "192.168.1.1",
          "user_agent": "Mozilla/5.0...",
          "created_at": "2025-01-18T09:15:00Z"
        }
      ],
      "current_page": 1,
      "last_page": 3,
      "per_page": 20,
      "total": 42
    },
    "form": {
      "id": 1,
      "name": "Player Feedback Survey",
      "fields": [
        { "name": "player_name", "label": "Your Name", "type": "text" },
        { "name": "email", "label": "Email Address", "type": "email" },
        { "name": "rating", "label": "How would you rate our server?", "type": "select" },
        { "name": "comments", "label": "Additional Comments", "type": "textarea" }
      ]
    }
  }
}

Get Single Submission

http
GET /api/external/v1/forms/{form_id}/submissions/{submission_id}

Example Request

bash
curl -X GET "https://yourstore.pixlpay.net/api/external/v1/forms/1/submissions/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "data": {
    "submission": {
      "id": 1,
      "form_id": 1,
      "customer": {
        "id": 5,
        "email": "player@example.com",
        "name": "Player123"
      },
      "data": {
        "player_name": "CoolPlayer99",
        "email": "player@example.com",
        "rating": "excellent",
        "comments": "Great server!"
      },
      "formatted_data": {
        "Your Name": "CoolPlayer99",
        "Email Address": "player@example.com",
        "How would you rate our server?": "Excellent",
        "Additional Comments": "Great server!"
      },
      "ip_address": "192.168.1.1",
      "user_agent": "Mozilla/5.0...",
      "created_at": "2025-01-18T09:15:00Z"
    }
  }
}

Delete Submission

http
DELETE /api/external/v1/forms/{form_id}/submissions/{submission_id}

Example Request

bash
curl -X DELETE "https://yourstore.pixlpay.net/api/external/v1/forms/1/submissions/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json"

Response

json
{
  "success": true,
  "message": "Submission deleted successfully"
}

Form Object

FieldTypeDescription
idintegerUnique identifier
namestringForm name
descriptionstringForm description
success_messagestringMessage shown after submission
is_activebooleanWhether form is active
require_loginbooleanWhether login is required
recaptcha_enabledbooleanWhether reCAPTCHA is enabled
opens_atstringISO 8601 date when form opens
closes_atstringISO 8601 date when form closes
submission_limitintegerMaximum submissions allowed (null = unlimited)
inherit_theme_stylingbooleanWhether to use store theme
stylingobjectCustom styling options
status_labelstringHuman-readable status: Active, Inactive, Scheduled, Closed, Full
schedule_infostringSchedule display text
remaining_submissionsintegerRemaining submissions until limit (null = unlimited)
submissions_countintegerTotal number of submissions
fieldsarrayForm field definitions
fields_countintegerNumber of fields
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

Form Field Object

FieldTypeDescription
idintegerField identifier
labelstringDisplay label
namestringField name (used as key in submission data)
typestringField type: text, email, number, textarea, select, checkbox, radio, date
placeholderstringPlaceholder text
optionsarrayOptions for select/radio/checkbox (each with value and label)
is_requiredbooleanWhether field is required
sort_orderintegerDisplay order

Form Submission Object

FieldTypeDescription
idintegerSubmission identifier
form_idintegerParent form ID
customerobjectCustomer who submitted (if logged in)
dataobjectRaw submission data (field names as keys)
formatted_dataobjectSubmission data with field labels as keys
ip_addressstringSubmitter's IP address
user_agentstringSubmitter's browser user agent
created_atstringISO 8601 timestamp

Required Scopes

EndpointRequired Scope
List formsforms:read
Get formforms:read
Create formforms:write
Update formforms:write
Delete formforms:write
List submissionsforms:read
Get submissionforms:read
Delete submissionforms:write

Errors

StatusErrorDescription
400Bad RequestInvalid request body or parameters
401UnauthorizedInvalid or missing token
403ForbiddenToken lacks required scope
404Not FoundForm or submission doesn't exist
422Unprocessable EntityValidation failed

Built for game developers, by game developers.