Skip to main content

Update card

PUT 

https://api.publicsquare.com/payment-methods/cards/:id

Update an existing card payment method in the Account.

Permissions

  • payment-method:write

Request

Path Parameters

    id stringrequired

Bodyrequired

    customer_idstringnullable

    Customer ID

    Example: cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ
    billing_details object
    address_line_1stringrequired

    Street name

    Possible values: non-empty and <= 250 characters

    Example: 111 Colorado Ave.
    address_line_2stringnullable

    Apt, Suite or PO Box

    Possible values: <= 250 characters

    Example: Apt 403
    citystringrequired

    City

    Possible values: non-empty and <= 100 characters

    Example: Des Moines
    statestringrequired

    2 or 3 character ISO state code

    Possible values: >= 2 characters and <= 3 characters

    Example: IA
    postal_codestringrequired

    Postal or zip code

    Possible values: non-empty and <= 30 characters

    Example: 51111
    countrystringrequired

    2 character ISO country code

    Possible values: non-empty and <= 2 characters

    Example: US

Responses

OK

Schema
    idstringnullable

    Card ID

    Example: card_8PajTnDVrviEJ8zYJDALFQm5t
    account_idstringnullable

    Account ID

    Example: acc_B518niGwGYKzig6vtrRVZGGGV
    environmentstringnullable

    Environment - Can be test or production

    Example: production
    customer_idstringnullable

    Customer ID

    Example: cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ
    billing_details object
    address_line_1stringrequired

    Street name

    Possible values: non-empty and <= 250 characters

    Example: 111 Colorado Ave.
    address_line_2stringnullable

    Apt, Suite or PO Box

    Possible values: <= 250 characters

    Example: Apt 403
    citystringrequired

    City

    Possible values: non-empty and <= 100 characters

    Example: Des Moines
    statestringrequired

    2 or 3 character ISO state code

    Possible values: >= 2 characters and <= 3 characters

    Example: IA
    postal_codestringrequired

    Postal or zip code

    Possible values: non-empty and <= 30 characters

    Example: 51111
    countrystringrequired

    2 character ISO country code

    Possible values: non-empty and <= 2 characters

    Example: US
    created_atdate-timenullable

    Date card was created

    Example: 2024-06-30T01:02:29.212Z
    modified_atdate-timenullable

    Date card was modified

    Example: 2024-06-30T01:02:29.212Z
    cardholder_namestringnullable

    Cardholder name

    Example: John Smith
    last4stringnullable

    Last 4 digits of the card

    Example: 4242
    exp_monthstringnullable

    Card expiration month

    Example: 12
    exp_yearstringnullable

    Card expiration year

    Example: 2025
    fingerprintstringnullable

    Fingerprint of the card to identify uniqueness

    Example: CC2XvyoohnqecEq4r3FtXv6MdCx4TbaW1UUTdCCN5MNL
    brandstringnullable

    Card brand

    Example: visa
    avs_codestringnullable

    AVS code

    Example: Y
    cvv2_replystringnullable

    CVV2 reply

    Example: M

Authorization: X-API-KEY

name: X-API-KEYtype: apiKeyscopes: payment-method:writedescription: Authorization by API Key inside request's X-API-KEY headerin: header
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.publicsquare.com/payment-methods/cards/:id");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("X-API-KEY", "<X-API-KEY>");
var content = new StringContent("{\n \"customer_id\": \"cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ\",\n \"billing_details\": {\n \"address_line_1\": \"111 Colorado Ave.\",\n \"address_line_2\": \"Apt 403\",\n \"city\": \"Des Moines\",\n \"state\": \"IA\",\n \"postal_code\": \"51111\",\n \"country\": \"US\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://api.publicsquare.com
Auth
Parameters
— pathrequired
Body required
{
  "customer_id": "cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ",
  "billing_details": {
    "address_line_1": "111 Colorado Ave.",
    "address_line_2": "Apt 403",
    "city": "Des Moines",
    "state": "IA",
    "postal_code": "51111",
    "country": "US"
  }
}
ResponseClear

Click the Send API Request button above and see the response here!