View Source Stripe.Refund (Striped v0.1.0)
Refund objects allow you to refund a charge that has previously been created
but not yet refunded. Funds will be refunded to the credit or debit card that
was originally charged.
Related guide: Refunds.
Link to this section Summary
Functions
Cancels a refund with a status of requires_action.
Create a refund.
Expire a refund with a status of requires_action.
You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.
Retrieves the details of an existing refund.
Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Link to this section Types
@type t() :: %Stripe.Refund{ amount: integer(), balance_transaction: (binary() | Stripe.BalanceTransaction.t()) | nil, charge: (binary() | Stripe.Charge.t()) | nil, created: integer(), currency: binary(), description: binary(), failure_balance_transaction: binary() | Stripe.BalanceTransaction.t(), failure_reason: binary(), id: binary(), instructions_email: binary(), metadata: term() | nil, next_action: term(), object: binary(), payment_intent: (binary() | Stripe.PaymentIntent.t()) | nil, reason: binary() | nil, receipt_number: binary() | nil, source_transfer_reversal: (binary() | Stripe.TransferReversal.t()) | nil, status: binary() | nil, transfer_reversal: (binary() | Stripe.TransferReversal.t()) | nil }
The refund type.
amountAmount, in %s.balance_transactionBalance transaction that describes the impact on your account balance.chargeID of the charge that was refunded.createdTime at which the object was created. Measured in seconds since the Unix epoch.currencyThree-letter ISO currency code, in lowercase. Must be a supported currency.descriptionAn arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)failure_balance_transactionIf the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.failure_reasonIf the refund failed, the reason for refund failure if known. Possible values arelost_or_stolen_card,expired_or_canceled_card, orunknown.idUnique identifier for the object.instructions_emailEmail to which refund instructions, if required, are sent to.metadataSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.next_actionobjectString representing the object's type. Objects of the same type share the same value.payment_intentID of the PaymentIntent that was refunded.reasonReason for the refund, either user-provided (duplicate,fraudulent, orrequested_by_customer) or generated by Stripe internally (expired_uncaptured_charge).receipt_numberThis is the transaction number that appears on email receipts sent for this refund.source_transfer_reversalThe transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details.statusStatus of the refund. For credit card refunds, this can bepending,succeeded, orfailed. For other types of refunds, it can bepending,requires_action,succeeded,failed, orcanceled. Refer to our refunds documentation for more details.transfer_reversalIf the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter.
Link to this section Functions
@spec cancel(client :: term(), refund :: binary(), params :: map()) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Cancels a refund with a status of requires_action.
Refunds in other states cannot be canceled, and only refunds for payment methods that require customer action will enter the requires_action state.
Details
- Method:
post - Path:
/v1/refunds/{refund}/cancel
@spec create(client :: term(), params :: map()) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Create a refund.
Details
- Method:
post - Path:
/v1/refunds
@spec expire(client :: term(), refund :: binary(), params :: map()) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Expire a refund with a status of requires_action.
Details
- Method:
post - Path:
/v1/test_helpers/refunds/{refund}/expire
@spec list(client :: term(), charge :: binary(), params :: map()) :: {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.
Details
- Method:
get - Path:
/v1/charges/{charge}/refunds
Query parameters
:ending_beforestring:expandarray of: string:limitinteger:starting_afterstring
@spec retrieve( client :: term(), charge :: binary(), refund :: binary(), params :: map() ) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Retrieves the details of an existing refund.
Details
- Method:
get - Path:
/v1/charges/{charge}/refunds/{refund}
Query parameters
:expandarray of: string
@spec update(client :: term(), refund :: binary(), params :: map()) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
Updates the specified refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request only accepts metadata as an argument.
Details
- Method:
post - Path:
/v1/refunds/{refund}