Skip to main content

ghl_models/v2/
store.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2// Source: https://github.com/GoHighLevel/highlevel-api-docs
3// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
4// they aren't held to rustdoc's markdown conventions.
5#![allow(
6    missing_docs,
7    clippy::doc_lazy_continuation,
8    clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13/// `AvailableShippingRate` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AvailableShippingRate {
16    /// Name of the shipping zone
17    /// Required by the API.
18    pub name: String,
19    /// Delivery description
20    #[serde(default, skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// The currency of the amount of the rate / handling fee
23    /// Required by the API.
24    pub currency: String,
25    /// The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee
26    /// if it is a carrier rate (it will add to the carrier rate).
27    /// Required by the API.
28    pub amount: f64,
29    /// is this a carrier rate
30    #[serde(
31        rename = "isCarrierRate",
32        default,
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub is_carrier_rate: Option<bool>,
36    /// Shipping carrier id
37    /// Required by the API.
38    #[serde(rename = "shippingCarrierId")]
39    pub shipping_carrier_id: String,
40    /// Percentage of rate fee if it is a carrier rate.
41    #[serde(
42        rename = "percentageOfRateFee",
43        default,
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub percentage_of_rate_fee: Option<f64>,
47    /// An array of items
48    #[serde(
49        rename = "shippingCarrierServices",
50        default,
51        skip_serializing_if = "Vec::is_empty"
52    )]
53    pub shipping_carrier_services: Vec<ShippingCarrierServiceDto>,
54    /// The unique identifier for the product.
55    /// Required by the API.
56    #[serde(rename = "_id")]
57    pub id: String,
58    /// The unique identifier for the shipping zone.
59    /// Required by the API.
60    #[serde(rename = "shippingZoneId")]
61    pub shipping_zone_id: String,
62}
63
64/// `ContactAddress` from the GoHighLevel OpenAPI spec.
65#[derive(Debug, Clone, Default, Serialize, Deserialize)]
66pub struct ContactAddress {
67    /// Name of the customer
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub name: Option<String>,
70    /// Name of the Company
71    #[serde(
72        rename = "companyName",
73        default,
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub company_name: Option<String>,
77    /// Address line 1 of the customer
78    #[serde(
79        rename = "addressLine1",
80        default,
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub address_line1: Option<String>,
84    /// Country code of the customer
85    /// Allowed values: `US`, `CA`, `AF`, `AX`, `AL`, `DZ`, `AS`, `AD`, `AO`, `AI`, `AQ`, `AG`.
86    /// Required by the API.
87    pub country: String,
88    /// State code of the customer
89    /// Allowed values: `AL`, `AK`, `AS`, `AZ`, `AR`, `AA`, `AE`, `AP`, `CA`, `CO`, `CT`, `DE`.
90    #[serde(default, skip_serializing_if = "Option::is_none")]
91    pub state: Option<String>,
92    /// City of the customer
93    #[serde(default, skip_serializing_if = "Option::is_none")]
94    pub city: Option<String>,
95    /// Zip code of the customer
96    #[serde(default, skip_serializing_if = "Option::is_none")]
97    pub zip: Option<String>,
98    /// Phone number of the customer
99    #[serde(default, skip_serializing_if = "Option::is_none")]
100    pub phone: Option<String>,
101    /// Email of the customer
102    #[serde(default, skip_serializing_if = "Option::is_none")]
103    pub email: Option<String>,
104}
105
106/// `CreateShippingCarrierDto` from the GoHighLevel OpenAPI spec.
107#[derive(Debug, Clone, Default, Serialize, Deserialize)]
108pub struct CreateShippingCarrierDto {
109    /// Location Id or Agency Id
110    /// Required by the API.
111    #[serde(rename = "altId")]
112    pub alt_id: String,
113    /// Allowed values: `location`.
114    /// Required by the API.
115    #[serde(rename = "altType")]
116    pub alt_type: String,
117    /// Name of the shipping carrier
118    /// Required by the API.
119    pub name: String,
120    /// The URL endpoint that GHL needs to retrieve shipping rates. This must be a public URL.
121    /// Required by the API.
122    #[serde(rename = "callbackUrl")]
123    pub callback_url: String,
124    /// An array of available shipping carrier services
125    #[serde(default, skip_serializing_if = "Vec::is_empty")]
126    pub services: Vec<ShippingCarrierServiceDto>,
127    /// The seller can choose multiple services while creating shipping rates if this is true.
128    #[serde(
129        rename = "allowsMultipleServiceSelection",
130        default,
131        skip_serializing_if = "Option::is_none"
132    )]
133    pub allows_multiple_service_selection: Option<bool>,
134}
135
136/// `CreateShippingCarrierResponseDto` from the GoHighLevel OpenAPI spec.
137#[derive(Debug, Clone, Default, Serialize, Deserialize)]
138pub struct CreateShippingCarrierResponseDto {
139    /// Status of api action
140    /// Required by the API.
141    pub status: bool,
142    /// Success message
143    #[serde(default, skip_serializing_if = "Option::is_none")]
144    pub message: Option<String>,
145    /// Shipping carrier data
146    /// Required by the API.
147    pub data: ShippingCarrierSchema,
148}
149
150/// `CreateShippingRateDto` from the GoHighLevel OpenAPI spec.
151#[derive(Debug, Clone, Default, Serialize, Deserialize)]
152pub struct CreateShippingRateDto {
153    /// Location Id or Agency Id
154    /// Required by the API.
155    #[serde(rename = "altId")]
156    pub alt_id: String,
157    /// Allowed values: `location`.
158    /// Required by the API.
159    #[serde(rename = "altType")]
160    pub alt_type: String,
161    /// Name of the shipping zone
162    /// Required by the API.
163    pub name: String,
164    /// Delivery description
165    #[serde(default, skip_serializing_if = "Option::is_none")]
166    pub description: Option<String>,
167    /// The currency of the amount of the rate / handling fee
168    /// Required by the API.
169    pub currency: String,
170    /// The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee
171    /// if it is a carrier rate (it will add to the carrier rate).
172    /// Required by the API.
173    pub amount: f64,
174    /// Type of condition to provide the conditional pricing
175    /// Allowed values: `none`, `price`, `weight`.
176    /// Required by the API.
177    #[serde(rename = "conditionType")]
178    pub condition_type: String,
179    /// Minimum condition for applying this price. set 0 or null if there is no minimum
180    /// Required by the API.
181    #[serde(rename = "minCondition")]
182    pub min_condition: f64,
183    /// Maximum condition for applying this price. set 0 or null if there is no maximum
184    /// Required by the API.
185    #[serde(rename = "maxCondition")]
186    pub max_condition: f64,
187    /// is this a carrier rate
188    #[serde(
189        rename = "isCarrierRate",
190        default,
191        skip_serializing_if = "Option::is_none"
192    )]
193    pub is_carrier_rate: Option<bool>,
194    /// Shipping carrier id
195    /// Required by the API.
196    #[serde(rename = "shippingCarrierId")]
197    pub shipping_carrier_id: String,
198    /// Percentage of rate fee if it is a carrier rate.
199    #[serde(
200        rename = "percentageOfRateFee",
201        default,
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub percentage_of_rate_fee: Option<f64>,
205    /// An array of items
206    #[serde(
207        rename = "shippingCarrierServices",
208        default,
209        skip_serializing_if = "Vec::is_empty"
210    )]
211    pub shipping_carrier_services: Vec<ShippingCarrierServiceDto>,
212}
213
214/// `CreateShippingRateResponseDto` from the GoHighLevel OpenAPI spec.
215#[derive(Debug, Clone, Default, Serialize, Deserialize)]
216pub struct CreateShippingRateResponseDto {
217    /// Status of api action
218    /// Required by the API.
219    pub status: bool,
220    /// Success message
221    #[serde(default, skip_serializing_if = "Option::is_none")]
222    pub message: Option<String>,
223    /// Shipping zone data
224    /// Required by the API.
225    pub data: ShippingRateSchema,
226}
227
228/// `CreateShippingZoneDto` from the GoHighLevel OpenAPI spec.
229#[derive(Debug, Clone, Default, Serialize, Deserialize)]
230pub struct CreateShippingZoneDto {
231    /// Location Id or Agency Id
232    /// Required by the API.
233    #[serde(rename = "altId")]
234    pub alt_id: String,
235    /// Allowed values: `location`.
236    /// Required by the API.
237    #[serde(rename = "altType")]
238    pub alt_type: String,
239    /// Name of the shipping zone
240    /// Required by the API.
241    pub name: String,
242    /// List of countries that are available
243    /// Required by the API.
244    #[serde(default, skip_serializing_if = "Vec::is_empty")]
245    pub countries: Vec<ShippingZoneCountryDto>,
246}
247
248/// `CreateShippingZoneResponseDto` from the GoHighLevel OpenAPI spec.
249#[derive(Debug, Clone, Default, Serialize, Deserialize)]
250pub struct CreateShippingZoneResponseDto {
251    /// Status of api action
252    /// Required by the API.
253    pub status: bool,
254    /// Success message
255    #[serde(default, skip_serializing_if = "Option::is_none")]
256    pub message: Option<String>,
257    /// Shipping zone data
258    /// Required by the API.
259    pub data: ShippingZoneSchema,
260}
261
262/// `CreateStoreSettingDto` from the GoHighLevel OpenAPI spec.
263#[derive(Debug, Clone, Default, Serialize, Deserialize)]
264pub struct CreateStoreSettingDto {
265    /// Location Id or Agency Id
266    /// Required by the API.
267    #[serde(rename = "altId")]
268    pub alt_id: String,
269    /// Allowed values: `location`.
270    /// Required by the API.
271    #[serde(rename = "altType")]
272    pub alt_type: String,
273    /// Shipping origin address
274    /// Required by the API.
275    #[serde(rename = "shippingOrigin")]
276    pub shipping_origin: StoreShippingOriginDto,
277    /// Store order notification email
278    #[serde(
279        rename = "storeOrderNotification",
280        default,
281        skip_serializing_if = "Option::is_none"
282    )]
283    pub store_order_notification: Option<StoreOrderNotificationDto>,
284    /// Store order fulfillment notification email
285    #[serde(
286        rename = "storeOrderFulfillmentNotification",
287        default,
288        skip_serializing_if = "Option::is_none"
289    )]
290    pub store_order_fulfillment_notification: Option<StoreOrderFulfillmentNotificationDto>,
291}
292
293/// `CreateStoreSettingResponseDto` from the GoHighLevel OpenAPI spec.
294#[derive(Debug, Clone, Default, Serialize, Deserialize)]
295pub struct CreateStoreSettingResponseDto {
296    /// Status of api action
297    /// Required by the API.
298    pub status: bool,
299    /// Success message
300    #[serde(default, skip_serializing_if = "Option::is_none")]
301    pub message: Option<String>,
302    /// Shipping carrier data
303    /// Required by the API.
304    pub data: StoreSettingSchema,
305}
306
307/// `DeleteShippingCarrierResponseDto` from the GoHighLevel OpenAPI spec.
308#[derive(Debug, Clone, Default, Serialize, Deserialize)]
309pub struct DeleteShippingCarrierResponseDto {
310    /// Status of api action
311    /// Required by the API.
312    pub status: bool,
313    /// Success message
314    #[serde(default, skip_serializing_if = "Option::is_none")]
315    pub message: Option<String>,
316}
317
318/// `DeleteShippingRateResponseDto` from the GoHighLevel OpenAPI spec.
319#[derive(Debug, Clone, Default, Serialize, Deserialize)]
320pub struct DeleteShippingRateResponseDto {
321    /// Status of api action
322    /// Required by the API.
323    pub status: bool,
324    /// Success message
325    #[serde(default, skip_serializing_if = "Option::is_none")]
326    pub message: Option<String>,
327}
328
329/// `DeleteShippingZoneResponseDto` from the GoHighLevel OpenAPI spec.
330#[derive(Debug, Clone, Default, Serialize, Deserialize)]
331pub struct DeleteShippingZoneResponseDto {
332    /// Status of api action
333    /// Required by the API.
334    pub status: bool,
335    /// Success message
336    #[serde(default, skip_serializing_if = "Option::is_none")]
337    pub message: Option<String>,
338}
339
340/// `GetAvailableShippingRates` from the GoHighLevel OpenAPI spec.
341#[derive(Debug, Clone, Default, Serialize, Deserialize)]
342pub struct GetAvailableShippingRates {
343    /// Location Id or Agency Id
344    /// Required by the API.
345    #[serde(rename = "altId")]
346    pub alt_id: String,
347    /// Allowed values: `location`.
348    /// Required by the API.
349    #[serde(rename = "altType")]
350    pub alt_type: String,
351    /// Country code of the customer
352    /// Allowed values: `US`, `CA`, `AF`, `AX`, `AL`, `DZ`, `AS`, `AD`, `AO`, `AI`, `AQ`, `AG`.
353    /// Required by the API.
354    pub country: String,
355    /// Address of the customer
356    #[serde(default, skip_serializing_if = "Option::is_none")]
357    pub address: Option<ContactAddress>,
358    /// it will not calculate the order amount form backend if it is true
359    /// Allowed values: `AF`, `AX`, `AL`, `DZ`, `AS`, `AD`, `AO`, `AI`, `AQ`, `AG`, `AR`, `AM`.
360    #[serde(
361        rename = "amountAvailable",
362        default,
363        skip_serializing_if = "Option::is_none"
364    )]
365    pub amount_available: Option<String>,
366    /// The amount of the price. ( min: 0.01 )
367    /// Required by the API.
368    #[serde(rename = "totalOrderAmount")]
369    pub total_order_amount: f64,
370    /// Flag to pass when the weight is already calculated and should not calculate again
371    #[serde(
372        rename = "weightAvailable",
373        default,
374        skip_serializing_if = "Option::is_none"
375    )]
376    pub weight_available: Option<bool>,
377    /// Estimated weight of the order calculated from the order creation side in kg(s)
378    /// Required by the API.
379    #[serde(rename = "totalOrderWeight")]
380    pub total_order_weight: f64,
381    /// Source of the order
382    /// Required by the API.
383    pub source: OrderSource,
384    /// An array of price IDs and quantity
385    /// Required by the API.
386    #[serde(default, skip_serializing_if = "Vec::is_empty")]
387    pub products: Vec<ProductItem>,
388    /// Coupon code
389    #[serde(
390        rename = "couponCode",
391        default,
392        skip_serializing_if = "Option::is_none"
393    )]
394    pub coupon_code: Option<String>,
395}
396
397/// `GetAvailableShippingRatesResponseDto` from the GoHighLevel OpenAPI spec.
398#[derive(Debug, Clone, Default, Serialize, Deserialize)]
399pub struct GetAvailableShippingRatesResponseDto {
400    /// Status of api action
401    /// Required by the API.
402    pub status: bool,
403    /// Success message
404    #[serde(default, skip_serializing_if = "Option::is_none")]
405    pub message: Option<String>,
406    /// Shipping rate data
407    /// Required by the API.
408    #[serde(default, skip_serializing_if = "Vec::is_empty")]
409    pub data: Vec<AvailableShippingRate>,
410}
411
412/// `GetShippingCarrierResponseDto` from the GoHighLevel OpenAPI spec.
413#[derive(Debug, Clone, Default, Serialize, Deserialize)]
414pub struct GetShippingCarrierResponseDto {
415    /// Status of api action
416    /// Required by the API.
417    pub status: bool,
418    /// Success message
419    #[serde(default, skip_serializing_if = "Option::is_none")]
420    pub message: Option<String>,
421    /// Shipping carrier data
422    /// Required by the API.
423    pub data: ShippingCarrierSchema,
424}
425
426/// `GetShippingRateResponseDto` from the GoHighLevel OpenAPI spec.
427#[derive(Debug, Clone, Default, Serialize, Deserialize)]
428pub struct GetShippingRateResponseDto {
429    /// Status of api action
430    /// Required by the API.
431    pub status: bool,
432    /// Success message
433    #[serde(default, skip_serializing_if = "Option::is_none")]
434    pub message: Option<String>,
435    /// Shipping zone data
436    /// Required by the API.
437    pub data: ShippingRateSchema,
438}
439
440/// `GetShippingZoneResponseDto` from the GoHighLevel OpenAPI spec.
441#[derive(Debug, Clone, Default, Serialize, Deserialize)]
442pub struct GetShippingZoneResponseDto {
443    /// Status of api action
444    /// Required by the API.
445    pub status: bool,
446    /// Success message
447    #[serde(default, skip_serializing_if = "Option::is_none")]
448    pub message: Option<String>,
449    /// Shipping zone data
450    /// Required by the API.
451    pub data: ShippingZoneSchema,
452}
453
454/// `GetStoreSettingResponseDto` from the GoHighLevel OpenAPI spec.
455#[derive(Debug, Clone, Default, Serialize, Deserialize)]
456pub struct GetStoreSettingResponseDto {
457    /// Status of api action
458    /// Required by the API.
459    pub status: bool,
460    /// Success message
461    #[serde(default, skip_serializing_if = "Option::is_none")]
462    pub message: Option<String>,
463    /// Shipping carrier data
464    /// Required by the API.
465    pub data: StoreSettingSchema,
466}
467
468/// `ListShippingCarrierResponseDto` from the GoHighLevel OpenAPI spec.
469#[derive(Debug, Clone, Default, Serialize, Deserialize)]
470pub struct ListShippingCarrierResponseDto {
471    /// Status of api action
472    /// Required by the API.
473    pub status: bool,
474    /// Success message
475    #[serde(default, skip_serializing_if = "Option::is_none")]
476    pub message: Option<String>,
477    /// An array of items
478    /// Required by the API.
479    #[serde(default, skip_serializing_if = "Vec::is_empty")]
480    pub data: Vec<ShippingCarrierSchema>,
481}
482
483/// `ListShippingRateResponseDto` from the GoHighLevel OpenAPI spec.
484#[derive(Debug, Clone, Default, Serialize, Deserialize)]
485pub struct ListShippingRateResponseDto {
486    /// Total number of items
487    /// Required by the API.
488    pub total: f64,
489    /// An array of items
490    /// Required by the API.
491    #[serde(default, skip_serializing_if = "Vec::is_empty")]
492    pub data: Vec<ShippingRateSchema>,
493}
494
495/// `ListShippingZoneResponseDto` from the GoHighLevel OpenAPI spec.
496#[derive(Debug, Clone, Default, Serialize, Deserialize)]
497pub struct ListShippingZoneResponseDto {
498    /// Total number of items
499    /// Required by the API.
500    pub total: f64,
501    /// An array of items
502    /// Required by the API.
503    #[serde(default, skip_serializing_if = "Vec::is_empty")]
504    pub data: Vec<ShippingZoneSchema>,
505}
506
507/// `OrderSource` from the GoHighLevel OpenAPI spec.
508#[derive(Debug, Clone, Default, Serialize, Deserialize)]
509pub struct OrderSource {
510    /// Source of order
511    /// Allowed values: `funnel`, `website`, `invoice`, `calendar`, `text2Pay`,
512    /// `document_contracts`, `membership`, `mobile_app`, `communities`, `point_of_sale`,
513    /// `manual`, `form`.
514    /// Required by the API.
515    #[serde(rename = "type")]
516    pub type_: String,
517    /// Source subtype of order
518    /// Allowed values: `one_step_order_form`, `two_step_order_form`, `upsell`, `tap_to_pay`,
519    /// `card_payment`, `store`, `contact_view`, `email_campaign`, `payments_dashboard`,
520    /// `shopify`, `subscription_view`, `store_upsell`.
521    #[serde(rename = "subType", default, skip_serializing_if = "Option::is_none")]
522    pub sub_type: Option<String>,
523}
524
525/// `ProductItem` from the GoHighLevel OpenAPI spec.
526#[derive(Debug, Clone, Default, Serialize, Deserialize)]
527pub struct ProductItem {
528    /// id of product
529    /// Required by the API.
530    pub id: String,
531    /// No of quantities
532    /// Required by the API.
533    pub qty: f64,
534}
535
536/// `ShippingCarrierSchema` from the GoHighLevel OpenAPI spec.
537#[derive(Debug, Clone, Default, Serialize, Deserialize)]
538pub struct ShippingCarrierSchema {
539    /// Location Id or Agency Id
540    /// Required by the API.
541    #[serde(rename = "altId")]
542    pub alt_id: String,
543    /// Allowed values: `location`.
544    /// Required by the API.
545    #[serde(rename = "altType")]
546    pub alt_type: String,
547    /// Name of the shipping carrier
548    /// Required by the API.
549    pub name: String,
550    /// The URL endpoint that GHL needs to retrieve shipping rates. This must be a public URL.
551    /// Required by the API.
552    #[serde(rename = "callbackUrl")]
553    pub callback_url: String,
554    /// An array of available shipping carrier services
555    #[serde(default, skip_serializing_if = "Vec::is_empty")]
556    pub services: Vec<ShippingCarrierServiceDto>,
557    /// The seller can choose multiple services while creating shipping rates if this is true.
558    #[serde(
559        rename = "allowsMultipleServiceSelection",
560        default,
561        skip_serializing_if = "Option::is_none"
562    )]
563    pub allows_multiple_service_selection: Option<bool>,
564    /// The unique identifier for the product.
565    /// Required by the API.
566    #[serde(rename = "_id")]
567    pub id: String,
568    /// The unique identifier for the marketplace app.
569    /// Required by the API.
570    #[serde(rename = "marketplaceAppId")]
571    pub marketplace_app_id: String,
572    /// created at
573    /// Required by the API.
574    #[serde(rename = "createdAt")]
575    pub created_at: String,
576    /// updated at
577    /// Required by the API.
578    #[serde(rename = "updatedAt")]
579    pub updated_at: String,
580}
581
582/// `ShippingCarrierServiceDto` from the GoHighLevel OpenAPI spec.
583#[derive(Debug, Clone, Default, Serialize, Deserialize)]
584pub struct ShippingCarrierServiceDto {
585    /// Name of the shipping carrier service
586    /// Required by the API.
587    pub name: String,
588    /// Value of the shipping carrier service
589    /// Required by the API.
590    pub value: String,
591}
592
593/// `ShippingRateSchema` from the GoHighLevel OpenAPI spec.
594#[derive(Debug, Clone, Default, Serialize, Deserialize)]
595pub struct ShippingRateSchema {
596    /// Location Id or Agency Id
597    /// Required by the API.
598    #[serde(rename = "altId")]
599    pub alt_id: String,
600    /// Allowed values: `location`.
601    /// Required by the API.
602    #[serde(rename = "altType")]
603    pub alt_type: String,
604    /// Name of the shipping zone
605    /// Required by the API.
606    pub name: String,
607    /// Delivery description
608    #[serde(default, skip_serializing_if = "Option::is_none")]
609    pub description: Option<String>,
610    /// The currency of the amount of the rate / handling fee
611    /// Required by the API.
612    pub currency: String,
613    /// The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee
614    /// if it is a carrier rate (it will add to the carrier rate).
615    /// Required by the API.
616    pub amount: f64,
617    /// Type of condition to provide the conditional pricing
618    /// Allowed values: `none`, `price`, `weight`.
619    /// Required by the API.
620    #[serde(rename = "conditionType")]
621    pub condition_type: String,
622    /// Minimum condition for applying this price. set 0 or null if there is no minimum
623    /// Required by the API.
624    #[serde(rename = "minCondition")]
625    pub min_condition: f64,
626    /// Maximum condition for applying this price. set 0 or null if there is no maximum
627    /// Required by the API.
628    #[serde(rename = "maxCondition")]
629    pub max_condition: f64,
630    /// is this a carrier rate
631    #[serde(
632        rename = "isCarrierRate",
633        default,
634        skip_serializing_if = "Option::is_none"
635    )]
636    pub is_carrier_rate: Option<bool>,
637    /// Shipping carrier id
638    /// Required by the API.
639    #[serde(rename = "shippingCarrierId")]
640    pub shipping_carrier_id: String,
641    /// Percentage of rate fee if it is a carrier rate.
642    #[serde(
643        rename = "percentageOfRateFee",
644        default,
645        skip_serializing_if = "Option::is_none"
646    )]
647    pub percentage_of_rate_fee: Option<f64>,
648    /// An array of items
649    #[serde(
650        rename = "shippingCarrierServices",
651        default,
652        skip_serializing_if = "Vec::is_empty"
653    )]
654    pub shipping_carrier_services: Vec<ShippingCarrierServiceDto>,
655    /// The unique identifier for the product.
656    /// Required by the API.
657    #[serde(rename = "_id")]
658    pub id: String,
659    /// The unique identifier for the shipping zone.
660    /// Required by the API.
661    #[serde(rename = "shippingZoneId")]
662    pub shipping_zone_id: String,
663    /// created at
664    /// Required by the API.
665    #[serde(rename = "createdAt")]
666    pub created_at: String,
667    /// updated at
668    /// Required by the API.
669    #[serde(rename = "updatedAt")]
670    pub updated_at: String,
671}
672
673/// `ShippingZoneCountryDto` from the GoHighLevel OpenAPI spec.
674#[derive(Debug, Clone, Default, Serialize, Deserialize)]
675pub struct ShippingZoneCountryDto {
676    /// Country code
677    /// Allowed values: `['US', 'CA', 'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ',
678    /// 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ',
679    /// 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH',
680    /// 'CM', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK',
681    /// 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ',
682    /// 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE',
683    /// 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT',
684    /// 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT',
685    /// 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'XK', 'KW', 'KG', 'LA', 'LV', 'LB',
686    /// 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT',
687    /// 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ',
688    /// 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP',
689    /// 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR',
690    /// 'QA', 'RE', 'RO', 'RU', 'RW', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST',
691    /// 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'KR',
692    /// 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL',
693    /// 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'UM',
694    /// 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW']`.
695    /// Required by the API.
696    pub code: String,
697    /// List of states that are available. If states is empty, then all states are available
698    #[serde(default, skip_serializing_if = "Vec::is_empty")]
699    pub states: Vec<ShippingZoneCountryStateDto>,
700}
701
702/// `ShippingZoneCountryStateDto` from the GoHighLevel OpenAPI spec.
703#[derive(Debug, Clone, Default, Serialize, Deserialize)]
704pub struct ShippingZoneCountryStateDto {
705    /// State code
706    /// Allowed values: `AL`, `AK`, `AS`, `AZ`, `AR`, `AA`, `AE`, `AP`, `CA`, `CO`, `CT`, `DE`.
707    /// Required by the API.
708    pub code: String,
709}
710
711/// `ShippingZoneSchema` from the GoHighLevel OpenAPI spec.
712#[derive(Debug, Clone, Default, Serialize, Deserialize)]
713pub struct ShippingZoneSchema {
714    /// Location Id or Agency Id
715    /// Required by the API.
716    #[serde(rename = "altId")]
717    pub alt_id: String,
718    /// Allowed values: `location`.
719    /// Required by the API.
720    #[serde(rename = "altType")]
721    pub alt_type: String,
722    /// Name of the shipping zone
723    /// Required by the API.
724    pub name: String,
725    /// List of countries that are available
726    /// Required by the API.
727    #[serde(default, skip_serializing_if = "Vec::is_empty")]
728    pub countries: Vec<ShippingZoneCountryDto>,
729    /// The unique identifier for the product.
730    /// Required by the API.
731    #[serde(rename = "_id")]
732    pub id: String,
733    /// Array of shipping rates under this shipping zone
734    #[serde(
735        rename = "shippingRates",
736        default,
737        skip_serializing_if = "Vec::is_empty"
738    )]
739    pub shipping_rates: Vec<ShippingRateSchema>,
740    /// created at
741    /// Required by the API.
742    #[serde(rename = "createdAt")]
743    pub created_at: String,
744    /// updated at
745    /// Required by the API.
746    #[serde(rename = "updatedAt")]
747    pub updated_at: String,
748}
749
750/// `StoreOrderFulfillmentNotificationDto` from the GoHighLevel OpenAPI spec.
751#[derive(Debug, Clone, Default, Serialize, Deserialize)]
752pub struct StoreOrderFulfillmentNotificationDto {
753    /// Store order fulfillment notification enabled
754    /// Required by the API.
755    pub enabled: bool,
756    /// Store order fulfillment email subject
757    /// Required by the API.
758    pub subject: String,
759    /// Email Template Id
760    /// Required by the API.
761    #[serde(rename = "emailTemplateId")]
762    pub email_template_id: String,
763    /// Default Email Template Id
764    /// Required by the API.
765    #[serde(rename = "defaultEmailTemplateId")]
766    pub default_email_template_id: String,
767}
768
769/// `StoreOrderNotificationDto` from the GoHighLevel OpenAPI spec.
770#[derive(Debug, Clone, Default, Serialize, Deserialize)]
771pub struct StoreOrderNotificationDto {
772    /// Store order notification enabled
773    /// Required by the API.
774    pub enabled: bool,
775    /// Store order email subject
776    /// Required by the API.
777    pub subject: String,
778    /// Email Template Id
779    /// Required by the API.
780    #[serde(rename = "emailTemplateId")]
781    pub email_template_id: String,
782    /// Default Email Template Id
783    /// Required by the API.
784    #[serde(rename = "defaultEmailTemplateId")]
785    pub default_email_template_id: String,
786}
787
788/// `StoreSettingSchema` from the GoHighLevel OpenAPI spec.
789#[derive(Debug, Clone, Default, Serialize, Deserialize)]
790pub struct StoreSettingSchema {
791    /// Location Id or Agency Id
792    /// Required by the API.
793    #[serde(rename = "altId")]
794    pub alt_id: String,
795    /// Allowed values: `location`.
796    /// Required by the API.
797    #[serde(rename = "altType")]
798    pub alt_type: String,
799    /// Shipping origin address
800    /// Required by the API.
801    #[serde(rename = "shippingOrigin")]
802    pub shipping_origin: StoreShippingOriginDto,
803    /// Store order notification email
804    #[serde(
805        rename = "storeOrderNotification",
806        default,
807        skip_serializing_if = "Option::is_none"
808    )]
809    pub store_order_notification: Option<StoreOrderNotificationDto>,
810    /// Store order fulfillment notification email
811    #[serde(
812        rename = "storeOrderFulfillmentNotification",
813        default,
814        skip_serializing_if = "Option::is_none"
815    )]
816    pub store_order_fulfillment_notification: Option<StoreOrderFulfillmentNotificationDto>,
817    /// The unique identifier for the settings.
818    /// Required by the API.
819    #[serde(rename = "_id")]
820    pub id: String,
821    /// created at
822    /// Required by the API.
823    #[serde(rename = "createdAt")]
824    pub created_at: String,
825    /// updated at
826    /// Required by the API.
827    #[serde(rename = "updatedAt")]
828    pub updated_at: String,
829}
830
831/// `StoreShippingOriginDto` from the GoHighLevel OpenAPI spec.
832#[derive(Debug, Clone, Default, Serialize, Deserialize)]
833pub struct StoreShippingOriginDto {
834    /// Name of the store / company
835    /// Required by the API.
836    pub name: String,
837    /// Country code
838    /// Allowed values: `['US', 'CA', 'AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ',
839    /// 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ',
840    /// 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH',
841    /// 'CM', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK',
842    /// 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ',
843    /// 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE',
844    /// 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT',
845    /// 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT',
846    /// 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KP', 'XK', 'KW', 'KG', 'LA', 'LV', 'LB',
847    /// 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT',
848    /// 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ',
849    /// 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP',
850    /// 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR',
851    /// 'QA', 'RE', 'RO', 'RU', 'RW', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST',
852    /// 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SX', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'KR',
853    /// 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL',
854    /// 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'UM',
855    /// 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW']`.
856    /// Required by the API.
857    pub country: String,
858    /// State code
859    /// Allowed values: `AL`, `AK`, `AS`, `AZ`, `AR`, `AA`, `AE`, `AP`, `CA`, `CO`, `CT`, `DE`.
860    #[serde(default, skip_serializing_if = "Option::is_none")]
861    pub state: Option<String>,
862    /// City name
863    /// Required by the API.
864    pub city: String,
865    /// Street address line 1
866    /// Required by the API.
867    pub street1: String,
868    /// Street address line 2
869    #[serde(default, skip_serializing_if = "Option::is_none")]
870    pub street2: Option<String>,
871    /// Zip code
872    /// Required by the API.
873    pub zip: String,
874    /// Business Phone Number
875    #[serde(default, skip_serializing_if = "Option::is_none")]
876    pub phone: Option<String>,
877    /// Email
878    #[serde(default, skip_serializing_if = "Option::is_none")]
879    pub email: Option<String>,
880}
881
882/// `UpdateShippingCarrierDto` from the GoHighLevel OpenAPI spec.
883#[derive(Debug, Clone, Default, Serialize, Deserialize)]
884pub struct UpdateShippingCarrierDto {
885    /// Location Id or Agency Id
886    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
887    pub alt_id: Option<String>,
888    /// Allowed values: `location`.
889    #[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
890    pub alt_type: Option<String>,
891    /// Name of the shipping carrier
892    #[serde(default, skip_serializing_if = "Option::is_none")]
893    pub name: Option<String>,
894    /// The URL endpoint that GHL needs to retrieve shipping rates. This must be a public URL.
895    #[serde(
896        rename = "callbackUrl",
897        default,
898        skip_serializing_if = "Option::is_none"
899    )]
900    pub callback_url: Option<String>,
901    /// An array of available shipping carrier services
902    #[serde(default, skip_serializing_if = "Vec::is_empty")]
903    pub services: Vec<ShippingCarrierServiceDto>,
904    /// The seller can choose multiple services while creating shipping rates if this is true.
905    #[serde(
906        rename = "allowsMultipleServiceSelection",
907        default,
908        skip_serializing_if = "Option::is_none"
909    )]
910    pub allows_multiple_service_selection: Option<bool>,
911}
912
913/// `UpdateShippingCarrierResponseDto` from the GoHighLevel OpenAPI spec.
914#[derive(Debug, Clone, Default, Serialize, Deserialize)]
915pub struct UpdateShippingCarrierResponseDto {
916    /// Status of api action
917    /// Required by the API.
918    pub status: bool,
919    /// Success message
920    #[serde(default, skip_serializing_if = "Option::is_none")]
921    pub message: Option<String>,
922    /// Shipping carrier data
923    /// Required by the API.
924    pub data: ShippingCarrierSchema,
925}
926
927/// `UpdateShippingRateDto` from the GoHighLevel OpenAPI spec.
928#[derive(Debug, Clone, Default, Serialize, Deserialize)]
929pub struct UpdateShippingRateDto {
930    /// Location Id or Agency Id
931    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
932    pub alt_id: Option<String>,
933    /// Allowed values: `location`.
934    #[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
935    pub alt_type: Option<String>,
936    /// Name of the shipping zone
937    #[serde(default, skip_serializing_if = "Option::is_none")]
938    pub name: Option<String>,
939    /// Delivery description
940    #[serde(default, skip_serializing_if = "Option::is_none")]
941    pub description: Option<String>,
942    /// The currency of the amount of the rate / handling fee
943    #[serde(default, skip_serializing_if = "Option::is_none")]
944    pub currency: Option<String>,
945    /// The amount of the shipping rate if it is normal rate (0 means free ). Fixed Handling fee
946    /// if it is a carrier rate (it will add to the carrier rate).
947    #[serde(default, skip_serializing_if = "Option::is_none")]
948    pub amount: Option<f64>,
949    /// Type of condition to provide the conditional pricing
950    /// Allowed values: `none`, `price`, `weight`.
951    #[serde(
952        rename = "conditionType",
953        default,
954        skip_serializing_if = "Option::is_none"
955    )]
956    pub condition_type: Option<String>,
957    /// Minimum condition for applying this price. set 0 or null if there is no minimum
958    #[serde(
959        rename = "minCondition",
960        default,
961        skip_serializing_if = "Option::is_none"
962    )]
963    pub min_condition: Option<f64>,
964    /// Maximum condition for applying this price. set 0 or null if there is no maximum
965    #[serde(
966        rename = "maxCondition",
967        default,
968        skip_serializing_if = "Option::is_none"
969    )]
970    pub max_condition: Option<f64>,
971    /// is this a carrier rate
972    #[serde(
973        rename = "isCarrierRate",
974        default,
975        skip_serializing_if = "Option::is_none"
976    )]
977    pub is_carrier_rate: Option<bool>,
978    /// Shipping carrier id
979    #[serde(
980        rename = "shippingCarrierId",
981        default,
982        skip_serializing_if = "Option::is_none"
983    )]
984    pub shipping_carrier_id: Option<String>,
985    /// Percentage of rate fee if it is a carrier rate.
986    #[serde(
987        rename = "percentageOfRateFee",
988        default,
989        skip_serializing_if = "Option::is_none"
990    )]
991    pub percentage_of_rate_fee: Option<f64>,
992    /// An array of items
993    #[serde(
994        rename = "shippingCarrierServices",
995        default,
996        skip_serializing_if = "Vec::is_empty"
997    )]
998    pub shipping_carrier_services: Vec<ShippingCarrierServiceDto>,
999}
1000
1001/// `UpdateShippingRateResponseDto` from the GoHighLevel OpenAPI spec.
1002#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1003pub struct UpdateShippingRateResponseDto {
1004    /// Status of api action
1005    /// Required by the API.
1006    pub status: bool,
1007    /// Success message
1008    #[serde(default, skip_serializing_if = "Option::is_none")]
1009    pub message: Option<String>,
1010    /// Shipping zone data
1011    /// Required by the API.
1012    pub data: ShippingRateSchema,
1013}
1014
1015/// `UpdateShippingZoneDto` from the GoHighLevel OpenAPI spec.
1016#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1017pub struct UpdateShippingZoneDto {
1018    /// Location Id or Agency Id
1019    #[serde(rename = "altId", default, skip_serializing_if = "Option::is_none")]
1020    pub alt_id: Option<String>,
1021    /// Allowed values: `location`.
1022    #[serde(rename = "altType", default, skip_serializing_if = "Option::is_none")]
1023    pub alt_type: Option<String>,
1024    /// Name of the shipping zone
1025    #[serde(default, skip_serializing_if = "Option::is_none")]
1026    pub name: Option<String>,
1027    /// List of countries that are available
1028    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1029    pub countries: Vec<ShippingZoneCountryDto>,
1030}
1031
1032/// `UpdateShippingZoneResponseDto` from the GoHighLevel OpenAPI spec.
1033#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1034pub struct UpdateShippingZoneResponseDto {
1035    /// Status of api action
1036    /// Required by the API.
1037    pub status: bool,
1038    /// Success message
1039    #[serde(default, skip_serializing_if = "Option::is_none")]
1040    pub message: Option<String>,
1041    /// Shipping zone data
1042    /// Required by the API.
1043    pub data: ShippingZoneSchema,
1044}