Override cancellation window
Can I programmatically override my cancellation window?
Why is this important?
How do we (programmatically) solve this problem?
import {Configuration, Postcard, PostcardsApi, PostcardEditable, CountryExtended } from "@lob/lob-typescript-sdk"
async function demo() {
const config: Configuration = new Configuration({
username: "<YOUR_TEST_KEY>"
})
const postcardData : PostcardEditable = {
to: {
name: "Harry Zhang",
address_line1: "210 King Street",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107"
},
from: {
name: "Leore Avidar",
address_line1: "210 King Street",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107",
address_country: CountryExtended.Us
},
front: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf",
back: "https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/4x6_pc_template.pdf",
send_date: "2022-07-01T14:00:00"
}
try {
const result : Postcard = await new PostcardsApi(config).create(postcardData)
return result
} catch (err: any) {
console.error(err)
}
}
demo().then((result)=> console.log(result)).catch()Last updated
Was this helpful?

