Skip to main content

Goal

Return funds to a user by refunding an approved intent.

Steps


Step 1: Submit a refund

What you need to do

Call the Push Cash API to create a refund with the intent_id of the original cash-in payment.

How to do it

  • Call the create-refund endpoint with the intent_id of the payment you want to refund.
  • Optionally, add an amount to refund a portion of the intent. If amount is omitted, the full intent amount is refunded.
  • Only one refund is allowed per intent. Subsequent refund attempts on the same intent will return a 200 with the already-created refund.
To check whether an intent has already been refunded, call get-an-intent and inspect the refund field on the response.
A refund can be declined by the issuer if the user’s bank rejects the transaction.
curl --request POST \
  --url https://sandbox.pushcash.com/refund \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "intent_id": "intent_R7xKpVwZ3mNqYtFh2sJcAe"
}
'

Step 2: Handle response

What you need to do

Check whether the refund was approved or declined.

How to do it

  • Check the HTTP status code. A non-200 response means the refund could not be processed.
  • A 401 response indicates the refund was declined by the payment network. The response body includes the id of the declined refund.
  • A 400 response indicates a validation error (e.g. the refund amount is greater than the intent amount).

Integration checklist

  • Submit a refund in the sandbox environment using a sandbox intent
    • Test a partial refund by specifying an amount less than the original intent amount
  • Test a refund decline by processing an intent with test card 5999 9619 6976 9301 and then submitting a refund