Process Refund Credit Memo Action
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.
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.
URI:/services/data/v68.0/actions/standard/processUnreferencedRefund
Formats: JSON, XML
HTTP Methods: POST
Authentication:Authorization: Bearer TOKEN
Where TOKEN is a placeholder for your OAuth access token.
| 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. |
| 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. |
POST
This sample request is for the Process Refund Credit Memo action.
This sample response shows a successful invocation.
This sample shows an error response for a credit memo already locked by another operation.