Refunds

Refund a completed payment, in full or in part.

A refund sends money back from the account that received a payment to the account that paid it. You create the refund with one API call. The holder of the account that received the payment then approves the refund at their bank, through a payUrl link.

At a glance

QuestionAnswer
Which payments can be refunded?Payments with status ACCC, ACSC, ACSP, ACTC, ACWC or ACFC. A refund cannot be refunded
Partial refunds?Yes. You can create several refunds, up to the original amount in total
What is a refund?A new payment, with isRefund: true and originalPaymentId set to the original payment
Who approves it?The holder of the account that received the original payment, through payUrl
Which scope?create:refund

1. Create a refund

POST https://api.open-finance.ai/v2/payments/{paymentId}/refund, with a bearer token that has the create:refund scope. If your token does not have it, contact support.

paymentId is the ID of the original payment. It can be any payment of your organization.

{
  "amount": 50,
  "description": "Refund for order 1234",
  "psuId": "000000018",
  "sendSMS": true,
  "phoneNumber": "0500000000"
}
Request fields
KeyTypeDescriptionRequired
amountnumberThe amount to refund. At most the original amount minus the amount already refundedYes
descriptionstringDescription of the refundYes
psuIdstringNational ID of the holder of the account that pays the refund (the account that received the original payment)See note
psuCorporateIdstringBusiness ID of that account holderNo
sendSMSbooleanSend payUrl to the account holder by SMSNo
phoneNumberstringPhone number for the SMSNo
📘

Merchant defaults

When the original payment was made to a merchant (merchantId), the merchant's saved ID number, business ID and phone number are used for any of psuId, psuCorporateId and phoneNumber you leave out. Without a merchant, psuId is required.

A successful response is HTTP 201:

{
  "id": "example-refund-id",
  "payUrl": "https://.../su/example-short-id",
  "sentMerchantSMS": true
}
KeyDescription
idThe payment ID of the refund. The refund is a new payment
payUrlThe link where the account holder approves the refund. Valid for 24 hours
sentMerchantSMStrue when the SMS was sent

The refund amount is added to the original payment's refundedAmount right away, before the refund is approved.

How the refund is saved as a payment

The refund is created as a new payment with status INIT:

  • debtorAccountNumber is the account that received the original payment, and the refund is set to that account's bank.
  • creditorAccountNumber is the account the original payment was paid from.
  • isRefund is true and originalPaymentId is the original payment's ID.

2. The account holder approves it

Send payUrl to the account holder. The journey shows the refund, and the account holder approves it at their bank.

When sendSMS is true, an SMS in Hebrew with the amount and payUrl is sent to phoneNumber, or to the merchant's phone number. If there is no phone number, or sending fails, the refund is still created and sentMerchantSMS is false.

3. Follow the refund

The refund moves through the usual payment statuses.

  • Webhooks: status changes of the refund are sent to your organization's webhook from the Dashboard, not to the original payment's callbackInformation.
  • Reading the refund: use GET /v2/payments/{id} with a token for the same user that created the refund.

Error responses

StatusErrorDescription
400Payment not foundNo payment with this ID in your organization
400Cant refund a refund paymentThe payment is itself a refund
400Can't refund uncompleted paymentsThe payment's status is not one of the refundable statuses
400Maximum left to refund for this payment: ...amount is more than what is left to refund
400Psu id must be in request or in merchant detailsNo psuId was sent, and there is no merchant ID number to use
403—The token does not have the create:refund scope

Next steps


Did this page help you?