pub struct CreateRefundRequest {
pub amount: Option<String>,
pub customer_display: Option<OperationCustomerDisplay>,
pub external_reference_id: Option<ExternalReferenceId>,
pub metadata: Option<Metadata>,
pub reason: Option<String>,
pub source: RefundSource,
}Expand description
A request to create a refund for a payment session.
JSON schema
{
"description": "A request to create a refund for a payment session.",
"examples": [
{
"amount": "0.50",
"reason": "Customer returned the item.",
"source": {
"accountId": "account_af2937b0-9846-4fe7-bfe9-ccc22d935114",
"asset": "usdc"
}
}
],
"type": "object",
"required": [
"source"
],
"properties": {
"amount": {
"description": "A decimal representation of the amount to refund, denominated in the session's `asset`. If omitted, the full remaining refundable amount is refunded.",
"examples": [
"0.50"
],
"type": "string"
},
"customerDisplay": {
"description": "Optional customer-facing display data for this refund, shown to the payer. Falls back to the session's `orderCode` when `referenceCode` is omitted.",
"examples": [
{
"referenceCode": "REF-ABC123"
}
],
"allOf": [
{
"$ref": "#/components/schemas/OperationCustomerDisplay"
}
]
},
"externalReferenceId": {
"description": "An optional merchant-provided internal identifier for this refund, from the merchant's own system—not visible to the payer.",
"examples": [
"merchant-refund-abc123"
],
"allOf": [
{
"$ref": "#/components/schemas/ExternalReferenceId"
}
]
},
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"reason": {
"description": "The reason for the refund.",
"examples": [
"Customer returned the item."
],
"type": "string"
},
"source": {
"description": "The source from which to fund the refund. Can be a CDP account or an onchain address.",
"examples": [
{
"accountId": "account_af2937b0-9846-4fe7-bfe9-ccc22d935114",
"asset": "usdc"
}
],
"allOf": [
{
"$ref": "#/components/schemas/RefundSource"
}
]
}
}
}Fields§
§amount: Option<String>A decimal representation of the amount to refund, denominated in the session’s asset. If omitted, the full remaining refundable amount is refunded.
customer_display: Option<OperationCustomerDisplay>Optional customer-facing display data for this refund, shown to the payer. Falls back to the session’s orderCode when referenceCode is omitted.
external_reference_id: Option<ExternalReferenceId>An optional merchant-provided internal identifier for this refund, from the merchant’s own system—not visible to the payer.
metadata: Option<Metadata>§reason: Option<String>The reason for the refund.
source: RefundSourceThe source from which to fund the refund. Can be a CDP account or an onchain address.
Implementations§
Source§impl CreateRefundRequest
impl CreateRefundRequest
pub fn builder() -> CreateRefundRequest
Trait Implementations§
Source§impl Clone for CreateRefundRequest
impl Clone for CreateRefundRequest
Source§impl Debug for CreateRefundRequest
impl Debug for CreateRefundRequest
Source§impl<'de> Deserialize<'de> for CreateRefundRequest
impl<'de> Deserialize<'de> for CreateRefundRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&CreateRefundRequest> for CreateRefundRequest
impl From<&CreateRefundRequest> for CreateRefundRequest
Source§fn from(value: &CreateRefundRequest) -> Self
fn from(value: &CreateRefundRequest) -> Self
Converts to this type from the input type.
Source§impl From<CreateRefundRequest> for CreateRefundRequest
impl From<CreateRefundRequest> for CreateRefundRequest
Source§fn from(value: CreateRefundRequest) -> Self
fn from(value: CreateRefundRequest) -> Self
Converts to this type from the input type.
Source§impl Serialize for CreateRefundRequest
impl Serialize for CreateRefundRequest
Source§impl TryFrom<CreateRefundRequest> for CreateRefundRequest
impl TryFrom<CreateRefundRequest> for CreateRefundRequest
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: CreateRefundRequest) -> Result<Self, ConversionError>
fn try_from(value: CreateRefundRequest) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for CreateRefundRequest
impl RefUnwindSafe for CreateRefundRequest
impl Send for CreateRefundRequest
impl Sync for CreateRefundRequest
impl Unpin for CreateRefundRequest
impl UnsafeUnpin for CreateRefundRequest
impl UnwindSafe for CreateRefundRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more