---
schema_version: "1"
id: 02af3634a760fd7c37cd45b99976902e5219f939785dad91054407b873dd9409
title: Refund
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_refund.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_refund.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4e06e1dd0a226b68ef5781d99813ca44f59eb2b41f6c5f5b29336c421e51c74f
description: Represents a refund made against a payment. This object is available in API version 48.0 and later.
---
# Refund

Represents a refund made against a payment. This object is available in API version 48.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete(), update(), upsert()

![Note](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note.png)

#### Note

You can only delete a payment in draft state, which you specify in the **Status** field.

## Special Access Rules

To access Salesforce Payments objects with the API, your org must have one or more of these licenses: Salesforce Payments, Salesforce Order Management, B2B Commerce, or D2C Commerce. Salesforce Payments objects are available only in Lightning Experience.

## Fields

| Field | Details |
| --- | --- |
| AccountId | 
Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The customer account containing the payment that this refund targets.

This is a relationship field.

Relationship Name

Account

Relationship Type

Lookup

Refers To

Account



 |
| Amount | 

Type

currency

Properties

Create, Filter, Sort, Update

Description

Total amount of this refund.



 |
| Balance | 

Type

currency

Properties

Filter, Nillable, Sort

Description

Remaining balance following refund line applications. Equal to the Amount field – the Net Applied field.



 |
| CancellationDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The date that the refund was canceled. This is a required parameter for void services.



 |
| CancellationEffectiveDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The date that the cancellation of this refund takes effect.



 |
| CancellationGatewayDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The date when the cancellation transaction was processed in the payment gateway.



 |
| CancellationGatewayRefNumber | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Unique ID for the cancellation transaction. Generated by the payment gateway.



 |
| CancellationGatewayResultCode | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Gateway-specific result code for the cancellation transaction. Generated by the payment gateway. Must be mapped to a Salesforce-specific result code.



 |
| CancellationSfResultCode | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Salesforce-specific result code that can map to one or more gateway result codes. We recommend configuring the payment gateway adapter layer to map gateway result codes to the appropriate Salesforce result code.



 |
| ClientContext | 

Type

textarea

Properties

Nillable

Description

Contains caller context for payment APIs. Useful for re-establishing context during an asynchronous payment transaction.



 |
| Comments | 

Type

textarea

Properties

Create, Filter, Nillable, Sort, Update

Description

Users can add comments to provide additional details about a record. Maximum of 1000 characters.



 |
| CurrencyIsoCode | 

Type

picklist

Properties

Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update

Description

Three-letter ISO 4217 currency code associated with the payment group record.



 |
| Date | 

Type

dateTime

Properties

Create, Defaulted on create, Filter, Nillable, Sort, Update

Description

The date and time that this refund was created.



 |
| EffectiveDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

Defines the date and time when the refund application becomes effective.



 |
| Email | 

Type

email

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Email address of the person who initiated the refund.



 |
| GatewayDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The date that a successful gateway communication caused the creation of this refund.



 |
| GatewayRefNumber | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Unique transaction ID created by the payment gateway.



 |
| GatewayResultCode | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Gateway-specific result code. Must be mapped to a Salesforce-specific result code.



 |
| GatewayResultCodeDescription | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Description of the GatewayResultCode. Useful for providing additional context as to why the gateway returned a specific result code.



 |
| ImpactAmount | 

Type

currency

Properties

Filter, Nillable, Sort

Description

Shows the refund’s financial impact against the customer’s accounts receivable. If the refund amount is valid, it equals the Amount field. Equals 0 when the refund amount is void. Has a null value when the refund is canceled.



 |
| IpAddress | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The IP address of the person who initiated the payment.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp for when the current user last viewed a record related to this record.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp for when the current user last viewed this record. If this value is null, this record can have been referenced (LastReferencedDate) but not viewed.



 |
| LegalEntityAccountingPeriodId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The accounting period record that’s related to the legal entity. Available in API version 65.0 and later. This field is a relationship field.

This field is available only in orgs where Billing is enabled.

Relationship Name

LegalEntityAccountingPeriod

Refers To

LegalEntyAccountingPeriod



 |
| LegalEntityId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The legal entity this refund is associated with. Available in API version 65.0 and later. This field is a relationship field.

This field is available only in orgs where Billing is enabled.

Relationship Name

LegalEntity

Refers To

LegalEntity



 |
| MacAddress | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The MAC address of the person who initiated the refund.



 |
| NetApplied | 

Type

currency

Properties

Filter, Nillable, Sort

Description

Equals the Total Applied field minus the Total Unapplied field.



 |
| OrderPaymentSummaryId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Order payment summary record that shows the balances of each authorization, capture, and refund made against an order.



 |
| PaymentGatewayId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The payment gateway used to process this refund.

This is a relationship field.

Relationship Name

PaymentGateway

Relationship Type

Lookup

Refers To

PaymentGateway



 |
| PaymentGroupId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The payment group for the payment being refunded.

This is a relationship field.

Relationship Name

PaymentGroup

Relationship Type

Lookup

Refers To

PaymentGroup



 |
| PaymentID | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

ID of the payment record.

This field is a relationship field.

Relationship Name

Payment

Relationship Type

Lookup

Refers To

Payment



 |
| PaymentIntentID | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

ID of the payment intent record.

This field is a relationship field.

Relationship Name

PaymentIntent

Relationship Type

Lookup

Refers To

PaymentIntent



 |
| PaymentMethodId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The payment method used to create the payment being refunded.

This is a relationship field.

Relationship Name

PaymentMethod

Relationship Type

Lookup

Refers To

PaymentMethod



 |
| Phone | 

Type

phone

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Phone number of the customer who initiated the refund.



 |
| ProcessingMode | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort

Description

Defines whether the payment has been made outside of the payment platform.

Possible values are:

- External: Transactions happened outside of the Salesforce payments platform.
- Salesforce: Salesforce made and recorded an external call to the payment gateway.





 |
| RefundNumber | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, idLookup, Sort

Description

System-created unique ID for this refund.



 |
| SfResultCode | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Restricted picklist, Sort, Update

Description

Salesforce-specific result code that can map to one or more gateway result codes. We recommend configuring the payment gateway adapter layer to map gateway result codes to the appropriate Salesforce result code.

Possible values are:

- Decline: The gateway call failed but the transaction can be attempted again. For example, the customer had insufficient funds or briefly lost their connection.
- Indeterminate: The gateway didn’t respond to the call. This response usually happens when Salesforce times out while waiting for a response from the gateway.
- PermanentFail: The gateway call failed and can’t work even if tried again. Gateway calls fail permanently for one of two reasons:
    - Hard Decline: The customer’s payment account has been closed or terminated.
    - Fraud: The gateway recognized the payment or payment method as known fraud.
- RequiresReview: The customer bank requires more information before completing the payment.
- Success: The gateway call succeeded.
- SystemError: Salesforce ended the payment request before receiving a response. For example, Salesforce lost credentials or access to its server. Salesforce ends payment calls if it doesn’t receive a response from the gateway within two minutes.
- ValidationError: Customer payment data was incorrect, such as a misspelling in the credit card address or an incorrect CVV.





 |
| Status | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

Defines the state of this refund.

Possible values are:

- Canceled: This refund has been voided and can no longer be allocated.
- Draft: The refund can be edited before posting it and allocating it to a target.
- Processed: This refund has been finalized and can be allocated against a target.

Users can manually change the Status field’s values as follows:

- Draft to Processed
- Processed to Canceled
- Draft to Canceled





 |
| TotalApplied | 

Type

currency

Properties

Filter, Nillable, Sort

Description

The sum of Amount fields across all of this refund’s applied refund lines.



 |
| TotalUnapplied | 

Type

currency

Properties

Filter, Nillable, Sort

Description

The sum of Amount fields across all of this refund’s unapplied refund lines.



 |
| Type | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

Defines how this refund is used.

Possible values are:

- NonReferenced: Standalone refund not linked to any payment.
- Referenced: Refund made against a payment.





 |
| ReasonCode | 

Type

picklist

Properties

Filter, Group, Nillable, Sort

Description

Specifies a unique code that identifies the primary reason for a refund. This field is available in API version 68.0 and later.



 |
| ReferenceRecordId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

The ID of the record that this refund was issued against. For example, an invoice, credit memo, or payment. This field is available in API version 68.0 and later.

This field is a polymorphic relationship field.

Relationship Name

ReferenceRecord

Refers To

CreditMemo



 |