Refund a payment
Refund a payment in a workflow execution with an optional reason, in full by omitting the amount, and for payment links pass the ID of the payment.
Authorizations
You can use an OAuth2 JWT bearer token in the Authorization header of your API requests for supported endpoints: Authorization: Bearer <YOUR_JWT_HERE>.
These tokens are valid for 10 minutes and can be requested via the access token endpoint endpoint.
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Path Parameters
Path parameter to specify the workflow code. Machine-friendly code of Workflow.
^[a-z][-A-Za-z0-9]*$Identifier of the resource in Payrails.
Body
The amount to refund, including currency. Full amount will be refunded if not specified.
Reason for invoking the operation or action. CustomerDontNeed is deprecated, use CustomerDoesNotNeed instead. With Other, reasonDescription is required for refunds: at least 3 characters after trimming. On refunds, reasonDescription is at most 255 characters for any reason.
BetterPrice, CustomerDoesNotNeed, CustomerDontNeed, DamagedProduct, Duplicate, FraudulentProduct, LateDelivery, NoReason, Other, ProductMismatchDescription, WrongProduct, WrongProductSpecification Any necessary information for the refund action, at most 255 characters. Required when reason is Other: at least 3 characters after trimming whitespace. A violation returns 400 with reason.field set to reasonDescription.
255"Customer was charged twice for the same order."
Optionally the ID of the payment to refund. Used for payment links where an execution can have multiple successful payments. If not specified, the most recent payment done using the payment link will be refunded.
Metadata for the context of an execution. Includes Payrails-defined structures for most common fields used in workflows, but can also be extended by merchant or provider-specific fields. For more information, visit our Meta Fields guide. See Meta for every field.
Response
The payment refund was requested.
Performed action name.
refund Unique identifier for this action execution. If its processing is done asynchronously, you will receive a notification with the same actionId.
Date and time when execution of the Action was started.
Links to the next possible actions that can be taken.
Unique identifier of a workspace in Payrails.
Reason for invoking the operation or action. CustomerDontNeed is deprecated, use CustomerDoesNotNeed instead. With Other, reasonDescription is required for refunds: at least 3 characters after trimming. On refunds, reasonDescription is at most 255 characters for any reason.
BetterPrice, CustomerDoesNotNeed, CustomerDontNeed, DamagedProduct, Duplicate, FraudulentProduct, LateDelivery, NoReason, Other, ProductMismatchDescription, WrongProduct, WrongProductSpecification An optional field to include any necessary information for the refund action.
"Accidentally charged the customer twice."