/update_card

Updates a card name.

This endpoint updates successfully linked debit card names.

Requests

The card_name key is required and is the field that is updated with this endpoint.
The card_id key is required and is used to uniquely identify the card to update.

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/update_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",
  "card_id": "<card_id>"
}

***

HTTP/1.1 200 OK

{
    "success": true,
    "card_name": "test_card",
    "card_last_4": 1157,
    "expiration": "12/27",
    "card_type": "Debit",
    "card_network": "Visa",
    "pull_enabled": true,
    "push_enabled": null,
    "push_availability": null,
    "active": true,
    "country": "GB",
    "currency": "USD",
    "card_id": "dfdbd0ac-dd7d-4691-b573-50b7b69fb29a",
    "message": "Card successfully updated.",
    "reference": "31a25154-8c8a-4341-9ddd-0863d7736a4d",
    "status": "SUCCESS",
    "response_time_ms": "124"
}
var cardName = "your card name";
const res = await Sila.deleteCard(userHandle, userPrivateKey, cardName);


// Success Response Object
console.log(res.statusCode); // 200
payload = {
    "user_handle": "user.silamoney.eth",
    "card_name": "Your Card"            
}

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);

// 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';

$response = self::$config->api->deleteCard($userHandle, $userPrivateKey, $cardName);
        
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.
KeyTypeDescription
headerJSON objectRequired. 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_nameStringRequired. Name of card, assigned at time of linkage, unique to a single user handle.
card_idStringRequired. Unique id assigned to card at time of linkage.

Responses

Status Codesuccess AttributeDescription
200true

Response Contents

KeyDatatypePossible ValuesDescription
card_nameStringThis is a nickname supplied by the /link_card request which will be used to reference this card in transaction requests.
card_last_4IntegerThese are the last 4 digits of the card for the purpose of identifying the card among other linked cards.
expirationStringThis is the card's expiration date.
card_typeString"Debit"This describes the type of card that was linked.
card_networkString"Visa"
pull_enabledBooleantrue/falseThis indicates whether funds can be pulled from the card (whether funds can be debited from the card, in other words).
push_enabledBooleantrue/falseThis indicates whether funds can be pushed to the card (whether funds can be credited to the card, in other words).
push_availabilityBooleantrue/falseThis indicates the availability of funds pushed to the card as reported by the card issuer.
activeBooleantrue/falseThis is true if the card is usable in transaction requests, false if not.
countryStringAny 2-character country code in the ISO 3166 standard (e.g. "US")This is where the card was issued.
currencyStringAny 3-character currency code in the ISO 4217 standard (e.g. "USD")This is the currency supported by the card.
card_idStringA unique ID in UUID format.This is a unique ID generated by Sila to identify the linked card.