postgrid-node 0.4.1 → 0.5.0

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 (101) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +1 -1
  3. package/README.md +3 -3
  4. package/client.d.mts +5 -5
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +5 -5
  7. package/client.d.ts.map +1 -1
  8. package/client.js +5 -5
  9. package/client.js.map +1 -1
  10. package/client.mjs +5 -5
  11. package/client.mjs.map +1 -1
  12. package/package.json +3 -3
  13. package/resources/print-mail/cheques.d.mts +25 -6
  14. package/resources/print-mail/cheques.d.mts.map +1 -1
  15. package/resources/print-mail/cheques.d.ts +25 -6
  16. package/resources/print-mail/cheques.d.ts.map +1 -1
  17. package/resources/print-mail/cheques.js.map +1 -1
  18. package/resources/print-mail/cheques.mjs.map +1 -1
  19. package/resources/print-mail/index.d.mts +0 -1
  20. package/resources/print-mail/index.d.mts.map +1 -1
  21. package/resources/print-mail/index.d.ts +0 -1
  22. package/resources/print-mail/index.d.ts.map +1 -1
  23. package/resources/print-mail/index.js +1 -3
  24. package/resources/print-mail/index.js.map +1 -1
  25. package/resources/print-mail/index.mjs +0 -1
  26. package/resources/print-mail/index.mjs.map +1 -1
  27. package/resources/print-mail/letters.d.mts +26 -7
  28. package/resources/print-mail/letters.d.mts.map +1 -1
  29. package/resources/print-mail/letters.d.ts +26 -7
  30. package/resources/print-mail/letters.d.ts.map +1 -1
  31. package/resources/print-mail/letters.js.map +1 -1
  32. package/resources/print-mail/letters.mjs.map +1 -1
  33. package/resources/print-mail/order-profiles/cheques.d.mts +4 -5
  34. package/resources/print-mail/order-profiles/cheques.d.mts.map +1 -1
  35. package/resources/print-mail/order-profiles/cheques.d.ts +4 -5
  36. package/resources/print-mail/order-profiles/cheques.d.ts.map +1 -1
  37. package/resources/print-mail/order-profiles/cheques.js.map +1 -1
  38. package/resources/print-mail/order-profiles/cheques.mjs.map +1 -1
  39. package/resources/print-mail/order-profiles/letters.d.mts +3 -4
  40. package/resources/print-mail/order-profiles/letters.d.mts.map +1 -1
  41. package/resources/print-mail/order-profiles/letters.d.ts +3 -4
  42. package/resources/print-mail/order-profiles/letters.d.ts.map +1 -1
  43. package/resources/print-mail/order-profiles/letters.js.map +1 -1
  44. package/resources/print-mail/order-profiles/letters.mjs.map +1 -1
  45. package/resources/print-mail/order-profiles/postcards.d.mts +3 -4
  46. package/resources/print-mail/order-profiles/postcards.d.mts.map +1 -1
  47. package/resources/print-mail/order-profiles/postcards.d.ts +3 -4
  48. package/resources/print-mail/order-profiles/postcards.d.ts.map +1 -1
  49. package/resources/print-mail/order-profiles/postcards.js.map +1 -1
  50. package/resources/print-mail/order-profiles/postcards.mjs.map +1 -1
  51. package/resources/print-mail/order-profiles/self-mailers.d.mts +3 -4
  52. package/resources/print-mail/order-profiles/self-mailers.d.mts.map +1 -1
  53. package/resources/print-mail/order-profiles/self-mailers.d.ts +3 -4
  54. package/resources/print-mail/order-profiles/self-mailers.d.ts.map +1 -1
  55. package/resources/print-mail/order-profiles/self-mailers.js.map +1 -1
  56. package/resources/print-mail/order-profiles/self-mailers.mjs.map +1 -1
  57. package/resources/print-mail/postcards.d.mts +27 -8
  58. package/resources/print-mail/postcards.d.mts.map +1 -1
  59. package/resources/print-mail/postcards.d.ts +27 -8
  60. package/resources/print-mail/postcards.d.ts.map +1 -1
  61. package/resources/print-mail/postcards.js.map +1 -1
  62. package/resources/print-mail/postcards.mjs.map +1 -1
  63. package/resources/print-mail/print-mail.d.mts +0 -4
  64. package/resources/print-mail/print-mail.d.mts.map +1 -1
  65. package/resources/print-mail/print-mail.d.ts +0 -4
  66. package/resources/print-mail/print-mail.d.ts.map +1 -1
  67. package/resources/print-mail/print-mail.js +0 -4
  68. package/resources/print-mail/print-mail.js.map +1 -1
  69. package/resources/print-mail/print-mail.mjs +0 -4
  70. package/resources/print-mail/print-mail.mjs.map +1 -1
  71. package/resources/print-mail/self-mailers.d.mts +27 -8
  72. package/resources/print-mail/self-mailers.d.mts.map +1 -1
  73. package/resources/print-mail/self-mailers.d.ts +27 -8
  74. package/resources/print-mail/self-mailers.d.ts.map +1 -1
  75. package/resources/print-mail/self-mailers.js.map +1 -1
  76. package/resources/print-mail/self-mailers.mjs.map +1 -1
  77. package/src/client.ts +7 -7
  78. package/src/resources/print-mail/cheques.ts +80 -6
  79. package/src/resources/print-mail/index.ts +0 -12
  80. package/src/resources/print-mail/letters.ts +107 -7
  81. package/src/resources/print-mail/order-profiles/cheques.ts +108 -5
  82. package/src/resources/print-mail/order-profiles/letters.ts +81 -4
  83. package/src/resources/print-mail/order-profiles/postcards.ts +81 -4
  84. package/src/resources/print-mail/order-profiles/self-mailers.ts +81 -4
  85. package/src/resources/print-mail/postcards.ts +134 -8
  86. package/src/resources/print-mail/print-mail.ts +0 -28
  87. package/src/resources/print-mail/self-mailers.ts +134 -8
  88. package/src/version.ts +1 -1
  89. package/version.d.mts +1 -1
  90. package/version.d.ts +1 -1
  91. package/version.js +1 -1
  92. package/version.mjs +1 -1
  93. package/resources/print-mail/boxes.d.mts +0 -321
  94. package/resources/print-mail/boxes.d.mts.map +0 -1
  95. package/resources/print-mail/boxes.d.ts +0 -321
  96. package/resources/print-mail/boxes.d.ts.map +0 -1
  97. package/resources/print-mail/boxes.js +0 -85
  98. package/resources/print-mail/boxes.js.map +0 -1
  99. package/resources/print-mail/boxes.mjs +0 -81
  100. package/resources/print-mail/boxes.mjs.map +0 -1
  101. package/src/resources/print-mail/boxes.ts +0 -412
@@ -1,85 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Boxes = void 0;
5
- const resource_1 = require("../../core/resource.js");
6
- const pagination_1 = require("../../core/pagination.js");
7
- const path_1 = require("../../internal/utils/path.js");
8
- class Boxes extends resource_1.APIResource {
9
- /**
10
- * This endpoint allows you to create a box containing up to 100 cheques. A Box is
11
- * mailed to a single destination.
12
- *
13
- * To create a box. You must specify:
14
- *
15
- * - `to`: The recipient (contact or contact ID)
16
- * - `from`: The sender (contact or contact ID)
17
- * - `cheques`: An array of cheques to go in the box
18
- *
19
- * For each cheque You must specify:
20
- *
21
- * - `to`: The recipient (contact or contact ID)
22
- * - `from`: The sender (contact or contact ID)
23
- * - `bankAccount`: The bank account ID
24
- * - `amount`: The amount to be sent
25
- * - `number`: The cheque number
26
- *
27
- * @example
28
- * ```ts
29
- * const box = await client.printMail.boxes.create({
30
- * cheques: [
31
- * {
32
- * from: 'contact_456',
33
- * to: 'contact_123',
34
- * bankAccount: 'bank_abc',
35
- * amount: 5000,
36
- * number: 1042,
37
- * },
38
- * ],
39
- * from: 'contact_456',
40
- * to: 'contact_123',
41
- * });
42
- * ```
43
- */
44
- create(body, options) {
45
- return this._client.post('/print-mail/v1/boxes', { body, ...options });
46
- }
47
- /**
48
- * Retrieve a box by ID.
49
- *
50
- * @example
51
- * ```ts
52
- * const box = await client.printMail.boxes.retrieve('id');
53
- * ```
54
- */
55
- retrieve(id, options) {
56
- return this._client.get((0, path_1.path) `/print-mail/v1/boxes/${id}`, options);
57
- }
58
- /**
59
- * List all boxes.
60
- *
61
- * @example
62
- * ```ts
63
- * // Automatically fetches more pages as needed.
64
- * for await (const box of client.printMail.boxes.list()) {
65
- * // ...
66
- * }
67
- * ```
68
- */
69
- list(query = {}, options) {
70
- return this._client.getAPIList('/print-mail/v1/boxes', (pagination_1.SkipLimit), { query, ...options });
71
- }
72
- /**
73
- * Cancel a box by ID (cannot be undone).
74
- *
75
- * @example
76
- * ```ts
77
- * const box = await client.printMail.boxes.delete('id');
78
- * ```
79
- */
80
- delete(id, options) {
81
- return this._client.delete((0, path_1.path) `/print-mail/v1/boxes/${id}`, options);
82
- }
83
- }
84
- exports.Boxes = Boxes;
85
- //# sourceMappingURL=boxes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boxes.js","sourceRoot":"","sources":["../../src/resources/print-mail/boxes.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,yDAAqF;AAErF,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA0C,EAAE,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,sBAAc,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;CACF;AAjFD,sBAiFC"}
@@ -1,81 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../core/resource.mjs";
3
- import { SkipLimit } from "../../core/pagination.mjs";
4
- import { path } from "../../internal/utils/path.mjs";
5
- export class Boxes extends APIResource {
6
- /**
7
- * This endpoint allows you to create a box containing up to 100 cheques. A Box is
8
- * mailed to a single destination.
9
- *
10
- * To create a box. You must specify:
11
- *
12
- * - `to`: The recipient (contact or contact ID)
13
- * - `from`: The sender (contact or contact ID)
14
- * - `cheques`: An array of cheques to go in the box
15
- *
16
- * For each cheque You must specify:
17
- *
18
- * - `to`: The recipient (contact or contact ID)
19
- * - `from`: The sender (contact or contact ID)
20
- * - `bankAccount`: The bank account ID
21
- * - `amount`: The amount to be sent
22
- * - `number`: The cheque number
23
- *
24
- * @example
25
- * ```ts
26
- * const box = await client.printMail.boxes.create({
27
- * cheques: [
28
- * {
29
- * from: 'contact_456',
30
- * to: 'contact_123',
31
- * bankAccount: 'bank_abc',
32
- * amount: 5000,
33
- * number: 1042,
34
- * },
35
- * ],
36
- * from: 'contact_456',
37
- * to: 'contact_123',
38
- * });
39
- * ```
40
- */
41
- create(body, options) {
42
- return this._client.post('/print-mail/v1/boxes', { body, ...options });
43
- }
44
- /**
45
- * Retrieve a box by ID.
46
- *
47
- * @example
48
- * ```ts
49
- * const box = await client.printMail.boxes.retrieve('id');
50
- * ```
51
- */
52
- retrieve(id, options) {
53
- return this._client.get(path `/print-mail/v1/boxes/${id}`, options);
54
- }
55
- /**
56
- * List all boxes.
57
- *
58
- * @example
59
- * ```ts
60
- * // Automatically fetches more pages as needed.
61
- * for await (const box of client.printMail.boxes.list()) {
62
- * // ...
63
- * }
64
- * ```
65
- */
66
- list(query = {}, options) {
67
- return this._client.getAPIList('/print-mail/v1/boxes', (SkipLimit), { query, ...options });
68
- }
69
- /**
70
- * Cancel a box by ID (cannot be undone).
71
- *
72
- * @example
73
- * ```ts
74
- * const box = await client.printMail.boxes.delete('id');
75
- * ```
76
- */
77
- delete(id, options) {
78
- return this._client.delete(path `/print-mail/v1/boxes/${id}`, options);
79
- }
80
- }
81
- //# sourceMappingURL=boxes.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boxes.mjs","sourceRoot":"","sources":["../../src/resources/print-mail/boxes.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAe,SAAS,EAAwB;OAEhD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA0C,EAAE,EAC5C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAA,SAAc,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wBAAwB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;CACF"}
@@ -1,412 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import * as BoxesAPI from './boxes';
5
- import * as ContactsAPI from './contacts';
6
- import * as PrintMailAPI from './print-mail';
7
- import { APIPromise } from '../../core/api-promise';
8
- import { PagePromise, SkipLimit, type SkipLimitParams } from '../../core/pagination';
9
- import { RequestOptions } from '../../internal/request-options';
10
- import { path } from '../../internal/utils/path';
11
-
12
- export class Boxes extends APIResource {
13
- /**
14
- * This endpoint allows you to create a box containing up to 100 cheques. A Box is
15
- * mailed to a single destination.
16
- *
17
- * To create a box. You must specify:
18
- *
19
- * - `to`: The recipient (contact or contact ID)
20
- * - `from`: The sender (contact or contact ID)
21
- * - `cheques`: An array of cheques to go in the box
22
- *
23
- * For each cheque You must specify:
24
- *
25
- * - `to`: The recipient (contact or contact ID)
26
- * - `from`: The sender (contact or contact ID)
27
- * - `bankAccount`: The bank account ID
28
- * - `amount`: The amount to be sent
29
- * - `number`: The cheque number
30
- *
31
- * @example
32
- * ```ts
33
- * const box = await client.printMail.boxes.create({
34
- * cheques: [
35
- * {
36
- * from: 'contact_456',
37
- * to: 'contact_123',
38
- * bankAccount: 'bank_abc',
39
- * amount: 5000,
40
- * number: 1042,
41
- * },
42
- * ],
43
- * from: 'contact_456',
44
- * to: 'contact_123',
45
- * });
46
- * ```
47
- */
48
- create(body: BoxCreateParams, options?: RequestOptions): APIPromise<Box> {
49
- return this._client.post('/print-mail/v1/boxes', { body, ...options });
50
- }
51
-
52
- /**
53
- * Retrieve a box by ID.
54
- *
55
- * @example
56
- * ```ts
57
- * const box = await client.printMail.boxes.retrieve('id');
58
- * ```
59
- */
60
- retrieve(id: string, options?: RequestOptions): APIPromise<Box> {
61
- return this._client.get(path`/print-mail/v1/boxes/${id}`, options);
62
- }
63
-
64
- /**
65
- * List all boxes.
66
- *
67
- * @example
68
- * ```ts
69
- * // Automatically fetches more pages as needed.
70
- * for await (const box of client.printMail.boxes.list()) {
71
- * // ...
72
- * }
73
- * ```
74
- */
75
- list(
76
- query: BoxListParams | null | undefined = {},
77
- options?: RequestOptions,
78
- ): PagePromise<BoxesSkipLimit, Box> {
79
- return this._client.getAPIList('/print-mail/v1/boxes', SkipLimit<Box>, { query, ...options });
80
- }
81
-
82
- /**
83
- * Cancel a box by ID (cannot be undone).
84
- *
85
- * @example
86
- * ```ts
87
- * const box = await client.printMail.boxes.delete('id');
88
- * ```
89
- */
90
- delete(id: string, options?: RequestOptions): APIPromise<Box> {
91
- return this._client.delete(path`/print-mail/v1/boxes/${id}`, options);
92
- }
93
- }
94
-
95
- export type BoxesSkipLimit = SkipLimit<Box>;
96
-
97
- export interface Box {
98
- /**
99
- * A unique ID prefixed with box\_
100
- */
101
- id: string;
102
-
103
- /**
104
- * The cheques inside this box (in read mode).
105
- */
106
- cheques: Array<Box.Cheque>;
107
-
108
- /**
109
- * The UTC time at which this resource was created.
110
- */
111
- createdAt: string;
112
-
113
- /**
114
- * The contact of the 'from' field in read mode should be a fully expanded Contact.
115
- */
116
- from: ContactsAPI.Contact;
117
-
118
- /**
119
- * `true` if this is a live mode resource else `false`.
120
- */
121
- live: boolean;
122
-
123
- /**
124
- * The mailing class of this order. This determines the speed and cost of delivery.
125
- * See `OrderMailingClass` for more details.
126
- */
127
- mailingClass: OrderMailingClass;
128
-
129
- /**
130
- * Always "box".
131
- */
132
- object: 'box';
133
-
134
- /**
135
- * This order will transition from `ready` to `printing` on the day after this
136
- * date. For example, if this is a date on Tuesday, the order will transition to
137
- * `printing` on Wednesday at midnight eastern time.
138
- */
139
- sendDate: string;
140
-
141
- /**
142
- * See `OrderStatus` for more details on the status of this order.
143
- */
144
- status: OrderStatus;
145
-
146
- /**
147
- * The recipient of this order. This will be provided even if you delete the
148
- * underlying contact.
149
- */
150
- to: ContactsAPI.Contact;
151
-
152
- /**
153
- * The UTC time at which this resource was last updated.
154
- */
155
- updatedAt: string;
156
-
157
- /**
158
- * The cancellation details of this order. Populated if the order has been
159
- * cancelled.
160
- */
161
- cancellation?: Cancellation;
162
-
163
- /**
164
- * An optional string describing this resource. Will be visible in the API and the
165
- * dashboard.
166
- */
167
- description?: string;
168
-
169
- /**
170
- * The last date that the IMB status was updated. See `imbStatus` for more details.
171
- */
172
- imbDate?: string;
173
-
174
- /**
175
- * The Intelligent Mail Barcode (IMB) status of this order. Only populated for
176
- * US-printed and US-destined orders. This is the most detailed way to track
177
- * non-express/certified orders.
178
- */
179
- imbStatus?: OrderImbStatus;
180
-
181
- /**
182
- * The most recent ZIP code of the USPS facility that the order has been processed
183
- * through. Only populated when an `imbStatus` is present.
184
- */
185
- imbZIPCode?: string;
186
-
187
- /**
188
- * These will be merged with the variables in the template or HTML you create this
189
- * order with. The keys in this object should match the variable names in the
190
- * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
191
- * PDFs uploaded with the order.
192
- */
193
- mergeVariables?: { [key: string]: unknown };
194
-
195
- /**
196
- * See the section on Metadata.
197
- */
198
- metadata?: { [key: string]: unknown };
199
-
200
- /**
201
- * The tracking number of this order. Populated after an express/certified order
202
- * has been processed for delivery.
203
- */
204
- trackingNumber?: string;
205
-
206
- /**
207
- * PostGrid renders a PDF preview for all orders. This should be inspected to
208
- * ensure that the order is correct before it is sent out because it shows what
209
- * will be printed and mailed to the recipient. Once the PDF preview is generated,
210
- * this field will be returned by all `GET` endpoints which produce this order.
211
- *
212
- * This URL is a signed link to the PDF preview. It will expire after a short
213
- * period of time. If you need to access this URL after it has expired, you can
214
- * regenerate it by calling the `GET` endpoint again.
215
- */
216
- url?: string;
217
- }
218
-
219
- export namespace Box {
220
- /**
221
- * Model representing a single cheque in "read" mode.
222
- *
223
- * - The "from" and "to" should be fully expanded Contact objects once created.
224
- */
225
- export interface Cheque extends BoxesAPI.BoxChequeBase {
226
- from: ContactsAPI.Contact;
227
-
228
- to: ContactsAPI.Contact;
229
- }
230
- }
231
-
232
- /**
233
- * Base fields that both reading and creating a cheque might share.
234
- */
235
- export interface BoxChequeBase {
236
- /**
237
- * The amount on the cheque.
238
- */
239
- amount: number;
240
-
241
- /**
242
- * The bank account (ID or reference) from which the cheque amount is drawn.
243
- */
244
- bankAccount: string;
245
-
246
- /**
247
- * The cheque number.
248
- */
249
- number: number;
250
-
251
- /**
252
- * A URL to a logo for the cheque (optional).
253
- */
254
- logoURL?: string;
255
-
256
- /**
257
- * The memo text on the cheque (optional).
258
- */
259
- memo?: string;
260
-
261
- /**
262
- * A set of dynamic merge variables for customizing the cheque or accompanying
263
- * documents (optional).
264
- */
265
- mergeVariables?: { [key: string]: unknown };
266
-
267
- /**
268
- * An optional message template to be printed on or with the cheque.
269
- */
270
- messageTemplate?: string;
271
- }
272
-
273
- export interface Cancellation {
274
- /**
275
- * The reason for the cancellation.
276
- */
277
- reason: 'user_initiated' | 'invalid_content' | 'invalid_order_mailing_class';
278
-
279
- /**
280
- * The user ID who cancelled the order.
281
- */
282
- cancelledByUser?: string;
283
-
284
- /**
285
- * An optional note provided by the user who cancelled the order.
286
- */
287
- note?: string;
288
- }
289
-
290
- export type OrderImbStatus = 'entered_mail_stream' | 'out_for_delivery' | 'returned_to_sender';
291
-
292
- export type OrderMailingClass =
293
- | 'first_class'
294
- | 'standard_class'
295
- | 'express'
296
- | 'certified'
297
- | 'certified_return_receipt'
298
- | 'registered'
299
- | 'usps_first_class'
300
- | 'usps_standard_class'
301
- | 'usps_eddm'
302
- | 'usps_express_2_day'
303
- | 'usps_express_3_day'
304
- | 'usps_first_class_certified'
305
- | 'usps_first_class_certified_return_receipt'
306
- | 'usps_first_class_registered'
307
- | 'usps_express_3_day_signature_confirmation'
308
- | 'usps_express_3_day_certified'
309
- | 'usps_express_3_day_certified_return_receipt'
310
- | 'ca_post_lettermail'
311
- | 'ca_post_personalized'
312
- | 'ca_post_neighbourhood_mail'
313
- | 'ups_express_overnight'
314
- | 'ups_express_2_day'
315
- | 'ups_express_3_day'
316
- | 'royal_mail_first_class'
317
- | 'royal_mail_second_class'
318
- | 'au_post_second_class';
319
-
320
- export type OrderStatus = 'ready' | 'printing' | 'processed_for_delivery' | 'completed' | 'cancelled';
321
-
322
- export interface BoxCreateParams {
323
- /**
324
- * The cheques to be mailed in the box. Only 100 cheques can be included in a box
325
- * at a time.
326
- */
327
- cheques: Array<BoxCreateParams.Cheque>;
328
-
329
- /**
330
- * The 'from' (sender) of the entire box. Accepts inline ContactCreate or a
331
- * contactID.
332
- */
333
- from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string;
334
-
335
- /**
336
- * The recipient of this order. You can either supply the contact information
337
- * inline here or provide a contact ID. PostGrid will automatically deduplicate
338
- * contacts regardless of whether you provide the information inline here or call
339
- * the contact creation endpoint.
340
- */
341
- to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string;
342
-
343
- /**
344
- * An optional string describing this resource. Will be visible in the API and the
345
- * dashboard.
346
- */
347
- description?: string;
348
-
349
- /**
350
- * The mailing class of this order. If not provided, automatically set to
351
- * `first_class`.
352
- */
353
- mailingClass?: OrderMailingClass;
354
-
355
- /**
356
- * These will be merged with the variables in the template or HTML you create this
357
- * order with. The keys in this object should match the variable names in the
358
- * template _exactly_ as they are case-sensitive. Note that these _do not_ apply to
359
- * PDFs uploaded with the order.
360
- */
361
- mergeVariables?: { [key: string]: unknown };
362
-
363
- /**
364
- * See the section on Metadata.
365
- */
366
- metadata?: { [key: string]: unknown };
367
-
368
- /**
369
- * This order will transition from `ready` to `printing` on the day after this
370
- * date. You can use this parameter to schedule orders for a future date.
371
- */
372
- sendDate?: string;
373
- }
374
-
375
- export namespace BoxCreateParams {
376
- /**
377
- * Model representing a single cheque in "create" mode.
378
- *
379
- * - The "from" and "to" can be ContactCreate objects (inline) or string
380
- * contactIDs.
381
- */
382
- export interface Cheque extends BoxesAPI.BoxChequeBase {
383
- from: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string;
384
-
385
- to: PrintMailAPI.ContactCreateWithFirstName | PrintMailAPI.ContactCreateWithCompanyName | string;
386
- }
387
- }
388
-
389
- export interface BoxListParams extends SkipLimitParams {
390
- /**
391
- * You can supply any string to help narrow down the list of resources. For
392
- * example, if you pass `"New York"` (quoted), it will return resources that have
393
- * that string present somewhere in their response. Alternatively, you can supply a
394
- * structured search query. See the documentation on `StructuredSearchQuery` for
395
- * more details.
396
- */
397
- search?: string;
398
- }
399
-
400
- export declare namespace Boxes {
401
- export {
402
- type Box as Box,
403
- type BoxChequeBase as BoxChequeBase,
404
- type Cancellation as Cancellation,
405
- type OrderImbStatus as OrderImbStatus,
406
- type OrderMailingClass as OrderMailingClass,
407
- type OrderStatus as OrderStatus,
408
- type BoxesSkipLimit as BoxesSkipLimit,
409
- type BoxCreateParams as BoxCreateParams,
410
- type BoxListParams as BoxListParams,
411
- };
412
- }