# Update the customer source `PUT https://api.leapa.co/v2/customers/{customer_id}/sources/{account_id}` Send your API key as a bearer token in the `Authorization` header. ## Path parameters - `customer_id` · _string_ · **required** Example: `cus_3d8e51fa20` - `account_id` · _string_ · **required** Example: `acc_62f3a8d15b` ## Request body Required. `application/json`. - `holder_address` · _AddressRequestGeneric_ - `city` · _string_ · **required** — City. Constraints: Not null, Size(min=3, max=90) Must be: 3 to 90 characters - `state` · _string_ — State. Constraints: Size(min=1, max=90) Must be: 1 to 90 characters - `type` · _string_ · **required** — The type of address. Constraints: Not null Allowed values: `personal`, `business` - `country` · _string_ · **required** — 2 letter ISO Country Code. Constraints: Not null, Size(min=2, max=3) Allowed values: `AD`, `AND`, `AE`, `ARE`, `AF`, `AFG`, `AG`, `ATG`, `AI`, `AIA`, `AL`, `ALB`, `AM`, `ARM`, `AN`, `ANT`, `AO`, `AGO`, `AQ`, `ATA`, `AR`, `ARG`, `AS`, `ASM`, `AT`, `AUT`, `AU`, `AUS`, `AW`, `ABW`, `AX`, `ALA`, `AZ`, `AZE`, `BA`, `BIH`, `BB`, `BRB`, `BD`, `BGD`, `BE`, `BEL`, `BF`, `BFA`, `BG`, `BGR`, `BH`, `BHR`, `BI`, `BDI`, `BJ`, `BEN`, `BL`, `BLM`, `BM`, `BMU`, `BN`, `BRN`, `BO`, `BOL`, `BQ`, `BES`, `BR`, `BRA`, `BS`, `BHS`, `BT`, `BTN`, `BV`, `BVT`, `BW`, `BWA`, `BY`, `BLR`, `BZ`, `BLZ`, `CA`, `CAN`, `CC`, `CCK`, `CD`, `COD`, `CF`, `CAF`, `CG`, `COG`, `CH`, `CHE`, `CI`, `CIV`, `CK`, `COK`, `CL`, `CHL`, `CM`, `CMR`, `CN`, `CHN`, `CO`, `COL`, `CR`, `CRI`, `CU`, `CUB`, `CV`, `CPV`, `CW`, `CUW`, `CX`, `CXR`, `CY`, `CYP`, `CZ`, `CZE`, `DE`, `DEU`, `DJ`, `DJI`, `DK`, `DNK`, `DM`, `DMA`, `DO`, `DOM`, `DZ`, `DZA`, `EC`, `ECU`, `EE`, `EST`, `EG`, `EGY`, `EH`, `ESH`, `ER`, `ERI`, `ES`, `ESP`, `ET`, `ETH`, `FI`, `FIN`, `FJ`, `FJI`, `FK`, `FLK`, `FM`, `FSM`, `FO`, `FRO`, `FR`, `FRA`, `GA`, `GAB`, `GB`, `GBR`, `GD`, `GRD`, `GE`, `GEO`, `GF`, `GUF`, `GG`, `GGY`, `GH`, `GHA`, `GI`, `GIB`, `GL`, `GRL`, `GM`, `GMB`, `GN`, `GIN`, `GP`, `GLP`, `GQ`, `GNQ`, `GR`, `GRC`, `GS`, `SGS`, `GT`, `GTM`, `GU`, `GUM`, `GW`, `GNB`, `GY`, `GUY`, `HK`, `HKG`, `HM`, `HMD`, `HN`, `HND`, `HR`, `HRV`, `HT`, `HTI`, `HU`, `HUN`, `ID`, `IDN`, `IE`, `IRL`, `IL`, `ISR`, `IM`, `IMN`, `IN`, `IND`, `IO`, `IOT`, `IQ`, `IRQ`, `IR`, `IRN`, `IS`, `ISL`, `IT`, `ITA`, `JE`, `JEY`, `JM`, `JAM`, `JO`, `JOR`, `JP`, `JPN`, `KE`, `KEN`, `KG`, `KGZ`, `KH`, `KHM`, `KI`, `KIR`, `KM`, `COM`, `KN`, `KNA`, `KP`, `PRK`, `KR`, `KOR`, `KW`, `KWT`, `KY`, `CYM`, `KZ`, `KAZ`, `LA`, `LAO`, `LB`, `LBN`, `LC`, `LCA`, `LI`, `LIE`, `LK`, `LKA`, `LR`, `LBR`, `LS`, `LSO`, `LT`, `LTU`, `LU`, `LUX`, `LV`, `LVA`, `LY`, `LBY`, `MA`, `MAR`, `MC`, `MCO`, `MD`, `MDA`, `ME`, `MNE`, `MF`, `MAF`, `MG`, `MDG`, `MH`, `MHL`, `MK`, `MKD`, `ML`, `MLI`, `MM`, `MMR`, `MN`, `MNG`, `MO`, `MAC`, `MP`, `MNP`, `MQ`, `MTQ`, `MR`, `MRT`, `MS`, `MSR`, `MT`, `MLT`, `MU`, `MUS`, `MV`, `MDV`, `MW`, `MWI`, `MX`, `MEX`, `MY`, `MYS`, `MZ`, `MOZ`, `NA`, `NAM`, `NC`, `NCL`, `NE`, `NER`, `NF`, `NFK`, `NG`, `NGA`, `NI`, `NIC`, `NL`, `NLD`, `NO`, `NOR`, `NP`, `NPL`, `NR`, `NRU`, `NU`, `NIU`, `NZ`, `NZL`, `OM`, `OMN`, `PA`, `PAN`, `PE`, `PER`, `PF`, `PYF`, `PG`, `PNG`, `PH`, `PHL`, `PK`, `PAK`, `PL`, `POL`, `PM`, `SPM`, `PN`, `PCN`, `PR`, `PRI`, `PS`, `PSE`, `PT`, `PRT`, `PW`, `PLW`, `PY`, `PRY`, `QA`, `QAT`, `RE`, `REU`, `RO`, `ROU`, `RS`, `SRB`, `RU`, `RUS`, `RW`, `RWA`, `SA`, `SAU`, `SB`, `SLB`, `SC`, `SYC`, `SD`, `SDN`, `SE`, `SWE`, `SG`, `SGP`, `SH`, `SHN`, `SI`, `SVN`, `SJ`, `SJM`, `SK`, `SVK`, `SL`, `SLE`, `SM`, `SMR`, `SN`, `SEN`, `SO`, `SOM`, `SR`, `SUR`, `SS`, `SSD`, `ST`, `STP`, `SV`, `SLV`, `SX`, `SXM`, `SY`, `SYR`, `SZ`, `SWZ`, `TC`, `TCA`, `TD`, `TCD`, `TF`, `ATF`, `TG`, `TGO`, `TH`, `THA`, `TJ`, `TJK`, `TK`, `TKL`, `TL`, `TLS`, `TM`, `TKM`, `TN`, `TUN`, `TO`, `TON`, `TR`, `TUR`, `TT`, `TTO`, `TV`, `TUV`, `TW`, `TWN`, `TZ`, `TZA`, `UA`, `UKR`, `UG`, `UGA`, `UM`, `UMI`, `US`, `USA`, `UY`, `URY`, `UZ`, `UZB`, `VA`, `VAT`, `VC`, `VCT`, `VE`, `VEN`, `VG`, `VGB`, `VI`, `VIR`, `VN`, `VNM`, `VU`, `VUT`, `WF`, `WLF`, `WS`, `WSM`, `YE`, `YEM`, `YT`, `MYT`, `ZA`, `ZAF`, `ZM`, `ZMB`, `ZW`, `ZWE` - `zip` · _string_ — Zip. Constraints: Size(min=1, max=15) Must be: 1 to 15 characters - `line1` · _string_ · **required** — Line 1. Constraints:Not null, Size(min=1, max=90) Must be: 1 to 90 characters - `line2` · _string_ · **required** — Line 2. Constraints: Size(min=1, max=90) Must be: 1 to 90 characters - `holder_name` · _string_ — The holder name. Constraints: Size(min=3, max=60) Must be: 3 to 60 characters - `default` · _boolean_ — Indicating whether this card is the default sources of payment ```json { "holder_address": { "city": "string", "state": "string", "type": "personal", "country": "AD", "zip": "string", "line1": "string", "line2": "string" }, "holder_name": "Jeanne Ndayishimiye", "default": false } ``` ## Response 200 - `id` · _string_ — Account Id - `object` · _string_ — Card Object Name - `address` · _AddressResponse_ - `object` · _string_ — Object name - `city` · _string_ — City - `type` · _string_ — The type of address. Can be Business location address or Bank Address Allowed values: `personal`, `business` - `status` · _string_ — Address status - invalid, line1_fail, line1_pass, line1_zip_pass, unchecked, verified, zip_fail, zip_pass Allowed values: `invalid`, `line1_pass`, `line1_name_pass`, `line1_zip_pass`, `name_pass`, `name_zip_pass`, `unchecked`, `verified`, `zip_pass` - `state` · _string_ — State - `zip` · _string_ — Zip - `line1` · _string_ — Line 1 - `line2` · _string_ — Line 2 - `brand` · _string_ — Card Brand Name Allowed values: `mastercard`, `visa` - `status` · _string_ — Status of the card account Allowed values: `created`, `validated`, `verified`, `verification_failed`, `errored`, `deleted` - `currency` · _string_ — The 3 letter representing the Currency. Allowed values: `BIF`, `USD`, `KES`, `XAF` - `token` · _string_ — Unique identifier of the bank data as returned by the CyberSource TMS API bank account number - `fingerprint` · _string_ — Unique identifier of the card number as returned by the CyberSource TMS API - `duplicateCard` · _boolean_ - `cvc_check` · _string_ — Card Verification Code check result Allowed values: `pass`, `fail`, `unavailable`, `unchecked` - `exp_month` · _string_ — Expiration Month - `exp_year` · _string_ — Expiration Year - `last_four` · _string_ — The last 4 digits of the card Number - `customer_id` · _string_ — Customer Unique Id - `statement_descriptor` · _string_ — Provides information about the charge that customers see on their statements. Maximum 22 characters. - `default` · _boolean_ — This flag indicate if this is the default source or not. - `holder_name` · _string_ — Holder name. Name of the owner as written on the card. - `holder_type` · _string_ — Card Holder Type. Allowed values: `individual`, `company` ```json { "id": "obj_5f21c8a40b", "object": "string", "address": { "object": "string", "city": "string", "type": "personal", "status": "invalid", "state": "string", "zip": "string", "line1": "string", "line2": "string" }, "brand": "mastercard", "status": "created", "currency": "BIF", "token": "string", "fingerprint": "string", "duplicateCard": false, "cvc_check": "pass", "exp_month": "string", "exp_year": "string", "last_four": "string", "customer_id": "cus_3d8e51fa20", "statement_descriptor": "string", "default": false, "holder_name": "Jeanne Ndayishimiye", "holder_type": "individual" } ``` ## Status codes - `200` OK - `400` Bad request - `401` Unauthorized - `402` Payment required - `403` Forbidden - `404` Not found - `428` Precondition required - `500` Server error ## Example ```bash curl -X PUT "https://api.leapa.co/v2/customers/cus_3d8e51fa20/sources/acc_62f3a8d15b" \ -H "Authorization: Bearer $LEAPA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "holder_address": { "city": "string", "state": "string", "type": "personal", "country": "AD", "zip": "string", "line1": "string", "line2": "string" }, "holder_name": "Jeanne Ndayishimiye", "default": false }' ``` --- _Generated from the Leapa documentation at leapa.co/docs._