pub struct CreateGiftCardRequest {
    pub idempotency_key: String,
    pub location_id: String,
    pub gift_card: GiftCard,
}
Expand description

This is a model struct for CreateGiftCardRequest type

Fields

idempotency_key: String

A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.

Min Length: 1, Max Length: 128

location_id: String

The ID of the [Location] where the gift card should be registered for reporting purposes. Gift cards can be redeemed at any of the seller’s locations.

Min Length: 1

gift_card: GiftCard

The gift card to create. The type field is required for this request. The gan_source and gan fields are included as follows:

To direct Square to generate a 16-digit GAN, omit gan_source and gan.

To provide a custom GAN, include gan_source and gan.

  • For gan_source, specify OTHER.
  • For gan, provide a custom GAN containing 8 to 20 alphanumeric characters. The GAN must be unique for the seller and cannot start with the same bank identification number (BIN) as major credit cards. Do not use GANs that are easy to guess (such as 12345678) because they greatly increase the risk of fraud. It is the responsibility of the developer to ensure the security of their custom GANs. For more information, see Custom GANs.

To register an unused, physical gift card that the seller previously ordered from Square, include gan and provide the GAN that is printed on the gift card.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more