-
Notifications
You must be signed in to change notification settings - Fork 0
/
shipments.ts
98 lines (84 loc) · 2.51 KB
/
shipments.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import * as Core from '../../core';
import { APIResource } from '../../resource';
import * as ShipmentsAPI from './shipments';
export class Shipments extends APIResource {
/**
* Simulate a shipment tracking update, such as those that Bolt would ingest from
* third-party shipping providers that would allow updating tracking and delivery
* information to shipments associated with orders.
*/
testingShipmentTrackingCreate(
body: ShipmentTestingShipmentTrackingCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<void> {
return this._client.post('/testing/shipments', {
body,
...options,
headers: { Accept: '*/*', ...options?.headers },
});
}
}
export interface ShipmentTestingShipmentTrackingCreateParams {
/**
* The shipment's status.
*/
status: 'in_transit' | 'cancelled' | 'failure' | 'delivered';
/**
* A list of tracking updates that contain the shipment's status, location, and any
* unique messages.
*/
tracking_details: Array<ShipmentTestingShipmentTrackingCreateParams.TrackingDetail>;
/**
* The carrier's tracking number for the shipment. Must be prefixed with
* `MockBolt`.
*/
tracking_number: string;
/**
* The shipment's actual or estimated delivery date.
*/
delivery_date?: string;
}
export namespace ShipmentTestingShipmentTrackingCreateParams {
export interface TrackingDetail {
/**
* The country associated this this set of tracking details, if any.
*/
country_code?: string;
/**
* The tracking detail's timestamp.
*/
event_date?: string;
/**
* The locality associated this this set of tracking details, if any.
*/
locality?: string;
/**
* An arbitrary, human-readable message associated with this set of tracking
* details.
*/
message?: string;
/**
* The postal associated this this set of tracking details, if any.
*/
postal_code?: string;
/**
* The region associated this this set of tracking details, if any.
*/
region?: string;
status?:
| 'unknown'
| 'pre_transit'
| 'in_transit'
| 'out_for_delivery'
| 'delivered'
| 'available_for_pickup'
| 'return_to_sender'
| 'failure'
| 'cancelled'
| 'error';
}
}
export namespace Shipments {
export import ShipmentTestingShipmentTrackingCreateParams = ShipmentsAPI.ShipmentTestingShipmentTrackingCreateParams;
}