Update card
PUThttps://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
- application/json
Bodyrequired
customer_idstringnullable
Customer ID
Example:
cus_7Ay5mcUXAxwrN6wQEQUVEHBCJ
billing_details object
Responses
- 200
- 400
- 401
- 403
- 404
OK
- application/json
- Schema
- Example (auto)
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
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
{
"id": "card_8PajTnDVrviEJ8zYJDALFQm5t",
"account_id": "acc_B518niGwGYKzig6vtrRVZGGGV",
"environment": "production",
"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"
},
"created_at": "2024-06-30T01:02:29.212Z",
"modified_at": "2024-06-30T01:02:29.212Z",
"cardholder_name": "John Smith",
"last4": "4242",
"exp_month": "12",
"exp_year": "2025",
"fingerprint": "CC2XvyoohnqecEq4r3FtXv6MdCx4TbaW1UUTdCCN5MNL",
"brand": "visa",
"avs_code": "Y",
"cvv2_reply": "M"
}
Bad Request
- application/json
- Schema
- Example (auto)
Schema
errors objectnullable
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"errors": {},
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Unauthorized
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Forbidden
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Not Found
- application/json
- Schema
- Example (auto)
Schema
typestringnullable
titlestringnullable
statusint32nullable
detailstringnullable
instancestringnullable
property name*any
{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string"
}
Authorization: X-API-KEY
name: X-API-KEYtype: apiKeyscopes: payment-method:write
description: Authorization by API Key inside request's X-API-KEY headerin: header
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
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());
ResponseClear