square_api_client/models/
refund.rs

1//! Model struct for Refund type
2
3use serde::{Deserialize, Serialize};
4
5use super::{enums::RefundStatus, AdditionalRecipient, DateTime, Money};
6
7/// Represents a refund processed for a Square transaction.
8#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
9pub struct Refund {
10    /// **Required** The refund's unique ID.
11    pub id: String,
12    /// **Required** The ID of the refund's associated location.
13    pub location_id: String,
14    /// **Required** The ID of the transaction that the refunded tender is part of.
15    pub transaction_id: String,
16    /// **Required** The ID of the refunded tender.
17    pub tender_id: String,
18    /// **Read only** The timestamp for when the refund was created.
19    pub created_at: Option<DateTime>,
20    /// **Required** The reason for the refund being issued.
21    pub reason: String,
22    /// **Required** The amount of money refunded to the buyer.
23    pub amount_money: Money,
24    /// **Required** The current status of the refund (`PENDING`, `APPROVED`, `REJECTED`, or
25    /// `FAILED`).
26    pub status: RefundStatus,
27    /// The amount of Square processing fee money refunded to the merchant.
28    pub processing_fee_money: Option<Money>,
29    /// Additional recipients (other than the merchant) receiving a portion of this refund. For
30    /// example, fees assessed on a refund of a purchase by a third party integration.
31    #[deprecated]
32    pub additional_recipients: Option<Vec<AdditionalRecipient>>,
33}