Rectify Docs
Public API · Guest checkout

Go from model file to paid order.

Create a quote, review the final price, and continue to secure card payment. No Rectify account or API key is required for guest orders.

How the flow works

All API requests below use https://api.rectifytech.com. The upload URL returned by the API points to object storage; send the model bytes directly to that URL.

01PrepareChoose a material and upload model files.
02QuoteWait for pricing and check each item.
03ReviewAdd shipping details and inspect the total.
04PayOpen Stripe Checkout and wait for PAID.

You can enter shipping details in the Rectify app or through the API. Card payment takes place on Stripe’s hosted page and returns to Rectify.

Choose a material

Published materials include layer-height options. Save a materialSettingsId for the model you plan to quote.

GET/public/materials/options

Request · cURL
curl -sS https://api.rectifytech.com/public/materials/options

Upload a model file

Request one URL per file. Set fileSizes to the exact byte counts and use the same Content-Type when uploading. Each file must be between 1 byte and 1 GiB; the request total is limited to 4 GiB.

1

Request an upload URL

POST/public/upload/presigned-urls

Request · cURL
curl -sS https://api.rectifytech.com/public/upload/presigned-urls \
  -H 'Content-Type: application/json' \
  -d '{"fileNames":["part.stl"],"fileSizes":[123456],"contentType":"model/stl"}'

The response is an array. Keep its key, uploadToken, presignedUrl and expirationTime together. The URL and token are short lived.

2

PUT the file bytes

Request · cURL
curl -X PUT "$PRESIGNED_URL" \
  -H 'Content-Type: model/stl' \
  --data-binary @part.stl

Set PRESIGNED_URL from the response. Do not send the checkout token or a Rectify authorization header to this storage URL.

Create and check a quote

Reference every uploaded file by its key and uploadToken. Use the selected material's technology: SLA for resin or FDM for filament. The quote is asynchronous: save both returned IDs and poll until COMPLETE or ERROR.

3

Start the quote

POST/public/quote

Request · JSON
{
  "country": "GB",
  "technology": "SLA",
  "files": [{
    "fileS3Key": "<key from upload response>",
    "uploadToken": "<uploadToken from upload response>",
    "fileName": "part.stl",
    "quantity": 1,
    "autoSupport": true,
    "materialSettingsId": "<materialSettingsId from materials>"
  }]
}

Save this body as quote.json, replacing the values in angle brackets, then send it:

Request · cURL
curl -sS https://api.rectifytech.com/public/quote \
  -H 'Content-Type: application/json' \
  --data-binary @quote.json

This call is not idempotent. If the response is lost, do not blindly create another quote.

4

Poll and inspect the result

GET/public/quote/{quoteId}?sessionId={sessionId}

Request · cURL
curl -sS "https://api.rectifytech.com/public/quote/$QUOTE_ID?sessionId=$SESSION_ID"

Before checkout, inspect each item’s material, quantity and price. Check isBroken for files that could not be processed, inBounds for parts that fit, and requiresHolePermission for parts that need vent or drain holes. A COMPLETE quote can still contain a file that cannot be printed.

Start a checkout

A checkout is a draft order for one completed quote. Creating it does not charge the customer. The checkout token grants access to that draft; it is not a payment method. Use the same token for every request to this checkout.

5

Generate a private token

Generate one token per quote using a cryptographically secure random source. This shell example creates 32 random bytes in the format the API accepts and saves them in CHECKOUT_TOKEN for the requests below:

Shell · Node.js
CHECKOUT_TOKEN="$(node -e 'process.stdout.write(require("node:crypto").randomBytes(32).toString("base64url"))')"

Keep the token private. Anyone with it and the checkout ID can access the checkout until it expires.

6

Create or resume checkout

POST/public/checkouts

Request · cURL
curl -sS https://api.rectifytech.com/public/checkouts \
  -H 'Content-Type: application/json' \
  -H "X-Checkout-Token: $CHECKOUT_TOKEN" \
  -d "{\"quoteId\":\"$QUOTE_ID\",\"sessionId\":\"$SESSION_ID\"}"

The response contains the checkout id, revision (initially 1), status: "DRAFT" and expiresAt. Save the ID and token together. Retrying with the same quote and token resumes this checkout. Access expires 24 hours after creation.

Using the Rectify checkout page? You can stop here and open https://app.rectifytech.com/checkout/<id>#checkoutToken=<token>. The page collects shipping details, shows the final total and opens payment. Keep that link private because it grants access to the checkout.

7

Save details and review the total through the API

To provide contact and shipping details through the API, use the revision returned by the previous request.

PUT/public/checkouts/{id}

Request body · JSON
{
  "revision": 1,
  "details": {
    "email": "buyer@example.com",
    "order": {
      "name": "Alex",
      "surname": "Rivera",
      "addressLine1": "10 Example Street",
      "city": "London",
      "stateProvince": "",
      "postalCode": "SW1A 1AA",
      "country": "GB",
      "postageType": "STANDARD",
      "allowDrainHoles": false
    }
  }
}

Save this body as details.json and send it with the checkout ID and token:

Request · cURL
curl -sS -X PUT "https://api.rectifytech.com/public/checkouts/$CHECKOUT_ID" \
  -H 'Content-Type: application/json' \
  -H "X-Checkout-Token: $CHECKOUT_TOKEN" \
  --data-binary @details.json

The response increments the revision and calculates pricing: subtotal, shipping, tax, fee and total. These values are in minor currency units (for example, pence), while quote item prices are in major units.

Review the returned currency and total before continuing to payment. If any item needs vent or drain holes, the checkout must include allowDrainHoles: true to continue.

Pay and confirm

After saving details through the API and reviewing the total, request a Stripe hosted payment page. The API returns a URL; it does not take card details or charge the customer by itself.

8

Request a payment URL

POST/public/checkouts/{id}/payment

Request body · JSON
{
  "revision": 2,
  "returnUrl": "https://app.rectifytech.com/checkout/<checkout-id>"
}

Save this body as payment.json, replacing the checkout ID and revision, then send it:

Request · cURL
curl -sS -X POST "https://api.rectifytech.com/public/checkouts/$CHECKOUT_ID/payment" \
  -H 'Content-Type: application/json' \
  -H "X-Checkout-Token: $CHECKOUT_TOKEN" \
  --data-binary @payment.json

When the payment session is open, the response includes a url for Stripe Checkout. The returnUrl must be the Rectify checkout page for this ID. Open the private Rectify checkout link from step 6 in a tab, then open the Stripe URL in that same tab to enter payment details. The page can then show the checkout after Stripe redirects back.

9

Verify payment with the API

GET/public/checkouts/{id}

Request · cURL
curl -sS "https://api.rectifytech.com/public/checkouts/$CHECKOUT_ID" \
  -H "X-Checkout-Token: $CHECKOUT_TOKEN"

Only status: "PAID" confirms payment. The returned orderNumber identifies the order. A success redirect or payment-session response alone does not confirm that Stripe collected the funds.

Retries and limits

SituationWhat to do
Checkout creation times outRetry with the same quote and checkout token.
Payment request result is uncertainRetry with the same revision and return URL. Do not create a second order.
Revision conflictReload the checkout, inspect the updated total, then retry.
Rate limited (429)Wait for the Retry-After interval.

Keep the quote session ID, checkout token, upload token, presigned URL and private checkout link out of public logs. Checkout access expires after 24 hours.