/refund_debit_card
This endpoint initiates a refund for a single payment request back to an end user's successfully linked debit card.
This endpoint initiates a refund to an end user's successfully linked debit card.
NOTE
The available balance in the end user's Sila wallet must be equal or greater than the refund amount for a successful refund.
Requests
The transaction_id
key is required and is used to uniquely identify the transaction to refund.
Authorization / Authentication
Apps using Access Token Authorization
Use a valid access token in an Authorization: Bearer request header.
See Authenticating with an Access Token for more details.
Apps using ECDSA Authentication
Both authsignature
and usersignature
headers are required for this request. The usersignature header should be generated with a keypair registered to the user (either registered from the /register endpoint or the /register_wallet endpoint).
See the section on ECDSA Authentication for more detail about ECDSA signature generation.
Note - We recently renamed the field auth_handle
to app_handle
. For backward compatibility, auth_handle
is still valid but has been removed from our documentation.
You cannot request a refund on a transaction if the associated debit card has been unlinked/deleted.
NOTE: You will need to create a Customer Reserve Wallet to utilize this endpoint.
Please contact Sila support via Slack and provide the following to set up your CRW:
For SANDBOX: app_handle, user_handle, and the Wallet ID
For PRODUCTION: Company Legal Name, app_handle, user_handle, and the Wallet ID
POST /0.2/refund_debit_card HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
{
"header": {
"created": 1234567890,
"auth_handle": "handle.silamoney.eth",
"user_handle":"user.silamoney.eth",
"reference": "<your unique id>"
},
"transaction_id": "<transaction_id>"
}
***
HTTP/1.1 200 OK
{
"success": true,
"reference": "6f8a23c0-4122-401c-b8c2-38847a8dd051",
"message": "A refund request is in progress for debit card transaction 881ac1ba-400c-44ed-b4bd-d82f34cea273.",
"status": "SUCCESS",
"response_time_ms": "883"
}Payload
{
"user_handle" : "user.silamoney.eth"
"transaction_id": "c4829191-e444-4244-b0ed-52dfefa21e0c"
}
response = Transaction.refundDebitCard(silaApp, payload, eth_private_key)
### Success Response Object
{
"success": true,
"transaction_id": "c4829191-e444-4244-b0ed-52dfefa21e0c",
"reference": "a650db98-681b-4ab6-9443-e8cf9acec640",
"message": "A refund request in the amount of $0.01 (1 SILA) has been submitted as a second/child transaction.",
"warning": null,
"status": "SUCCESS",
"response_time_ms": "1083"
}
### Failure Response Object
{
status: 'FAILURE'
}
var payload = {
"header": {
"app_handle": "{{app_handle}}",
"user_handle": "{{user_handle}}"
},
"transaction_id": "c4829191-e444-4244-b0ed-52dfefa21e0c"
}
const res2 = await sila.refundDebitCard(handles[0],wallets[0].privateKey,payload);
//Response
{
"success": true,
"transaction_id": "c4829191-e444-4244-b0ed-52dfefa21e0c",
"refund_transaction_id": "0bc545b8-2559-4294-85ac-9429bc6b9df4",
"reference": "a650db98-681b-4ab6-9443-e8cf9acec640",
"message": "A refund request in the amount of $0.01 (1 SILA) has been submitted as a second/child transaction.",
"warning": null,
"status": "SUCCESS",
"response_time_ms": "1083"
}
RefundDebitCardMessage refundDebitCardMessage = RefundDebitCardMessage.builder()
.userHandle("user_handle")
.userPrivateKey("user_private_key")
.transactionId("transaction id")
.build();
ApiResponse response = api.refundDebitCard(refundDebitCardMessage);
// Success response
System.out.println(response.getStatusCode()); // 202
RefundDebitCardResponse parsedResponse = (RefundDebitCardResponse) response.getData();
System.out.println(parsedResponse.getSuccess());
System.out.println(parsedResponse.getReference()); // Random reference number
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getMessage()); // A refund request is in progress for debit card transaction ...
System.out.println(parsedResponse.getTransactionId()); // Transaction id
System.out.println(parsedResponse.getRefundTransactionId()); // Refund transaction id
Key | Type | Description |
---|---|---|
header | JSON object | Required. Requires these keys in JSON format: created, auth_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object. |
transaction_id | String | Required. See the /get_transactions endpoint response to find transaction_id information. |
Responses
Status Code | success Attribute | Description | |
---|---|---|---|
202 | true | Refund successfully initiated. | |
400 | false | Refund request not authorized by Checkout.com. | |
400 | false | Refund requested for a transaction that was not processed through Checkout.com. | |
400 | false | Refund requested for a transaction that did not originate from a debit card (i.e, can't request a refund on an transaction that originated from a bank account). | |
400 | false | Refund requested for a transaction that originated from a credit card. | |
400 | false | Refund requested for a transaction that originated from a debit card which has since been deleted. | |
404 | false | Transaction not found matching provided id. |
Updated 7 months ago