Initiates a refund against a posted credit memo. This action locks the credit memo, calls the Commerce Refund API, and returns the refund and application record IDs.
This action is available in API version 68.0 and later.
Special Access Rules
The Process Refund Credit Memo action is available in Enterprise, Unlimited, and Developer Editions where Billing is enabled. To use this action, your org needs the Payment Run Advance permission.
Where TOKEN is a placeholder for your OAuth access token.
Inputs
Input
Type
Description
appliedToId
reference
Required. ID of the posted credit memo to refund against.
currencyIsoCode
string
Optional. ISO currency code for the refund. Required when multi-currency is enabled. The value must match the currency of the credit memo.
refundNotes
string
Optional. Notes stored in the refund record comments.
paymentMethodId
reference
Optional. ID of the payment method to issue the refund on. The payment method must be valid and active.
refundAmount
double
Required. Amount to refund. The value must be greater than 0 and less than or equal to the remaining balance of the credit memo.
refundReason
string
Optional. Reason for the refund.
Outputs
Output
Type
Description
processRefundResponse
Apex-defined (ProcessRefundCreditMemoResponse)
Result of the refund operation. Contains these fields success (boolean)—Indicates whether the refund was processed successfully ( true ) or not ( false ); refundId (string)—ID of the created refund record; applicationId (string)—ID of the created application junction record (CreditMemoRefund or CreditMemoLineRefund ) that links the refund to the credit memo; or errors (list of Apex-defined ProcessRefundCreditMemoErrorResponse )—List of errors returned if the refund wasn’t processed successfully. Each error contains an errorCode and a message. Possible error codes are INVALID_CREDIT_MEMO—The specified credit memo isn’t in a valid state for refund processing, AMOUNT_EXCEEDS_BALANCE—The refund amount exceeds the remaining balance on the credit memo, CREDIT_MEMO_LOCKED—The credit memo is locked by another operation, LIMIT_EXCEEDED—The number of requests exceeds the maximum allowed (50), MISSING_REQUIRED_FIELD—A required input parameter is missing, or EXTERNAL_SERVICE_EXCEPTION—The Commerce Refund API call failed without a more specific error.
Example
POST
This sample request is for the Process Refund Credit Memo action.