Step 5: update a card's details

Lastly, let's try updating the details of an existing card.

In this example, we'll just be updating the card's name — but you can update other details, such as the ID of the person associated with the card (if it's an individual card) or the phone number associated with the card's budget.

SandboxProduction
Copy
Copied
curl -i -X PUT \
  'https://api-sandbox.equalsmoney.com/v2/cards/{cardId}?accountId={accountId}' \
  -H 'Authorization: ApiKey {apiKey}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Birthday"
  }'
Copy
Copied
curl -i -X PUT \
  'https://api.equalsmoney.com/v2/cards/{cardId}?accountId={accountId}' \
  -H 'Authorization: ApiKey {apiKey}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Birthday"
  }'

If your request is successful, you'll receive a 200 response containing the updated details.

Copy
Copied
{
  "id": "800065b2-4d12-42ac-940c-00cd930e3758",
  "name": "Birthday",
  "personId": "cfd2431d-a682-4167-adfa-5975bc47aaf5",
  "accountId": "F12345",
  "state": "ACTIVE",
  "cardType": "VIRTUAL_PAN",
  "lastFour": "3315",
  "cardProductToken": "23ada04b-5b3b-4b73-8343-da3f14d8d96f",
  "fulfillmentStatus": "ISSUED",
  "expiration": "0128",
  "pinIsSet": false,
  "recipientAddress": {
    "city": "Porterville",
    "country": "US",
    "address1": "123 Henry St",
    "lastName": "Doe",
    "firstName": "Jane",
    "postalCode": "93257"
  },
  "cardPersonalization": null,
  "careOfLine": null,
  "budgetCardPhoneNumber": null,
  "userTokenId": "5609caee-f89d-4e49-8d2e-6e4d8f8d0422",
  "cardOwnerType": "PEOPLE",
  "budgetCardPhoneNumberPersonId": null,
  "cardGroupId": "800065b2-4d12-42ac-940c-00cd930e3758",
  "cardProductId": "029bddac-7ef0-11ee-8764-06395f802f08",
  "physicalCardState": "PENDING_ACTIVATION",
  "physicalCardId": "0302fbed-6078-4497-a580-61ad686eb228",
  "forceChangePin": false,
  "createdAt": "2024-01-18T13:42:51.000Z",
  "updatedAt": "2024-01-18T14:19:18.651Z",
  "meta": [
    {
      "id": "8a98c26c-8196-4f40-ba72-037569a0a8d0",
      "cardId": "800065b2-4d12-42ac-940c-00cd930e3758",
      "metaKey": "expirationTime",
      "metaValue": "2028-01-31T23:59:59Z",
      "createdAt": "2024-01-18T13:42:51.000Z",
      "updatedAt": "2024-01-18T13:42:51.000Z",
      "CardId": "800065b2-4d12-42ac-940c-00cd930e3758"
    },
    {
      "id": "ee473b51-d16b-429d-8017-d13cd2361925",
      "cardId": "800065b2-4d12-42ac-940c-00cd930e3758",
      "metaKey": "stateReason",
      "metaValue": "New card",
      "createdAt": "2024-01-18T13:42:51.000Z",
      "updatedAt": "2024-01-18T13:42:51.000Z",
    "CardId": "800065b2-4d12-42ac-940c-00cd930e3758"
    }
  ],
  "token": {
    "id": "5609caee-f89d-4e49-8d2e-6e4d8f8d0422",
    "personId": "cfd2431d-a682-4167-adfa-5975bc47aaf5",
    "accountId": "F12345",
    "userToken": "c8b9f4a6-b254-4b01-a3b3-9c266980e36c",
    "budgetId": null
  }
}

Next