Redstone API Documentation
Use the Create Order API to submit standardized print and mail orders with downloadable production files. Successful sandbox responses include the generated Redstone job number; production responses confirm the client order identifier.
Quick Start
The minimum path for creating an order.
- Authenticate the request. Add the assigned API key to the endpoint query string.
- Send a JSON or XML object. Include every required core field and each field required by the selected job type.
-
Provide remote files.
Every order requires at least one downloadable
datafile. -
Use a unique order ID.
An
idmay only be used once per authenticated company.
Endpoint and Authentication
Create Order uses a single authenticated POST endpoint for JSON, XML, and form-encoded requests.
Send requests to
https://redstonemail.com/apis/createOrder?API=YOUR_API_KEY using
POST. Your
assigned API key is provided in the API
query parameter and identifies the company that owns
the order. JSON requests should use
Content-Type: application/json; XML
requests should use application/xml,
text/xml, or another content type
containing xml. Standard form submissions
and URL-encoded POST bodies are also parsed.
?format=json or ?format=xml
takes priority. Otherwise the endpoint checks the
Accept header, then an XML request
Content-Type; JSON is the default response.
https://redstonemail.com/apis/createOrder?API=YOUR_API_KEY
lightning_id is submitted, the authenticated
client must be enabled for Lightning and the supplied
lightning_id must resolve to an existing
Lightning configuration available to that client.
Your First Request
A simple path from credentials to a verified sandbox order.
Use the API key assigned for testing so your first integration request cannot release a production order.
Supply the required order fields and a unique
id.
Provide a direct HTTP or HTTPS URL that the Redstone server can download without an interactive login.
Send JSON or XML to the Create Order endpoint with your API key in the query string.
A successful sandbox request returns HTTP
201 with the generated job
number, the stored ext_id that
corresponds to your submitted id,
the api_test flag, and an order URL.
Request Fields
Unknown top-level fields are rejected. Submit only fields listed in this documentation.
Required Fields
| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
id |
string | Yes | 1–100 characters. Letters, numbers, spaces, periods, hyphens, underscores, and slashes only. | Your unique order identifier. Duplicate values are rejected within the authenticated company. |
name |
string | Yes | Maximum 255 characters. | Human-readable order name. |
duedate |
string | Yes | YYYY-MM-DD. Cannot be earlier than the current date. | Requested due date. |
jobtype |
string | Yes | Letter, Post Card, Snap Pack, or Self Mailer. | Determines which job-specific fields are required. |
qty_est |
integer | Yes | Whole number greater than zero. | Estimated production quantity. |
notes |
string | Yes | May not be null or an empty string. | Order instructions or production notes. |
api_test |
boolean | No | true, false | Requests test processing. A test-only API credential always forces test mode. |
Accepted Request Shapes
Fields may be submitted at the top level or inside
an Order object. The public identifier
is id. The alias ext_id is
accepted only when id is omitted or
when both values are identical. Authentication
fields named API, api, or
api_key are removed from order data.
Required Fields For Given Job-Types
| Job Type | Field | Type | Required | Allowed Value | Description |
|---|---|---|---|---|---|
| Letter | custom_envelope |
boolean | Yes | true, false | States whether the letter uses a custom envelope. |
| Letter | num_inserts |
integer | Yes | 0–6 | Number of inserts included with the letter. |
| Post Card | postcardH |
float | Yes | Greater than 0 | Postcard height in inches. |
| Post Card | postcardW |
float | Yes | Greater than 0 | Postcard width in inches. |
| Snap Pack | fold_type |
string | Yes | Half-Fold, C-Fold, or Z-Fold | Required fold configuration. |
| Snap Pack | snap_seal |
string | Yes | Pressure Seal | Required sealing method. |
| Self Mailer | fold_type |
string | Yes | Half-Fold or C-Fold | Required fold configuration. |
| Self Mailer | snap_seal |
string | Yes | Converted | Required sealing method. |
Optional Request Fields
| Field | Type | Allowed Values | Description |
|---|---|---|---|
lightning_id |
string | Existing authorized Lightning configuration ID | Optional. Uses a Lightning configuration for the order. The authenticated client must be enabled for Lightning, and the supplied lightning_id must resolve to an existing Lightning configuration available to that client. |
color |
string | 1/0, 1/1, 4/0, 4/1, 4/4 | Specifies the color configuration for the front and back of the printed piece. The first number represents the front side and the second number represents the back side. 1/0 = one color on the front and blank on the back; 1/1 = one color on both sides; 4/0 = full color (CMYK) on the front and blank on the back; 4/1 = full color (CMYK) on the front and one color on the back; 4/4 = full color (CMYK) on both sides. |
papertype |
string | #20, #60, #67.5 Vellum, #70, #80 Text, #80 Gloss Cover, #100 Cover, #100 Gloss Cover, #100 Gloss Book, Custom | Specifies the paper type or weight for the printed piece. |
envelopetype |
string | Single Window, Double Window, Custom | Specifies the envelope type for jobs that use an envelope. |
bleeds |
boolean | true, false | Indicates whether artwork includes bleeds. |
purls |
boolean | true, false | Enables personalized URLs. |
qr_code |
boolean | true, false | Indicates QR-code processing. |
streetview |
boolean | true, false | Indicates Street View processing. |
response_boost |
boolean | true, false | Indicates Response Boost processing. |
permit_number |
string | Client-provided value | Mail permit number. |
postage_class |
string | First Class, First Class Pre-Sort, Standard, Full Rate | Postage class. |
postage_type |
string | Permit, Permit Imprint, Stamp | Postage payment type. |
dist_type |
string | PMOD, Will Call, Drop Ship, Priority Direct, Co-Mingle, None | Distribution method. |
release_hours |
integer | 0–168 | Optional delay, in hours, before the job is released to the CSR team. |
lightning_id is optional. When supplied,
the authenticated client must be enabled for Lightning,
and the referenced Lightning configuration must exist
and be available to that client.
Remote Files
Files are downloaded and validated before the order record is created.
| Type | Required | Allowed Extensions | Description |
|---|---|---|---|
data |
At least one | csv, txt, tsv, xlsx, xls | Primary production data. At least one data file is required for every order. |
suppression |
No | csv, txt, tsv, xlsx, xls | Optional suppression data. |
art |
No | pdf, jpg, jpeg, png, tif, tiff, zip | Optional artwork or artwork package. |
http:// or
https://. Embedded URL credentials, local
hosts, and private or reserved network destinations are
rejected.
File Rules
- Only complete
http://andhttps://URLs are accepted. - Each URL may be no longer than 2,048 characters.
- Credentials may not be embedded in the URL.
- The hostname must resolve and may not point to localhost, a
.localhost, or a private/reserved address. - Redirects are followed up to three times and the final destination is validated again.
- Each file must return an HTTP status from 200 through 299.
- Each file must be non-empty and no larger than 1 GB.
- The URL path must provide a filename with one of the supported extensions shown above.
- Connection timeout is 15 seconds; total download timeout is 120 seconds.
- Data and suppression file MIME types are checked, but their column/header structure is not validated by this endpoint.
File Payload Formats
Submit direct file fields as a single URL or an
array of URLs. Alternatively, use the
files array with type and
url in each entry. Each
type must be exactly
data, suppression, or
art. Both forms may be used in one
request.
{
"files": [
{
"type": "data",
"url": "https://files.example.com/orders/10025/data.csv"
},
{
"type": "suppression",
"url": "https://files.example.com/orders/10025/suppression.csv"
},
{
"type": "art",
"url": "https://files.example.com/orders/10025/artwork.pdf"
}
]
}
Seed Addresses
Optional seed records must use the exact schema below.
| Field | Required | Validation |
|---|---|---|
fname | Yes | Non-empty value |
lname | Yes | Non-empty value |
address | Yes | Non-empty value |
city | Yes | Non-empty value |
state | Yes | Two uppercase letters |
zip | Yes | 12345 or 12345-1234 |
A single seed object or an array of seed objects is accepted. Unknown fields inside a seed record are rejected.
Test Mode (Sandbox Environment)
Test status is resolved from both the API credential and the request.
| API Credential | Request api_test |
Result |
|---|---|---|
| Test | Any value or omitted | Test order |
| Production | true | Test order |
| Production | false or omitted | Production order |
Missing api_test account flag | Any value | Test order |
Malformed api_test account flag | Any value | Request fails |
Test orders are stored with api_test
enabled. Their names are prefixed with
API Test: unless that prefix is already
present.
Request Examples
These examples use only fields accepted by the current service.
{
"id": "CLIENT-ORDER-10025",
"name": "August Renewal Letter",
"duedate": "2026-10-02",
"jobtype": "Letter",
"qty_est": 2500,
"notes": "Process the attached data and artwork.",
"custom_envelope": false,
"num_inserts": 1,
"color": "4/4",
"papertype": "#80 Text",
"envelopetype": "Single Window",
"bleeds": true,
"postage_class": "First Class Pre-Sort",
"postage_type": "Permit Imprint",
"dist_type": "Co-Mingle",
"api_test": true,
"seeds": [
{
"fname": "Jane",
"lname": "Doe",
"address": "123 Main Street",
"city": "Reno",
"state": "NV",
"zip": "89501"
}
],
"data": [
"https://files.example.com/orders/10025/data.csv"
],
"art": [
"https://files.example.com/orders/10025/letter.pdf"
]
}
<?xml version="1.0" encoding="UTF-8"?>
<Order>
<id>CLIENT-ORDER-10025</id>
<name>August Renewal Letter</name>
<duedate>2026-10-02</duedate>
<jobtype>Letter</jobtype>
<qty_est>2500</qty_est>
<notes>Process the attached data and artwork.</notes>
<custom_envelope>false</custom_envelope>
<num_inserts>1</num_inserts>
<color>4/4</color>
<papertype>#80 Text</papertype>
<envelopetype>Single Window</envelopetype>
<bleeds>true</bleeds>
<api_test>true</api_test>
<seeds>
<seed>
<fname>Jane</fname>
<lname>Doe</lname>
<address>123 Main Street</address>
<city>Reno</city>
<state>NV</state>
<zip>89501</zip>
</seed>
</seeds>
<data>https://files.example.com/orders/10025/data.csv</data>
<art>https://files.example.com/orders/10025/letter.pdf</art>
</Order>
Responses
Successful production and sandbox requests return different response data.
A successful order creation returns HTTP
201 Created. Production responses confirm
the client-supplied order identifier. Sandbox responses
additionally return the generated Redstone job number,
the api_test flag, and an internal order
URL so the test order can be reviewed.
?format=xml or an
XML Accept header to request XML. XML
responses are wrapped in a <response>
root element.
{
"success": true,
"environment": "production",
"message": "Production order created successfully.",
"data": {
"ext_id": "CLIENT-ORDER-10025"
}
}
{
"success": true,
"environment": "sandbox",
"message": "Sandbox order created successfully.",
"data": {
"job_id": "13761",
"ext_id": "CLIENT-ORDER-10025",
"api_test": true,
"url": "https://development.redstonemail.com/orders/view/6a6cf20f4fc07ee14b8b4567"
}
}
{
"success": false,
"environment": "production",
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "The production order could not be created because of an internal error.",
"reference_id": "api_64f0000000000.00000000"
}
}
{
"success": false,
"environment": "production",
"error": {
"code": "EMPTY_REQUEST",
"message": "The production request body is empty or missing."
}
}
HTTP Status Codes
| Status | Meaning |
|---|---|
201 | Order created successfully. |
400 | Empty request body or a request explicitly classified as invalid by the controller. |
401 | Request classified as unauthorized by the controller. |
405 | HTTP method is not allowed. Create Order requires POST. |
422 | A structured validation error reaches the controller. |
500 | All other exceptions. The response includes a generated reference_id. |
503 | Endpoint is temporarily unavailable for maintenance. |
Standard Endpoint Limits
The Create Order endpoint accepts only the fields and file-delivery methods implemented by the current service.
- Unknown top-level order fields are rejected.
lightning_idis optional and requires the authenticated client to be enabled for Lightning.- A submitted
lightning_idmust resolve to an existing Lightning configuration available to that client. - Remote files must use public HTTP or HTTPS URLs.
- File URLs may not contain embedded usernames or passwords.
- Local, private, and reserved file destinations are rejected.
- File URLs using schemes other than HTTP or HTTPS are rejected.
Order Processing
The service follows this sequence after the request is parsed and authenticated.
- Normalize the authenticated client and request payload.
- Assign the order to the company associated with the authenticated API key.
- If
lightning_idis supplied, verify the authenticated client is Lightning-enabled and verify the referenced Lightning configuration exists and is available to that client. - Resolve test or production status.
- Validate allowed fields and job-specific requirements.
- Reject a duplicate
idfor the authenticated company. - Validate and download all remote files.
- Build the internal order and determine its initial status.
- Save the order and generate the Redstone job number.
- Store the downloaded files in GridFS.
- Update the order with its available file icons and return the completed order to the controller.
Validation and Errors
Requests fail immediately when a validation or processing rule is not satisfied.
500
response and return a reference_id. Separate
controller branches also exist for 400,
401, and structured 422 errors.
- Unsupported top-level fields are rejected.
- A submitted
lightning_idis rejected unless the authenticated client is Lightning-enabled and the referenced Lightning configuration exists and is available to that client. - All missing required fields are identified during service validation.
- A duplicate client order ID is rejected before file download.
- Malformed booleans are rejected instead of being silently converted.
- Invalid job-specific fields are rejected before order creation.
- If job-number generation fails, the service attempts to remove the newly created order.
- If file storage fails, the service attempts to remove the order and returns the storage error.
- Temporary downloaded files are removed after success or failure.
Duplicate Order IDs
The submitted id is stored internally as
ext_id. The service checks the
authenticated company and rejects a request when an
order already exists with the same identifier. This
duplicate check occurs before remote files are
downloaded.