/delete_card
Deletes a card
This endpoint deletes cards successfully linked to end users, removing them from use as future payment methods.
Requests
The card_name
key is required and is used to uniquely identify the card to delete.
The provider
key is required.
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.
POST /0.2/delete_card HTTP/1.1
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>"
},
"card_name": "Card name",
"provider": "cko"
}
***
HTTP/1.1 200 OK
{
"success": true,
"message": "Card cko_card_2 has been successfully deleted.",
"status": "SUCCESS",
"reference": "2aa0f069-6263-483e-97c0-57f109656836",
"response_time_ms": "16425"
}
var cardName = "your card name";
var provider = "evolve";
const res = await Sila.deleteCard(userHandle, userPrivateKey, cardName, provider);
// Success Response Object
console.log(res.statusCode); // 200
payload = {
"user_handle": "user.silamoney.eth",
"card_name": "Your Card",
"provider": "CKO"
}
response = User.delete_card(silaApp, payload, eth_private_key)
### Success Response Object
{
'success': True,
'message': 'Card visa has been successfully deleted.',
'status': 'SUCCESS',
'status_code': 200
}
### Failure Response Object
{
status: 'FAILURE'
}
ApiResponse response = api.deleteCard(userHandle, cardName, userPrivateKey,provider);
// Success Response
BaseResponse parsedResponse = (BaseResponse) response.getData();
System.out.println(response.getStatusCode()); // 200
System.out.println(parsedResponse.getSuccess());
System.out.println(parsedResponse.getStatus());
System.out.println(parsedResponse.getMessage());
System.out.println(parsedResponse.getReference());
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'user private key';
$cardName = 'visa';
$provider = 'CKO';
$response = self::$config->api->deleteCard($userHandle, $userPrivateKey, $cardName, $provider);
echo $response->getStatusCode();
echo $response->getData()->getStatus();
echo $response->getData()->getSuccess();
echo $response->getData()->getMessage();
ApiResponse<object> response = api.DeleteCard(userHandle, userPrivateKey, cardName);
// Success Response Object
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((DeleteCardResult)response.Data).Reference); // Random reference number
Console.WriteLine(((DeleteCardResult)response.Data).Success); // true
Console.WriteLine(((DeleteCardResult)response.Data).Status); // SUCCESS
Console.WriteLine(((DeleteCardResult)response.Data).Message); // Card successfully deleted.
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. |
card_name | String | Required. Name of card, assigned at time of linkage, unique to a single user handle. |
provider | String | Required. Identifies the card processor. Should be set to "cko" or "CKO". |
Responses
Status Code | success Attribute | Description |
---|---|---|
200 | true | Card was successfully deleted and will no longer be available for use in transaction endpoints. |
400 | false | Bad request format - check validation_details for more information. |
403 | false | authsignature or usersignature header was absent or incorrect. |
Updated about 1 year ago