@chrt-inc/typescript-sdk 0.0.203 → 0.0.205

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 (54) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.d.ts +13 -13
  3. package/dist/cjs/api/resources/courierPayDriverRateSheets/client/Client.js +57 -57
  4. package/dist/cjs/api/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/index.js +1 -0
  6. package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.d.ts +16 -16
  7. package/dist/cjs/api/resources/shipperPayCourierLineItemGroups/client/Client.js +45 -45
  8. package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.d.ts +50 -30
  9. package/dist/cjs/api/resources/shipperPayCourierPayments/client/Client.js +134 -59
  10. package/dist/cjs/api/resources/shipperPayCourierPayments/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/shipperPayCourierPayments/client/index.js +15 -0
  12. package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.d.ts +16 -0
  13. package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.d.ts +15 -0
  14. package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.js +5 -0
  15. package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/shipperPayCourierPayments/client/requests/index.js +2 -0
  17. package/dist/cjs/api/types/CreateShipperPayCourierPaymentReq.d.ts +0 -3
  18. package/dist/cjs/api/types/GetShipperPayCourierPaymentsForShipperRes.d.ts +0 -3
  19. package/dist/cjs/api/types/PaymentPreviewResponse.d.ts +0 -3
  20. package/dist/cjs/api/types/ShipperPayCourierPayment1.d.ts +4 -3
  21. package/dist/cjs/api/types/index.d.ts +0 -1
  22. package/dist/cjs/api/types/index.js +0 -1
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/Client.mjs +2 -2
  26. package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.d.mts +13 -13
  27. package/dist/esm/api/resources/courierPayDriverRateSheets/client/Client.mjs +57 -57
  28. package/dist/esm/api/resources/index.d.mts +1 -0
  29. package/dist/esm/api/resources/index.mjs +1 -0
  30. package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.d.mts +16 -16
  31. package/dist/esm/api/resources/shipperPayCourierLineItemGroups/client/Client.mjs +45 -45
  32. package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.d.mts +50 -30
  33. package/dist/esm/api/resources/shipperPayCourierPayments/client/Client.mjs +134 -59
  34. package/dist/esm/api/resources/shipperPayCourierPayments/client/index.d.mts +1 -0
  35. package/dist/esm/api/resources/shipperPayCourierPayments/client/index.mjs +1 -1
  36. package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.d.mts +16 -0
  37. package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.d.mts +15 -0
  38. package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/ListPaymentsByShipperReq.mjs +4 -0
  39. package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/index.d.mts +2 -0
  40. package/dist/esm/api/resources/shipperPayCourierPayments/client/requests/index.mjs +1 -0
  41. package/dist/esm/api/types/CreateShipperPayCourierPaymentReq.d.mts +0 -3
  42. package/dist/esm/api/types/GetShipperPayCourierPaymentsForShipperRes.d.mts +0 -3
  43. package/dist/esm/api/types/PaymentPreviewResponse.d.mts +0 -3
  44. package/dist/esm/api/types/ShipperPayCourierPayment1.d.mts +4 -3
  45. package/dist/esm/api/types/index.d.mts +0 -1
  46. package/dist/esm/api/types/index.mjs +0 -1
  47. package/dist/esm/version.d.mts +1 -1
  48. package/dist/esm/version.mjs +1 -1
  49. package/package.json +1 -1
  50. package/reference.md +159 -84
  51. package/dist/cjs/api/types/GetShipperPayCourierPaymentsRes.d.ts +0 -10
  52. package/dist/esm/api/types/GetShipperPayCourierPaymentsRes.d.mts +0 -10
  53. /package/dist/cjs/api/{types/GetShipperPayCourierPaymentsRes.js → resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.js} +0 -0
  54. /package/dist/esm/api/{types/GetShipperPayCourierPaymentsRes.mjs → resources/shipperPayCourierPayments/client/requests/ListPaymentsByCourierReq.mjs} +0 -0
@@ -56,24 +56,24 @@ class ShipperPayCourierPayments {
56
56
  this._options = _options;
57
57
  }
58
58
  /**
59
- * Retrieves all shipper-to-courier payments for a specific order by ID or short ID.
59
+ * Get a shipper pay courier payment by its ID
60
60
  *
61
- * @param {string} orderIdOrShortId
61
+ * @param {string} shipperPayCourierPaymentId
62
62
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
63
63
  *
64
64
  * @throws {@link Chrt.UnprocessableEntityError}
65
65
  *
66
66
  * @example
67
- * await client.shipperPayCourierPayments.getByOrderIdOrShortId("order_id_or_short_id")
67
+ * await client.shipperPayCourierPayments.getById("shipper_pay_courier_payment_id")
68
68
  */
69
- getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
70
- return core.HttpResponsePromise.fromPromise(this.__getByOrderIdOrShortId(orderIdOrShortId, requestOptions));
69
+ getById(shipperPayCourierPaymentId, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__getById(shipperPayCourierPaymentId, requestOptions));
71
71
  }
72
- __getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
72
+ __getById(shipperPayCourierPaymentId, requestOptions) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
74
  var _a, _b, _c, _d;
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/${encodeURIComponent(orderIdOrShortId)}`),
76
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/${encodeURIComponent(shipperPayCourierPaymentId)}`),
77
77
  method: "GET",
78
78
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
79
79
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -103,7 +103,7 @@ class ShipperPayCourierPayments {
103
103
  rawResponse: _response.rawResponse,
104
104
  });
105
105
  case "timeout":
106
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/{order_id_or_short_id}.");
106
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/{shipper_pay_courier_payment_id}.");
107
107
  case "unknown":
108
108
  throw new errors.ChrtError({
109
109
  message: _response.error.errorMessage,
@@ -113,31 +113,26 @@ class ShipperPayCourierPayments {
113
113
  });
114
114
  }
115
115
  /**
116
- * Create a shipper-to-courier payment record based on all task groups in an order
116
+ * Deletes a shipper-to-courier payment record. Only allowed if the payment status is PENDING.
117
117
  *
118
- * @param {Chrt.CreateShipperPayCourierPaymentReq} request
118
+ * @param {string} shipperPayCourierPaymentId
119
119
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
120
120
  *
121
121
  * @throws {@link Chrt.UnprocessableEntityError}
122
122
  *
123
123
  * @example
124
- * await client.shipperPayCourierPayments.create({
125
- * order_id_or_short_id: "order_id_or_short_id"
126
- * })
124
+ * await client.shipperPayCourierPayments.delete("shipper_pay_courier_payment_id")
127
125
  */
128
- create(request, requestOptions) {
129
- return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
126
+ delete(shipperPayCourierPaymentId, requestOptions) {
127
+ return core.HttpResponsePromise.fromPromise(this.__delete(shipperPayCourierPaymentId, requestOptions));
130
128
  }
131
- __create(request, requestOptions) {
129
+ __delete(shipperPayCourierPaymentId, requestOptions) {
132
130
  return __awaiter(this, void 0, void 0, function* () {
133
131
  var _a, _b, _c, _d;
134
132
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
135
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/create"),
136
- method: "POST",
133
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/${encodeURIComponent(shipperPayCourierPaymentId)}`),
134
+ method: "DELETE",
137
135
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
- contentType: "application/json",
139
- requestType: "json",
140
- body: request,
141
136
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
142
137
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
143
138
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -165,7 +160,7 @@ class ShipperPayCourierPayments {
165
160
  rawResponse: _response.rawResponse,
166
161
  });
167
162
  case "timeout":
168
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/create.");
163
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/shipper_pay_courier_payments/{shipper_pay_courier_payment_id}.");
169
164
  case "unknown":
170
165
  throw new errors.ChrtError({
171
166
  message: _response.error.errorMessage,
@@ -175,27 +170,92 @@ class ShipperPayCourierPayments {
175
170
  });
176
171
  }
177
172
  /**
178
- * Retrieves all shipper-to-courier payments for the authenticated shipper organization.
173
+ * Get a shipper pay courier payment by order ID or short ID
179
174
  *
175
+ * @param {string} orderIdOrShortId
180
176
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
181
177
  *
178
+ * @throws {@link Chrt.UnprocessableEntityError}
179
+ *
182
180
  * @example
183
- * await client.shipperPayCourierPayments.listByShipperOrg()
181
+ * await client.shipperPayCourierPayments.getByOrderIdOrShortId("order_id_or_short_id")
184
182
  */
185
- listByShipperOrg(requestOptions) {
186
- return core.HttpResponsePromise.fromPromise(this.__listByShipperOrg(requestOptions));
183
+ getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
184
+ return core.HttpResponsePromise.fromPromise(this.__getByOrderIdOrShortId(orderIdOrShortId, requestOptions));
187
185
  }
188
- __listByShipperOrg(requestOptions) {
186
+ __getByOrderIdOrShortId(orderIdOrShortId, requestOptions) {
189
187
  return __awaiter(this, void 0, void 0, function* () {
190
188
  var _a, _b, _c, _d;
191
189
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
192
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/shipper/all"),
190
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/by_order/${encodeURIComponent(orderIdOrShortId)}`),
193
191
  method: "GET",
194
192
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
195
193
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
196
194
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
197
195
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
198
196
  });
197
+ if (_response.ok) {
198
+ return { data: _response.body, rawResponse: _response.rawResponse };
199
+ }
200
+ if (_response.error.reason === "status-code") {
201
+ switch (_response.error.statusCode) {
202
+ case 422:
203
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
204
+ default:
205
+ throw new errors.ChrtError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.body,
208
+ rawResponse: _response.rawResponse,
209
+ });
210
+ }
211
+ }
212
+ switch (_response.error.reason) {
213
+ case "non-json":
214
+ throw new errors.ChrtError({
215
+ statusCode: _response.error.statusCode,
216
+ body: _response.error.rawBody,
217
+ rawResponse: _response.rawResponse,
218
+ });
219
+ case "timeout":
220
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/by_order/{order_id_or_short_id}.");
221
+ case "unknown":
222
+ throw new errors.ChrtError({
223
+ message: _response.error.errorMessage,
224
+ rawResponse: _response.rawResponse,
225
+ });
226
+ }
227
+ });
228
+ }
229
+ /**
230
+ * List shipper pay courier payments by shipper org ID with status filtering
231
+ *
232
+ * @param {Chrt.ListPaymentsByShipperReq} request
233
+ * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
234
+ *
235
+ * @throws {@link Chrt.UnprocessableEntityError}
236
+ *
237
+ * @example
238
+ * await client.shipperPayCourierPayments.listByShipperOrgId({
239
+ * statuses: ["invoice_not_yet_created"]
240
+ * })
241
+ */
242
+ listByShipperOrgId(request, requestOptions) {
243
+ return core.HttpResponsePromise.fromPromise(this.__listByShipperOrgId(request, requestOptions));
244
+ }
245
+ __listByShipperOrgId(request, requestOptions) {
246
+ return __awaiter(this, void 0, void 0, function* () {
247
+ var _a, _b, _c, _d;
248
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
249
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/list/by_shipper_org_id"),
250
+ method: "POST",
251
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
252
+ contentType: "application/json",
253
+ requestType: "json",
254
+ body: request,
255
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
256
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
257
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
258
+ });
199
259
  if (_response.ok) {
200
260
  return {
201
261
  data: _response.body,
@@ -203,11 +263,16 @@ class ShipperPayCourierPayments {
203
263
  };
204
264
  }
205
265
  if (_response.error.reason === "status-code") {
206
- throw new errors.ChrtError({
207
- statusCode: _response.error.statusCode,
208
- body: _response.error.body,
209
- rawResponse: _response.rawResponse,
210
- });
266
+ switch (_response.error.statusCode) {
267
+ case 422:
268
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
269
+ default:
270
+ throw new errors.ChrtError({
271
+ statusCode: _response.error.statusCode,
272
+ body: _response.error.body,
273
+ rawResponse: _response.rawResponse,
274
+ });
275
+ }
211
276
  }
212
277
  switch (_response.error.reason) {
213
278
  case "non-json":
@@ -217,7 +282,7 @@ class ShipperPayCourierPayments {
217
282
  rawResponse: _response.rawResponse,
218
283
  });
219
284
  case "timeout":
220
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/shipper/all.");
285
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/list/by_shipper_org_id.");
221
286
  case "unknown":
222
287
  throw new errors.ChrtError({
223
288
  message: _response.error.errorMessage,
@@ -227,26 +292,31 @@ class ShipperPayCourierPayments {
227
292
  });
228
293
  }
229
294
  /**
230
- * Retrieves shipper-to-courier payments for the authenticated shipper organization filtered by payment status.
295
+ * List shipper pay courier payments by courier org ID with status filtering
231
296
  *
232
- * @param {Chrt.StripeConnectInvoiceStatusEnum} paymentStatus
297
+ * @param {Chrt.ListPaymentsByCourierReq} request
233
298
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
234
299
  *
235
300
  * @throws {@link Chrt.UnprocessableEntityError}
236
301
  *
237
302
  * @example
238
- * await client.shipperPayCourierPayments.listByShipperOrgAndStatus("invoice_not_yet_created")
303
+ * await client.shipperPayCourierPayments.listByCourierOrgId({
304
+ * statuses: ["invoice_not_yet_created"]
305
+ * })
239
306
  */
240
- listByShipperOrgAndStatus(paymentStatus, requestOptions) {
241
- return core.HttpResponsePromise.fromPromise(this.__listByShipperOrgAndStatus(paymentStatus, requestOptions));
307
+ listByCourierOrgId(request, requestOptions) {
308
+ return core.HttpResponsePromise.fromPromise(this.__listByCourierOrgId(request, requestOptions));
242
309
  }
243
- __listByShipperOrgAndStatus(paymentStatus, requestOptions) {
310
+ __listByCourierOrgId(request, requestOptions) {
244
311
  return __awaiter(this, void 0, void 0, function* () {
245
312
  var _a, _b, _c, _d;
246
313
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
247
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/shipper/status/${encodeURIComponent(paymentStatus)}`),
248
- method: "GET",
314
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/list/by_courier_org_id"),
315
+ method: "POST",
249
316
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
317
+ contentType: "application/json",
318
+ requestType: "json",
319
+ body: request,
250
320
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
251
321
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
252
322
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -277,7 +347,7 @@ class ShipperPayCourierPayments {
277
347
  rawResponse: _response.rawResponse,
278
348
  });
279
349
  case "timeout":
280
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/shipper_pay_courier_payments/shipper/status/{payment_status}.");
350
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/list/by_courier_org_id.");
281
351
  case "unknown":
282
352
  throw new errors.ChrtError({
283
353
  message: _response.error.errorMessage,
@@ -287,7 +357,7 @@ class ShipperPayCourierPayments {
287
357
  });
288
358
  }
289
359
  /**
290
- * Preview a shipper-to-courier payment showing task groups, line item groups, total amount, and readiness status
360
+ * Create a shipper-to-courier payment record based on all task groups in an order
291
361
  *
292
362
  * @param {Chrt.CreateShipperPayCourierPaymentReq} request
293
363
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
@@ -295,18 +365,18 @@ class ShipperPayCourierPayments {
295
365
  * @throws {@link Chrt.UnprocessableEntityError}
296
366
  *
297
367
  * @example
298
- * await client.shipperPayCourierPayments.preview({
368
+ * await client.shipperPayCourierPayments.create({
299
369
  * order_id_or_short_id: "order_id_or_short_id"
300
370
  * })
301
371
  */
302
- preview(request, requestOptions) {
303
- return core.HttpResponsePromise.fromPromise(this.__preview(request, requestOptions));
372
+ create(request, requestOptions) {
373
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
304
374
  }
305
- __preview(request, requestOptions) {
375
+ __create(request, requestOptions) {
306
376
  return __awaiter(this, void 0, void 0, function* () {
307
377
  var _a, _b, _c, _d;
308
378
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
309
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/preview"),
379
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/create"),
310
380
  method: "POST",
311
381
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
312
382
  contentType: "application/json",
@@ -339,7 +409,7 @@ class ShipperPayCourierPayments {
339
409
  rawResponse: _response.rawResponse,
340
410
  });
341
411
  case "timeout":
342
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/preview.");
412
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/create.");
343
413
  case "unknown":
344
414
  throw new errors.ChrtError({
345
415
  message: _response.error.errorMessage,
@@ -349,26 +419,31 @@ class ShipperPayCourierPayments {
349
419
  });
350
420
  }
351
421
  /**
352
- * Deletes a shipper-to-courier payment record. Only allowed if the payment status is PENDING.
422
+ * Preview a shipper-to-courier payment showing task groups, line item groups, total amount, and readiness status
353
423
  *
354
- * @param {string} shipperPayCourierPaymentId
424
+ * @param {Chrt.CreateShipperPayCourierPaymentReq} request
355
425
  * @param {ShipperPayCourierPayments.RequestOptions} requestOptions - Request-specific configuration.
356
426
  *
357
427
  * @throws {@link Chrt.UnprocessableEntityError}
358
428
  *
359
429
  * @example
360
- * await client.shipperPayCourierPayments.delete("shipper_pay_courier_payment_id")
430
+ * await client.shipperPayCourierPayments.preview({
431
+ * order_id_or_short_id: "order_id_or_short_id"
432
+ * })
361
433
  */
362
- delete(shipperPayCourierPaymentId, requestOptions) {
363
- return core.HttpResponsePromise.fromPromise(this.__delete(shipperPayCourierPaymentId, requestOptions));
434
+ preview(request, requestOptions) {
435
+ return core.HttpResponsePromise.fromPromise(this.__preview(request, requestOptions));
364
436
  }
365
- __delete(shipperPayCourierPaymentId, requestOptions) {
437
+ __preview(request, requestOptions) {
366
438
  return __awaiter(this, void 0, void 0, function* () {
367
439
  var _a, _b, _c, _d;
368
440
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
369
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, `oort/shipper_pay_courier_payments/${encodeURIComponent(shipperPayCourierPaymentId)}`),
370
- method: "DELETE",
441
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "oort/shipper_pay_courier_payments/preview"),
442
+ method: "POST",
371
443
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
444
+ contentType: "application/json",
445
+ requestType: "json",
446
+ body: request,
372
447
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
373
448
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
374
449
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -396,7 +471,7 @@ class ShipperPayCourierPayments {
396
471
  rawResponse: _response.rawResponse,
397
472
  });
398
473
  case "timeout":
399
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /oort/shipper_pay_courier_payments/{shipper_pay_courier_payment_id}.");
474
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/shipper_pay_courier_payments/preview.");
400
475
  case "unknown":
401
476
  throw new errors.ChrtError({
402
477
  message: _response.error.errorMessage,
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests/index.js";
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * statuses: ["invoice_not_yet_created"]
9
+ * }
10
+ */
11
+ export interface ListPaymentsByCourierReq {
12
+ statuses: Chrt.StripeConnectInvoiceStatusEnum[];
13
+ /** Must be a string starting with `org_` */
14
+ shipper_org_id?: string | null;
15
+ off_chrt_shipper_org_info_id?: string | null;
16
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * statuses: ["invoice_not_yet_created"]
9
+ * }
10
+ */
11
+ export interface ListPaymentsByShipperReq {
12
+ statuses: Chrt.StripeConnectInvoiceStatusEnum[];
13
+ /** Must be a string starting with `org_` */
14
+ courier_org_id?: string | null;
15
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { type ListPaymentsByShipperReq } from "./ListPaymentsByShipperReq.js";
2
+ export { type ListPaymentsByCourierReq } from "./ListPaymentsByCourierReq.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- /**
5
- * Request model for creating a payment.
6
- */
7
4
  export interface CreateShipperPayCourierPaymentReq {
8
5
  order_id_or_short_id: string;
9
6
  }
@@ -2,9 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Chrt from "../index.js";
5
- /**
6
- * Response model for getting shipper pay courier payments for a shipper organization.
7
- */
8
5
  export interface GetShipperPayCourierPaymentsForShipperRes {
9
6
  payments: Chrt.ShipperPayCourierPayment1[];
10
7
  }
@@ -2,9 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as Chrt from "../index.js";
5
- /**
6
- * Response model for payment preview.
7
- */
8
5
  export interface PaymentPreviewResponse {
9
6
  task_groups: Chrt.TaskGroup1[];
10
7
  line_item_groups: Chrt.ShipperPayCourierLineItemGroup1[];
@@ -11,13 +11,14 @@ export interface ShipperPayCourierPayment1 {
11
11
  shipper_org_id?: string | null;
12
12
  /** Must be a string starting with `org_` */
13
13
  courier_org_id: string;
14
+ stripe_connect_shipper_pay_courier_customer_id?: string | null;
15
+ stripe_invoice_id?: string | null;
16
+ stripe_invoice_url?: string | null;
14
17
  stripe_invoice_created_timestamp?: string | null;
15
- stripe_invoice_completed_timestamp?: string | null;
16
18
  /** Must be a string starting with `user_` */
17
19
  stripe_invoice_created_by_user_id?: string | null;
18
20
  payment_amount: number;
19
21
  stripe_invoice_status?: Chrt.StripeConnectInvoiceStatusEnum;
20
- stripe_invoice_id?: string | null;
21
- stripe_connect_shipper_pay_courier_customer_id?: string | null;
22
+ stripe_invoice_completed_timestamp?: string | null;
22
23
  _id: string;
23
24
  }
@@ -25,7 +25,6 @@ export * from "./GeometryCollectionOutputGeometriesItem.js";
25
25
  export * from "./GetOrderFullRes.js";
26
26
  export * from "./GetOrderRes.js";
27
27
  export * from "./GetShipperPayCourierPaymentsForShipperRes.js";
28
- export * from "./GetShipperPayCourierPaymentsRes.js";
29
28
  export * from "./HttpValidationError.js";
30
29
  export * from "./LineItem1.js";
31
30
  export * from "./LineItemClientCreate1.js";
@@ -41,7 +41,6 @@ __exportStar(require("./GeometryCollectionOutputGeometriesItem.js"), exports);
41
41
  __exportStar(require("./GetOrderFullRes.js"), exports);
42
42
  __exportStar(require("./GetOrderRes.js"), exports);
43
43
  __exportStar(require("./GetShipperPayCourierPaymentsForShipperRes.js"), exports);
44
- __exportStar(require("./GetShipperPayCourierPaymentsRes.js"), exports);
45
44
  __exportStar(require("./HttpValidationError.js"), exports);
46
45
  __exportStar(require("./LineItem1.js"), exports);
47
46
  __exportStar(require("./LineItemClientCreate1.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.203";
1
+ export declare const SDK_VERSION = "0.0.205";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.0.203";
4
+ exports.SDK_VERSION = "0.0.205";
@@ -30,8 +30,8 @@ export class ChrtClient {
30
30
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
31
31
  "X-Fern-Language": "JavaScript",
32
32
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
33
- "X-Fern-SDK-Version": "0.0.203",
34
- "User-Agent": "@chrt-inc/typescript-sdk/0.0.203",
33
+ "X-Fern-SDK-Version": "0.0.205",
34
+ "User-Agent": "@chrt-inc/typescript-sdk/0.0.205",
35
35
  "X-Fern-Runtime": core.RUNTIME.type,
36
36
  "X-Fern-Runtime-Version": core.RUNTIME.version,
37
37
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -38,6 +38,19 @@ export declare class CourierPayDriverRateSheets {
38
38
  */
39
39
  listByCourierOrgId(requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
40
40
  private __listByCourierOrgId;
41
+ /**
42
+ * Retrieves all rate sheets assigned to a specific driver.
43
+ *
44
+ * @param {string} driverId
45
+ * @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
46
+ *
47
+ * @throws {@link Chrt.UnprocessableEntityError}
48
+ *
49
+ * @example
50
+ * await client.courierPayDriverRateSheets.listByDriverId("driver_id")
51
+ */
52
+ listByDriverId(driverId: string, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
53
+ private __listByDriverId;
41
54
  /**
42
55
  * Creates a new driver rate sheet for calculating courier payments.
43
56
  *
@@ -107,18 +120,5 @@ export declare class CourierPayDriverRateSheets {
107
120
  */
108
121
  updateById(id: string, request?: Chrt.CourierPayDriverRateSheetClientUpdate1, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1>;
109
122
  private __updateById;
110
- /**
111
- * Retrieves all rate sheets assigned to a specific driver.
112
- *
113
- * @param {string} driverId
114
- * @param {CourierPayDriverRateSheets.RequestOptions} requestOptions - Request-specific configuration.
115
- *
116
- * @throws {@link Chrt.UnprocessableEntityError}
117
- *
118
- * @example
119
- * await client.courierPayDriverRateSheets.listByDriverId("driver_id")
120
- */
121
- listByDriverId(driverId: string, requestOptions?: CourierPayDriverRateSheets.RequestOptions): core.HttpResponsePromise<Chrt.CourierPayDriverRateSheet1[]>;
122
- private __listByDriverId;
123
123
  protected _getAuthorizationHeader(): Promise<string | undefined>;
124
124
  }