Backend API
Update an existing account card using the ID that was returned when created.
Arguments
Unique identifier for the account card.
Full name of the customer. If first_name or last_name are updated, then name will be automatically updated as a combination of first/last.
Customer's first name. If name is updated, then first_name will be automatically updated as the first word of the name.
If name is updated, then last_name will be automatically updated as the last words of the name.
Billing address line 1: street address/PO box/company name.
Billing address line 2: apartment/suite/unit/building.
Billing city/district/suburb/town/village.
Billing state/county/province/region.
Billing zip/postal code.
Two-letter ISO country code.
Credit card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown.
Two-digit number representing the credit card expiration month.
Four-digit number representing the credit card expiration year.
Last four digits of the card number.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/accounts:cards/{id}', {
id: '62ceea552fa37600132911f6',
exp_month: 11,
exp_year: 2025
});Response
{
"parent_id": "621e53a6213eaf013d1fa6b2",
"billing": {
"name": "Jarl Balgruff",
"first_name": "Jarl",
"last_name": "Balgruff",
"address1": "543 Castle Way",
"address2": null,
"city": "Whiterun",
"state": "CA",
"zip": null,
"country": "US",
"phone": null,
"company": null
},
"brand": "Visa",
"last4": "1234",
"exp_month": 11,
"exp_year": 2025,
"token": "card_QD4rOXP3I5bOmUCKlmLo8AzC",
"address_check": "unchecked",
"zip_check": "unchecked",
"cvc_check": "unchecked",
"fingerprint": "3618a9581fec797682e06740212c08f3",
"date_created": "2022-07-13T15:52:53.253Z",
"active": true,
"date_updated": "2022-07-18T20:00:49.662Z",
"id": "62ceea552fa37600132911f6"
}