square_rust/api/models/objects/customer.rs
1//! Customer
2
3use serde::{Deserialize, Serialize};
4
5use crate::api::models::enums::customer_creation_source::CustomerCreationSource;
6use crate::api::models::objects::address::Address;
7use crate::api::models::objects::customer_preferences::CustomerPreferences;
8use crate::api::models::objects::customer_tax_ids::CustomerTaxIds;
9
10/// Represents a Square customer profile, which can have one or more cards on file associated with it.
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Customer {
13 /// A unique Square-assigned ID for the customer profile.
14 ///
15 /// If you need this ID for an API request, use the ID returned when you created the customer profile or call the [SearchCustomers](https://developer.squareup.com/reference/square/customers-api/search-customers) or [ListCustomers](https://developer.squareup.com/reference/square/customers-api/list-customers) endpoint.
16 pub id: Option<String>,
17 /// Read only The timestamp when the customer profile was created, in RFC 3339 format.
18 ///
19 /// Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
20 ///
21 /// UTC: 2020-01-26T02:25:34Z
22 ///
23 /// Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00
24 pub created_at: Option<String>,
25 /// Read only The timestamp when the customer profile was last updated, in RFC 3339 format.
26 ///
27 /// Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
28 ///
29 /// UTC: 2020-01-26T02:25:34Z
30 ///
31 /// Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00
32 pub updated_at: Option<String>,
33 /// The given name (that is, the first name) associated with the customer profile.
34 pub given_name: Option<String>,
35 /// The family name (that is, the last name) associated with the customer profile.
36 pub family_name: Option<String>,
37 /// A nickname for the customer profile.
38 pub nickname: Option<String>,
39 /// A business name associated with the customer profile.
40 pub company_name: Option<String>,
41 /// The email address associated with the customer profile.
42 pub email_address: Option<String>,
43 /// The physical address associated with the customer profile.
44 pub address: Option<Address>,
45 /// The phone number associated with the customer profile.
46 pub phone_number: Option<String>,
47 /// The birthday associated with the customer profile, in YYYY-MM-DD format. For example, 1998-09-21 represents September 21, 1998, and 0000-09-21 represents September 21 (without a birth year).
48 pub birthday: Option<String>,
49 /// An optional, second ID used to associate the customer profile with an entity in another system.
50 pub reference_id: Option<String>,
51 /// A custom note associated with the customer profile.
52 pub note: Option<String>,
53 /// Represents general customer preferences.
54 pub preferences: Option<CustomerPreferences>,
55 /// The method used to create the customer profile.
56 pub creation_source: Option<CustomerCreationSource>,
57 /// The IDs of [customer groups](https://developer.squareup.com/reference/square/objects/CustomerGroup) the customer belongs to.
58 pub group_ids: Option<Vec<String>>,
59 /// The IDs of [customer segments](https://developer.squareup.com/reference/square/objects/CustomerSegment) the customer belongs to.
60 pub segment_ids: Option<Vec<String>>,
61 /// The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file.
62 pub version: Option<i64>,
63 /// The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom. For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
64 pub tax_ids: Option<Vec<CustomerTaxIds>>,
65}