square_api_client/models/create_gift_card_request.rs
1//! Model struct for CreateGiftCardRequest type
2
3use serde::Serialize;
4
5use super::GiftCard;
6
7/// This is a model struct for CreateGiftCardRequest type
8#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
9pub struct CreateGiftCardRequest {
10 /// A unique identifier for this request, used to ensure idempotency. For more information, see
11 /// [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
12 ///
13 /// Min Length: 1, Max Length: 128
14 pub idempotency_key: String,
15 /// The ID of the [Location] where the gift card should be registered for reporting purposes.
16 /// Gift cards can be redeemed at any of the seller's locations.
17 ///
18 /// Min Length: 1
19 pub location_id: String,
20 /// The gift card to create. The `type` field is required for this request. The `gan_source` and
21 /// `gan` fields are included as follows:
22 ///
23 /// To direct Square to generate a 16-digit GAN, omit `gan_source` and `gan`.
24 ///
25 /// To provide a custom GAN, include `gan_source` and `gan`.
26 /// - For `gan_source`, specify `OTHER`.
27 /// - For `gan`, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must
28 /// be unique for the seller and cannot start with the same bank identification number (BIN) as
29 /// major credit cards. Do not use GANs that are easy to guess (such as 12345678) because they
30 /// greatly increase the risk of fraud. It is the responsibility of the developer to ensure the
31 /// security of their custom GANs. For more information, see [Custom
32 /// GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans).
33 ///
34 /// To register an unused, physical gift card that the seller previously ordered from Square,
35 /// include `gan` and provide the GAN that is printed on the gift card.
36 pub gift_card: GiftCard,
37}