Skip to content

Create Letter endpoint

Glenn Piludu edited this page Aug 13, 2022 · 6 revisions

Create a new letter and specify a letter template. Amplify does not store this information; this API leverages the Lob createLetter API

POST

POST /api/createLetter

Syntax

Request body parameters

Name Type Description
description string A description that uniquely identifies this letter. Must be no longer than 255 characters.
to object parameters below
from object parameters below
templateId string The Lob template_id created for this letter.
sessionId string Stripe session id returned from checkout session redirect or from Stripe API.

to is an address object with the following parameters. This address will be verified, recorded, and assigned an ID, if possible, when submitted.

{
name: 'Amy',
address_line1: 'Address line 1',
address_line2: 'Address line 2',
address_city: 'San Francisco',
address_state: 'CA',
address_zip: '94101'
}

from: is an object with the following parameter, which is an integer.

{
address_id: The `address_id` returned from the `createAddress` endpoint
}
Clone this wiki locally