Step 2: Receive Outbound Refund Initiation Response
Overview
Once the refund initiation has been processed by the scheme, Electrum communicates the outcome to you asynchronously in a refund initiation response. This message indicates whether the refund was successful or not and will determine whether you finalise the transaction on your system, or return funds that have been debited from the customer's account.
The refund initiation response has a financial impact. Be sure to consider these important factors when handling this step:
- Electrum treats the refund initiation response as a must-deliver message and will repeatedly send it until you acknowledge receipt.
- Once Electrum has received your acknowledgement, then the transaction is considered complete.
- If the outcome indicates a successful authorisation, then you may finalise the transaction.
- If the outcome indicates a failed authorisation, then you should credit funds back to the sender's account.
- Refer to Outbound PayShap Request-To-Pay Step 3 for more details on how to process the possible outcomes.
Implementing the API
Receive Outcome
Electrum sends an outboundRefundInitiationResponse
message to your /transactions/outbound/refund-initiation-response
endpoint.
The full message schema can be found in the API reference documentation. Code and payload samples are shown below.
- Partner API sandbox
https://example.com/path/payments/partner-api/v1/transactions/outbound/refund-initiation-response
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://example.com/path/payments/partner-api/v1/transactions/outbound/refund-initiation-response \
-H 'Content-Type: application/json' \
-H 'traceparent: string' \
-H 'tracestate: string' \
-d '{
"schema": "PaymentStatusReport",
"messageIdentifiers": {
"messageIdentification": "9fd51c7124ba4819b9253e296a6be1da",
"creationDateTime": "2022-05-04T03:22:11Z"
},
"originalMessageIdentifiers": {
"messageIdentification": "8fd51c7124ba4819b9253e296a68e1da",
"creationDateTime": "2022-05-04T03:02:01Z"
},
"paymentScheme": {
"schema": "ZA_RPP"
},
"transactionIdentifiers": {
"endToEndIdentification": "5129118655591098",
"transactionIdentification": "RRN000000002",
"uetr": "9f7a56ad-c5ab-4b70-a3f9-946d743eaeaa"
},
"status": {
"outcome": "APPROVED",
"reasonInfo": [
{
"reason": {
"schema": "CODE",
"value": "ACSC"
},
"additionalInformation": "Settlement completed on debtor account"
}
]
},
"instructingAgent": {
"bicfi": "RY8PEG0L",
"memberId": "AmazingBankId",
"name": "Amazing Bank Inc",
"branch": {
"identification": 210514,
"name": "ABC Plettenberg Bay",
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": 42,
"buildingName": "Mysterious Building",
"floor": 42,
"postBox": 1024,
"postCode": 4242,
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
8001
]
}
}
},
"instructedAgent": {
"bicfi": "RY8PEG0L",
"memberId": "AmazingBankId",
"name": "Amazing Bank Inc",
"branch": {
"identification": 210514,
"name": "ABC Plettenberg Bay",
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": 42,
"buildingName": "Mysterious Building",
"floor": 42,
"postBox": 1024,
"postCode": 4242,
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
8001
]
}
}
},
"originalTransactionData": {
"paymentMethod": "CreditTransfer",
"creditor": {
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": "42",
"buildingName": "Mysterious Building",
"floor": "42",
"postBox": "1024",
"postCode": "4242",
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
"8001"
]
},
"contactDetails": {
"phoneNumber": "+27-0214620000",
"mobileNumber": "+27-08230000000",
"emailAddress": "developer.dave@electrum.com"
},
"countryOfResidence": "ZA",
"identification": {
"schema": "PERSON",
"identifiers": [
{
"identification": "90001236549870",
"scheme": {
"schema": "CODE",
"value": "NIDN"
},
"issuer": "Dept of Home Affairs"
}
]
}
},
"creditorAccount": {
"identification": {
"schema": "GENERIC",
"scheme": {
"schema": "PROPRIETARY",
"value": "AProprietaryCode123"
},
"issuer": "Amazing Bank",
"value": "abcdef987654"
},
"type": {
"schema": "CODE",
"value": "CACC"
}
},
"creditorAgent": {
"bicfi": "RY8PEG0L",
"memberId": "AmazingBankId",
"name": "Amazing Bank Inc",
"branch": {
"identification": 210514,
"name": "ABC Plettenberg Bay",
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": 42,
"buildingName": "Mysterious Building",
"floor": 42,
"postBox": 1024,
"postCode": 4242,
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
8001
]
}
}
},
"amounts": {
"bankSettlementAmount": {
"value": 50,
"currency": "ZAR"
},
"instructedAmount": {
"value": 50,
"currency": "ZAR"
}
},
"debtor": {
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": "42",
"buildingName": "Mysterious Building",
"floor": "42",
"postBox": "1024",
"postCode": "4242",
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
"8001"
]
},
"contactDetails": {
"phoneNumber": "+27-0214620000",
"mobileNumber": "+27-08230000000",
"emailAddress": "developer.dave@electrum.com"
},
"countryOfResidence": "ZA",
"identification": {
"schema": "PERSON",
"identifiers": [
{
"identification": "90001236549870",
"scheme": {
"schema": "CODE",
"value": "NIDN"
},
"issuer": "Dept of Home Affairs"
}
]
}
},
"debtorAccount": {
"identification": {
"schema": "GENERIC",
"scheme": {
"schema": "PROPRIETARY",
"value": "AProprietaryCode123"
},
"issuer": "Amazing Bank",
"value": "abcdef987654"
},
"type": {
"schema": "CODE",
"value": "CACC"
}
},
"debtorAgent": {
"bicfi": "RY8PEG0L",
"memberId": "AmazingBankId",
"name": "Amazing Bank Inc",
"branch": {
"identification": 210514,
"name": "ABC Plettenberg Bay",
"address": {
"addressType": "ADDR",
"department": "Department of Mysteries",
"streetName": "Street of Mysteries",
"buildingNumber": 42,
"buildingName": "Mysterious Building",
"floor": 42,
"postBox": 1024,
"postCode": 4242,
"townName": "Mysty Town",
"townLocationName": "Mysty Location",
"districtName": "Mysty District",
"countrySubDivision": "Mysterious Cape",
"country": "ZA",
"addressLine": [
"16A",
"New market street",
"Foreshore",
"Cape Town",
"ZA",
8001
]
}
}
},
"supplementaryData": {
"customData1": "My custom data 1",
"customData2": "My custom data 2"
},
"paymentTypeInformation": {
"localInstrument": {
"schema": "CODE",
"value": "BTR"
}
}
}
}'
No content
Respond With Success
If you receive the message successfully and are able to process it, then respond with an HTTP 202
status. Process the message as described here.
Respond With An Error
If you experience an error while handling the request and are unable to submit it for asynchronous processing, then respond with an appropriate error response.