Payment Methods
Create credit card
POST /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"credit_card": {
"first_name": "Joe",
"last_name": "Jones",
"number": "5555555555554444",
"verification_value": "423",
"month": "3",
"year": "2029",
"company": "Acme Inc.",
"address1": "33 Lane Road",
"address2": "Apartment 4",
"city": "Wanaque",
"state": "NJ",
"zip": "31331",
"country": "US",
"phone_number": "919.331.3313",
"shipping_address1": "33 Lane Road",
"shipping_address2": "Apartment 4",
"shipping_city": "Wanaque",
"shipping_state": "NJ",
"shipping_zip": "31331",
"shipping_country": "US",
"shipping_phone_number": "919.331.3313"
},
"email": "joey@example.com",
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
}
}
}
<payment_method>
<credit_card>
<first_name>Joey</first_name>
<last_name>Jones</last_name>
<number>5555555555554444</number>
<verification_value>423</verification_value>
<month>3</month>
<year>2029</year>
<company>Acme Inc.</company>
<address1>33 Lane Road</address1>
<address2>Apartment 4</address2>
<city>Wanaque</city>
<state>NJ</state>
<zip>31331</zip>
<country>US</country>
<phone_number>919.331.3313</phone_number>
<shipping_address1>33 Lane Road</shipping_address1>
<shipping_address2>Apartment 4</shipping_address2>
<shipping_city>Wanaque</shipping_city>
<shipping_state>NJ</shipping_state>
<shipping_zip>31331</shipping_zip>
<shipping_country>US</shipping_country>
<shipping_phone_number>919.331.3313</shipping_phone_number>
</credit_card>
<email>joey@example.com</email>
<metadata>
<key>String Value</key>
<another_key>123</another_key>
<final_key>true</final_key>
</metadata>
</payment_method>
HTTPS/1.1 201 Created
{
"transaction": {
"token": "AXKchwDYMqAmDqDhxCSaEqiHBk0",
"created_at": "2022-04-14T18:15:18Z",
"updated_at": "2022-04-14T18:15:18Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "PTp0nIk2NcqxaTlgsx3Esz2JSAN",
"created_at": "2022-04-14T18:15:18Z",
"updated_at": "2022-04-14T18:15:18Z",
"email": "joey@example.com",
"data": null,
"storage_state": "cached",
"test": true,
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
},
"callback_url": null,
"last_four_digits": "4444",
"first_six_digits": "555555",
"card_type": "master",
"first_name": "Joe",
"last_name": "Jones",
"month": 3,
"year": 2029,
"address1": "33 Lane Road",
"address2": "Apartment 4",
"city": "Wanaque",
"state": "NJ",
"zip": "31331",
"country": "US",
"phone_number": "919.331.3313",
"company": "Acme Inc.",
"full_name": "Joe Jones",
"eligible_for_card_updater": true,
"shipping_address1": "33 Lane Road",
"shipping_address2": "Apartment 4",
"shipping_city": "Wanaque",
"shipping_state": "NJ",
"shipping_zip": "31331",
"shipping_country": "US",
"shipping_phone_number": "919.331.3313",
"issuer_identification_number": "55555555",
"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": "b5fe350d5135ab64a8f3c1097fadefd9effb",
"verification_value": "XXX",
"number": "XXXX-XXXX-XXXX-4444"
}
}
}
<transaction>
<token>IJR7usbdOAmpMkA35Zx7d5eCAwi</token>
<created_at type="dateTime">2022-04-14T18:15:18Z</created_at>
<updated_at type="dateTime">2022-04-14T18:15:18Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddPaymentMethod</transaction_type>
<retained type="boolean">false</retained>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>NNgAp50f3BASpah2NLovmIMQDuE</token>
<created_at type="dateTime">2022-04-14T18:15:18Z</created_at>
<updated_at type="dateTime">2022-04-14T18:15:18Z</updated_at>
<email>joey@example.com</email>
<data nil="true"></data>
<storage_state>cached</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>4444</last_four_digits>
<first_six_digits>555555</first_six_digits>
<card_type>master</card_type>
<first_name>Joey</first_name>
<last_name>Jones</last_name>
<month type="integer">3</month>
<year type="integer">2029</year>
<address1>33 Lane Road</address1>
<address2>Apartment 4</address2>
<city>Wanaque</city>
<state>NJ</state>
<zip>31331</zip>
<country>US</country>
<phone_number>919.331.3313</phone_number>
<company>Acme Inc.</company>
<full_name>Joey Jones</full_name>
<eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
<shipping_address1>33 Lane Road</shipping_address1>
<shipping_address2>Apartment 4</shipping_address2>
<shipping_city>Wanaque</shipping_city>
<shipping_state>NJ</shipping_state>
<shipping_zip>31331</shipping_zip>
<shipping_country>US</shipping_country>
<shipping_phone_number>919.331.3313</shipping_phone_number>
<issuer_identification_number>55555555</issuer_identification_number>
<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>XXX</verification_value>
<number>XXXX-XXXX-XXXX-4444</number>
<fingerprint>b5fe350d5135ab64a8f3c1097fadefd9effb</fingerprint>
</payment_method>
</transaction>
Add a credit card to the authenticated environment’s vault.
To create a credit card for testing, use one of the test credit card numbers. For more information about testing on Spreedly, please see this guide.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
payment_method | Root element |
❯ credit_card | Credit card element |
❯❯ first_name required |
The first name of the cardholder |
❯❯ last_name required |
The last name of the cardholder |
❯❯ number required |
The full card number |
❯❯ verification_value | The verification value (CVV/CVC) of the card |
❯❯ month required |
The expiration month of the card |
❯❯ year required |
The expiration year of the card |
❯❯ full_name optional: either full_name or both first_name and last_name are required |
The full name of the cardholder. If provided, will be parsed to determine first_name and last_name . If “full_name” is entered with only a single name, “first_name” will be populated with “Not Provided” and “last_name” will be populated with the provided name. |
❯❯ company | The company name associated with the credit card |
❯❯ address1 | The first line of the billing address |
❯❯ address2 | The second line of the billing address |
❯❯ city | The city of the billing address |
❯❯ state | The state of the billing address |
❯❯ zip | The zip code of the billing address |
❯❯ country | The country code of the billing address |
❯❯ phone_number | The phone number of the billing address |
❯❯ shipping_address1 | The first line of the shipping address |
❯❯ shipping_address2 | The second line of the shipping address |
❯❯ shipping_city | The city of the shipping address |
❯❯ shipping_state | The state of the shipping address |
❯❯ shipping_zip | The zip code of the shipping address |
❯❯ shipping_country | The country code of the shipping address |
❯❯ shipping_phone_number | The phone number of the shipping address |
The email address of the customer associated with this credit card | |
❯ retained | true if this payment method should be automatically retained on creation |
❯ allow_blank_name | true if this payment method should skip the name validation requirement |
❯ allow_expired_date | true if this payment method should skip the expired date validation requirement |
❯ 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 |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the created payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ payment_method | The payment method created as part of this transaction |
❯❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯❯ storage_state | The storage state of the payment method |
❯❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
❯❯ last_four_digits | The last four digits of the credit card number. This can be displayed to the user. |
❯❯ first_six_digits | The first six digits of the credit card number. This can be displayed to the user. |
❯❯ issuer_identification_number | The numbers of the PAN required to identify the card issuer. |
❯❯ verification_value | The obscured verification value (CVV), e.g., XXX or XXXX |
❯❯ number | The obscured credit card number, e.g., XXXX-XXXX-XXXX-4444 |
❯❯ month | The expiration month |
❯❯ year | The expiration year |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Create bank account
POST /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"bank_account": {
"first_name": "Jon",
"last_name": "Doe",
"bank_name": "Test Bank",
"bank_routing_number": "021000021",
"bank_account_number": "9876543210",
"bank_account_type": "checking",
"bank_account_holder_type": "personal"
},
"email": "jon.doe@example.com",
"data": {
"my_payment_method_identifier": 448,
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
}
}
}
<payment_method>
<bank_account>
<first_name>Jon</first_name>
<last_name>Doe</last_name>
<bank_name>Test Bank</bank_name>
<bank_routing_number>021000021</bank_routing_number>
<bank_account_number>9876543210</bank_account_number>
<bank_account_type>checking</bank_account_type>
<bank_account_holder_type>personal</bank_account_holder_type>
</bank_account>
<email>jon.doe@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>
<metadata>
<key>String Value</key>
<another_key>123</another_key>
<final_key>true</final_key>
</metadata>
</payment_method>
HTTPS/1.1 201 Created
{
"transaction": {
"token": "Xs0fhYu6CdcaX98CkqTyC8RqvB5",
"created_at": "2023-05-22T19:46:39Z",
"updated_at": "2023-05-22T19:46:39Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "Wvv7vOdcnkeOldsa7tBi69H9tD9",
"created_at": "2023-05-22T19:46:39Z",
"updated_at": "2023-05-22T19:46:39Z",
"email": "jon.doe@example.com",
"data": {
"my_payment_method_identifier": 448,
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"storage_state": "cached",
"test": true,
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
},
"callback_url": null,
"full_name": "Jon Doe",
"bank_name": "Test Bank",
"account_type": "checking",
"account_holder_type": "personal",
"routing_number_display_digits": "021",
"account_number_display_digits": "3210",
"first_name": "Jon",
"last_name": "Doe",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"payment_method_type": "bank_account",
"errors": [
],
"routing_number": "021*",
"account_number": "*3210"
}
}
}
<transaction>
<token>NZ8uQMvwLw2ICqiGtJfIVOVYa2j</token>
<created_at type="dateTime">2023-05-22T19:46:39Z</created_at>
<updated_at type="dateTime">2023-05-22T19:46:39Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddPaymentMethod</transaction_type>
<retained type="boolean">false</retained>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>4FZOtVeKxuyI7WMOepXi3P3JRwA</token>
<created_at type="dateTime">2023-05-22T19:46:39Z</created_at>
<updated_at type="dateTime">2023-05-22T19:46:39Z</updated_at>
<email>jon.doe@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>cached</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>
<full_name>Jon Doe</full_name>
<bank_name>Test Bank</bank_name>
<account_type>checking</account_type>
<account_holder_type>personal</account_holder_type>
<routing_number_display_digits>021</routing_number_display_digits>
<account_number_display_digits>3210</account_number_display_digits>
<first_name>Jon</first_name>
<last_name>Doe</last_name>
<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>
<payment_method_type>bank_account</payment_method_type>
<errors>
</errors>
<routing_number>021*</routing_number>
<account_number>*3210</account_number>
</payment_method>
</transaction>
Add a bank account/ACH payment type to the authenticated environment’s vault.
To create a bank account for testing, use one of the test bank account numbers. For more information about testing on Spreedly, please see this guide.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
payment_method | Root element |
❯ bank_account | Bank account element |
❯❯ first_name required |
The first name of the account owner |
❯❯ last_name required |
The last name of the account owner |
❯❯ bank_routing_number required |
The account routing number |
❯❯ bank_account_number required |
The account number |
❯❯ bank_name | The name of the bank |
❯❯ bank_account_type | The type of account. Can be one of checking or savings . |
❯❯ bank_account_holder_type | The account holder type. Can be one business or personal . |
❯❯ full_name optional: either full_name or both first_name and last_name are required |
The full name of the account owner. If provided, will be parsed to determine first_name and last_name . |
❯ retained | true if this payment method should be automatically retained on creation |
❯ 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 |
Response Body
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the created payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ payment_method | The payment method created as part of this transaction |
❯❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯❯ storage_state | The storage state of the payment method |
❯❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
❯❯ account_type | The type of account. Can be one of checking or savings . |
❯❯ account_holder_type | The account holder type. Can be one business or personal . |
❯❯ routing_number_display_digits | The obscured (first three digits) routing number. This value can be displayed to users. |
❯❯ account_number_display_digits | The obscured (last four digits) account number. This value can be displayed to users. |
Create Apple Pay
POST /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"apple_pay": {
"payment_data": {
"version": "EC_v1",
"data": "QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud",
"signature": "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",
"header": {
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQwjaSlnZ3EXpwKfWAd2e1VnbS6vmioMyF6bNcq/Qd65NLQsjrPatzHWbJzG7v5vJtAyrf6WhoNx3C1VchQxYuw==",
"transactionId": "e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371",
"publicKeyHash": "/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="
}
},
"test_card_number": "4111111111111111"
},
"first_name": "John",
"last_name": "Smith",
"email": "john.smith@example.com",
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
},
"address1": "12345 Example Way",
"city": "Atlanta",
"state": "GA",
"zip": "30301",
"country": "USA",
"shipping_address1": "12345 Example Way",
"shipping_city": "Atlanta",
"shipping_state": "GA",
"shipping_zip": "30301",
"shipping_country": "USA"
}
}
<payment_method>
<apple_pay>
<payment_data>
<![CDATA[{"version":"EC_v1","data":"QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud","signature":"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE0MDkyNTIyMDYxMVoXDTE5MDkyNDIyMDYxMVowXzElMCMGA1UEAwwcZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtUFJPRDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwhV37evWx7Ihj2jdcJChIY3HsL1vLCg9hGCV2Ur0pUEbg0IO2BHzQH6DMx8cVMP36zIg1rrV1O/0komJPnwPE6OCAhEwggINMEUGCCsGAQUFBwEBBDkwNzA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZWFpY2EzMDEwHQYDVR0OBBYEFJRX22/VdIGGiYl2L35XhQfnm1gkMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUI/JJxE+T5O8n5sT2KGw/orv9LkswggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlYWljYTMuY3JsMA4GA1UdDwEB/wQEAwIHgDAPBgkqhkiG92NkBh0EAgUAMAoGCCqGSM49BAMCA0gAMEUCIHKKnw+Soyq5mXQr1V62c0BXKpaHodYu9TWXEPUWPpbpAiEAkTecfW6+W5l0r0ADfzTCPq2YtbS39w01XIayqBNy8bEwggLuMIICdaADAgECAghJbS+/OpjalzAKBggqhkjOPQQDAjBnMRswGQYDVQQDDBJBcHBsZSBSb290IENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNDA1MDYyMzQ2MzBaFw0yOTA1MDYyMzQ2MzBaMHoxLjAsBgNVBAMMJUFwcGxlIEFwcGxpY2F0aW9uIEludGVncmF0aW9uIENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPAXEYQZ12SF1RpeJYEHduiAou/ee65N4I38S5PhM1bVZls1riLQl3YNIk57ugj9dhfOiMt2u2ZwvsjoKYT/VEWjgfcwgfQwRgYIKwYBBQUHAQEEOjA4MDYGCCsGAQUFBzABhipodHRwOi8vb2NzcC5hcHBsZS5jb20vb2NzcDA0LWFwcGxlcm9vdGNhZzMwHQYDVR0OBBYEFCPyScRPk+TvJ+bE9ihsP6K7/S5LMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUu7DeoVgziJqkipnevr3rr9rLJKswNwYDVR0fBDAwLjAsoCqgKIYmaHR0cDovL2NybC5hcHBsZS5jb20vYXBwbGVyb290Y2FnMy5jcmwwDgYDVR0PAQH/BAQDAgEGMBAGCiqGSIb3Y2QGAg4EAgUAMAoGCCqGSM49BAMCA2cAMGQCMDrPcoNRFpmxhvs1w1bKYr/0F+3ZD3VNoo6+8ZyBXkK3ifiY95tZn5jVQQ2PnenC/gIwMi3VRCGwowV3bF3zODuQZ/0XfCwhbZZPxnJpghJvVPh6fRuZy5sJiSFhBpkPCZIdAAAxggFfMIIBWwIBATCBhjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCCRD8qgGnfV3MA0GCWCGSAFlAwQCAQUAoGkwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTUwMjI0MTgzNTU5WjAvBgkqhkiG9w0BCQQxIgQgohbm8d0A42OAyMnc5fsgQoCNYjtEd/W/dW6+yezIwoAwCgYIKoZIzj0EAwIERzBFAiEAtEkap+JHypwfL1EdabD7RWPZol3na0LhMk9XzLhis0oCIGwxzOhQnMw+Td8WglTMNYcidqeYILTGzn3zMEXmW3j7AAAAAAAA","header":{"ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQwjaSlnZ3EXpwKfWAd2e1VnbS6vmioMyF6bNcq/Qd65NLQsjrPatzHWbJzG7v5vJtAyrf6WhoNx3C1VchQxYuw==","transactionId":"e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371","publicKeyHash":"/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="}}
]]>
</payment_data>
<test_card_number>4111111111111111</test_card_number>
</apple_pay>
<email>joey@example.com</email>
<metadata>
<key>String Value</key>
<another_key>123</another_key>
<final_key>true</final_key>
</metadata>
<first_name>Joey</first_name>
<last_name>Smith</last_name>
<address1>12345 Example Way</address1>
<city>Atlanta</city>
<state>GA</state>
<zip>30301</zip>
<country>USA</country>
<shipping_address1>12345 Example Way</shipping_address1>
<shipping_city>Atlanta</shipping_city>
<shipping_state>GA</shipping_state>
<shipping_zip>30301</shipping_zip>
<shipping_country>USA</shipping_country>
</payment_method>
HTTPS/1.1 201 Created
{
"transaction": {
"token": "T6uE4YJ1Pztb3C2h0n3azd8im3M",
"created_at": "2018-11-06T20:10:47Z",
"updated_at": "2018-11-06T20:10:47Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "HgMCAtQCjZtxuDBC6fqabmvZIAq",
"created_at": "2018-11-06T20:10:47Z",
"updated_at": "2018-11-06T20:10:47Z",
"email": "john.smith@example.com",
"data": null,
"storage_state": "cached",
"test": true,
"metadata": {
"key": "string value",
"another_key": 123,
"final_key": true
},
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "John",
"last_name": "Smith",
"month": 12,
"year": 2023,
"full_name": "John Smith",
"address1": "12345 Example Way",
"address2": null,
"city": "Atlanta",
"state": "GA",
"zip": "30301",
"country": "USA",
"phone_number": null,
"company": null,
"shipping_address1": "12345 Example Way",
"shipping_address2": null,
"shipping_city": "Atlanta",
"shipping_state": "GA",
"shipping_zip": "30301",
"shipping_country": "USA",
"shipping_phone_number": null,
"issuer_identification_number": "41111111",
"payment_method_type": "apple_pay",
"errors": [
]
}
}
}
<transaction>
<token>5tozGHP1EGxrVKpHTD2y6ZmJvST</token>
<created_at type="dateTime">2018-11-06T20:10:46Z</created_at>
<updated_at type="dateTime">2018-11-06T20:10:47Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddPaymentMethod</transaction_type>
<retained type="boolean">false</retained>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>8CkRPxdrA3dbvapFrSiPZuXZ4dL</token>
<created_at type="dateTime">2018-11-06T20:10:46Z</created_at>
<updated_at type="dateTime">2018-11-06T20:10:47Z</updated_at>
<email>joey@example.com</email>
<data nil="true"></data>
<storage_state>cached</storage_state>
<test type="boolean">true</test>
<metadata>
<key>String Value</key>
<another_key>123</another_key>
<final_key>true</final_key>
</metadata>
<last_four_digits>1111</last_four_digits>
<first_six_digits>411111</first_six_digits>
<card_type>visa</card_type>
<first_name>Joey</first_name>
<last_name>Smith</last_name>
<month type="integer">12</month>
<year type="integer">2023</year>
<full_name>Joey Smith</full_name>
<address1>12345 Example Way</address1>
<address2 nil="true"></address2>
<city>Atlanta</city>
<state>GA</state>
<zip>30301</zip>
<country>USA</country>
<phone_number nil="true"></phone_number>
<company nil="true"></company>
<shipping_address1>12345 Example Way</shipping_address1>
<shipping_address2 nil="true"></shipping_address2>
<shipping_city>Atlanta</shipping_city>
<shipping_state>GA</shipping_state>
<shipping_zip>30301</shipping_zip>
<shipping_country>USA</shipping_country>
<shipping_phone_number nil="true"></shipping_phone_number>
<issuer_identification_number>41111111</issuer_identification_number>
<payment_method_type>apple_pay</payment_method_type>
<errors>
</errors>
</payment_method>
</transaction>
Add an Apple Pay payment method to the authenticated environment’s vault.
To create a test Apple Pay payment method, set the test_card_number
element to one of the known test credit card numbers. For more information about testing on Spreedly, please see this guide.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
payment_method | Root element |
❯ apple_pay | Apple pay element |
❯❯ payment_data required |
The JSON serialized paymentData property of an Apple Pay PKPaymentToken |
❯❯ test_card_number | Apple Pay does not provide a way to create a test payment token. To mark this as a test Apple Pay payment method, specify a test card number in this field. Doing so will prevent this payment method from being used against a production gateway, while still verifying the submitted Apple Pay payment data. |
❯ retained | true if this payment method should be automatically retained on creation |
The email address of the cardholder | |
❯ first_name | The first name of the cardholder |
❯ last_name | The last name of the cardholder |
❯ address1 | Cardholder’s address, line 1 |
❯ address2 | Cardholder’s address, line 2 |
❯ city | Cardholder’s city |
❯ state | Cardholder’s state |
❯ zip | Cardholder’s zip |
❯ country | Cardholder’s country |
❯ 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 |
Response Body
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the created payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ payment_method | The payment method created as part of this transaction |
❯❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯❯ storage_state | The storage state of the payment method |
❯❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
❯❯ last_four_digits | The last four digits of the (Apple Pay alias) credit card number. This can be displayed to the user. |
❯❯ first_six_digits | The first six digits of the (Apple Pay alias) credit card number. This can be displayed to the user. |
❯❯ issuer_identification_number | The numbers of the PAN required to identify the card issuer. |
❯❯ month | The expiration month |
❯❯ year | The expiration year |
Create Google Pay
POST /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"google_pay": {
"payment_data": {
"signature": "MEUCIA6SGVRwhOyeYRkeDUUNwB/kGtyfQAlOsg7NZydT17u/AiEA48BhWGQEF1EbEU0J+m8eSK3rTfhok9QqpiFVbME+Ky0=",
"protocolVersion": "ECv1",
"signedMessage": "{\"encryptedMessage\":\"3v4IcT/eovIDP2WF8iRUy4qWQnE9Cx0vQxIZ5f9i3Emv3Tzs1AzvB7cxXhxrjp9FVIzdOwsZAPAsm03gvoYq8Xdr70XvrVRd2MFwQhMC7IV/uEsthw4JsR8oCkbI5v/zqhu2B+JodFgavNliHcpKBgijy2D6bpx7jXEkM39M/L4oBObFxFrhVSLA1GjOV6A5gLAXNXt0ffkCYekihqAyJrWlk3sCBDCF5SUiAKEIOIZtzZLgusxjVp6ufZHOHm/53uhAi6JWSJ1E6G5aaYGtULYdwgURHtxN5OIzQPYlEGctaQd5tgfCsBFfGkYyN1GRNgclbaLzAfk/Jn7/6IVKuV0ol3xubTcnjGTZXwtTjiEyYDoz1yVqB9ViMmJa55L6nBtbbAkcNEgAi7dPnrbvBGEP7QWsNT9D71g8SWrlRTCYUAOyuamaQhofG4ul1IVjmltdAy2BHBWpqgJnR9kczydQyE7uDiqhSC1/0eG8GCGIqoi8XfOioGXfMyLZ1p2ZcNK9ECjzUrH/edrwgtShxgWuWMwQTM4DQlVTAA/R4DVs192YWZcc7jm5wLqZ0+XEaPuighJM1Ps1Egeccg\\u003d\\u003d\",\"ephemeralPublicKey\":\"BA2SvF9BdCX7Tl1wwRkyLzTfqhctobhZgSugC9Cz77XNUCBOBMfFyJQt506PUs89D6IJZZfOkZopy0shRF9Uph4\\u003d\",\"tag\":\"Uhin1BE7KAuuiam7eEQFimRUDd9Xn6tZc2fClTpfrXQ\\u003d\"}"
},
"first_name": "John",
"last_name": "Smith",
"test_card_number": "4111111111111111"
},
"email": "john.smith@example.com"
}
}
<payment_method>
<google_pay>
<payment_data>
<![CDATA[{"signature":"MEUCIA6SGVRwhOyeYRkeDUUNwB/kGtyfQAlOsg7NZydT17u/AiEA48BhWGQEF1EbEU0J+m8eSK3rTfhok9QqpiFVbME+Ky0\u003d","protocolVersion":"ECv1","signedMessage":"{\"encryptedMessage\":\"3v4IcT/eovIDP2WF8iRUy4qWQnE9Cx0vQxIZ5f9i3Emv3Tzs1AzvB7cxXhxrjp9FVIzdOwsZAPAsm03gvoYq8Xdr70XvrVRd2MFwQhMC7IV/uEsthw4JsR8oCkbI5v/zqhu2B+JodFgavNliHcpKBgijy2D6bpx7jXEkM39M/L4oBObFxFrhVSLA1GjOV6A5gLAXNXt0ffkCYekihqAyJrWlk3sCBDCF5SUiAKEIOIZtzZLgusxjVp6ufZHOHm/53uhAi6JWSJ1E6G5aaYGtULYdwgURHtxN5OIzQPYlEGctaQd5tgfCsBFfGkYyN1GRNgclbaLzAfk/Jn7/6IVKuV0ol3xubTcnjGTZXwtTjiEyYDoz1yVqB9ViMmJa55L6nBtbbAkcNEgAi7dPnrbvBGEP7QWsNT9D71g8SWrlRTCYUAOyuamaQhofG4ul1IVjmltdAy2BHBWpqgJnR9kczydQyE7uDiqhSC1/0eG8GCGIqoi8XfOioGXfMyLZ1p2ZcNK9ECjzUrH/edrwgtShxgWuWMwQTM4DQlVTAA/R4DVs192YWZcc7jm5wLqZ0+XEaPuighJM1Ps1Egeccg\\u003d\\u003d\",\"ephemeralPublicKey\":\"BA2SvF9BdCX7Tl1wwRkyLzTfqhctobhZgSugC9Cz77XNUCBOBMfFyJQt506PUs89D6IJZZfOkZopy0shRF9Uph4\\u003d\",\"tag\":\"Uhin1BE7KAuuiam7eEQFimRUDd9Xn6tZc2fClTpfrXQ\\u003d\"}"}
]]>
</payment_data>
<first_name>John</first_name>
<last_name>Smith</last_name>
<test_card_number>4111111111111111</test_card_number>
</google_pay>
<email>john.smith@example.com</email>
</payment_method>
HTTPS/1.1 201 Created
{
"transaction": {
"token": "1n4j3sExB12GFJcncZnPdZXMaXs",
"created_at": "2018-09-25T15:59:50Z",
"updated_at": "2018-09-25T15:59:50Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "2w9cGgCkg77AmZj8xFLNQnKPdSh",
"created_at": "2018-09-25T15:59:50Z",
"updated_at": "2018-09-25T15:59:50Z",
"email": "john.smith@example.com",
"data": null,
"storage_state": "cached",
"test": true,
"metadata": null,
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "John",
"last_name": "Smith",
"month": 12,
"year": 2023,
"full_name": "John Smith",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"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": "google_pay",
"google_pay_type": "TOKENIZED_CARD",
"errors": [
]
}
}
}
<transaction>
<token>9v92w2708YpQ5KYxsz62oZRlPsx</token>
<created_at type="dateTime">2018-09-25T15:59:50Z</created_at>
<updated_at type="dateTime">2018-09-25T15:59:50Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddPaymentMethod</transaction_type>
<retained type="boolean">false</retained>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>UbOdSftBw7YlCG6BXB0szSGKwGZ</token>
<created_at type="dateTime">2018-09-25T15:59:50Z</created_at>
<updated_at type="dateTime">2018-09-25T15:59:50Z</updated_at>
<email>john.smith@example.com</email>
<data nil="true"></data>
<storage_state>cached</storage_state>
<test type="boolean">true</test>
<metadata nil="true"></metadata>
<last_four_digits>1111</last_four_digits>
<first_six_digits>411111</first_six_digits>
<card_type>visa</card_type>
<first_name>John</first_name>
<last_name>Smith</last_name>
<month type="integer">12</month>
<year type="integer">2023</year>
<full_name>John Smith</full_name>
<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>
<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>
<payment_method_type>google_pay</payment_method_type>
<google_pay_type>TOKENIZED_CARD</google_pay_type>
<errors>
</errors>
</payment_method>
</transaction>
Add an Google Pay payment method to the authenticated environment’s vault.
To create a test Google Pay payment method, set the test_card_number
element to one of the known test credit card numbers. For more information about testing on Spreedly, please see this guide.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
payment_method | Root element |
❯ Google_pay | Google pay element |
❯❯ payment_data required |
The JSON serialized paymentData |
❯❯ test_card_number | Specify a test card number in this field. Doing so will prevent this payment method from being used against a production gateway, while still verifying the submitted Google Pay payment data. |
❯❯ first_name | The first name of the cardholder |
❯❯ last_name | The last name of the cardholder |
❯❯ address1 | Cardholder’s address, line 1 |
❯❯ address2 | Cardholder’s address, line 2 |
❯❯ city | Cardholder’s city |
❯❯ state | Cardholder’s state |
❯❯ zip | Cardholder’s zip |
❯❯ country | Cardholder’s country |
❯ retained | true if this payment method should be automatically retained on creation |
The email address of the cardholder | |
❯ 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 |
Response Body
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the created payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ payment_method | The payment method created as part of this transaction |
❯❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯❯ storage_state | The storage state of the payment method |
❯❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
❯❯ last_four_digits | The last four digits of the (Google Pay alias) credit card number. This can be displayed to the user. |
❯❯ first_six_digits | The first six digits of the (Google Pay alias) credit card number. This can be displayed to the user. |
❯❯ issuer_identification_number | The numbers of the PAN required to identify the card issuer. |
❯❯ month | The expiration month |
❯❯ year | The expiration year |
Create third party token
POST /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"payment_method_type": "third_party_token",
"reference": "MF424cE3jPVESunRNZW0oFtmyI4",
"gateway_type": "litle"
}
}
<payment_method>
<payment_method_type>third_party_token</payment_method_type>
<reference>MF424cE3jPVESunRNZW0oFtmyI4</reference>
<gateway_type>litle</gateway_type>
</payment_method>
HTTPS/1.1 201 Created
{
"transaction": {
"token": "ActkD0upyjQvkvtER6ra7vdpZJQ",
"created_at": "2017-07-27T17:55:02Z",
"updated_at": "2017-07-27T17:55:02Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "8s5YC3RaRv3zfLVNmuzVep9Mo0z",
"created_at": "2017-07-27T17:55:02Z",
"updated_at": "2017-07-27T17:55:02Z",
"gateway_type": "litle",
"storage_state": "cached",
"third_party_token": "MF424cE3jPVESunRNZW0oFtmyI4",
"payment_method_type": "third_party_token",
"errors": [
]
}
}
}
<transaction>
<token>XLRFd2gmnEVAx7K3Ryme25dvlhU</token>
<created_at type="dateTime">2017-07-27T17:55:03Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:03Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddPaymentMethod</transaction_type>
<retained type="boolean">false</retained>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>ZeA4EtYPFZ8Km9OlKkd3RWOFFQv</token>
<created_at type="dateTime">2017-07-27T17:55:03Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:03Z</updated_at>
<gateway_type>litle</gateway_type>
<storage_state>cached</storage_state>
<third_party_token>MF424cE3jPVESunRNZW0oFtmyI4</third_party_token>
<payment_method_type>third_party_token</payment_method_type>
<errors>
</errors>
</payment_method>
</transaction>
Add a third party token payment method to the authenticated environment’s vault.
Third party tokens are payment methods stored in the Spreedly vault, that are a reference to another payment method stored at the gateway’s vault. For more information about third party tokens, please see this guide.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
payment_method | Root element |
❯ payment_method_type | third_party_token to represent an externally vaulted payment method reference |
❯ reference | The token identifying the payment method at the external gateway |
❯ gateway_type | The type of the external gateway |
Response Body
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the created payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ payment_method | The payment method created as part of this transaction |
❯❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯❯ storage_state | The storage state of the payment method |
❯❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
❯❯ third_party_token | The token identifying the payment method at the external gateway |
❯❯ gateway_type | The type of the external gateway at which the target payment method is stored |
List
GET /v1/payment_methods.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"payment_methods": [
{
"token": "72GW93Z3rarasS7EqiUCXsqx4jW",
"created_at": "2017-06-22T15:10:48Z",
"updated_at": "2017-06-22T15:10:48Z",
"gateway_type": "test",
"storage_state": "retained",
"third_party_token": "test_vault:4111111111111111",
"payment_method_type": "third_party_token",
"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": [
]
},
{
"token": "5voMXfW8xotx25P7OyNywmfeYPZ",
"created_at": "2017-06-22T15:10:49Z",
"updated_at": "2017-06-22T15:10:49Z",
"gateway_type": "test",
"storage_state": "retained",
"third_party_token": "test_vault:4111111111111111",
"payment_method_type": "third_party_token",
"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": [
]
}
]
}
<payment_methods>
<payment_method>
<token>72GW93Z3rarasS7EqiUCXsqx4jW</token>
<created_at type="dateTime">2017-06-22T15:10:48Z</created_at>
<updated_at type="dateTime">2017-06-22T15:10:48Z</updated_at>
<gateway_type>test</gateway_type>
<storage_state>retained</storage_state>
<third_party_token>test_vault:4111111111111111</third_party_token>
<payment_method_type>third_party_token</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>
</payment_method>
<payment_method>
<token>5voMXfW8xotx25P7OyNywmfeYPZ</token>
<created_at type="dateTime">2017-06-22T15:10:49Z</created_at>
<updated_at type="dateTime">2017-06-22T15:10:49Z</updated_at>
<gateway_type>test</gateway_type>
<storage_state>retained</storage_state>
<third_party_token>test_vault:4111111111111111</third_party_token>
<payment_method_type>third_party_token</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>
</payment_method>
</payment_methods>
Retrieve an ordered and paginated list of all retained payment methods in the authenticated environment.
States
Payment methods can exist in several states in the Spreedly vault - retained
, redacted
, cached
, used
, or closed
. Retained payment methods are stored in Spreedly’s vault until redacted. Redacted payment methods are payment methods that were either not retained or have been manually redacted. Cached payment methods are payment methods that have not been retained but have not yet been automatically redacted yet. Cached payment methods can still be retained. For more information, please see our guide on retaining payment methods.
If no state parameter or an invalid state parameter is passed, list will only return retained
payment methods. If the state parameter is passed, list will return those parameters: retained
, redacted
, cached
.
Example: https://core.spreedly.com/v1/payment_methods.json?state=retained,redacted,cached
If the state parameter is combined with other existing parameters such as metadata, both will be considered.
Example: https://core.spreedly.com/v1/payment_methods.json?metadata[customer_id]=123abc&state=redacted,retained
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
order | The order of the returned list. Default is asc , which returns the oldest records first. To list newer records first, use desc . |
since_token | The token of the item to start from (e.g., the last token received in the previous list if iterating through records) |
metadata | A metadata key/value pair represented as a hash (e.g. metadata[key]=value ). |
state | The list of storage_states to return. By default returns retained , acceptable values are retained , redacted , cached , used , closed |
count | The number of payment methods to return. By default returns 20, maximum allowed is 100. |
Response Body
Notable response elements include:
Element | Description |
---|---|
payment_methods | Root element |
❯ token | The token uniquely identifying the payment method at Spreedly |
❯ retained | if the payment method was set to be automatically retained on creation |
❯ storage_state | The storage state of the payment method |
❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , etc… |
❯ errors | If the payment method is invalid (missing first name, number etc…), there will be an associated error message here |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Show
GET /v1/payment_methods/<payment_method_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
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">2022-04-14T18:46:01Z</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>
<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>
</payment_method>
Get a payment method with the given token.
URL Parameters
Parameter | Description |
---|---|
payment_method_token required |
The token of the payment method |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
payment_method | Root element |
❯ token | The token identifying the newly created payment method in the Spreedly vault |
❯ storage_state | The storage state of the payment method |
❯ test | true if this payment method is a test payment method and cannot be used against real gateways or receivers |
❯ payment_method_type | The type of this payment method, e.g., credit_card , bank_account , apple_pay , google_pay , third_party_token , etc… |
❯ errors | If the payment method is invalid (missing required fields, etc…), there will be associated error messages here |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
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.
update_gratis
PUT /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6/update_gratis.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"managed": true
}
}
<payment_method>
<managed>true</managed>
</payment_method>
HTTPS/1.1 200 OK
{
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2023-07-14T18:05:20Z",
"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"
},
"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",
"click_to_pay": false,
"managed": true,
"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": [
],
"stored_credential_usage": {
"test": {
"original_network_transaction_id": "37be5367d6dbe4a88c9d",
"network_transaction_id": "37be5367d6dbe4a88c9d"
}
},
"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-07-14T18:05:19Z</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>
</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>
<managed type="boolean">true</managed>
<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 management state. For further details, see Advanced Vault.
Please note, that this API call is only available to merchants who are currently enrolled in Advanced Vault.
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 |
❯ managed | true or false |
❯ allow_blank_name | true if this payment method should skip the name validation requirement |
❯ allow_expired_date | true if this payment method should skip the expired date validation requirement |
❯ 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 |
Response Body
Element | Description |
---|---|
payment_method | Root element |
❯ token | The token uniquely identifying the updated payment method |
❯ managed | The value indicating the payment method’s management status |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Delete metadata
DELETE /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6/metadata.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"keys": [
"another_key",
"final_key"
]
}
<keys type="array">
<value>another_key</value>
<value>final_key</value>
</keys>
HTTPS/1.1 200 OK
{
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2018-11-07T20:42:14Z",
"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"
},
"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,
"payment_method_type": "credit_card",
"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">2018-11-07T20:47:26Z</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>
</metadata>
<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>
<payment_method_type>credit_card</payment_method_type>
<errors>
</errors>
<verification_value></verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
Remove key value pairs from a payment method’s metadata.
URL Parameters
Parameter | Description |
---|---|
keys | An array of metadata key whose key/value pairs will be deleted. If a metadata key does not already exist, it will be ignored. |
Retain
PUT /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6/retain.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"token": "4IaiFmcDuB4gr1hfEukGit1MuJl",
"created_at": "2022-04-15T11:26:15Z",
"updated_at": "2022-04-15T11:26:15Z",
"succeeded": true,
"transaction_type": "RetainPaymentMethod",
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2022-04-15T11:26:15Z",
"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": "XXX",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<token>HEDkJEeVxxfh52d1NMw8iSWFMDU</token>
<created_at type="dateTime">2022-04-15T11:26:15Z</created_at>
<updated_at type="dateTime">2022-04-15T11:26:15Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>RetainPaymentMethod</transaction_type>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:26:15Z</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>
<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>XXX</verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
</transaction>
Retain (keep in the Spreedly vault for future use) a payment method.
URL Parameters
Parameter | Description |
---|---|
payment_method_token required |
The token of the payment method |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ message | A human-readable string indicating the result of the transaction |
❯ payment_method | The payment method that was retained |
❯❯ storage_state | The new state of the payment method (retained ) |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Store
POST /v1/gateways/<gateway_token>/store.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6"
}
}
<transaction>
<payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
</transaction>
HTTPS/1.1 200 OK
{
"transaction": {
"created_at": "2022-04-15T11:26:15Z",
"currency_code": null,
"updated_at": "2022-04-15T11:26:15Z",
"succeeded": true,
"token": "JCdsxQyvgkOAzJkmx5C7PLJeiAO",
"state": "succeeded",
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"transaction_type": "Store",
"third_party_token": null,
"gateway_transaction_id": "62",
"gateway_latency_ms": 11,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"sub_merchant_key": null,
"payment_method": {
"token": "SEeYT1k54yYeXJyYjeYAujWn9lt",
"created_at": "2022-04-15T11:26:15Z",
"updated_at": "2022-04-15T11:26:15Z",
"gateway_type": "test",
"storage_state": "retained",
"metadata": null,
"third_party_token": "test_vault:4111111111111111",
"payment_method_type": "third_party_token",
"errors": [
]
},
"basis_payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2022-04-15T11:26:15Z",
"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": "XXX",
"number": "XXXX-XXXX-XXXX-1111"
},
"response": {
"success": true,
"message": "Successful store",
"avs_code": null,
"avs_message": null,
"cvv_code": null,
"cvv_message": null,
"pending": false,
"result_unknown": false,
"error_code": null,
"error_detail": null,
"cancelled": false,
"fraud_review": null,
"created_at": "2022-04-15T11:26:15Z",
"updated_at": "2022-04-15T11:26:15Z"
}
}
}
<transaction>
<created_at type="dateTime">2022-04-15T11:26:15Z</created_at>
<currency_code nil="true"/>
<updated_at type="dateTime">2022-04-15T11:26:15Z</updated_at>
<succeeded type="boolean">true</succeeded>
<token>7E9aTI6KrHgnjDfUC3177qZBAqB</token>
<state>succeeded</state>
<gateway_specific_fields nil="true"/>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<transaction_type>Store</transaction_type>
<third_party_token nil="true"/>
<gateway_transaction_id>52</gateway_transaction_id>
<gateway_latency_ms type="integer">9</gateway_latency_ms>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<sub_merchant_key nil="true"/>
<payment_method>
<token>PzbfgpmaMfoXrnPG2FVCZN8CSPw</token>
<created_at type="dateTime">2022-04-15T11:26:15Z</created_at>
<updated_at type="dateTime">2022-04-15T11:26:15Z</updated_at>
<gateway_type>test</gateway_type>
<storage_state>retained</storage_state>
<metadata nil="true"/>
<third_party_token>test_vault:4111111111111111</third_party_token>
<payment_method_type>third_party_token</payment_method_type>
<errors>
</errors>
</payment_method>
<basis_payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:26:15Z</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"/>
<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"/>
<address2 nil="true"/>
<city nil="true"/>
<state nil="true"/>
<zip nil="true"/>
<country nil="true"/>
<phone_number nil="true"/>
<company nil="true"/>
<full_name>Newfirst Newlast</full_name>
<eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
<shipping_address1 nil="true"/>
<shipping_address2 nil="true"/>
<shipping_city nil="true"/>
<shipping_state nil="true"/>
<shipping_zip nil="true"/>
<shipping_country nil="true"/>
<shipping_phone_number nil="true"/>
<issuer_identification_number>41111111</issuer_identification_number>
<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>XXX</verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</basis_payment_method>
<response>
<success type="boolean">true</success>
<message>Successful store</message>
<avs_code nil="true"/>
<avs_message nil="true"/>
<cvv_code nil="true"/>
<cvv_message nil="true"/>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"/>
<error_detail nil="true"/>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"/>
<created_at type="dateTime">2022-04-15T11:26:15Z</created_at>
<updated_at type="dateTime">2022-04-15T11:26:15Z</updated_at>
</response>
</transaction>
Tokenize a payment method at the gateway.
This transaction copies the payment method information from the Spreedly vault to the gateway’s vault and creates a new Spreedly payment method to represent the gateway’s version. The reference to the payment method at the gateway is called a ThirdPartyToken
and is a separate payment method from the original payment method. It is up to you to manage the lifecycle of these linked payment methods – Spreedly does not keep them in sync in any way.
The ThirdPartyToken
is locked to the gateway where the card is stored; it cannot be used at another gateway. If you’d like a card to be used at multiple gateways, you’ll need to retain the card in the Spreedly vault.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
transaction | Root element |
❯ payment_method_token required |
The token of the payment method to copy to the gateway |
❯ currency_code | The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars. Some gateways may need this for a store call but most do not. |
❯ sub_merchant_key | The token of the sub-merchant to associate with the current transaction. If an invalid sub_merchant_key is passed through, the value defaults to null |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ message | A human-readable string indicating the result of the transaction |
❯ gateway_transaction_id | The id of the transaction at the gateway. To be used when corresponding with the gateway or reconciling transactions. |
❯ response | Unmodified details of the gateway response, including the message and error_code , if applicable. For failed transactions these fields can help determine the root cause. |
❯ payment_method | The Spreedly payment method token that references the payment method stored at the gateway |
❯❯ third_party_token | The token identifying the payment method as it exists at the gateway |
❯ basis_payment_method | The payment method vaulted at Spreedly that was copied to the gateway as part of this transaction |
❯ sub_merchant_key | The token of the sub-merchant associated with the transaction. |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Redact
PUT /v1/payment_methods/<payment_method_token>/redact.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": false,
"created_at": "2022-04-15T11:25:39Z",
"updated_at": "2022-04-15T11:25:39Z",
"succeeded": true,
"token": "6TW5FroKua8CaebJUMcEiXzxPBj",
"state": "succeeded",
"gateway_specific_fields": {
},
"gateway_specific_response_fields": {
},
"transaction_type": "RedactPaymentMethod",
"order_id": null,
"ip": null,
"gateway_transaction_id": null,
"gateway_latency_ms": null,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "NNgAp50f3BASpah2NLovmIMQDuE",
"created_at": "2022-04-14T18:15:18Z",
"updated_at": "2022-04-15T11:25:39Z",
"email": "joey@example.com",
"data": null,
"storage_state": "redacted",
"test": true,
"metadata": {
"key": "String Value",
"another_key": "123",
"final_key": "true"
},
"callback_url": null,
"last_four_digits": "4444",
"first_six_digits": "555555",
"card_type": "master",
"first_name": "Joey",
"last_name": "Jones",
"month": 3,
"year": 2029,
"address1": "33 Lane Road",
"address2": "Apartment 4",
"city": "Wanaque",
"state": "NJ",
"zip": "31331",
"country": "US",
"phone_number": "919.331.3313",
"company": "Acme Inc.",
"full_name": "Joey Jones",
"eligible_for_card_updater": true,
"shipping_address1": "33 Lane Road",
"shipping_address2": "Apartment 4",
"shipping_city": "Wanaque",
"shipping_state": "NJ",
"shipping_zip": "31331",
"shipping_country": "US",
"shipping_phone_number": "919.331.3313",
"issuer_identification_number": "55555555",
"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": "b5fe350d5135ab64a8f3c1097fadefd9effb",
"verification_value": "",
"number": ""
}
}
}
<transaction>
<on_test_gateway type="boolean">false</on_test_gateway>
<created_at type="dateTime">2022-04-15T11:25:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</updated_at>
<succeeded type="boolean">true</succeeded>
<token>WdtgsGYLqq6BsybRX4Nqfmmj66n</token>
<state>succeeded</state>
<gateway_specific_fields>
</gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<transaction_type>RedactPaymentMethod</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<gateway_transaction_id nil="true"></gateway_transaction_id>
<gateway_latency_ms nil="true"></gateway_latency_ms>
<message key="messages.transaction_succeeded">Succeeded!</message>
<payment_method>
<token>NNgAp50f3BASpah2NLovmIMQDuE</token>
<created_at type="dateTime">2022-04-14T18:15:18Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</updated_at>
<email>joey@example.com</email>
<data nil="true"></data>
<storage_state>redacted</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>4444</last_four_digits>
<first_six_digits>555555</first_six_digits>
<card_type>master</card_type>
<first_name>Joey</first_name>
<last_name>Jones</last_name>
<month type="integer">3</month>
<year type="integer">2029</year>
<address1>33 Lane Road</address1>
<address2>Apartment 4</address2>
<city>Wanaque</city>
<state>NJ</state>
<zip>31331</zip>
<country>US</country>
<phone_number>919.331.3313</phone_number>
<company>Acme Inc.</company>
<full_name>Joey Jones</full_name>
<eligible_for_card_updater type="boolean">true</eligible_for_card_updater>
<shipping_address1>33 Lane Road</shipping_address1>
<shipping_address2>Apartment 4</shipping_address2>
<shipping_city>Wanaque</shipping_city>
<shipping_state>NJ</shipping_state>
<shipping_zip>31331</shipping_zip>
<shipping_country>US</shipping_country>
<shipping_phone_number>919.331.3313</shipping_phone_number>
<issuer_identification_number>55555555</issuer_identification_number>
<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></number>
<fingerprint>b5fe350d5135ab64a8f3c1097fadefd9effb</fingerprint>
</payment_method>
</transaction>
Redact (strip of any sensitive credentials and make inactive) a payment method.
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 |
---|---|
transaction | Root element |
❯ remove_from_gateway | If the payment method is also stored at the gateway (e.g., for third party vaulting or offsite authorizations), include the token of the gateway here and it will be removed from the gateway as well as being redacted from Spreedly. This element is optional. If required, gateway_specific_fields can be used in tandem with remove_from_gateway . See your gateways guide for gateway specific field options and formatting. |
❯ remove_personal_data | true if personally identifiable information should be removed from the payment method and related its transactions. This element is optional. |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ message | A human-readable string indicating the result of the transaction |
❯ personal_data_removal | Personal data redaction information as part of this transaction, if applicable. |
❯ payment_method | The payment method that was redacted |
❯❯ storage_state | The new state of the payment method (redacted ) |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Recache
POST /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6/recache.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"payment_method": {
"credit_card": {
"verification_value": "423"
}
}
}
<payment_method>
<credit_card>
<verification_value>423</verification_value>
</credit_card>
</payment_method>
HTTPS/1.1 200 OK
{
"transaction": {
"token": "1W7ydsgjmXa9pI7uX4kkD3bOS7f",
"transaction_type": "RecacheSensitiveData",
"succeeded": true,
"data": null,
"created_at": "2022-04-15T11:25:38Z",
"updated_at": "2022-04-15T11:25:38Z",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2022-04-15T11:25:38Z",
"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": "XXX",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<token>Ni8rpmqfrbT1T1ss0Bew0WsnpUs</token>
<transaction_type>RecacheSensitiveData</transaction_type>
<succeeded type="boolean">true</succeeded>
<message key="messages.transaction_succeeded">Succeeded!</message>
<data nil="true"></data>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</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>
<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>XXX</verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
<created_at type="dateTime">2022-04-15T11:25:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</updated_at>
</transaction>
Update a credit card’s verification value (CVV) so the card can be transacted against.
Note: A credit card must be retained in your environment in order to re-cache its CVV.
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 |
❯ credit_card | Credit card element |
❯❯ verification_value | The verification value (CVV/CVC) of the card |
Response Body
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying this transaction (not the payment method) at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ payment_method | The payment method whose CVV was updated |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Transactions
GET /v1/payment_methods/56wyNnSmuA6CWYP7w0MiYCVIbW6/transactions.<format>?order=desc HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"transactions": [
{
"token": "Ni8rpmqfrbT1T1ss0Bew0WsnpUs",
"transaction_type": "RecacheSensitiveData",
"succeeded": true,
"data": null,
"created_at": "2022-04-15T11:25:38Z",
"updated_at": "2022-04-15T11:25:38Z",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2022-04-15T11:25:38Z",
"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": "XXX",
"number": "XXXX-XXXX-XXXX-1111"
}
}
]
}
<transactions>
<transaction>
<token>Ni8rpmqfrbT1T1ss0Bew0WsnpUs</token>
<transaction_type>RecacheSensitiveData</transaction_type>
<succeeded type="boolean">true</succeeded>
<message key="messages.transaction_succeeded">Succeeded!</message>
<data nil="true"></data>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at type="dateTime">2017-06-26T17:04:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</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>
<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>XXX</verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<fingerprint>e3cef43464fc832f6e04f187df25af497994</fingerprint>
</payment_method>
<created_at type="dateTime">2022-04-15T11:25:38Z</created_at>
<updated_at type="dateTime">2022-04-15T11:25:38Z</updated_at>
</transaction>
</transactions>
Get an ordered and paginated list of transactions executed against a specific payment method.
URL Parameters
Parameter | Description |
---|---|
payment_method_token required |
The token of the payment method whose transactions should be fetched |
format required |
One of json or xml |
order | The order of the returned list. Default is asc , which returns the oldest records first. To list newer records first, use desc . |
since_token | The token of the item to start from (e.g., the last token received in the previous list if iterating through records) |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction(s) | Root element |
❯ token | The token uniquely identifying this transaction at Spreedly |
❯ succeeded | true if the transaction request was successfully executed, false otherwise |
❯ message | A human-readable string indicating the result of the transaction |
❯ gateway_transaction_id | The id of the transaction at the gateway. To be used when corresponding with the gateway or reconciling transactions |
❯ retain_on_success | If the payment method was set to be retained on successful completion of the transaction. To determine if the payment method was actually retained, see the payment_method/storage_state field |
❯ payment_method_added | If the payment method was added as part of this transaction (i.e. a direct pass-in of the payment information) vs. using an already tokenized payment method |
❯ response | Unmodified details of the gateway response, including the message and error_code , if applicable. For failed transactions these fields can help determine the root cause |
❯ payment_method | The payment method used in this transaction |
❯ merchant_profile_key | The token of the Merchant Profile associated with the gateway used for the transaction |
❯ sub_merchant_key | The token of the sub-merchant associated with the transaction. |
❯ gateway_specific_response_fields | A hash containing unique optional fields that a gateway may return based on certain customized options. |
❯ transaction_metadata | The hash of key/value pairs that was included in the transaction request body. |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.