UNPKG

3.18 kBTypeScriptView Raw
1import {Address} from './shared';
2import {PaymentIntent} from './payment-intents';
3
4/**
5 * The Order object.
6 */
7export interface Order {
8 /**
9 * Unique identifier for the object.
10 */
11 id: string;
12
13 /**
14 * String representing the object's type. Objects of the same type share the same value.
15 */
16 object: 'order';
17
18 /**
19 * Total order cost after discounts and taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts).
20 */
21 amount_total: number;
22
23 /**
24 * Order cost before any discounts or taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
25 */
26 amount_subtotal: number;
27
28 /**
29 * Customer billing details associated with the order.
30 */
31 billing_details: Order.Billing | null;
32
33 /**
34 * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
35 */
36 currency: string;
37
38 /**
39 * Time at which the object was created. Measured in seconds since the Unix epoch.
40 */
41 created: number;
42
43 /**
44 * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
45 */
46 livemode: boolean;
47
48 /**
49 * Customer shipping information associated with the order.
50 */
51 shipping_details: Order.Shipping | null;
52
53 /**
54 * Payment information associated with the order.
55 */
56 payment: Order.Payment;
57
58 /**
59 * The overall status of the order.
60 */
61 status: Order.Status;
62}
63
64export namespace Order {
65 export interface Billing {
66 /**
67 * Billing address for the order.
68 */
69 address?: Address;
70
71 /**
72 * Email address for the order.
73 */
74 email?: string | null;
75
76 /**
77 * Full name for the order.
78 */
79 name?: string | null;
80
81 /**
82 * Billing phone number for the order (including extension).
83 */
84 phone?: string | null;
85 }
86
87 export interface Shipping {
88 /**
89 * Recipient shipping address. Required if the order includes products that are shippable.
90 */
91 address?: Address;
92
93 /**
94 * Recipient name.
95 */
96 name?: string | null;
97
98 /**
99 * Recipient phone (including extension).
100 */
101 phone?: string | null;
102 }
103
104 export interface Payment {
105 /**
106 * Payment intent associated with this order. Null when the order is `open`.
107 */
108 payment_intent?: PaymentIntent | null;
109
110 /**
111 * The status of the underlying payment associated with this order, if any. Null when the order is `open`.
112 */
113 status?: PaymentIntent.Status | null;
114 }
115
116 export type Status =
117 | 'open'
118 | 'submitted'
119 | 'processing'
120 | 'complete'
121 | 'canceled';
122}