app_store_server_library/primitives/
external_purchase_token.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use serde_with::formats::Flexible;
4use serde_with::TimestampMilliSeconds;
5
6/// The payload data that contains an external purchase token.
7///
8/// [externalPurchaseToken](https://developer.apple.com/documentation/appstoreservernotifications/externalpurchasetoken)
9#[serde_with::serde_as]
10#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
11pub struct ExternalPurchaseToken {
12    /// The field of an external purchase token that uniquely identifies the token.
13    ///
14    /// [externalPurchaseId](https://developer.apple.com/documentation/appstoreservernotifications/externalpurchaseid)
15    #[serde(rename = "externalPurchaseId")]
16    pub external_purchase_id: Option<String>,
17
18    /// The field of an external purchase token that contains the UNIX date, in milliseconds,
19    /// when the system created the token.
20    ///
21    /// [tokenCreationDate](https://developer.apple.com/documentation/appstoreservernotifications/tokencreationdate)
22    #[serde(rename = "tokenCreationDate")]
23    #[serde_as(as = "Option<TimestampMilliSeconds<String, Flexible>>")]
24    pub token_creation_date: Option<DateTime<Utc>>,
25
26    /// The unique identifier of an app in the App Store.
27    ///
28    /// [appAppleId](https://developer.apple.com/documentation/appstoreservernotifications/appappleid)
29    #[serde(rename = "appAppleId")]
30    pub app_apple_id: Option<i64>,
31
32    /// The bundle identifier of an app.
33    ///
34    /// [bundleId](https://developer.apple.com/documentation/appstoreservernotifications/bundleid)
35    #[serde(rename = "bundleId")]
36    pub bundle_id: Option<String>,
37}