How to Send an HTML Document via USPS

How to Send an HTML Document via USPS

This page gives the short answer first, then every step.

Short answer: Upload your HTML template, then mail it with the template ID, a return address, a shipping type, your data, and the payee. The steps are below.

Before you start

Step 1

Get your API key

Sign in. Click SETTINGS, then More, then Developer Panel. On the API Settings tab, click the eye icon to show your API Key. Click the copy icon to copy it. Keep it private.

Step 2

Pick the web address (base URL)

For tests, use the sandbox: https://test.onlinecheckwriter.com/api/v3. For real payments, use the live site: https://app.onlinecheckwriter.com/api/v3. Before you go live, ask our support team to turn on the live API. If you do not, your requests can come back with Access Denied.

Step 3

Add three headers to every request

Content-Type: application/json
Accept: application/json
Authorization: Bearer YOUR_API_KEY
Replace YOUR_API_KEY with your key.

Steps

Step 4

Upload your HTML template

Send the HTML file as file. Give a document_title and an idempotency_key. You get a template ID back.

POST /documentmailing/template/upload

Send this in the body of the request:

file: (file)
idempotency_key: 
document_title: 

Step 5

Mail the document

Give the template_id, the reply_id (your return address), the shipping_type, the json_content (the values for your template), and the payee_id. All are required.

POST /documentmailing/template/mail

Send this in the body of the request:

template_id: 
reply_id: 
shipping_type: 
json_content: 
payee_id: 

Step 6

Track it

Use the tracking request with the document ID.

GET /documentmailing/tracking/{documentId}

Common questions

What is json_content?

It is the data that fills the blanks in your HTML template, such as a name or an amount.

Where is the full API guide?

Open apiv3.onlinecheckwriter.com. It lists every request, with examples.

I need more help.

Call (408) 775-7720, use the chat box in the lower right corner of the app, or email support@onlinecheckwriter.com.

Pay your vendors with Online Check Writer

Want help? Book a demo. Our team will answer your questions.

This page gives general information. It is not legal advice.