postgrid-node 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +201 -0
  3. package/README.md +346 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +914 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +882 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +144 -0
  87. package/index.d.ts +144 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +161 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +118 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +124 -0
  94. package/pagination.d.ts +24 -0
  95. package/pagination.d.ts.map +1 -0
  96. package/pagination.js +45 -0
  97. package/pagination.js.map +1 -0
  98. package/pagination.mjs +41 -0
  99. package/pagination.mjs.map +1 -0
  100. package/resource.d.ts +6 -0
  101. package/resource.d.ts.map +1 -0
  102. package/resource.js +11 -0
  103. package/resource.js.map +1 -0
  104. package/resource.mjs +7 -0
  105. package/resource.mjs.map +1 -0
  106. package/resources/bank-accounts.d.ts +285 -0
  107. package/resources/bank-accounts.d.ts.map +1 -0
  108. package/resources/bank-accounts.js +45 -0
  109. package/resources/bank-accounts.js.map +1 -0
  110. package/resources/bank-accounts.mjs +40 -0
  111. package/resources/bank-accounts.mjs.map +1 -0
  112. package/resources/boxes.d.ts +683 -0
  113. package/resources/boxes.d.ts.map +1 -0
  114. package/resources/boxes.js +54 -0
  115. package/resources/boxes.js.map +1 -0
  116. package/resources/boxes.mjs +49 -0
  117. package/resources/boxes.mjs.map +1 -0
  118. package/resources/campaigns.d.ts +644 -0
  119. package/resources/campaigns.d.ts.map +1 -0
  120. package/resources/campaigns.js +67 -0
  121. package/resources/campaigns.js.map +1 -0
  122. package/resources/campaigns.mjs +62 -0
  123. package/resources/campaigns.mjs.map +1 -0
  124. package/resources/cheques/cheques.d.ts +349 -0
  125. package/resources/cheques/cheques.d.ts.map +1 -0
  126. package/resources/cheques/cheques.js +95 -0
  127. package/resources/cheques/cheques.js.map +1 -0
  128. package/resources/cheques/cheques.mjs +67 -0
  129. package/resources/cheques/cheques.mjs.map +1 -0
  130. package/resources/cheques/index.d.ts +4 -0
  131. package/resources/cheques/index.d.ts.map +1 -0
  132. package/resources/cheques/index.js +12 -0
  133. package/resources/cheques/index.js.map +1 -0
  134. package/resources/cheques/index.mjs +5 -0
  135. package/resources/cheques/index.mjs.map +1 -0
  136. package/resources/cheques/url.d.ts +29 -0
  137. package/resources/cheques/url.d.ts.map +1 -0
  138. package/resources/cheques/url.js +20 -0
  139. package/resources/cheques/url.js.map +1 -0
  140. package/resources/cheques/url.mjs +16 -0
  141. package/resources/cheques/url.mjs.map +1 -0
  142. package/resources/cheques/with-deposit-ready-pdf.d.ts +13 -0
  143. package/resources/cheques/with-deposit-ready-pdf.d.ts.map +1 -0
  144. package/resources/cheques/with-deposit-ready-pdf.js +18 -0
  145. package/resources/cheques/with-deposit-ready-pdf.js.map +1 -0
  146. package/resources/cheques/with-deposit-ready-pdf.mjs +14 -0
  147. package/resources/cheques/with-deposit-ready-pdf.mjs.map +1 -0
  148. package/resources/contacts.d.ts +295 -0
  149. package/resources/contacts.d.ts.map +1 -0
  150. package/resources/contacts.js +52 -0
  151. package/resources/contacts.js.map +1 -0
  152. package/resources/contacts.mjs +47 -0
  153. package/resources/contacts.mjs.map +1 -0
  154. package/resources/index.d.ts +12 -0
  155. package/resources/index.d.ts.map +1 -0
  156. package/resources/index.js +50 -0
  157. package/resources/index.js.map +1 -0
  158. package/resources/index.mjs +13 -0
  159. package/resources/index.mjs.map +1 -0
  160. package/resources/letters.d.ts +639 -0
  161. package/resources/letters.d.ts.map +1 -0
  162. package/resources/letters.js +55 -0
  163. package/resources/letters.js.map +1 -0
  164. package/resources/letters.mjs +50 -0
  165. package/resources/letters.mjs.map +1 -0
  166. package/resources/postcards.d.ts +346 -0
  167. package/resources/postcards.d.ts.map +1 -0
  168. package/resources/postcards.js +56 -0
  169. package/resources/postcards.js.map +1 -0
  170. package/resources/postcards.mjs +51 -0
  171. package/resources/postcards.mjs.map +1 -0
  172. package/resources/reports/exports.d.ts +207 -0
  173. package/resources/reports/exports.d.ts.map +1 -0
  174. package/resources/reports/exports.js +33 -0
  175. package/resources/reports/exports.js.map +1 -0
  176. package/resources/reports/exports.mjs +29 -0
  177. package/resources/reports/exports.mjs.map +1 -0
  178. package/resources/reports/index.d.ts +4 -0
  179. package/resources/reports/index.d.ts.map +1 -0
  180. package/resources/reports/index.js +12 -0
  181. package/resources/reports/index.js.map +1 -0
  182. package/resources/reports/index.mjs +5 -0
  183. package/resources/reports/index.mjs.map +1 -0
  184. package/resources/reports/reports.d.ts +245 -0
  185. package/resources/reports/reports.d.ts.map +1 -0
  186. package/resources/reports/reports.js +85 -0
  187. package/resources/reports/reports.js.map +1 -0
  188. package/resources/reports/reports.mjs +57 -0
  189. package/resources/reports/reports.mjs.map +1 -0
  190. package/resources/reports/samples.d.ts +81 -0
  191. package/resources/reports/samples.d.ts.map +1 -0
  192. package/resources/reports/samples.js +26 -0
  193. package/resources/reports/samples.js.map +1 -0
  194. package/resources/reports/samples.mjs +22 -0
  195. package/resources/reports/samples.mjs.map +1 -0
  196. package/resources/self-mailers.d.ts +622 -0
  197. package/resources/self-mailers.d.ts.map +1 -0
  198. package/resources/self-mailers.js +45 -0
  199. package/resources/self-mailers.js.map +1 -0
  200. package/resources/self-mailers.mjs +40 -0
  201. package/resources/self-mailers.mjs.map +1 -0
  202. package/resources/shared.d.ts +147 -0
  203. package/resources/shared.d.ts.map +1 -0
  204. package/resources/shared.js +4 -0
  205. package/resources/shared.js.map +1 -0
  206. package/resources/shared.mjs +3 -0
  207. package/resources/shared.mjs.map +1 -0
  208. package/resources/templates.d.ts +126 -0
  209. package/resources/templates.d.ts.map +1 -0
  210. package/resources/templates.js +46 -0
  211. package/resources/templates.js.map +1 -0
  212. package/resources/templates.mjs +41 -0
  213. package/resources/templates.mjs.map +1 -0
  214. package/shims/node.d.ts +30 -0
  215. package/shims/node.d.ts.map +1 -0
  216. package/shims/node.js +31 -0
  217. package/shims/node.js.map +1 -0
  218. package/shims/node.mjs +5 -0
  219. package/shims/node.mjs.map +1 -0
  220. package/shims/web.d.ts +26 -0
  221. package/shims/web.d.ts.map +1 -0
  222. package/shims/web.js +31 -0
  223. package/shims/web.js.map +1 -0
  224. package/shims/web.mjs +5 -0
  225. package/shims/web.mjs.map +1 -0
  226. package/src/_shims/MultipartBody.ts +9 -0
  227. package/src/_shims/README.md +46 -0
  228. package/src/_shims/auto/runtime-bun.ts +4 -0
  229. package/src/_shims/auto/runtime-node.ts +4 -0
  230. package/src/_shims/auto/runtime.ts +4 -0
  231. package/src/_shims/auto/types-node.ts +4 -0
  232. package/src/_shims/auto/types.d.ts +101 -0
  233. package/src/_shims/auto/types.js +3 -0
  234. package/src/_shims/auto/types.mjs +3 -0
  235. package/src/_shims/bun-runtime.ts +14 -0
  236. package/src/_shims/index.d.ts +81 -0
  237. package/src/_shims/index.js +13 -0
  238. package/src/_shims/index.mjs +7 -0
  239. package/src/_shims/manual-types.d.ts +12 -0
  240. package/src/_shims/manual-types.js +3 -0
  241. package/src/_shims/manual-types.mjs +3 -0
  242. package/src/_shims/node-runtime.ts +81 -0
  243. package/src/_shims/node-types.d.ts +42 -0
  244. package/src/_shims/node-types.js +3 -0
  245. package/src/_shims/node-types.mjs +3 -0
  246. package/src/_shims/registry.ts +67 -0
  247. package/src/_shims/web-runtime.ts +103 -0
  248. package/src/_shims/web-types.d.ts +83 -0
  249. package/src/_shims/web-types.js +3 -0
  250. package/src/_shims/web-types.mjs +3 -0
  251. package/src/core.ts +1208 -0
  252. package/src/error.ts +130 -0
  253. package/src/index.ts +428 -0
  254. package/src/lib/.keep +4 -0
  255. package/src/pagination.ts +69 -0
  256. package/src/resource.ts +11 -0
  257. package/src/resources/bank-accounts.ts +382 -0
  258. package/src/resources/boxes.ts +982 -0
  259. package/src/resources/campaigns.ts +853 -0
  260. package/src/resources/cheques/cheques.ts +493 -0
  261. package/src/resources/cheques/index.ts +12 -0
  262. package/src/resources/cheques/url.ts +37 -0
  263. package/src/resources/cheques/with-deposit-ready-pdf.ts +17 -0
  264. package/src/resources/contacts.ts +387 -0
  265. package/src/resources/index.ts +102 -0
  266. package/src/resources/letters.ts +870 -0
  267. package/src/resources/postcards.ts +548 -0
  268. package/src/resources/reports/exports.ts +272 -0
  269. package/src/resources/reports/index.ts +28 -0
  270. package/src/resources/reports/reports.ts +359 -0
  271. package/src/resources/reports/samples.ts +109 -0
  272. package/src/resources/self-mailers.ts +958 -0
  273. package/src/resources/shared.ts +182 -0
  274. package/src/resources/templates.ts +184 -0
  275. package/src/shims/node.ts +50 -0
  276. package/src/shims/web.ts +50 -0
  277. package/src/tsconfig.json +11 -0
  278. package/src/uploads.ts +255 -0
  279. package/src/version.ts +1 -0
  280. package/uploads.d.ts +75 -0
  281. package/uploads.d.ts.map +1 -0
  282. package/uploads.js +171 -0
  283. package/uploads.js.map +1 -0
  284. package/uploads.mjs +158 -0
  285. package/uploads.mjs.map +1 -0
  286. package/version.d.ts +2 -0
  287. package/version.d.ts.map +1 -0
  288. package/version.js +5 -0
  289. package/version.js.map +1 -0
  290. package/version.mjs +2 -0
  291. package/version.mjs.map +1 -0
@@ -0,0 +1,683 @@
1
+ import { APIResource } from "../resource.js";
2
+ import * as Core from "../core.js";
3
+ import * as ContactsAPI from "./contacts.js";
4
+ import * as Shared from "./shared.js";
5
+ import { List, type ListParams } from "../pagination.js";
6
+ export declare class Boxes extends APIResource {
7
+ /**
8
+ * This endpoint allows you to create a box containing up to 100 cheques. A Box is
9
+ * mailed to a single destination.
10
+ *
11
+ * To create a box. You must specify:
12
+ *
13
+ * - `to`: The recipient (contact or contact ID)
14
+ * - `from`: The sender (contact or contact ID)
15
+ * - `cheques`: An array of cheques to go in the box
16
+ *
17
+ * For each cheque You must specify:
18
+ *
19
+ * - `to`: The recipient (contact or contact ID)
20
+ * - `from`: The sender (contact or contact ID)
21
+ * - `bankAccount`: The bank account ID
22
+ * - `amount`: The amount to be sent
23
+ * - `number`: The cheque number
24
+ */
25
+ create(body: BoxCreateParams, options?: Core.RequestOptions): Core.APIPromise<BoxCreateResponse>;
26
+ /**
27
+ * Retrieve a box by ID.
28
+ */
29
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<BoxRetrieveResponse>;
30
+ /**
31
+ * List all boxes.
32
+ */
33
+ list(query?: BoxListParams, options?: Core.RequestOptions): Core.PagePromise<BoxListResponsesList, BoxListResponse>;
34
+ list(options?: Core.RequestOptions): Core.PagePromise<BoxListResponsesList, BoxListResponse>;
35
+ /**
36
+ * Cancel a box by ID (cannot be undone).
37
+ */
38
+ cancel(id: string, options?: Core.RequestOptions): Core.APIPromise<BoxCancelResponse>;
39
+ }
40
+ export declare class BoxListResponsesList extends List<BoxListResponse> {
41
+ }
42
+ export interface BoxCreateResponse {
43
+ /**
44
+ * A unique ID prefixed with box\_
45
+ */
46
+ id: string;
47
+ /**
48
+ * The cheques inside this box (in read mode).
49
+ */
50
+ cheques: Array<BoxCreateResponse.Cheque>;
51
+ /**
52
+ * The UTC time at which this resource was created.
53
+ */
54
+ createdAt: string;
55
+ /**
56
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
57
+ */
58
+ from: ContactsAPI.Contact;
59
+ /**
60
+ * `true` if this is a live mode resource else `false`.
61
+ */
62
+ live: boolean;
63
+ /**
64
+ * The mailing class of this order. This determines the speed and cost of delivery.
65
+ * See `OrderMailingClass` for more details.
66
+ */
67
+ mailingClass: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
68
+ /**
69
+ * Always "box".
70
+ */
71
+ object: 'box';
72
+ /**
73
+ * This order will transition from `ready` to `printing` on the day after this
74
+ * date. For example, if this is a date on Tuesday, the order will transition to
75
+ * `printing` on Wednesday at midnight eastern time.
76
+ */
77
+ sendDate: string;
78
+ /**
79
+ * See `OrderStatus` for more details on the status of this order.
80
+ */
81
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
82
+ /**
83
+ * The recipient of this order. This will be provided even if you delete the
84
+ * underlying contact.
85
+ */
86
+ to: ContactsAPI.Contact;
87
+ /**
88
+ * The UTC time at which this resource was last updated.
89
+ */
90
+ updatedAt: string;
91
+ /**
92
+ * The cancellation details of this order. Populated if the order has been
93
+ * cancelled.
94
+ */
95
+ cancellation?: Shared.Cancellation;
96
+ /**
97
+ * An optional string describing this resource. Will be visible in the API and the
98
+ * dashboard.
99
+ */
100
+ description?: string;
101
+ /**
102
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
103
+ */
104
+ imbDate?: string;
105
+ /**
106
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
107
+ * US-printed and US-destined orders. This is the most detailed way to track
108
+ * non-express/certified orders.
109
+ */
110
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
111
+ /**
112
+ * The most recent ZIP code of the USPS facility that the order has been processed
113
+ * through. Only populated when an `imbStatus` is present.
114
+ */
115
+ imbZIPCode?: string;
116
+ /**
117
+ * These will be merged with the variables in the template or HTML you create this
118
+ * order with. The keys in this object should match the variable names in the
119
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
120
+ * PDFs uploaded with the order.
121
+ */
122
+ mergeVariables?: Record<string, unknown>;
123
+ /**
124
+ * See the section on Metadata.
125
+ */
126
+ metadata?: Record<string, unknown>;
127
+ /**
128
+ * The tracking number of this order. Populated after an express/certified order
129
+ * has been processed for delivery.
130
+ */
131
+ trackingNumber?: string;
132
+ /**
133
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
134
+ * ensure that the order is correct before it is sent out because it shows what
135
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
136
+ * this field will be returned by all `GET` endpoints which produce this order.
137
+ *
138
+ * This URL is a signed link to the PDF preview. It will expire after a short
139
+ * period of time. If you need to access this URL after it has expired, you can
140
+ * regenerate it by calling the `GET` endpoint again.
141
+ */
142
+ url?: string;
143
+ }
144
+ export declare namespace BoxCreateResponse {
145
+ interface Cheque {
146
+ /**
147
+ * The amount on the cheque.
148
+ */
149
+ amount: number;
150
+ /**
151
+ * The bank account (ID or reference) from which the cheque amount is drawn.
152
+ */
153
+ bankAccount: string;
154
+ from: ContactsAPI.Contact;
155
+ /**
156
+ * The cheque number.
157
+ */
158
+ number: number;
159
+ to: ContactsAPI.Contact;
160
+ /**
161
+ * A URL to a logo for the cheque (optional).
162
+ */
163
+ logoURL?: string;
164
+ /**
165
+ * The memo text on the cheque (optional).
166
+ */
167
+ memo?: string;
168
+ /**
169
+ * A set of dynamic merge variables for customizing the cheque or accompanying
170
+ * documents (optional).
171
+ */
172
+ mergeVariables?: Record<string, unknown>;
173
+ /**
174
+ * An optional message template to be printed on or with the cheque.
175
+ */
176
+ messageTemplate?: string;
177
+ }
178
+ }
179
+ export interface BoxRetrieveResponse {
180
+ /**
181
+ * A unique ID prefixed with box\_
182
+ */
183
+ id: string;
184
+ /**
185
+ * The cheques inside this box (in read mode).
186
+ */
187
+ cheques: Array<BoxRetrieveResponse.Cheque>;
188
+ /**
189
+ * The UTC time at which this resource was created.
190
+ */
191
+ createdAt: string;
192
+ /**
193
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
194
+ */
195
+ from: ContactsAPI.Contact;
196
+ /**
197
+ * `true` if this is a live mode resource else `false`.
198
+ */
199
+ live: boolean;
200
+ /**
201
+ * The mailing class of this order. This determines the speed and cost of delivery.
202
+ * See `OrderMailingClass` for more details.
203
+ */
204
+ mailingClass: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
205
+ /**
206
+ * Always "box".
207
+ */
208
+ object: 'box';
209
+ /**
210
+ * This order will transition from `ready` to `printing` on the day after this
211
+ * date. For example, if this is a date on Tuesday, the order will transition to
212
+ * `printing` on Wednesday at midnight eastern time.
213
+ */
214
+ sendDate: string;
215
+ /**
216
+ * See `OrderStatus` for more details on the status of this order.
217
+ */
218
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
219
+ /**
220
+ * The recipient of this order. This will be provided even if you delete the
221
+ * underlying contact.
222
+ */
223
+ to: ContactsAPI.Contact;
224
+ /**
225
+ * The UTC time at which this resource was last updated.
226
+ */
227
+ updatedAt: string;
228
+ /**
229
+ * The cancellation details of this order. Populated if the order has been
230
+ * cancelled.
231
+ */
232
+ cancellation?: Shared.Cancellation;
233
+ /**
234
+ * An optional string describing this resource. Will be visible in the API and the
235
+ * dashboard.
236
+ */
237
+ description?: string;
238
+ /**
239
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
240
+ */
241
+ imbDate?: string;
242
+ /**
243
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
244
+ * US-printed and US-destined orders. This is the most detailed way to track
245
+ * non-express/certified orders.
246
+ */
247
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
248
+ /**
249
+ * The most recent ZIP code of the USPS facility that the order has been processed
250
+ * through. Only populated when an `imbStatus` is present.
251
+ */
252
+ imbZIPCode?: string;
253
+ /**
254
+ * These will be merged with the variables in the template or HTML you create this
255
+ * order with. The keys in this object should match the variable names in the
256
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
257
+ * PDFs uploaded with the order.
258
+ */
259
+ mergeVariables?: Record<string, unknown>;
260
+ /**
261
+ * See the section on Metadata.
262
+ */
263
+ metadata?: Record<string, unknown>;
264
+ /**
265
+ * The tracking number of this order. Populated after an express/certified order
266
+ * has been processed for delivery.
267
+ */
268
+ trackingNumber?: string;
269
+ /**
270
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
271
+ * ensure that the order is correct before it is sent out because it shows what
272
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
273
+ * this field will be returned by all `GET` endpoints which produce this order.
274
+ *
275
+ * This URL is a signed link to the PDF preview. It will expire after a short
276
+ * period of time. If you need to access this URL after it has expired, you can
277
+ * regenerate it by calling the `GET` endpoint again.
278
+ */
279
+ url?: string;
280
+ }
281
+ export declare namespace BoxRetrieveResponse {
282
+ interface Cheque {
283
+ /**
284
+ * The amount on the cheque.
285
+ */
286
+ amount: number;
287
+ /**
288
+ * The bank account (ID or reference) from which the cheque amount is drawn.
289
+ */
290
+ bankAccount: string;
291
+ from: ContactsAPI.Contact;
292
+ /**
293
+ * The cheque number.
294
+ */
295
+ number: number;
296
+ to: ContactsAPI.Contact;
297
+ /**
298
+ * A URL to a logo for the cheque (optional).
299
+ */
300
+ logoURL?: string;
301
+ /**
302
+ * The memo text on the cheque (optional).
303
+ */
304
+ memo?: string;
305
+ /**
306
+ * A set of dynamic merge variables for customizing the cheque or accompanying
307
+ * documents (optional).
308
+ */
309
+ mergeVariables?: Record<string, unknown>;
310
+ /**
311
+ * An optional message template to be printed on or with the cheque.
312
+ */
313
+ messageTemplate?: string;
314
+ }
315
+ }
316
+ export interface BoxListResponse {
317
+ /**
318
+ * A unique ID prefixed with box\_
319
+ */
320
+ id: string;
321
+ /**
322
+ * The cheques inside this box (in read mode).
323
+ */
324
+ cheques: Array<BoxListResponse.Cheque>;
325
+ /**
326
+ * The UTC time at which this resource was created.
327
+ */
328
+ createdAt: string;
329
+ /**
330
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
331
+ */
332
+ from: ContactsAPI.Contact;
333
+ /**
334
+ * `true` if this is a live mode resource else `false`.
335
+ */
336
+ live: boolean;
337
+ /**
338
+ * The mailing class of this order. This determines the speed and cost of delivery.
339
+ * See `OrderMailingClass` for more details.
340
+ */
341
+ mailingClass: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
342
+ /**
343
+ * Always "box".
344
+ */
345
+ object: 'box';
346
+ /**
347
+ * This order will transition from `ready` to `printing` on the day after this
348
+ * date. For example, if this is a date on Tuesday, the order will transition to
349
+ * `printing` on Wednesday at midnight eastern time.
350
+ */
351
+ sendDate: string;
352
+ /**
353
+ * See `OrderStatus` for more details on the status of this order.
354
+ */
355
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
356
+ /**
357
+ * The recipient of this order. This will be provided even if you delete the
358
+ * underlying contact.
359
+ */
360
+ to: ContactsAPI.Contact;
361
+ /**
362
+ * The UTC time at which this resource was last updated.
363
+ */
364
+ updatedAt: string;
365
+ /**
366
+ * The cancellation details of this order. Populated if the order has been
367
+ * cancelled.
368
+ */
369
+ cancellation?: Shared.Cancellation;
370
+ /**
371
+ * An optional string describing this resource. Will be visible in the API and the
372
+ * dashboard.
373
+ */
374
+ description?: string;
375
+ /**
376
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
377
+ */
378
+ imbDate?: string;
379
+ /**
380
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
381
+ * US-printed and US-destined orders. This is the most detailed way to track
382
+ * non-express/certified orders.
383
+ */
384
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
385
+ /**
386
+ * The most recent ZIP code of the USPS facility that the order has been processed
387
+ * through. Only populated when an `imbStatus` is present.
388
+ */
389
+ imbZIPCode?: string;
390
+ /**
391
+ * These will be merged with the variables in the template or HTML you create this
392
+ * order with. The keys in this object should match the variable names in the
393
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
394
+ * PDFs uploaded with the order.
395
+ */
396
+ mergeVariables?: Record<string, unknown>;
397
+ /**
398
+ * See the section on Metadata.
399
+ */
400
+ metadata?: Record<string, unknown>;
401
+ /**
402
+ * The tracking number of this order. Populated after an express/certified order
403
+ * has been processed for delivery.
404
+ */
405
+ trackingNumber?: string;
406
+ /**
407
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
408
+ * ensure that the order is correct before it is sent out because it shows what
409
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
410
+ * this field will be returned by all `GET` endpoints which produce this order.
411
+ *
412
+ * This URL is a signed link to the PDF preview. It will expire after a short
413
+ * period of time. If you need to access this URL after it has expired, you can
414
+ * regenerate it by calling the `GET` endpoint again.
415
+ */
416
+ url?: string;
417
+ }
418
+ export declare namespace BoxListResponse {
419
+ interface Cheque {
420
+ /**
421
+ * The amount on the cheque.
422
+ */
423
+ amount: number;
424
+ /**
425
+ * The bank account (ID or reference) from which the cheque amount is drawn.
426
+ */
427
+ bankAccount: string;
428
+ from: ContactsAPI.Contact;
429
+ /**
430
+ * The cheque number.
431
+ */
432
+ number: number;
433
+ to: ContactsAPI.Contact;
434
+ /**
435
+ * A URL to a logo for the cheque (optional).
436
+ */
437
+ logoURL?: string;
438
+ /**
439
+ * The memo text on the cheque (optional).
440
+ */
441
+ memo?: string;
442
+ /**
443
+ * A set of dynamic merge variables for customizing the cheque or accompanying
444
+ * documents (optional).
445
+ */
446
+ mergeVariables?: Record<string, unknown>;
447
+ /**
448
+ * An optional message template to be printed on or with the cheque.
449
+ */
450
+ messageTemplate?: string;
451
+ }
452
+ }
453
+ export interface BoxCancelResponse {
454
+ /**
455
+ * A unique ID prefixed with box\_
456
+ */
457
+ id: string;
458
+ /**
459
+ * The cheques inside this box (in read mode).
460
+ */
461
+ cheques: Array<BoxCancelResponse.Cheque>;
462
+ /**
463
+ * The UTC time at which this resource was created.
464
+ */
465
+ createdAt: string;
466
+ /**
467
+ * The contact of the 'from' field in read mode should be a fully expanded Contact.
468
+ */
469
+ from: ContactsAPI.Contact;
470
+ /**
471
+ * `true` if this is a live mode resource else `false`.
472
+ */
473
+ live: boolean;
474
+ /**
475
+ * The mailing class of this order. This determines the speed and cost of delivery.
476
+ * See `OrderMailingClass` for more details.
477
+ */
478
+ mailingClass: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
479
+ /**
480
+ * Always "box".
481
+ */
482
+ object: 'box';
483
+ /**
484
+ * This order will transition from `ready` to `printing` on the day after this
485
+ * date. For example, if this is a date on Tuesday, the order will transition to
486
+ * `printing` on Wednesday at midnight eastern time.
487
+ */
488
+ sendDate: string;
489
+ /**
490
+ * See `OrderStatus` for more details on the status of this order.
491
+ */
492
+ status: 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
493
+ /**
494
+ * The recipient of this order. This will be provided even if you delete the
495
+ * underlying contact.
496
+ */
497
+ to: ContactsAPI.Contact;
498
+ /**
499
+ * The UTC time at which this resource was last updated.
500
+ */
501
+ updatedAt: string;
502
+ /**
503
+ * The cancellation details of this order. Populated if the order has been
504
+ * cancelled.
505
+ */
506
+ cancellation?: Shared.Cancellation;
507
+ /**
508
+ * An optional string describing this resource. Will be visible in the API and the
509
+ * dashboard.
510
+ */
511
+ description?: string;
512
+ /**
513
+ * The last date that the IMB status was updated. See `imbStatus` for more details.
514
+ */
515
+ imbDate?: string;
516
+ /**
517
+ * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
518
+ * US-printed and US-destined orders. This is the most detailed way to track
519
+ * non-express/certified orders.
520
+ */
521
+ imbStatus?: 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
522
+ /**
523
+ * The most recent ZIP code of the USPS facility that the order has been processed
524
+ * through. Only populated when an `imbStatus` is present.
525
+ */
526
+ imbZIPCode?: string;
527
+ /**
528
+ * These will be merged with the variables in the template or HTML you create this
529
+ * order with. The keys in this object should match the variable names in the
530
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
531
+ * PDFs uploaded with the order.
532
+ */
533
+ mergeVariables?: Record<string, unknown>;
534
+ /**
535
+ * See the section on Metadata.
536
+ */
537
+ metadata?: Record<string, unknown>;
538
+ /**
539
+ * The tracking number of this order. Populated after an express/certified order
540
+ * has been processed for delivery.
541
+ */
542
+ trackingNumber?: string;
543
+ /**
544
+ * PostGrid renders a PDF preview for all orders. This should be inspected to
545
+ * ensure that the order is correct before it is sent out because it shows what
546
+ * will be printed and mailed to the recipient. Once the PDF preview is generated,
547
+ * this field will be returned by all `GET` endpoints which produce this order.
548
+ *
549
+ * This URL is a signed link to the PDF preview. It will expire after a short
550
+ * period of time. If you need to access this URL after it has expired, you can
551
+ * regenerate it by calling the `GET` endpoint again.
552
+ */
553
+ url?: string;
554
+ }
555
+ export declare namespace BoxCancelResponse {
556
+ interface Cheque {
557
+ /**
558
+ * The amount on the cheque.
559
+ */
560
+ amount: number;
561
+ /**
562
+ * The bank account (ID or reference) from which the cheque amount is drawn.
563
+ */
564
+ bankAccount: string;
565
+ from: ContactsAPI.Contact;
566
+ /**
567
+ * The cheque number.
568
+ */
569
+ number: number;
570
+ to: ContactsAPI.Contact;
571
+ /**
572
+ * A URL to a logo for the cheque (optional).
573
+ */
574
+ logoURL?: string;
575
+ /**
576
+ * The memo text on the cheque (optional).
577
+ */
578
+ memo?: string;
579
+ /**
580
+ * A set of dynamic merge variables for customizing the cheque or accompanying
581
+ * documents (optional).
582
+ */
583
+ mergeVariables?: Record<string, unknown>;
584
+ /**
585
+ * An optional message template to be printed on or with the cheque.
586
+ */
587
+ messageTemplate?: string;
588
+ }
589
+ }
590
+ export interface BoxCreateParams {
591
+ /**
592
+ * The cheques to be mailed in the box. Only 100 cheques can be included in a box
593
+ * at a time.
594
+ */
595
+ cheques: Array<BoxCreateParams.Cheque>;
596
+ /**
597
+ * The 'from' (sender) of the entire box. Accepts inline ContactCreate or a
598
+ * contactID.
599
+ */
600
+ from: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
601
+ /**
602
+ * The recipient of this order. You can either supply the contact information
603
+ * inline here or provide a contact ID. PostGrid will automatically deduplicate
604
+ * contacts regardless of whether you provide the information inline here or call
605
+ * the contact creation endpoint.
606
+ */
607
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
608
+ /**
609
+ * An optional string describing this resource. Will be visible in the API and the
610
+ * dashboard.
611
+ */
612
+ description?: string;
613
+ /**
614
+ * The mailing class of this order. If not provided, automatically set to
615
+ * `first_class`.
616
+ */
617
+ mailingClass?: 'first_class' | 'standard_class' | 'express' | 'certified' | 'certified_return_receipt' | 'registered' | 'usps_first_class' | 'usps_standard_class' | 'usps_eddm' | 'usps_express_2_day' | 'usps_express_3_day' | 'usps_first_class_certified' | 'usps_first_class_certified_return_receipt' | 'usps_first_class_registered' | 'usps_express_3_day_signature_confirmation' | 'usps_express_3_day_certified' | 'usps_express_3_day_certified_return_receipt' | 'ca_post_lettermail' | 'ca_post_personalized' | 'ca_post_neighbourhood_mail' | 'ups_express_overnight' | 'ups_express_2_day' | 'ups_express_3_day' | 'royal_mail_first_class' | 'royal_mail_second_class' | 'au_post_second_class';
618
+ /**
619
+ * These will be merged with the variables in the template or HTML you create this
620
+ * order with. The keys in this object should match the variable names in the
621
+ * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
622
+ * PDFs uploaded with the order.
623
+ */
624
+ mergeVariables?: Record<string, unknown>;
625
+ /**
626
+ * See the section on Metadata.
627
+ */
628
+ metadata?: Record<string, unknown>;
629
+ /**
630
+ * This order will transition from `ready` to `printing` on the day after this
631
+ * date. You can use this parameter to schedule orders for a future date.
632
+ */
633
+ sendDate?: string;
634
+ }
635
+ export declare namespace BoxCreateParams {
636
+ interface Cheque {
637
+ /**
638
+ * The amount on the cheque.
639
+ */
640
+ amount: number;
641
+ /**
642
+ * The bank account (ID or reference) from which the cheque amount is drawn.
643
+ */
644
+ bankAccount: string;
645
+ from: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
646
+ /**
647
+ * The cheque number.
648
+ */
649
+ number: number;
650
+ to: Shared.ContactCreateWithFirstName | Shared.ContactCreateWithCompanyName | string;
651
+ /**
652
+ * A URL to a logo for the cheque (optional).
653
+ */
654
+ logoURL?: string;
655
+ /**
656
+ * The memo text on the cheque (optional).
657
+ */
658
+ memo?: string;
659
+ /**
660
+ * A set of dynamic merge variables for customizing the cheque or accompanying
661
+ * documents (optional).
662
+ */
663
+ mergeVariables?: Record<string, unknown>;
664
+ /**
665
+ * An optional message template to be printed on or with the cheque.
666
+ */
667
+ messageTemplate?: string;
668
+ }
669
+ }
670
+ export interface BoxListParams extends ListParams {
671
+ /**
672
+ * You can supply any string to help narrow down the list of resources. For
673
+ * example, if you pass `"New York"` (quoted), it will return resources that have
674
+ * that string present somewhere in their response. Alternatively, you can supply a
675
+ * structured search query. See the documentation on `StructuredSearchQuery` for
676
+ * more details.
677
+ */
678
+ search?: string;
679
+ }
680
+ export declare namespace Boxes {
681
+ export { type BoxCreateResponse as BoxCreateResponse, type BoxRetrieveResponse as BoxRetrieveResponse, type BoxListResponse as BoxListResponse, type BoxCancelResponse as BoxCancelResponse, BoxListResponsesList as BoxListResponsesList, type BoxCreateParams as BoxCreateParams, type BoxListParams as BoxListParams, };
682
+ }
683
+ //# sourceMappingURL=boxes.d.ts.map