Update

PUT /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "payment_method": {
    "first_name": "Newfirst",
    "last_name": "Newlast",
    "metadata": {
      "key": "string value",
      "another_key": 123,
      "final_key": true
    }
  }
}
<payment_method>
  <first_name>Newfirst</first_name>
  <last_name>Newlast</last_name>
  <metadata>
    <key>String Value</key>
    <another_key>123</another_key>
    <final_key>true</final_key>
  </metadata>
</payment_method>

HTTPS/1.1 200 OK
{
  "payment_method": {
    "token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
    "created_at": "2017-06-26T17:04:38Z",
    "updated_at": "2022-04-14T18:46:01Z",
    "email": "joey@example.com",
    "data": {
      "my_payment_method_identifier": "448",
      "extra_stuff": {
        "some_other_things": "Can be anything really"
      }
    },
    "storage_state": "retained",
    "test": true,
    "metadata": {
      "key": "string value",
      "another_key": 123,
      "final_key": true
    },
    "callback_url": null,
    "last_four_digits": "1111",
    "first_six_digits": "411111",
    "card_type": "visa",
    "first_name": "Newfirst",
    "last_name": "Newlast",
    "month": 3,
    "year": 2032,
    "address1": null,
    "address2": null,
    "city": null,
    "state": null,
    "zip": null,
    "country": null,
    "phone_number": null,
    "company": null,
    "full_name": "Newfirst Newlast",
    "eligible_for_card_updater": true,
    "shipping_address1": null,
    "shipping_address2": null,
    "shipping_city": null,
    "shipping_state": null,
    "shipping_zip": null,
    "shipping_country": null,
    "shipping_phone_number": null,
    "issuer_identification_number": "41111111",
    "payment_method_type": "credit_card",
    "bin_metadata": {
      "card_brand": "DISCOVER",
      "card_category": "PERSONAL",
      "card_type": "CREDIT",
      "issuing_bank": "DISCOVER BANK",
      "issuing_country_iso_number": "840",
      "issuing_country_iso_a2_code": "US",
      "issuing_country_iso_a3_code": "USA",
      "issuing_country_iso_name": "UNITED STATES",
      "issuing_bank_phone_number": "1 (800) 347-7000",
      "issuing_bank_website": "HTTPS://WWW.DISCOVER.COM/",
      "bin_type": "PERSONAL",
      "regulated": "Y",
      "max_pan_length": 19,
      "message": "Successful"
    },
    "errors": [

    ],
    "fingerprint": "e3cef43464fc832f6e04f187df25af497994",
    "verification_value": "",
    "number": "XXXX-XXXX-XXXX-1111"
  }
}
<payment_method>
  <token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
  <created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
  <updated_at type="dateTime">2023-06-05T02:33:54Z</updated_at>
  <email>joey@example.com</email>
  <data>
    <my_payment_method_identifier>448</my_payment_method_identifier>
    <extra_stuff>
      <some_other_things>Can be anything really</some_other_things>
    </extra_stuff>
  </data>
  <storage_state>retained</storage_state>
  <test type="boolean">true</test>
  <metadata>
    <key>String Value</key>
    <another_key>123</another_key>
    <final_key>true</final_key>
  </metadata>
  <callback_url nil="true"></callback_url>
  <last_four_digits>1111</last_four_digits>
  <first_six_digits>411111</first_six_digits>
  <card_type>visa</card_type>
  <first_name>Newfirst</first_name>
  <last_name>Newlast</last_name>
  <month type="integer">3</month>
  <year type="integer">2032</year>
  <address1 nil="true"></address1>
  <address2 nil="true"></address2>
  <city nil="true"></city>
  <state nil="true"></state>
  <zip nil="true"></zip>
  <country nil="true"></country>
  <phone_number nil="true"></phone_number>
  <company nil="true"></company>
  <full_name>Newfirst Newlast</full_name>
  <eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
  <shipping_address1 nil="true"></shipping_address1>
  <shipping_address2 nil="true"></shipping_address2>
  <shipping_city nil="true"></shipping_city>
  <shipping_state nil="true"></shipping_state>
  <shipping_zip nil="true"></shipping_zip>
  <shipping_country nil="true"></shipping_country>
  <shipping_phone_number nil="true"></shipping_phone_number>
  <issuer_identification_number>41111111</issuer_identification_number>
  <click_to_pay type="boolean">false</click_to_pay>
  <payment_method_type>credit_card</payment_method_type>
  <bin_metadata>
    <card_brand>DISCOVER</card_brand>
    <card_category>PERSONAL</card_category>
    <card_type>CREDIT</card_type>
    <issuing_bank>DISCOVER BANK</issuing_bank>
    <issuing_country_iso_number>840</issuing_country_iso_number>
    <issuing_country_iso_a2_code>US</issuing_country_iso_a2_code>
    <issuing_country_iso_a3_code>USA</issuing_country_iso_a3_code>
    <issuing_country_iso_name>UNITED STATES</issuing_country_iso_name>
    <issuing_bank_phone_number>1 (800) 347-7000</issuing_bank_phone_number>
    <issuing_bank_website>HTTPS://WWW.DISCOVER.COM/</issuing_bank_website>
    <bin_type>PERSONAL</bin_type>
    <regulated>Y</regulated>
    <max_pan_length>19</max_pan_length>
    <message>Successful</message>
  </bin_metadata>
  <errors>
  </errors>
  <verification_value></verification_value>
  <number>XXXX-XXXX-XXXX-1111</number>
  <fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
  <stored_credential_usage>
    <test>
      <original_network_transaction_id>37be5367d6dbe4a88c9d</original_network_transaction_id>
      <network_transaction_id>37be5367d6dbe4a88c9d</network_transaction_id>
    </test>
  </stored_credential_usage>
</payment_method>

Update a payment method’s non-sensitive attributes.

URL Parameters

Parameter Description
payment_method_token
required
The token of the payment method
format
required
One of json or xml

Request Body

Element Description
payment_method Root element
attribute One or more non-sensitive attributes to update. Non-sensitive attributes are attributes excluding card numbers, verification values (CVV), bank account numbers etc…
❯ allow_blank_name true if this payment method should skip the name validation requirement (credit card only)
❯ allow_expired_date true if this payment method should skip the expired date validation requirement (credit card only)
❯ allow_blank_date true if this payment method should skip the expiration date validation requirement
❯ eligible_for_card_updater true if this payment method should be included in Account Updater
❯ metadata metadata key-value pairs (limit 25). Keys are limited to 50 characters. Values are limited to 500 characters and cannot contain compounding data types

allow_blank_date, allow_expired_date and allow_blank_name are not sticky flags meaning that they have to be passed in every time a payment method is created or update.

Response Body

Element Description
payment_method Root element
❯ token The token uniquely identifying the updated payment method

BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.