Introduction
These are the API docs for version 1 of the Spreedly API (previously Spreedly Core).
API v1 is a standard REST-style API that accepts/returns XML or JSON requests and is located at:
https://core.spreedly.com/v1/
API examples
These API reference docs are meant to clearly define the URLs, parameters, request bodies, responses and error states of the Spreedly API. Most sections will be accompanied by the HTTP representation of the API call in the right-most column and should be easily translated to the equivalent curl
(or other library) command.
For instance, the following HTTP request representation:
Is equivalent to the following curl
command:
The response section immediately follows the request and outputs both the HTTP response code:
as well as the response body itself:
Variables
POST /v1/gateways/<gateway_token>/verify.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
"retain_on_success": true
}
}
<transaction>
<payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
<retain_on_success>true</retain_on_success>
</transaction>
Request variables are displayed as <var_name>
with the docs. Anytime a variable exists in an example API request, it will be defined in the associated request/response element tables.
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
Unless a variable is denoted as required, it is optional and can be omitted.
Using the API
Authentication
Unless otherwise noted, all calls to the Spreedly API use HTTP basic authentication over HTTPS. Spreedly requires TLS 1.2.
Use the environment key of the Spreedly environment you wish to execute against as the HTTP basic user
, and one of your organization’s access secrets as the HTTP basic password
.
HTTP basic authentication can be set when using curl
in the -u
option as environment-key:access-secret
.
$ curl https://core.spreedly.com/v1/gateways.json -u 'env_key:secret'
JSON endpoints
To make a request for the JSON version of an endpoint, send the Content-Type: application/json
header to the endpoint with the .json
URL suffix.
JSON endpoint examples are contained within the json
tab of the code column here in the docs. If some part of the documentation is ambiguous to the format, it will be displayed in all code tabs.
XML endpoints
To make a request for the XML version of an endpoint, send the Content-Type: application/xml
header to the endpoint with the .xml
URL suffix.
XML endpoint examples are contained within the xml
tab of the code column here in the docs. If some part of the documentation is ambiguous to the format, it will be displayed in all code tabs.
Gateways
List supported gateways
GET /v1/gateways_options.<format> HTTPS/1.1
Host: core.spreedly.com
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"gateways": [
{
"gateway_type": "acapture",
"name": "Acapture",
"auth_modes": [
{
"auth_mode_type": "default",
"name": "Default",
"credentials": [
{
"name": "entity_id",
"label": "Entity Id",
"safe": true
},
{
"name": "access_token",
"label": "Access Token",
"safe": false
}
]
}
],
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"void",
"verify"
],
"payment_methods": [
"credit_card"
],
"gateway_settings": [
],
"gateway_specific_fields": [
"disable_3d_secure"
],
"supported_countries": [
"AD",
"AI",
"AT",
"BE",
"BG",
"CA",
"HR",
"CY",
"CZ",
"DK",
"EE",
"FI",
"FR",
"DE",
"GR",
"HK",
"HU",
"IS",
"IT",
"LV",
"LI",
"LT",
"LU",
"MT",
"MC",
"NL",
"PL",
"PT",
"SM",
"SK",
"SI",
"ES",
"SE",
"CH",
"TR",
"GB",
"US"
],
"supported_cardtypes": [
"visa",
"master",
"american_express",
"diners_club",
"discover",
"jcb",
"maestro",
"dankort"
],
"regions": [
"asia_pacific",
"europe",
"north_america"
],
"homepage": "https://www.acapture.com",
"display_api_url": "https://oppwa.com/v1/payments",
"company_name": "Acapture"
},
{
"gateway_type": "adyen",
"name": "Adyen",
"auth_modes": [
{
"auth_mode_type": "default",
"name": "Default",
"credentials": [
{
"name": "merchant_account",
"label": "Merchant Account",
"safe": true
},
{
"name": "username",
"label": "Username",
"safe": true
},
{
"name": "password",
"label": "Password",
"safe": false
}
]
}
],
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials",
"card_scheme_ntid",
"moto_exemption",
"low_value_exemption"
],
"payment_methods": [
"credit_card",
"apple_pay",
"google_pay",
"third_party_token",
"bank_account"
],
"gateway_settings": [
{
"name": "subdomain",
"label": "Subdomain"
}
],
"gateway_specific_fields": [
"shopper_reference",
"shopper_statement",
"fraud_offset",
"selected_brand",
"delivery_date",
"merchant_order_reference",
"shopper_interaction",
"installments",
"recurring_processing_model",
"brand_override",
"custom_routing_flag",
"user_agent",
"accept_header",
"risk_data",
"shopper_ip",
"threed_dynamic",
"idempotency_key",
"device_fingerprint",
"adjust_authorisation_data",
"authorisation_type",
"requested_test_acquirer_response_code",
"update_shopper_statement",
"industry_usage",
"capture_delay_hours",
"splits",
"tokenize_only",
"recurring_contract_type",
"recurring_detail_reference",
"sub_merchant_id",
"sub_merchant_name",
"sub_merchant_street",
"sub_merchant_city",
"sub_merchant_state",
"sub_merchant_postal_code",
"sub_merchant_country",
"sub_merchant_tax_id",
"sub_merchant_mcc",
"sub_merchant_data",
"cancel_or_refund",
"network_transaction_id",
"external_platform",
"merchant_application",
"verify_amount",
"level_2_data",
"level_3_data",
"additional_data_airline",
"additional_data_lodging",
"store",
"date_of_birth",
"nationality",
"fund_source",
"address_override",
"mcc",
"metadata"
],
"supported_countries": [
"AT",
"AU",
"BE",
"BG",
"BR",
"CH",
"CY",
"CZ",
"DE",
"DK",
"EE",
"ES",
"FI",
"FR",
"GB",
"GI",
"GR",
"HK",
"HU",
"IE",
"IS",
"IT",
"LI",
"LT",
"LU",
"LV",
"MC",
"MT",
"MX",
"NL",
"NO",
"PL",
"PT",
"RO",
"SE",
"SG",
"SK",
"SI",
"US"
],
"supported_cardtypes": [
"visa",
"master",
"american_express",
"diners_club",
"jcb",
"dankort",
"maestro",
"discover",
"elo",
"naranja",
"cabal",
"unionpay"
],
"regions": [
"asia_pacific",
"europe",
"latin_america",
"north_america"
],
"homepage": "https://www.adyen.com/",
"display_api_url": "https://pal-live.adyen.com/pal/servlet/",
"company_name": "Adyen"
}
]
}
<gateways>
<gateway>
<gateway_type>acapture</gateway_type>
<name>Acapture</name>
<auth_modes>
<auth_mode>
<auth_mode_type>default</auth_mode_type>
<name>Default</name>
<credentials>
<credential>
<name>entity_id</name>
<label>Entity Id</label>
<safe type="boolean">true</safe>
</credential>
<credential>
<name>access_token</name>
<label>Access Token</label>
<safe type="boolean">false</safe>
</credential>
</credentials>
</auth_mode>
</auth_modes>
<gateway_settings>
</gateway_settings>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">false</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">false</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">false</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">false</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">false</supports_store>
<supports_remove type="boolean">false</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">false</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">false</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">false</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
</characteristics>
<payment_methods>
<payment_method>credit_card</payment_method>
</payment_methods>
<gateway_specific_fields>
<gateway_specific_field>disable_3d_secure</gateway_specific_field>
</gateway_specific_fields>
<supported_countries>AD, AI, AT, BE, BG, CA, HR, CY, CZ, DK, EE, FI, FR, DE, GR, HK, HU, IS, IT, LV, LI, LT, LU, MT, MC, NL, PL, PT, SM, SK, SI, ES, SE, CH, TR, GB, US</supported_countries>
<supported_cardtypes>visa, master, american_express, diners_club, discover, jcb, maestro, dankort</supported_cardtypes>
<regions>asia_pacific, europe, north_america</regions>
<homepage>https://www.acapture.com</homepage>
<display_api_url>https://oppwa.com/v1/payments</display_api_url>
<company_name>Acapture</company_name>
</gateway>
<gateway>
<gateway_type>adyen</gateway_type>
<name>Adyen</name>
<auth_modes>
<auth_mode>
<auth_mode_type>default</auth_mode_type>
<name>Default</name>
<credentials>
<credential>
<name>merchant_account</name>
<label>Merchant Account</label>
<safe type="boolean">true</safe>
</credential>
<credential>
<name>username</name>
<label>Username</label>
<safe type="boolean">true</safe>
</credential>
<credential>
<name>password</name>
<label>Password</label>
<safe type="boolean">false</safe>
</credential>
</credentials>
</auth_mode>
</auth_modes>
<gateway_settings>
<gateway_setting>
<name>subdomain</name>
<label>Subdomain</label>
</gateway_setting>
</gateway_settings>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">false</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">false</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
<supports_card_scheme_ntid type="boolean">true</supports_card_scheme_ntid>
<supports_moto_exemption type="boolean">true</supports_moto_exemption>
<supports_low_value_exemption type="boolean">true</supports_low_value_exemption>
</characteristics>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
</payment_methods>
<gateway_specific_fields>
<gateway_specific_field>shopper_reference</gateway_specific_field>
<gateway_specific_field>shopper_statement</gateway_specific_field>
<gateway_specific_field>fraud_offset</gateway_specific_field>
<gateway_specific_field>selected_brand</gateway_specific_field>
<gateway_specific_field>delivery_date</gateway_specific_field>
<gateway_specific_field>merchant_order_reference</gateway_specific_field>
<gateway_specific_field>shopper_interaction</gateway_specific_field>
<gateway_specific_field>installments</gateway_specific_field>
<gateway_specific_field>recurring_processing_model</gateway_specific_field>
<gateway_specific_field>brand_override</gateway_specific_field>
<gateway_specific_field>custom_routing_flag</gateway_specific_field>
<gateway_specific_field>user_agent</gateway_specific_field>
<gateway_specific_field>accept_header</gateway_specific_field>
<gateway_specific_field>risk_data</gateway_specific_field>
<gateway_specific_field>shopper_ip</gateway_specific_field>
<gateway_specific_field>threed_dynamic</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>device_fingerprint</gateway_specific_field>
<gateway_specific_field>adjust_authorisation_data</gateway_specific_field>
<gateway_specific_field>authorisation_type</gateway_specific_field>
<gateway_specific_field>requested_test_acquirer_response_code</gateway_specific_field>
<gateway_specific_field>update_shopper_statement</gateway_specific_field>
<gateway_specific_field>industry_usage</gateway_specific_field>
<gateway_specific_field>capture_delay_hours</gateway_specific_field>
<gateway_specific_field>splits</gateway_specific_field>
<gateway_specific_field>tokenize_only</gateway_specific_field>
<gateway_specific_field>recurring_contract_type</gateway_specific_field>
<gateway_specific_field>recurring_detail_reference</gateway_specific_field>
<gateway_specific_field>sub_merchant_id</gateway_specific_field>
<gateway_specific_field>sub_merchant_name</gateway_specific_field>
<gateway_specific_field>sub_merchant_street</gateway_specific_field>
<gateway_specific_field>sub_merchant_city</gateway_specific_field>
<gateway_specific_field>sub_merchant_state</gateway_specific_field>
<gateway_specific_field>sub_merchant_postal_code</gateway_specific_field>
<gateway_specific_field>sub_merchant_country</gateway_specific_field>
<gateway_specific_field>sub_merchant_tax_id</gateway_specific_field>
<gateway_specific_field>sub_merchant_mcc</gateway_specific_field>
<gateway_specific_field>sub_merchant_data</gateway_specific_field>
<gateway_specific_field>cancel_or_refund</gateway_specific_field>
<gateway_specific_field>network_transaction_id</gateway_specific_field>
<gateway_specific_field>external_platform</gateway_specific_field>
<gateway_specific_field>merchant_application</gateway_specific_field>
<gateway_specific_field>verify_amount</gateway_specific_field>
<gateway_specific_field>level_2_data</gateway_specific_field>
<gateway_specific_field>level_3_data</gateway_specific_field>
<gateway_specific_field>additional_data_airline</gateway_specific_field>
<gateway_specific_field>additional_data_lodging</gateway_specific_field>
<gateway_specific_field>store</gateway_specific_field>
<gateway_specific_field>date_of_birth</gateway_specific_field>
<gateway_specific_field>nationality</gateway_specific_field>
<gateway_specific_field>fund_source</gateway_specific_field>
<gateway_specific_field>address_override</gateway_specific_field>
<gateway_specific_field>mcc</gateway_specific_field>
<gateway_specific_field>metadata</gateway_specific_field>
</gateway_specific_fields>
<supported_countries>AT, AU, BE, BG, BR, CH, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GI, GR, HK, HU, IE, IS, IT, LI, LT, LU, LV, MC, MT, MX, NL, NO, PL, PT, RO, SE, SG, SK, SI, US</supported_countries>
<supported_cardtypes>visa, master, american_express, diners_club, jcb, dankort, maestro, discover, elo, naranja, cabal, unionpay</supported_cardtypes>
<regions>asia_pacific, europe, latin_america, north_america</regions>
<homepage>https://www.adyen.com/</homepage>
<display_api_url>https://pal-live.adyen.com/pal/servlet/</display_api_url>
<company_name>Adyen</company_name>
</gateway>
</gateways>
Retrieve a list of all gateways, and their properties, supported by Spreedly. This call can be used to dynamically present a gateway credential form to users or to do any sort of dynamic rendering.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateways | Root element |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway. |
❯ auth_modes | A list of authorization modes for the gateway. An auth mode is basically a list of credentials required for this gateway (some gateways support various ways of entering credentials). |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
❯ supported_countries | The list of countries this gateway supports |
❯ supported_cardtypes | The list of credit card brands this gateway supports |
❯ regions | The list of geographic regions this gateway supports (determined by the supported_countries) |
List created gateways
GET /v1/gateways.<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
{
"gateways": [
{
"token": "CtehwikoMnllHsr3XFfAY1EzPkN",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2017-06-22T13:19:11Z",
"updated_at": "2017-11-27T21:08:11Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
},
{
"token": "7NTzuQfnaNU2Jr4cVgOt7jfTVGq",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2017-06-22T14:16:23Z",
"updated_at": "2017-11-27T21:44:49Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
}
]
}
<gateways>
<gateway>
<token>CtehwikoMnllHsr3XFfAY1EzPkN</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2017-06-22T13:19:11Z</created_at>
<updated_at type="dateTime">2017-11-27T21:08:11Z</updated_at>
</gateway>
<gateway>
<token>7NTzuQfnaNU2Jr4cVgOt7jfTVGq</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2017-06-22T14:16:23Z</created_at>
<updated_at type="dateTime">2017-11-27T21:44:49Z</updated_at>
</gateway>
</gateways>
Retrieve an ordered and paginated list of all gateways in the environment. This is different from the list of all supported gateways in that this will only return the gateway instances that have been provisioned in the authenticated environment.
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) |
count | The number of gateways to return. By default returns 20, maximum allowed is 100. |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateways | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Create test gateway
POST /v1/gateways.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"gateway": {
"gateway_type": "test"
}
}
<gateway>
<gateway_type>test</gateway_type>
</gateway>
HTTPS/1.1 201 Created
{
"gateway": {
"token": "HaQOnzrDfDHdqWmO0WAjw9zDjGE",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2023-06-06T17:15:23Z",
"updated_at": "2023-06-06T17:15:23Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
}
}
<gateway>
<token>7dPJgE2MQZajMypeVkpfWnNMRlk</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2023-06-06T17:16:02Z</created_at>
<updated_at type="dateTime">2023-06-06T17:16:02Z</updated_at>
</gateway>
Create (provision) a test gateway in the authenticated environment. A test gateway is used to test your integration to Spreedly and can only be used with test payment methods.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
gateway | Root element |
❯ gateway_type required |
The type of gateway, e.g., test for a test gateway. |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateway | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Create sandbox gateway
POST /v1/gateways.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"gateway": {
"gateway_type": "stripe",
"login": "your Stripe API secret",
"sandbox": true
}
}
<gateway>
<gateway_type>stripe</gateway_type>
<login>your api secret key</login>
<sandbox>true</sandbox>
</gateway>
HTTPS/1.1 201 Created
{
"gateway": {
"token": "UlSR3GCgSBzryKio8zeIF4aIHqm",
"gateway_type": "stripe",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"third_party_token",
"apple_pay",
"bank_account",
"google_pay"
],
"state": "retained",
"created_at": "2022-06-22T20:15:29Z",
"updated_at": "2022-06-22T20:15:29Z",
"name": "Stripe",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"void",
"verify",
"3dsecure_purchase",
"3dsecure_authorize",
"store",
"remove"
],
"credentials": [
],
"gateway_settings": {
"webhook_id": null,
"version_override": null
},
"gateway_specific_fields": [
"receipt_email",
"radar_session_id",
"skip_radar_rules",
"application_fee",
"stripe_account",
"metadata",
"idempotency_key",
"reason",
"refund_application_fee",
"refund_fee_amount",
"reverse_transfer",
"account_id",
"customer_id",
"validate",
"make_default",
"statement_description",
"statement_descriptor_suffix",
"destination",
"destination_amount",
"merchant_reference",
"customer_reference",
"shipping_address_zip",
"shipping_from_zip",
"shipping_amount",
"line_items",
"transfer_destination",
"transfer_amount",
"transfer_group",
"on_behalf_of",
"application_fee_amount",
"recurring"
],
"redacted": false,
"sandbox": true,
"mode": "default"
}
}
<gateway>
<token>XalHWUjzXpdSfHUTGUYtFvtEbll</token>
<gateway_type>stripe</gateway_type>
<name>Stripe</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">false</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">false</supports_offsite_synchronous_purchase>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">false</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">false</supports_populate_mit_fields>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
<webhook_id nil="true"></webhook_id>
<version_override nil="true"></version_override>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>receipt_email</gateway_specific_field>
<gateway_specific_field>radar_session_id</gateway_specific_field>
<gateway_specific_field>skip_radar_rules</gateway_specific_field>
<gateway_specific_field>application_fee</gateway_specific_field>
<gateway_specific_field>stripe_account</gateway_specific_field>
<gateway_specific_field>metadata</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>reason</gateway_specific_field>
<gateway_specific_field>refund_application_fee</gateway_specific_field>
<gateway_specific_field>refund_fee_amount</gateway_specific_field>
<gateway_specific_field>reverse_transfer</gateway_specific_field>
<gateway_specific_field>account_id</gateway_specific_field>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>validate</gateway_specific_field>
<gateway_specific_field>make_default</gateway_specific_field>
<gateway_specific_field>statement_description</gateway_specific_field>
<gateway_specific_field>statement_descriptor_suffix</gateway_specific_field>
<gateway_specific_field>destination</gateway_specific_field>
<gateway_specific_field>destination_amount</gateway_specific_field>
<gateway_specific_field>merchant_reference</gateway_specific_field>
<gateway_specific_field>customer_reference</gateway_specific_field>
<gateway_specific_field>shipping_address_zip</gateway_specific_field>
<gateway_specific_field>shipping_from_zip</gateway_specific_field>
<gateway_specific_field>shipping_amount</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>transfer_destination</gateway_specific_field>
<gateway_specific_field>transfer_amount</gateway_specific_field>
<gateway_specific_field>transfer_group</gateway_specific_field>
<gateway_specific_field>on_behalf_of</gateway_specific_field>
<gateway_specific_field>application_fee_amount</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">true</sandbox>
<mode>default</mode>
<created_at type="dateTime">2022-06-22T20:15:27Z</created_at>
<updated_at type="dateTime">2022-06-22T20:15:27Z</updated_at>
</gateway>
Create (provision) a gateway to process simulated card data and transactions in the authenticated environment. A sandbox gateway should be used to test out complex integrations like 3D Secure. It is recommended that you create all your sandboxed gateways in their own environment and add a description that highlights that the gateway is intended for sandbox based transactions only. When interacting with a sandbox gateway, you need to ensure that you’re not using real payment method data; instead you should be using the gateway’s test payment method data. Here is an example of Stripe’s sandbox payment method data from their testing guide.
Sandbox gateways are created using the credentials required for that gateway, meaning each call is slightly different depending on the gateway’s API requirements. This example uses Stripe, but any supported gateway will have a similar call.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
gateway | Root element |
❯ gateway_type required |
The type of gateway, e.g., stripe , braintree , etc…. You can find the list of supported gateways and their respective gateway types on this page |
❯ gateway specific credential field(s) required |
The merchant credentials required for this type of gateway. Stripe has login , but your gateway type will most likely require a different set of credentials. Please reference the gateway’s documentation to determine the appropriate credential(s) to pass here. |
❯ description | A description of the gateway. Useful to differentiate between multiple gateways of the same type provisioned within your system. EG: “Sandboxed gateway, not for production use.” |
❯ merchant_profile_key | optional The token for an existing Merchant Profile in your environment. Useful for organizing gateways in an environment with multiple merchants, or associating merchant data with gateway transactions. |
❯ sandbox | optional true or false (false if omitted). Useful to test out a gateway’s sandbox mode, this is recommended in situations where the gateway integration is difficult and where you don’t want to execute real transactions. |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateway | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Create production gateway
POST /v1/gateways.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"gateway": {
"gateway_type": "stripe",
"login": "your Stripe API secret",
"sandbox": true
}
}
<gateway>
<gateway_type>stripe</gateway_type>
<login>your api secret key</login>
<sandbox>true</sandbox>
</gateway>
HTTPS/1.1 201 Created
{
"gateway": {
"token": "UlSR3GCgSBzryKio8zeIF4aIHqm",
"gateway_type": "stripe",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"third_party_token",
"apple_pay",
"bank_account",
"google_pay"
],
"state": "retained",
"created_at": "2022-06-22T20:15:29Z",
"updated_at": "2022-06-22T20:15:29Z",
"name": "Stripe",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"void",
"verify",
"3dsecure_purchase",
"3dsecure_authorize",
"store",
"remove"
],
"credentials": [
],
"gateway_settings": {
"webhook_id": null,
"version_override": null
},
"gateway_specific_fields": [
"receipt_email",
"radar_session_id",
"skip_radar_rules",
"application_fee",
"stripe_account",
"metadata",
"idempotency_key",
"reason",
"refund_application_fee",
"refund_fee_amount",
"reverse_transfer",
"account_id",
"customer_id",
"validate",
"make_default",
"statement_description",
"statement_descriptor_suffix",
"destination",
"destination_amount",
"merchant_reference",
"customer_reference",
"shipping_address_zip",
"shipping_from_zip",
"shipping_amount",
"line_items",
"transfer_destination",
"transfer_amount",
"transfer_group",
"on_behalf_of",
"application_fee_amount",
"recurring"
],
"redacted": false,
"sandbox": true,
"mode": "default"
}
}
<gateway>
<token>XalHWUjzXpdSfHUTGUYtFvtEbll</token>
<gateway_type>stripe</gateway_type>
<name>Stripe</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">false</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">false</supports_offsite_synchronous_purchase>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">false</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">false</supports_populate_mit_fields>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
<webhook_id nil="true"></webhook_id>
<version_override nil="true"></version_override>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>receipt_email</gateway_specific_field>
<gateway_specific_field>radar_session_id</gateway_specific_field>
<gateway_specific_field>skip_radar_rules</gateway_specific_field>
<gateway_specific_field>application_fee</gateway_specific_field>
<gateway_specific_field>stripe_account</gateway_specific_field>
<gateway_specific_field>metadata</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>reason</gateway_specific_field>
<gateway_specific_field>refund_application_fee</gateway_specific_field>
<gateway_specific_field>refund_fee_amount</gateway_specific_field>
<gateway_specific_field>reverse_transfer</gateway_specific_field>
<gateway_specific_field>account_id</gateway_specific_field>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>validate</gateway_specific_field>
<gateway_specific_field>make_default</gateway_specific_field>
<gateway_specific_field>statement_description</gateway_specific_field>
<gateway_specific_field>statement_descriptor_suffix</gateway_specific_field>
<gateway_specific_field>destination</gateway_specific_field>
<gateway_specific_field>destination_amount</gateway_specific_field>
<gateway_specific_field>merchant_reference</gateway_specific_field>
<gateway_specific_field>customer_reference</gateway_specific_field>
<gateway_specific_field>shipping_address_zip</gateway_specific_field>
<gateway_specific_field>shipping_from_zip</gateway_specific_field>
<gateway_specific_field>shipping_amount</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>transfer_destination</gateway_specific_field>
<gateway_specific_field>transfer_amount</gateway_specific_field>
<gateway_specific_field>transfer_group</gateway_specific_field>
<gateway_specific_field>on_behalf_of</gateway_specific_field>
<gateway_specific_field>application_fee_amount</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">true</sandbox>
<mode>default</mode>
<created_at type="dateTime">2022-06-22T20:15:27Z</created_at>
<updated_at type="dateTime">2022-06-22T20:15:27Z</updated_at>
</gateway>
Create (provision) a gateway to process real card data and transactions in the authenticated environment.
Production gateways are created using the credentials required for that gateway, meaning each call is slightly different depending on the gateway’s API requirements. This example uses Stripe, but any supported gateway will have a similar call.
suggestion If you’d like to test out a gateway in test / sandbox mode, you can do so by including the sandbox parameter when creating a gateway. If you do so, you’ll need to check the gateway’s documentation to determine test cards in sandbox mode. Once you’re satisfied with your testing and ready for a real transaction, you’ll need to create another gateway without the sandbox parameter.
Example sandbox workflow
- create a gateway in sandbox mode
- verify your integration with Spreedly and the gateway
- create another gateway without sandbox mode
- start transacting with real payments
note If you wish to go straight to production with transactions, skip the first two steps.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
gateway | Root element |
❯ gateway_type required |
The type of gateway, e.g., stripe , braintree , etc…. You can find the list of supported gateways and their respective gateway types on this page |
❯ gateway specific credential field(s) required |
The merchant credentials required for this type of gateway. Stripe has login , but your gateway type will most likely require a different set of credentials. Please reference the gateway’s documentation to determine the appropriate credential(s) to pass here. |
❯ description | A description of the gateway. Useful to differentiate between multiple gateways of the same type provisioned within your system. |
❯ merchant_profile_key | optional The token for an existing Merchant Profile in your environment. Useful to organize gateways in an environment with multiple merchants, or to associate merchant data with gateway transactions. |
❯ sub_merchant_key | optional The token for an existing Sub-merchant in your environment. Useful for tagging the transactions through this gateway with the sub-merchant who transacts through the gateway. |
❯ sandbox | optional true or false . Useful to test out a gateway’s sandbox mode, this is recommended in situations where the gateway integration is difficult and where you don’t want to execute real transactions. |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateway | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Show
GET /v1/gateways/<gateway_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"gateway": {
"token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2017-06-26T16:57:27Z",
"updated_at": "2017-11-27T20:04:25Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
}
}
<gateway>
<token>T11bJAANtTWnxl36GYjKWvbNK0g</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2017-06-26T16:57:27Z</created_at>
<updated_at type="dateTime">2017-11-27T20:04:25Z</updated_at>
</gateway>
Get a gateway with the given token.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateway | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Update
PUT /v1/gateways/<gateway_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"gateway": {
"login": "updated Stripe API secret"
}
}
<gateway>
<login>updated Stripe API secret</login>
</gateway>
HTTPS/1.1 200 OK
{
"gateway": {
"token": "YhtVn4t7MJRd6ukjktiHn6RXX5P",
"gateway_type": "stripe",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"third_party_token",
"apple_pay",
"bank_account",
"google_pay"
],
"state": "retained",
"created_at": "2021-06-01T19:13:25Z",
"updated_at": "2022-03-16T17:58:13Z",
"name": "Stripe",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"void",
"verify",
"3dsecure_purchase",
"3dsecure_authorize",
"store",
"remove"
],
"credentials": [
],
"gateway_settings": {
"webhook_id": null,
"version_override": null
},
"gateway_specific_fields": [
"receipt_email",
"radar_session_id",
"skip_radar_rules",
"application_fee",
"stripe_account",
"metadata",
"idempotency_key",
"reason",
"refund_application_fee",
"refund_fee_amount",
"reverse_transfer",
"account_id",
"customer_id",
"validate",
"make_default",
"statement_description",
"statement_descriptor_suffix",
"destination",
"destination_amount",
"merchant_reference",
"customer_reference",
"shipping_address_zip",
"shipping_from_zip",
"shipping_amount",
"line_items",
"transfer_destination",
"transfer_amount",
"transfer_group",
"on_behalf_of",
"application_fee_amount",
"recurring"
],
"redacted": false,
"sandbox": false,
"mode": "default"
}
}
<gateway>
<token>YhtVn4t7MJRd6ukjktiHn6RXX5P</token>
<gateway_type>stripe</gateway_type>
<name>Stripe</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">false</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">false</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">false</supports_populate_mit_fields>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
<webhook_id nil="true"></webhook_id>
<version_override nil="true"></version_override>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>receipt_email</gateway_specific_field>
<gateway_specific_field>radar_session_id</gateway_specific_field>
<gateway_specific_field>skip_radar_rules</gateway_specific_field>
<gateway_specific_field>application_fee</gateway_specific_field>
<gateway_specific_field>stripe_account</gateway_specific_field>
<gateway_specific_field>metadata</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>reason</gateway_specific_field>
<gateway_specific_field>refund_application_fee</gateway_specific_field>
<gateway_specific_field>refund_fee_amount</gateway_specific_field>
<gateway_specific_field>reverse_transfer</gateway_specific_field>
<gateway_specific_field>account_id</gateway_specific_field>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>validate</gateway_specific_field>
<gateway_specific_field>make_default</gateway_specific_field>
<gateway_specific_field>statement_description</gateway_specific_field>
<gateway_specific_field>statement_descriptor_suffix</gateway_specific_field>
<gateway_specific_field>destination</gateway_specific_field>
<gateway_specific_field>destination_amount</gateway_specific_field>
<gateway_specific_field>merchant_reference</gateway_specific_field>
<gateway_specific_field>customer_reference</gateway_specific_field>
<gateway_specific_field>shipping_address_zip</gateway_specific_field>
<gateway_specific_field>shipping_from_zip</gateway_specific_field>
<gateway_specific_field>shipping_amount</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>transfer_destination</gateway_specific_field>
<gateway_specific_field>transfer_amount</gateway_specific_field>
<gateway_specific_field>transfer_group</gateway_specific_field>
<gateway_specific_field>on_behalf_of</gateway_specific_field>
<gateway_specific_field>application_fee_amount</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2021-06-01T19:13:25Z</created_at>
<updated_at type="dateTime">2022-03-16T17:58:12Z</updated_at>
</gateway>
Update a gateway.
Updating a redacted gateway’s credentials will set its state back to retained, allowing it to be used for transactions.
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 |
---|---|
gateway | Root element |
❯ gateway specific credential field(s) required |
The merchant credentials required for this type of gateway. Stripe has login , but your gateway type will most likely require a different set of credentials. Please reference the gateway’s documentation to determine the appropriate credential(s) to pass here. |
❯ description | A description of the gateway. Useful to differentiate between multiple gateways of the same type provisioned within your system. |
❯ merchant_profile_key | optional The token for an existing Merchant Profile in your environment. Useful to organize gateways in an environment with multiple merchants, or to associate merchant data with gateway transactions. |
❯ sub_merchant_key | optional The token for an existing Sub-merchant in your environment. Useful for tagging the transactions through this gateway with the sub-merchant who transacts through the gateway. |
Response Body
Notable response elements include:
Element | Description |
---|---|
gateway | Root element |
❯ token | The token identifying the provisioned gateway at Spreedly |
❯ name | The human readable name of the gateway |
❯ gateway_type | The type (short name) of the gateway. Use this value when provisioning a gateway |
❯ description | The description of the provisioned gateway |
❯ merchant_profile_key | The token of the Merchant Profile associated with the provisioned gateway |
❯ sub_merchant_key | The token of the Sub-merchant associated with the provisioned gateway |
❯ state | The storage state of the gateway (retained, redacted, etc…) |
❯ sandbox | If the gateway was created in sandbox mode or not |
❯ redacted | If this gateway is redacted or not |
❯ credentials | The non-sensitive credentials used for this gateway |
❯ gateway_settings | The non-credential fields that can be specified at the gateway level, and included in all transactions |
❯ characteristics | A list of operations (such as purchase, capture etc…) that the gateway supports |
❯ payment_methods | A list of payment methods (such as credit_card, apple_pay, google_pay, etc…) that the gateway supports |
❯ gateway_specific_fields | The list of gateway specific fields that can be specified in supported gateway transactions |
Retain
PUT /v1/gateways/<gateway_token>/retain.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"token": "9EwxsDWR0g3EsE686j8qsX5gAuS",
"created_at": "2020-04-03T18:22:31Z",
"updated_at": "2020-04-03T18:22:31Z",
"succeeded": true,
"transaction_type": "RetainGateway",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway": {
"token": "RpnIaNabjy9E8Itba4JPV4Zgapz",
"gateway_type": "authorize_net",
"description": null,
"payment_methods": [
"credit_card",
"bank_account",
"apple_pay",
"third_party_token"
],
"state": "retained",
"created_at": "2020-04-03T18:22:31Z",
"updated_at": "2020-04-03T18:22:31Z",
"name": "Authorize.Net",
"login": "Your Authorize.Net API Login ID",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"verify",
"store",
"fraud_review"
],
"credentials": [
{
"name": "login",
"value": "Your Authorize.Net API Login ID"
}
],
"gateway_settings": {
"opt_out_recurring_default": null
},
"gateway_specific_fields": [
"customer_id",
"customer_profile_id",
"duplicate_window",
"disable_partial_auth",
"market_type",
"recurring",
"email_customer",
"header_email_receipt",
"line_items",
"po_number",
"tax_exempt",
"tax",
"duty",
"shipping",
"transaction_id",
"require_billing_address",
"customer_payment_profile_id",
"ship_from_address",
"summary_commodity_code",
"authentication_indicator",
"cardholder_authentication_value"
],
"redacted": false,
"sandbox": false
}
}
}
<transaction>
<token>7fQWQ3hA9sv80Gl5pLff4KPkG2d</token>
<created_at type="dateTime">2020-04-03T18:22:31Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:31Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>RetainGateway</transaction_type>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway>
<token>GULbQX8cBftv3qXyGGKsoowkRDy</token>
<gateway_type>authorize_net</gateway_type>
<name>Authorize.Net</name>
<description nil="true"></description>
<login>Your Authorize.Net API Login ID</login>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_3dsecure_purchase type="boolean">false</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">false</supports_remove>
<supports_fraud_review type="boolean">true</supports_fraud_review>
</characteristics>
<credentials>
<credential>
<name>login</name>
<value>Your Authorize.Net API Login ID</value>
</credential>
</credentials>
<gateway_settings>
<opt_out_recurring_default nil="true"></opt_out_recurring_default>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>customer_profile_id</gateway_specific_field>
<gateway_specific_field>duplicate_window</gateway_specific_field>
<gateway_specific_field>disable_partial_auth</gateway_specific_field>
<gateway_specific_field>market_type</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
<gateway_specific_field>email_customer</gateway_specific_field>
<gateway_specific_field>header_email_receipt</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>po_number</gateway_specific_field>
<gateway_specific_field>tax_exempt</gateway_specific_field>
<gateway_specific_field>tax</gateway_specific_field>
<gateway_specific_field>duty</gateway_specific_field>
<gateway_specific_field>shipping</gateway_specific_field>
<gateway_specific_field>transaction_id</gateway_specific_field>
<gateway_specific_field>require_billing_address</gateway_specific_field>
<gateway_specific_field>customer_payment_profile_id</gateway_specific_field>
<gateway_specific_field>ship_from_address</gateway_specific_field>
<gateway_specific_field>summary_commodity_code</gateway_specific_field>
<gateway_specific_field>authentication_indicator</gateway_specific_field>
<gateway_specific_field>cardholder_authentication_value</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>third_party_token</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<created_at type="dateTime">2020-04-03T18:22:30Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:31Z</updated_at>
</gateway>
</transaction>
When gateways are created via the API, they are automatically retained. However, gateways created via the unauthenticated API (e.g., from a browser/javascript library) are created in the “cached” state. Only by retaining a cached gateway will it be saved and available for future use.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
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 |
❯ gateway | The gateway that was redacted |
❯❯ redacted | If the gateway is redacted |
❯❯ state | The new state of the gateway (retained ) |
Redact
PUT /v1/gateways/<gateway_token>/redact.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"token": "kKMybjJETZqTBhyVjr71zAE5Cf",
"created_at": "2020-04-03T18:22:29Z",
"updated_at": "2020-04-03T18:22:29Z",
"succeeded": true,
"transaction_type": "RedactGateway",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway": {
"token": "Dj9T30zWhNRIlJbfdcSCbw2o6Yp",
"gateway_type": "authorize_net",
"description": null,
"payment_methods": [
"credit_card",
"bank_account",
"apple_pay",
"third_party_token"
],
"state": "redacted",
"created_at": "2020-04-03T18:22:29Z",
"updated_at": "2020-04-03T18:22:29Z",
"name": "Authorize.Net",
"login": "Your Authorize.Net API Login ID",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"verify",
"store",
"fraud_review"
],
"credentials": [
{
"name": "login",
"value": "Your Authorize.Net API Login ID"
}
],
"gateway_settings": {
"opt_out_recurring_default": null
},
"gateway_specific_fields": [
"customer_id",
"customer_profile_id",
"duplicate_window",
"disable_partial_auth",
"market_type",
"recurring",
"email_customer",
"header_email_receipt",
"line_items",
"po_number",
"tax_exempt",
"tax",
"duty",
"shipping",
"transaction_id",
"require_billing_address",
"customer_payment_profile_id",
"ship_from_address",
"summary_commodity_code",
"authentication_indicator",
"cardholder_authentication_value"
],
"redacted": true,
"sandbox": false
}
}
}
<transaction>
<token>GQxQpU4iKeYkUzk8Y8lKFDel4Dp</token>
<created_at type="dateTime">2020-04-03T18:22:28Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:28Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>RedactGateway</transaction_type>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway>
<token>HF664DtDUtyxHyAS4qHgqUuy2kM</token>
<gateway_type>authorize_net</gateway_type>
<name>Authorize.Net</name>
<description nil="true"></description>
<login>Your Authorize.Net API Login ID</login>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">false</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">false</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">false</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">false</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">false</supports_offsite_authorize>
<supports_3dsecure_purchase type="boolean">false</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">false</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">false</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">false</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">false</supports_remove>
<supports_fraud_review type="boolean">true</supports_fraud_review>
</characteristics>
<credentials>
<credential>
<name>login</name>
<value>Your Authorize.Net API Login ID</value>
</credential>
</credentials>
<gateway_settings>
<opt_out_recurring_default nil="true"></opt_out_recurring_default>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>customer_id</gateway_specific_field>
<gateway_specific_field>customer_profile_id</gateway_specific_field>
<gateway_specific_field>duplicate_window</gateway_specific_field>
<gateway_specific_field>disable_partial_auth</gateway_specific_field>
<gateway_specific_field>market_type</gateway_specific_field>
<gateway_specific_field>recurring</gateway_specific_field>
<gateway_specific_field>email_customer</gateway_specific_field>
<gateway_specific_field>header_email_receipt</gateway_specific_field>
<gateway_specific_field>line_items</gateway_specific_field>
<gateway_specific_field>po_number</gateway_specific_field>
<gateway_specific_field>tax_exempt</gateway_specific_field>
<gateway_specific_field>tax</gateway_specific_field>
<gateway_specific_field>duty</gateway_specific_field>
<gateway_specific_field>shipping</gateway_specific_field>
<gateway_specific_field>transaction_id</gateway_specific_field>
<gateway_specific_field>require_billing_address</gateway_specific_field>
<gateway_specific_field>customer_payment_profile_id</gateway_specific_field>
<gateway_specific_field>ship_from_address</gateway_specific_field>
<gateway_specific_field>summary_commodity_code</gateway_specific_field>
<gateway_specific_field>authentication_indicator</gateway_specific_field>
<gateway_specific_field>cardholder_authentication_value</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>third_party_token</payment_method>
</payment_methods>
<state>redacted</state>
<redacted type="boolean">true</redacted>
<sandbox type="boolean">false</sandbox>
<created_at type="dateTime">2020-04-03T18:22:28Z</created_at>
<updated_at type="dateTime">2020-04-03T18:22:28Z</updated_at>
</gateway>
</transaction>
Redact (strip of any sensitive credentials and make inactive) a provisioned gateway.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
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 |
❯ gateway | The gateway that was redacted |
❯❯ redacted | If the gateway is now redacted |
❯❯ state | The new state of the gateway (redacted ) |
Transactions
GET /v1/gateways/<gateway_token>/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": [
{
"on_test_gateway": true,
"created_at": "2021-06-01T18:12:58Z",
"updated_at": "2021-06-01T18:12:58Z",
"succeeded": true,
"state": "succeeded",
"token": "HTDLYnmo52ZEKrpLgW5mmFw3Mss",
"transaction_type": "Purchase",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "50",
"gateway_latency_ms": 0,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"warning": null,
"application_id": null,
"amount": 100,
"currency_code": "USD",
"retain_on_success": false,
"payment_method_added": false,
"smart_routed": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful purchase",
"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": "2021-06-01T18:12:58Z",
"updated_at": "2021-06-01T18:12:58Z"
},
"shipping_address": {
"name": "Newfirst Newlast",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2021-06-01T18:12:57Z",
"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,
"payment_method_type": "credit_card",
"errors": [
],
"fingerprint": "e3cef43464fc832f6e04f187df25af497994",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-1111"
}
}
]
}
<transactions>
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2021-06-01T18:12:58Z</created_at>
<updated_at type="dateTime">2021-06-01T18:12:58Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>HTDLYnmo52ZEKrpLgW5mmFw3Mss</token>
<transaction_type>Purchase</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<description nil="true"></description>
<email nil="true"></email>
<merchant_name_descriptor nil="true"></merchant_name_descriptor>
<merchant_location_descriptor nil="true"></merchant_location_descriptor>
<merchant_profile_key nil="true"></merchant_profile_key>
<gateway_specific_fields nil="true"></gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>50</gateway_transaction_id>
<gateway_latency_ms type="integer">0</gateway_latency_ms>
<stored_credential_initiator nil="true"></stored_credential_initiator>
<stored_credential_reason_type nil="true"></stored_credential_reason_type>
<warning nil="true"></warning>
<application_id nil="true"></application_id>
<amount type="integer">100</amount>
<currency_code>USD</currency_code>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">false</payment_method_added>
<smart_routed type="boolean">false</smart_routed>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<shipping_address>
<name>Newfirst Newlast</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>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful purchase</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2021-06-01T18:12:58Z</created_at>
<updated_at type="dateTime">2021-06-01T18:12:58Z</updated_at>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at>2017-06-26T17:04:38Z</created_at>
<updated_at>2021-06-01T18:12:57Z</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>
<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>
<attempt_3dsecure type="boolean">false</attempt_3dsecure>
</transaction>
</transactions>
Get an ordered and paginated list of transactions executed against a specific gateway.
URL Parameters
Parameter | Description |
---|---|
gateway_token required |
The token of the gateway to execute against |
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) |
state | The transaction state on which to filter the returned list. Can be one of succeeded , failed , gateway_processing_failed , gateway_processing_result_unknown . |
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. |
Receivers
List supported receivers
GET /v1/receivers_options.<format>?published=true HTTPS/1.1
Host: core.spreedly.com
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"receivers": [
{
"receiver_type": "a1_payments",
"name": "A1payments Receiver",
"hostnames": "https://www.a1payments.com",
"company_name": "A1 Payments"
},
{
"receiver_type": "abg_direct",
"name": "Abgdirect Receiver",
"hostnames": "https://services.carrental.com,https://qaservices.carrental.com",
"company_name": "ABG Direct"
}
]
}
<receivers>
<receiver>
<receiver_type>a1_payments</receiver_type>
<name>A1payments Receiver</name>
<hostnames>https://www.a1payments.com</hostnames>
<company_name>A1 Payments</company_name>
</receiver>
<receiver>
<receiver_type>abg_direct</receiver_type>
<name>Abgdirect Receiver</name>
<hostnames>https://services.carrental.com,https://qaservices.carrental.com</hostnames>
<company_name>ABG Direct</company_name>
</receiver>
</receivers>
Retrieve a list of all payment method distribution receivers, and their properties, supported by Spreedly.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
receivers | Root element |
❯ name | The human readable name of the receiver |
❯ receiver_type | The type (short name) of the receiver. Use this value when provisioning a receiver. |
❯ hostnames | The urls used to interact with the receiver |
❯ company_name | The name of the company providing the receiver |
List created receivers
GET /v1/receivers.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"receivers": [
{
"company_name": "TEST",
"receiver_type": "test",
"token": "2kAEQYkLqRJLJZoyGvF9c8gVieo",
"hostnames": "https://spreedly-echo.herokuapp.com/",
"state": "retained",
"created_at": "2017-06-22T21:17:45Z",
"updated_at": "2018-04-20T12:10:52Z",
"credentials": null
},
{
"company_name": "TEST",
"receiver_type": "test",
"token": "XYEV709EQHWUkwFyTcRx1N6WXKz",
"hostnames": "https://spreedly-echo.herokuapp.com/",
"state": "retained",
"created_at": "2017-06-22T21:20:21Z",
"updated_at": "2018-04-20T12:12:38Z",
"credentials": [
{
"name": "app-id",
"value": "1234",
"safe": "true"
},
{
"name": "app-secret",
"safe": "false"
}
]
}
]
}
<receivers>
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>2kAEQYkLqRJLJZoyGvF9c8gVieo</token>
<hostnames>https://spreedly-echo.herokuapp.com/</hostnames>
<state>retained</state>
<created_at type="dateTime">2017-06-22T21:17:45Z</created_at>
<updated_at type="dateTime">2018-04-20T12:10:52Z</updated_at>
<credentials nil="true"></credentials>
</receiver>
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>XYEV709EQHWUkwFyTcRx1N6WXKz</token>
<hostnames>https://spreedly-echo.herokuapp.com/</hostnames>
<state>retained</state>
<created_at type="dateTime">2017-06-22T21:20:21Z</created_at>
<updated_at type="dateTime">2018-04-20T12:12:38Z</updated_at>
<credentials type="array">
<credential>
<name>app-id</name>
<value>1234</value>
<safe>true</safe>
</credential>
<credential>
<name>app-secret</name>
<safe>false</safe>
</credential>
</credentials>
</receiver>
</receivers>
Retrieve an ordered and paginated list of all receivers in the authenticated environment.
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) |
Response Body
Notable response elements include:
Element | Description |
---|---|
receivers | Root element |
❯ company_name | The name of the company providing the receiver |
❯ token | The token uniquely identifying this receiver at Spreedly |
❯ receiver_type | The type of receiver |
❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
Create HTTP receiver
POST /v1/receivers.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"receiver": {
"receiver_type": "test",
"hostnames": "https://spreedly-echo.herokuapp.com",
"credentials": [
{
"name": "app-id",
"value": 1234,
"safe": true
},
{
"name": "app-secret",
"value": 5678
}
]
}
}
<receiver>
<receiver_type>test</receiver_type>
<hostnames>https://spreedly-echo.herokuapp.com</hostnames>
<credentials>
<credential>
<name>app-id</name>
<value>1234</value>
<safe>true</safe>
</credential>
<credential>
<name>app-secret</name>
<value>5678</value>
</credential>
</credentials>
</receiver>
HTTPS/1.1 201 Created
{
"receiver": {
"company_name": "TEST",
"receiver_type": "test",
"token": "TdXjq6sqBHpD1200iIvUhYy9x50",
"hostnames": "https://spreedly-echo.herokuapp.com",
"state": "retained",
"created_at": "2020-02-13T18:38:04Z",
"updated_at": "2020-02-13T18:38:04Z",
"credentials": [
{
"name": "app-id",
"value": 1234,
"safe": true
},
{
"name": "app-secret",
"safe": false
}
]
}
}
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>NG7rSGp3MPJIWEXwKxZ5sr7tgvj</token>
<hostnames>https://spreedly-echo.herokuapp.com</hostnames>
<state>retained</state>
<created_at type="dateTime">2020-02-13T18:38:04Z</created_at>
<updated_at type="dateTime">2020-02-13T18:38:04Z</updated_at>
<credentials type="array">
<credential>
<name>app-id</name>
<value>1234</value>
<safe>true</safe>
</credential>
<credential>
<name>app-secret</name>
<safe>false</safe>
</credential>
</credentials>
</receiver>
Create a receiver for use in payment method distribution.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Parameter | Description |
---|---|
receiver | Root element |
❯ receiver_type required |
The type of receiver to provision. Can be test for a test receiver, or any one of the other supported production receiver types. |
❯ hostnames | Allowed list of hosts that the receiver can send payments to. Supports a comma separated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., https://testing.receiver.com (https is required). If provided for a test receiver, we will validate the delivery URL against the list of hostnames when simulating delivery to the receiver. Production receivers can omit hostnames as their values are hard-coded. |
❯ credentials | Sensitive values that should be securely stored and made available to the request template at time of delivery |
❯❯ name | The name of the credential. This will be the name of the variable in the delivery request template. |
❯❯ value | The value of the credential. This will be the value substituted in for the credential variable in the delivery request template. |
❯❯ safe default: false |
Set to true if the credential is not a sensitive value (e.g., a user name). Otherwise it is assumed to be a sensitive value and will not be echoed back in API responses. |
Response Body
Notable response elements include:
Element | Description |
---|---|
receiver | Root element |
❯ company_name | The name of the company providing the receiver |
❯ token | The token uniquely identifying this receiver at Spreedly |
❯ receiver_type | The type of receiver |
❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
❯ credentials | One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed. |
Create SFTP receiver
POST /v1/receivers.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"receiver": {
"receiver_type": "test",
"hostnames": "sftp://testserver.com",
"protocol": {
"user": "test_user",
"password": "test_password"
}
}
}
<receiver>
<receiver_type>test</receiver_type>
<hostnames>sftp://testserver.com</hostnames>
<protocol>
<user>test_user</user>
<password>test_password</password>
</protocol>
</receiver>
HTTPS/1.1 201 Created
{
"receiver": {
"company_name": "TEST",
"receiver_type": "test",
"token": "Rz3rhs0J7V2UW41egNYTBJiMpUQ",
"hostnames": "sftp://testserver.com",
"state": "retained",
"created_at": "2018-04-20T12:58:03Z",
"updated_at": "2018-04-20T12:58:03Z",
"credentials": null,
"protocol": {
"user": "test_user"
}
}
}
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>9X7emTBWC90OjvcYBkmuJZM6HbC</token>
<hostnames>sftp://testserver.com</hostnames>
<state>retained</state>
<created_at type="dateTime">2018-04-20T12:58:02Z</created_at>
<updated_at type="dateTime">2018-04-20T12:58:02Z</updated_at>
<credentials nil="true"></credentials>
<protocol>
<user>test_user</user>
</protocol>
</receiver>
Create a receiver for use in payment method distribution.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Parameter | Description |
---|---|
receiver | Root element |
❯ receiver_type required |
The type of receiver to provision. Can be test for a test receiver, or any one of the other supported production receiver types. |
❯ protocol required for SFTP receivers |
a hash of protocol values, currently only used for the SFTP protocol. e.g. sftp://user:password@127.0.0.0 |
❯ hostnames | Allowed list of hosts that the receiver can send payments to. Supports a comma separated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., sftp://testing.receiver.com . If provided for a test receiver, we will validate the delivery URL against the list of hostnames when simulating delivery to the receiver. Production receivers can omit hostnames as their values are hard-coded. |
❯❯ user | The user value. |
❯❯ password | The password value. |
Response Body
Notable response elements include:
Element | Description |
---|---|
receiver | Root element |
❯ company_name | The name of the company providing the receiver |
❯ token | The token uniquely identifying this receiver at Spreedly |
❯ receiver_type | The type of receiver |
❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
❯ protocol_user | The user value used to authenticate with the SFTP receiver. |
Show receiver
GET /v1/receivers/<receiver_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"receiver": {
"company_name": "TEST",
"receiver_type": "test",
"token": "JhGsltr85iI0C2CnrSFA2nmjAOO",
"hostnames": "https://spreedly-echo.herokuapp.com",
"state": "retained",
"created_at": "2017-07-27T17:55:34Z",
"updated_at": "2017-07-27T17:55:34Z",
"credentials": null
}
}
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>T4WSwkjLmmBnnKYNeeGCb7FmPxB</token>
<hostnames>https://spreedly-echo.herokuapp.com</hostnames>
<state>retained</state>
<created_at type="dateTime">2018-04-04T15:36:17Z</created_at>
<updated_at type="dateTime">2018-04-04T15:36:17Z</updated_at>
<credentials nil="true"></credentials>
</receiver>
Get a receiver with the given token.
URL Parameters
Parameter | Description |
---|---|
receiver_token required |
The token of the receiver at Spreedly |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
receiver | Root element |
❯ company_name | The name of the company providing the receiver |
❯ token | The token uniquely identifying this receiver at Spreedly |
❯ receiver_type | The type of receiver |
❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
Update receiver
PUT /v1/receivers/<receiver_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"receiver": {
"credentials": [
{
"name": "app-id",
"value": "abcd",
"safe": true
},
{
"name": "app-secret",
"value": "efgh"
}
]
}
}
<receiver>
<credentials>
<credential>
<name>app-id</name>
<value>abcd</value>
<safe>true</safe>
</credential>
<credential>
<name>app-secret</name>
<value>efgh</value>
</credential>
</credentials>
</receiver>
HTTPS/1.1 200 OK
{
"transaction": {
"token": "4844UmKDKTnRLSu203SjJ5vaHSH",
"created_at": "2017-07-27T17:55:36Z",
"updated_at": "2017-07-27T17:55:36Z",
"succeeded": true,
"transaction_type": "UpdatePaymentMethodReceiver",
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"receiver": {
"company_name": "TEST",
"receiver_type": "test",
"token": "IXPvgTDJUxCKwzXdYn6shVVjPrd",
"hostnames": "https://spreedly-echo.herokuapp.com",
"state": "retained",
"created_at": "2017-07-27T17:55:35Z",
"updated_at": "2017-07-27T17:55:36Z",
"credentials": [
{
"name": "app-id",
"value": "abcd",
"safe": true
},
{
"name": "app-secret",
"safe": "false"
}
]
}
}
}
<transaction>
<token>BIqYM6q9kideDE8Xwj8LbMKGvvF</token>
<created_at type="dateTime">2017-07-27T17:55:37Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:37Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>UpdatePaymentMethodReceiver</transaction_type>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>I915nS7vmJnqPN9twDHW9blRaq0</token>
<hostnames>https://spreedly-echo.herokuapp.com</hostnames>
<state>retained</state>
<created_at type="dateTime">2017-07-27T17:55:36Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:37Z</updated_at>
<credentials type="array">
<credential>
<name>app-id</name>
<value>abcd</value>
<safe>true</safe>
</credential>
<credential>
<name>app-secret</name>
<safe>false</safe>
</credential>
</credentials>
</receiver>
</transaction>
Update a receiver with new credentials.
URL Parameters
Parameter | Description |
---|---|
receiver_token required |
The token of the receiver at Spreedly |
format required |
One of json or xml |
Request Body
Parameter | Description |
---|---|
receiver | Root element |
❯ credentials required |
Sensitive values that should be securely stored and made available to the request template at time of delivery |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ receiver | Updated receiver |
❯❯ token | The token uniquely identifying this receiver at Spreedly |
❯❯ receiver_type | The type of receiver |
❯❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
❯❯ credentials | One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed. |
Redact receiver
PUT /v1/receivers/<receiver_token>/redact.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
{
"transaction": {
"token": "GX7M1jZKAdsYGVrQSvvMw2gLHQx",
"created_at": "2017-07-27T17:55:33Z",
"updated_at": "2017-07-27T17:55:33Z",
"succeeded": true,
"transaction_type": "RedactPaymentMethodReceiver",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"receiver": {
"company_name": "TEST",
"receiver_type": "test",
"token": "BDNVxsYWxxDVrMQhTsC14r6qASy",
"hostnames": "https://spreedly-echo.herokuapp.com",
"state": "redacted",
"created_at": "2017-07-27T17:55:32Z",
"updated_at": "2017-07-27T17:55:33Z",
"credentials": null
}
}
}
<transaction>
<token>2fetQVEr2aIn9f9lM1tCd2xjUJG</token>
<created_at type="dateTime">2017-07-27T17:55:33Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:33Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>RedactPaymentMethodReceiver</transaction_type>
<message key="messages.transaction_succeeded">Succeeded!</message>
<receiver>
<company_name>TEST</company_name>
<receiver_type>test</receiver_type>
<token>J3jPlZXbgZIhLjPGxYqmRiqBQKA</token>
<hostnames>https://spreedly-echo.herokuapp.com</hostnames>
<state>redacted</state>
<created_at type="dateTime">2017-07-27T17:55:33Z</created_at>
<updated_at type="dateTime">2017-07-27T17:55:33Z</updated_at>
<credentials nil="true"></credentials>
</receiver>
</transaction>
Redact (strip of any sensitive credentials and make inactive) a receiver.
URL Parameters
Parameter | Description |
---|---|
receiver_token required |
The token of the receiver at Spreedly |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ receiver | Updated receiver |
❯❯ token | The token uniquely identifying this receiver at Spreedly |
❯❯ receiver_type | The type of receiver |
❯❯ hostnames | The allowed list of hostnames to which payment methods can be delivered |
❯❯ state | The storage state of the payment method. Can be one of retained or redacted . By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required. |
❯❯ credentials | One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed. |
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/GTaMhBwgmZ2ywntbr9iOcBY4Tj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w+Td8WglTMNYcidqeYILTGzn3zMEXmW3j7AAAAAAAA",
"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":"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIz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GCCqGSM49BAMCA2cAMGQCMDrPcoNRFpmxhvs1w1bKYr/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.
Certificates
List certificates
GET /v1/certificates.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Example response has been truncated for brevity
HTTPS/1.1 200 OK
{
"certificates": [
{
"token": "8ERbJicjPjc2p8OfDnSZXbFHDdp",
"algorithm": "ec-prime256v1",
"cn": "MyApp ApplePay Production Certificate",
"o": null,
"ou": null,
"c": null,
"st": null,
"l": null,
"email_address": "security@yourorg.com",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYKXdTdWUxdSjgHVN6uRUEjExXvE5\n7hPhu9BuQTuBDaQCdIhsDXj+aTaJL73BAQI8asKhcZynfcSIHJCoz0Xthg==\n-----END PUBLIC KEY-----\n",
"public_key_hash": "K3xhhI8Efg1/oVezCy2/r5EbC3MhrNTijO2sDo3YMaE=",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ\nMAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv\ndXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYKXdTdWUxdSjgHVN\n6uRUEjExXvE57hPhu9BuQTuBDaQCdIhsDXj+aTaJL73BAQI8asKhcZynfcSIHJCo\nz0XthqAAMAoGCCqGSM49BAMCA0gAMEUCIQDiwBI8XLAzt/23h7PIMSnPR71EoSyi\nr8ivSDzwW1bGdAIgQ3MH5fbtU9XFckDizWko+4Yvuy0OKDifYKp0c0qjP8c=\n-----END CERTIFICATE REQUEST-----\n",
"pem": null,
"created_at": "2017-06-22T20:42:05Z",
"updated_at": "2017-06-22T20:42:05Z"
},
{
"token": "J1Conxz9vbU8RBzj3Z1jMKaquwS",
"algorithm": "ec-prime256v1",
"cn": "MyApp ApplePay Production Certificate",
"o": null,
"ou": null,
"c": null,
"st": null,
"l": null,
"email_address": "security@yourorg.com",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwueSZR2V+2bSdjuok5GNDPjfseuU\nBkTFmAvHns5LKjOnLHI9cE1zJYOn6Lvc3mAoQoCawO/M0pJQuOd+uqco7w==\n-----END PUBLIC KEY-----\n",
"public_key_hash": "lXtoHJvMFdmRq/N7Hm8UFnNr+9jJcdtYSWNfDLsMYzk=",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSTCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ\nMAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv\ndXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwueSZR2V+2bSdjuo\nk5GNDPjfseuUBkTFmAvHns5LKjOnLHI9cE1zJYOn6Lvc3mAoQoCawO/M0pJQuOd+\nuqco76AAMAoGCCqGSM49BAMCA0kAMEYCIQDiyLXI8RqeQJCSoM80IR0uKhtjHPFz\n4YrBZmA9E+GoeAIhAJFL7zUT/Xo/e1o5TBKJKamtG6hSAF8amP+96/LXymly\n-----END CERTIFICATE REQUEST-----\n",
"pem": null,
"created_at": "2017-06-22T21:24:27Z",
"updated_at": "2017-06-22T21:24:27Z"
}
]
}
<certificates>
<certificate>
<token>0304N680YM9WSAZKDA54GE9HXA</token>
<algorithm nil="true"></algorithm>
<cn>MyApp XML Signature Production Certificate</cn>
<o nil="true"></o>
<ou nil="true"></ou>
<c nil="true"></c>
<st nil="true"></st>
<l nil="true"></l>
<email_address>security@yourorg.com</email_address>
<public_key>-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyV1sJK9aNE76M4H2k5t5
HNVTdCqmxFMf1HDufcueK49t1sj3wG9psZXPBan6cLJEy7bVo2QIl/NQDwaC5vDg
IiJKIz+KwxeF1q+0it2cutxURjWY4ycxs/WuOJewSHIML+GZhzhX0nJ8xCiJKzyf
xoBdlATrlMI70Gcgqmv5Xh7D+CR65ynIuU8J3YMRn7bhojcueWJD8AEh01KVBfji
fno1f2W6Lj6euxv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XG5fs8ZEwlLGAS+bNgCctmW
NcuqxEreR4TiV07WT/18m1go+34IygGxlxgntLQOZQyX6mjVyZjgOjefweA8OFyG
s+xqgVuR9G7Zu8KFW0MaCj7QZBl1h4FfA3Hz25R1WC2qcbY04Db3EkLYPU4hBEzX
HXkAyW5LWRk4pzxew9CRQ+uHyumPyi2O6Yv9avI9QA5PkuRoH0xgQ87n3AXgQ08p
HDoiNxcDFhfL13lspowI40bsOWfGm2vvTrV42PvobHB2Hwb3a77mM2Z6bCvdN32R
jn30kQ==
-----END CERTIFICATE-----
</pem>
<created_at type="dateTime">2023-06-06T16:19:47Z</created_at>
<updated_at type="dateTime">2023-06-06T16:19:47Z</updated_at>
</certificate>
<certificate>
<token>04MBTRKHZW9V2THG1EFQGCWXHR</token>
<algorithm nil="true"></algorithm>
<cn>MyApp XML Signature Production Certificate</cn>
<o nil="true"></o>
<ou nil="true"></ou>
<c nil="true"></c>
<st nil="true"></st>
<l nil="true"></l>
<email_address>security@yourorg.com</email_address>
<public_key>-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyV1sJK9aNE76M4H2k5t5
HNVTdCqmxFMf1HDufcueK49t1sj3wG9psZXPBan6cLJEy7bVo2QIl/NQDwaC5vDg
IiJKIz+KwxeF1q+0it2cutxURjWY4ycxs/WuOJewSHIML+GZhzhX0nJ8xCiJKzyf
xoBdlATrlMI70Gcgqmv5Xh7D+CR65ynIuU8J3YMRn7bhojcueWJD8AEh01KVBfji
fno1f2W6Lj6euxvwiapaMTZioHe8uH4geOVw5WIuI3uLsR5RNuLT/q/Ft0SIwuev
fp6odCkAC69AIvttPEfqGcqNn+F0fLRnn2Ad+YRsipuOYefWBPmw+SFikxvkliKr
fwIDAQAB
-----END PUBLIC KEY-----
</public_key>
<public_key_hash>dnb3kyfglEbIgOB5wK6VfggYZFNU1q1Ms7sJn/6cjRc=</public_key_hash>
<csr nil="true"></csr>
<pem>-----BEGIN CER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lspowI40bsOWfGm2vvTrV42PvobHB2Hwb3a77mM2Z6bCvdN32R
jn30kQ==
-----END CERTIFICATE-----
</pem>
<created_at type="dateTime">2023-06-06T15:53:21Z</created_at>
<updated_at type="dateTime">2023-06-06T15:53:21Z</updated_at>
</certificate>
</certificates>
Retrieve an ordered and paginated list of all certificates in the authenticated environment.
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) |
Response Body
Notable response elements include:
Element | Description |
---|---|
certificates | Root element |
❯ algorithm | The encryption algorithm used to create the key pair |
❯ cn | The certificate common name |
❯ o | The organization |
❯ ou | The organization unit |
❯ c | The country |
❯ st | The state |
❯ l | The locality or city |
❯ email_address | The email address |
❯ public_key | PEM-formatted public key value |
❯ public_key_hash | The base64 encoded, SHA256 hash, of the public key |
❯ csr | PEM formatted certificate signing request (CSR) |
❯ pem | The signed certificate in PEM format, if it has been set on this certificate |
Create certificate
POST /v1/certificates.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"certificate": {
"pem": "-----BEGIN CERTIFICATE-----\nMIIDMDCCAhgCCQCJjV5tUn0DNTANBgkqhkiG9w0BAQsFADBaMTMwMQYDVQQDDCpN\neUFwcCBYTUwgU2lnbmF0dXJlIFByb2R1Y3Rpb24gQ2VydGlmaWNhdGUxIzAhBgkq\nhkiG9w0BCQEWFHNlY3VyaXR5QHlvdXJvcmcuY29tMB4XDTE5MDQwMjE4MjIzMFoX\nDTIwMDQwMTE4MjIzMFowWjEzMDEGA1UEAwwqTXlBcHAgWE1MIFNpZ25hdHVyZSBQ\ncm9kdWN0aW9uIENlcnRpZmljYXRlMSMwIQYJKoZIhvcNAQkBFhRzZWN1cml0eUB5\nb3Vyb3JnLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQo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b0j87kJV8JsHMvk3qbbunWHisQr23U4Vl/k6rjkodryrzDrwQ3czzR3nlKN/Kl
VROR8TMBAoGBAOmi434+RbZQP9PdVEa+pEh2IA81L3og6+TqemL4sZtqlCEfrOZD
FsSH6CEU13SMn7l+riYCzBYSdvPDAynhJp+u0REUQFPJAMcgefxw2mfJwFrtn9Ap
JWaAPhcMeK8l/5rdZxnjECDRAkW+5SdtYj9x6rjgsmJ89DFdd5EW1JL/AoGBANyj
vpNSRBdy+lM62T0DiAJ6gc0HpYQpNzIydIT9bh8zkmwU5z0pVtczpmIzdK0lPlHO
ERWgBXXsfRfEupVoFND9H5A7tTMQtJF4rLg3gUpa2alTUXSWfm9uS7TWVRYR7hsV
/ui7oW3zIXdD8dRHozITSzM27gfiMy6Q3I/SIGeBAoGAf0lgObJBlq8n5wxpUtWg
eV3p338xa48uFZxtqygk0zCAnX89WoHokJAeto89RuEqUAwlYs4ZVFkg93MicRma
SlsayfxHg545z0LxUshFJVB0fNWDQQx5tNtfeH0x7vJ7zGqdNixP6CEW5Nq4y/87
DKfKoojAhwnenFp4vtI6ZA8CgYBqTvcvEo8+YSbd3Vf4fvAUiaRq/okwgY9Xv1nH
Djj2Dao6K2QzYuy1qew8GqDYID7Dua8fpUecRwMK5b4k6M5G1/9SRoKLBTyLbwKB
jDTed6GyZTO1IiHvXMxbaH38sUzxfgqhZm5khKYWSgWGC7JFGWi9V3UfFU0l3aR4
I317gQKBgQCxWrKZlfq/iWcvBqB8Ep4wiJPXZXjl/Dvic/2pCC69MMimtDTHQ8o8
gp7c3Fp+RDO8U5wgqq2amodR1RPbAdgG7rQvewnzPsaTIKSfOueY3LG4UR22tNvZ
LeaSV7WUssler/Ybk6Gj+psx8RXbL+ZcYPoeL7mb6kUoWFfzcmpIjA==
-----END RSA PRIVATE KEY-----
</private_key>
</certificate>
HTTPS/1.1 201 Created
{
"certificate": {
"token": "VRYbo8zKRpCSTgMvfPuBOpeyN5n",
"algorithm": null,
"cn": "MyApp XML Signature Production Certificate",
"o": null,
"ou": null,
"c": null,
"st": null,
"l": null,
"email_address": "security@yourorg.com",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyV1sJK9aNE76M4H2k5t5\nHNVTdCqmxFMf1HDufcueK49t1sj3wG9psZXPBan6cLJEy7bVo2QIl/NQDwaC5vDg\nIiJKIz+KwxeF1q+0it2cutxURjWY4ycxs/WuOJewSHIML+GZhzhX0nJ8xCiJKzyf\nxoBdlATrlMI70Gcgqmv5Xh7D+CR65ynIuU8J3YMRn7bhojcueWJD8AEh01KVBfji\nfno1f2W6Lj6euxvwiapaMTZioHe8uH4geOVw5WIuI3uLsR5RNuLT/q/Ft0SIwuev\nfp6odCkAC69AIvttPEfqGcqNn+F0fLRnn2Ad+YRsipuOYefWBPmw+SFikxvkliKr\nfwIDAQAB\n-----END PUBLIC KEY-----\n",
"public_key_hash": "dnb3kyfglEbIgOB5wK6VfggYZFNU1q1Ms7sJn/6cjRc=",
"csr": null,
"pem": "-----BEGIN CERTIFICATE-----\nMIIDMDCCAhgCCQCJjV5tUn0DNTANBgkqhkiG9w0BAQsFADBaMTMwMQYDVQQDDCpN\neUFwcCBYTUwgU2lnbmF0dXJlIFByb2R1Y3Rpb24gQ2VydGlmaWNhdGUxIzAhBgkq\nhkiG9w0BCQEWFHNlY3VyaXR5QHlvdXJvcmcuY29tMB4XDTE5MDQwMjE4MjIzMFoX\nDTIwMDQwMTE4MjIzMFowWjEzMDEGA1UEAwwqTXlBcHAgWE1MIFNpZ25hdHVyZSBQ\ncm9kdWN0aW9uIENlcnRpZmljYXRlMSMwIQYJKoZIhvcNAQkBFhRzZWN1cml0eUB5\nb3Vyb3JnLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMldbCSv\nWjRO+jOB9pObeRzVU3QqpsRTH9Rw7n3LniuPbdbI98BvabGVzwWp+nCyRMu21aNk\nCJfzUA8Ggubw4CIiSiM/isMXhdavtIrdnLrcVEY1mOMnMbP1rjiXsEhyDC/hmYc4\nV9JyfMQoiSs8n8aAXZQE65TCO9BnIKpr+V4ew/gkeucpyLlPCd2DEZ+24aI3Lnli\nQ/ABIdNSlQX44n56NX9lui4+nrsb8ImqWjE2YqB3vLh+IHjlcOViLiN7i7EeUTbi\n0/6vxbdEiMLnr36eqHQpAAuvQCL7bTxH6hnKjZ/hdHy0Z59gHfmEbIqbjmHn1gT5\nsPkhYpMb5JYiq38CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAGNjf8tNsQ/mvQNk4\n3b4knwlCIT6elhiofeKXoV9224C5ZcM1bw0hRfeEIXG5fs8ZEwlLGAS+bNgCctmW\nNcuqxEreR4TiV07WT/18m1go+34IygGxlxgntLQOZQyX6mjVyZjgOjefweA8OFyG\ns+xqgVuR9G7Zu8KFW0MaCj7QZBl1h4FfA3Hz25R1WC2qcbY04Db3EkLYPU4hBEzX\nHXkAyW5LWRk4pzxew9CRQ+uHyumPyi2O6Yv9avI9QA5PkuRoH0xgQ87n3AXgQ08p\nHDoiNxcDFhfL13lspowI40bsOWfGm2vvTrV42PvobHB2Hwb3a77mM2Z6bCvdN32R\njn30kQ==\n-----END CERTIFICATE-----\n",
"created_at": "2019-04-03T21:12:44Z",
"updated_at": "2019-04-03T21:12:44Z"
}
}
<certificate>
<token>L3N4RoaY9gb7mlctO4SoOQ7oa0u</token>
<algorithm nil="true"></algorithm>
<cn>MyApp XML Signature Production Certificate</cn>
<o nil="true"></o>
<ou nil="true"></ou>
<c nil="true"></c>
<st nil="true"></st>
<l nil="true"></l>
<email_address>security@yourorg.com</email_address>
<public_key>-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyV1sJK9aNE76M4H2k5t5
HNVTdCqmxFMf1HDufcueK49t1sj3wG9psZXPBan6cLJEy7bVo2QIl/NQDwaC5vDg
IiJKIz+KwxeF1q+0it2cutxURjWY4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mHn1gT5
sPkhYpMb5JYiq38CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAGNjf8tNsQ/mvQNk4
3b4knwlCIT6elhiofeKXoV9224C5ZcM1bw0hRfeEIXG5fs8ZEwlLGAS+bNgCctmW
NcuqxEreR4TiV07WT/18m1go+34IygGxlxgntLQOZQyX6mjVyZjgOjefweA8OFyG
s+xqgVuR9G7Zu8KFW0MaCj7QZBl1h4FfA3Hz25R1WC2qcbY04Db3EkLYPU4hBEzX
HXkAyW5LWRk4pzxew9CRQ+uHyumPyi2O6Yv9avI9QA5PkuRoH0xgQ87n3AXgQ08p
HDoiNxcDFhfL13lspowI40bsOWfGm2vvTrV42PvobHB2Hwb3a77mM2Z6bCvdN32R
jn30kQ==
-----END CERTIFICATE-----
</pem>
<created_at type="dateTime">2019-04-03T21:12:43Z</created_at>
<updated_at type="dateTime">2019-04-03T21:12:43Z</updated_at>
</certificate>
Add a certificate to the authenticated environment for use in payment method distribution functions such as XML digital signatures.
Request Body
Element | Description |
---|---|
certificate | Root element |
❯ pem required |
The signed certificate in PEM format |
❯ private_key | The certificate’s RSA or EC private key, in non-password-protected PEM format |
❯ level optional |
This is an optional parameter for organizational level certificate configuration; the value is set to environment by default but you can pass in organization for certificates shared across aunthenticated environments for the same organization. |
Response Body
Notable response elements include:
Element | Description |
---|---|
certificate | Root element |
❯ public_key | PEM-formatted public key of the certificate |
❯ public_key_hash | The base64 encoded, SHA256 hash, of the public key |
❯ csr | PEM formatted certificate signing request (CSR) |
❯ pem | The signed certificate in PEM format |
Generate certificate
POST /v1/certificates/generate.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"certificate": {
"algorithm": "ec-prime256v1",
"cn": "MyApp ApplePay Production Certificate",
"email_address": "security@yourorg.com"
}
}
<certificate>
<algorithm>ec-prime256v1</algorithm>
<cn>MyApp ApplePay Production Certificate</cn>
<email_address>security@yourorg.com</email_address>
</certificate>
HTTPS/1.1 201 Created
{
"certificate": {
"token": "65ZDETqI5decVMjVMyR5ckhaO9I",
"algorithm": "ec-prime256v1",
"cn": "MyApp ApplePay Production Certificate",
"o": null,
"ou": null,
"c": null,
"st": null,
"l": null,
"email_address": "security@yourorg.com",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoQsY700wd1Vz8LzVDmH2ts4rYRRh\nk751oz+yW/2U2oe29yWrPJA5oLHZw8L7P8qmuyzuoFOjNxRlTypTyCFuag==\n-----END PUBLIC KEY-----\n",
"public_key_hash": "DkI5At7x9GHqoLfgANfHiL7/+S5CzxAmHOe09T6ubNg=",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ\nMAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv\ndXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoQsY700wd1Vz8LzV\nDmH2ts4rYRRhk751oz+yW/2U2oe29yWrPJA5oLHZw8L7P8qmuyzuoFOjNxRlTypT\nyCFuaqAAMAoGCCqGSM49BAMCA0gAMEUCIQDQgWnEgXLY45qGTqcwBOxvm8O5Qku+\nVPv3E+rX1J+oIQIgHK7KFPV2qb8D5WKP5LXG9Nla1Pw2cTCy0x7t8+4Kf7c=\n-----END CERTIFICATE REQUEST-----\n",
"pem": null,
"created_at": "2019-03-20T19:49:29Z",
"updated_at": "2019-03-20T19:49:29Z"
}
}
<certificate>
<token>XAJBkzmrXn4MjIzxpQ4KxVlULpi</token>
<algorithm>ec-prime256v1</algorithm>
<cn>MyApp ApplePay Production Certificate</cn>
<o nil="true"></o>
<ou nil="true"></ou>
<c nil="true"></c>
<st nil="true"></st>
<l nil="true"></l>
<email_address>security@yourorg.com</email_address>
<public_key>-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqkKCYmP9oiOErYBfHacG5TKUtW7h
H5GQW3Pr2mcxo+pHoxjIhKQj/OtUlP7EnfbSZipSOrai+3FmFc8CueUP4Q==
-----END PUBLIC KEY-----
</public_key>
<public_key_hash>ZWO9uQKXq69UnSQjE93slmfBFGmMzvKopcR9X2xR/ws=</public_key_hash>
<csr>-----BEGIN CERTIFICATE REQUEST-----
MIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv
biBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ
MAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv
dXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqkKCYmP9oiOErYBf
HacG5TKUtW7hH5GQW3Pr2mcxo+pHoxjIhKQj/OtUlP7EnfbSZipSOrai+3FmFc8C
ueUP4aAAMAoGCCqGSM49BAMCA0gAMEUCIFZPBNLZ1LyXU/COBYnXVMpe4xDKtIr6
/nDF+TH94r0hAiEAn4qwUb4q326hHsg6O2nflm97ZPUgY7yFrVHFfpDM24w=
-----END CERTIFICATE REQUEST-----
</csr>
<pem nil="true"></pem>
<created_at type="dateTime">2019-03-20T19:53:24Z</created_at>
<updated_at type="dateTime">2019-03-20T19:53:24Z</updated_at>
</certificate>
Generate a new SSL keypair and certificate signing request (CSR).
Since Spreedly is not a certificate authority we cannot issue trusted certificates. Instead, it is intended that you will get the certificate signed by your certificate authority (or sign it yourself) and update the certificate record at Spreedly with the final and signed cert.
Request Body
Element | Description |
---|---|
certificate | Root element |
❯ algorithm required |
The encryption algorithm to use when creating the key pair. Currently, the only supported options are ec-prime256v1 representing the X9.62/SECG curve over a 256 bit prime field, or rsa-2048 , which uses a 2048-bit RSA key. |
❯ cn required |
The certificate common name |
❯ o | The organization |
❯ ou | The organization unit |
❯ c | The country |
❯ st | The state |
❯ l | The locality or city |
❯ email_address | The email address |
Response Body
Notable response elements include:
Element | Description |
---|---|
certificate | Root element |
❯ public_key | PEM-formatted public key of the certificate |
❯ public_key_hash | The base64 encoded, SHA256 hash, of the public key |
❯ csr | PEM formatted certificate signing request (CSR) |
❯ pem | The signed certificate in PEM format. This value will be empty on initial certificate generation. |
Update certificate
PUT /v1/certificates/<certificate_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"certificate": {
"pem": "-----BEGIN CERTIFICATE-----\nMIIEiTCCBC6gAwIBAgIIFRZ9ouKAzqwwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMM\nK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAk\nBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApB\ncHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNTAyMTkyMDMzMzBaFw0xNzAzMjAy\nMDMzMzBaMIG5MTowOAYKCZImiZPyLGQBAQwqbWVyY2hhbnQuY29tLnNlYXRnZWVr\nLlNwcmVlZGx5QXBwbGVQYXlUZXN0MUAwPgYDVQQDDDdNZXJjaGFudCBJRDogbWVy\nY2hhbnQuY29tLnNlYXRnZWVrLlNwcmVlZGx5QXBwbGVQYXlUZXN0MRMwEQYDVQQL\nDAo5QjNRWTlXQlo1MRcwFQYDVQQKDA5TZWF0R2VlaywgSW5jLjELMAkGA1UEBhMC\nVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQhoBD6FaOXUJq3e4EoI7rWemTz\nhLaPlAdF87WzmbhWKVNJ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RhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlLCBjZXJ0
aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRpZmljYXRpb24gcHJhY3RpY2Ugc3RhdGVt
ZW50cy4wNgYIKwYBBQUHAgEWKmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj
YXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl
LmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk
BiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG
Q0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD
Q87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0
LDW0aLigLHbDgQcrXA==
-----END CERTIFICATE-----
]]>
</pem>
</certificate>
HTTPS/1.1 200 OK
{
"certificate": {
"token": "BHD5mnpizTjP9NhlQqUuIMs8qFF",
"algorithm": "ec-prime256v1",
"cn": "MyApp ApplePay Production Certificate",
"o": null,
"ou": null,
"c": null,
"st": null,
"l": null,
"email_address": "security@yourorg.com",
"public_key": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIaAQ+hWjl1Cat3uBKCO61npk84S2\nj5QHRfO1s5m4VilTSfSwBIawYwLY+orO+uTsNnZ2LWtEDxfRCaLm8Cjoyg==\n-----END PUBLIC KEY-----\n",
"public_key_hash": "/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI=",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSTCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0Z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token>BHD5mnpizTjP9NhlQqUuIMs8qFF</token>
<algorithm>ec-prime256v1</algorithm>
<cn>MyApp ApplePay Production Certificate</cn>
<o nil="true"></o>
<ou nil="true"></ou>
<c nil="true"></c>
<st nil="true"></st>
<l nil="true"></l>
<email_address>security@yourorg.com</email_address>
<public_key>-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIaAQ+hWjl1Cat3uBKCO61npk84S2
j5QHRfO1s5m4VilTSfSwBIawYwLY+orO+uTsNnZ2LWtEDxfRCaLm8Cjoyg==
-----END PUBLIC KEY-----
</public_key>
<public_key_hash>/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI=</public_key_hash>
<csr>-----BEGIN CERTIFICATE REQUEST-----
MIIBSTCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv
biBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ
MAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv
dXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0fpMDOVsNWh56lzY
LLT8AUv77xfxIDEH0EvVcoDIGjO1wHwrUhp/p8kSVXYEt5i+jzE7UHEUNwrD5YtC
7i64hKAAMAoGCCqGSM49BAMCA0kAMEYCIQD0qoJM4EKR9DT6AIHNMm7I0Hwzu3rp
u7CIFgdchCsNeQIhANCstbvSt7ZwQY4abRS9GiTlFn3vGGjwGdeeXb0RmxGg
-----END CERTIFICATE REQUEST-----
</csr>
<pem>-----BEGIN CERTIFICATE-----
MIIEiTCCBC6gAwIBAgIIFRZ9ouKAzqwwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMM
K0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAk
B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YBBQUHAgEWKmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj
YXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl
LmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk
BiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG
Q0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD
Q87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0
LDW0aLigLHbDgQcrXA==
-----END CERTIFICATE-----
</pem>
<created_at type="dateTime">2017-06-27T18:16:35Z</created_at>
<updated_at type="dateTime">2017-07-27T17:54:24Z</updated_at>
</certificate>
Update an existing SSL certificate record with the signed certificate value (in PEM format).
URL Parameters
Parameter | Description |
---|---|
certificate_token required |
A unique string generated by Spreedly to identify a certificate. |
format required |
One of json or xml |
Request Body
Parameter | Description |
---|---|
certificate | Root element |
❯ pem required |
The signed certificate in PEM format. Spreedly is not a certificate authority and, thusly, will not sign the certificate for you. It is your responsibility to take the CSR to your certificate authority, and then update the certificate record with the signed cert in PEM format. |
Response Body
Notable response elements include:
Element | Description |
---|---|
certificate | Root element |
❯ algorithm | The encryption algorithm used to create the key pair |
❯ cn | The certificate common name |
❯ o | The organization |
❯ ou | The organization unit |
❯ c | The country |
❯ st | The state |
❯ l | The locality or city |
❯ email_address | The email address |
❯ public-key | PEM-formatted public key value |
❯ csr | PEM formatted certificate signing request |
❯ pem | The signed certificate in PEM format. Spreedly is not a certificate authority and, thusly, will not sign the certificate for you. It is your responsibility to take the CSR to your certificate authority (or self-sign the cert), and then update the certificate record with the signed cert in PEM format. |
Transactions
Every action performed against the Spreedly API is captured as a transaction. Transactions can represent local actions, such as storing a payment method, or an external action, such as performing a purchase against a gateway. Any interaction that creates or updates information via the Spreedly API, or sends information to a third party such as a gateway or receiver, will generate a Transaction.
Confirm (Offsite transactions)
Attempts to confirm a pending offsite purchase, offsite synchronous purchase or offsite synchronous authorization.
Braintree
- A
processing
transaction with apayment_method_type
of ‘paypal’ or 'venmo’ is needed to confirm this transaction. - A object returned in iFrame. This could contain the following parameters;
state
,nonce
,payment_method
,device_date
,username
Please see our Braintree APM section for more information and reference implementations.
Stripe
For Stripe this offsite purchase is using APMs with a card payment.
- A pending transaction with a
payment_method
of type 'stripe_apm’ is needed to confirm this transaction. - A
payment_method_token
or credit card details in apayment_method
object must be passed.
Please see our Stripe APM guide for more information and reference implementations.
POST /v1/transactions/D4EkbtWlUtWmfK5QvhttGsBktRj/confirm.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6"
}
}
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2018-11-07T15:01:45Z",
"updated_at": "2018-11-07T15:01:45Z",
"succeeded": true,
"state": "succeeded",
"token": "a8CseM5RdIhHQwsgCKTZLi9UhSo",
"transaction_type": "Purchase",
"order_id": null,
"ip": null,
"sub_merchant_key": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "49",
"gateway_latency_ms": 0,
"amount": 100,
"currency_code": "USD",
"retain_on_success": false,
"payment_method_added": true,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful purchase",
"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": "2018-11-07T15:01:45Z",
"updated_at": "2018-11-07T15:01:45Z"
},
"shipping_address": {
"name": "Joe Smith",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
}
],
"payment_method": {
"token": "ZjcXez8r5tOkQ4wjXDCv5lZ6pKg",
"created_at": "2018-11-07T15:01:45Z",
"updated_at": "2018-11-07T15:01:45Z",
"email": null,
"data": null,
"storage_state": "cached",
"test": true,
"metadata": null,
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "Joe",
"last_name": "Smith",
"month": 12,
"year": 2018,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "Joe Smith",
"eligible_for_card_updater": null,
"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",
"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>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2018-11-07T15:01:44Z</created_at>
<updated_at type="dateTime">2018-11-07T15:01:44Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>HlOybss40Zr3hwCqqwRKBlYmXsi</token>
<transaction_type>Purchase</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<sub_merchant_key nil="true"></sub_merchant_key>
<description nil="true"></description>
<email nil="true"></email>
<merchant_name_descriptor nil="true"></merchant_name_descriptor>
<merchant_location_descriptor nil="true"></merchant_location_descriptor>
<gateway_specific_fields nil="true"></gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>47</gateway_transaction_id>
<gateway_latency_ms type="integer">0</gateway_latency_ms>
<amount type="integer">100</amount>
<currency_code>USD</currency_code>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">true</payment_method_added>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<shipping_address>
<name>Joey Jones</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>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful purchase</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2018-11-07T15:01:44Z</created_at>
<updated_at type="dateTime">2018-11-07T15:01:44Z</updated_at>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>TtdNEGumPZzS7RWBiwj4ejLpHbd</token>
<created_at type="dateTime">2018-11-07T15:01:44Z</created_at>
<updated_at type="dateTime">2018-11-07T15:01:44Z</updated_at>
<email nil="true"></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>Joey</first_name>
<last_name>Jones</last_name>
<month type="integer">3</month>
<year type="integer">2020</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>Joey Jones</full_name>
<eligible_for_card_updater nil="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>
<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>
Request Body
Element | Description |
---|---|
transaction | Root request element |
❯ payment_method_token required |
The token of the payment method to use |
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. |
❯ sca_authentication | The details of the SCA Authentication transaction created if performing a Spreedly Global 3DS2 transaction. See the SCA Authentication Show details for more information on this object. |
BIN metadata is available in the response if the card is enrolled in Advanced Vault. See BIN metadata for more information.
Complete (3DS 2)
Attempts to complete or advance a pending 3DS 2 transaction. We require merchants to make authenticated calls to this endpoint in response to certain Spreedly.ThreeDS.Lifecycle
events being emitted:
- A pending transaction with a
required_action
ofdevice_fingerprint
will fire atrigger-completion
event when the transaction status was updated due to a callback in the cardholder’s iFrame or when 10 seconds have elapsed. When this event is received, it is necessary to callcomplete
so that the latest transaction state can be retrieved in case of a timeout. - A pending transaction with a
required_action
ofchallenge
will fire afinalization-timeout
when ourSpreedly.ThreeDS.Lifecycle
stops polling for updates after 10-15 minutes of not receiving a new status. When this event is received, it is recommended that merchants callcomplete
so that the transaction state can be updated due to cardholder abandonment or missed callbacks.
Please see our 3DS 2 guides for more information and reference implementations.
POST /v1/transactions/D4EkbtWlUtWmfK5QvhttGsBktRj/complete.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2021-06-01T16:14:14Z",
"updated_at": "2021-06-01T16:14:14Z",
"succeeded": true,
"state": "succeeded",
"token": "WYWKUodgezds18eT6xdWde6TIQ6",
"transaction_type": "Authorization",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "55",
"gateway_latency_ms": 0,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"warning": null,
"application_id": null,
"amount": 100,
"currency_code": "USD",
"retain_on_success": false,
"payment_method_added": false,
"smart_routed": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful authorize",
"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": "2021-06-01T16:14:14Z",
"updated_at": "2021-06-01T16:14:14Z"
},
"shipping_address": {
"name": "Newfirst Newlast",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2021-06-01T16:14: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"
},
"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,
"payment_method_type": "credit_card",
"errors": [
],
"fingerprint": "e3cef43464fc832f6e04f187df25af497994",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2021-06-01T16:14:13Z</created_at>
<updated_at type="dateTime">2021-06-01T16:14:13Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>KMRQGOgdSGyyCOimswKxSpXFG6O</token>
<transaction_type>Purchase</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<description nil="true"></description>
<email nil="true"></email>
<merchant_name_descriptor nil="true"></merchant_name_descriptor>
<merchant_location_descriptor nil="true"></merchant_location_descriptor>
<merchant_profile_key nil="true"></merchant_profile_key>
<gateway_specific_fields nil="true"></gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>50</gateway_transaction_id>
<gateway_latency_ms type="integer">0</gateway_latency_ms>
<stored_credential_initiator nil="true"></stored_credential_initiator>
<stored_credential_reason_type nil="true"></stored_credential_reason_type>
<warning nil="true"></warning>
<application_id nil="true"></application_id>
<amount type="integer">100</amount>
<currency_code>USD</currency_code>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">false</payment_method_added>
<smart_routed type="boolean">false</smart_routed>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<shipping_address>
<name>Newfirst Newlast</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>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful purchase</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2021-06-01T16:14:13Z</created_at>
<updated_at type="dateTime">2021-06-01T16:14:13Z</updated_at>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at>2017-06-26T17:04:38Z</created_at>
<updated_at>2021-06-01T16:14:13Z</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>
<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>
<attempt_3dsecure type="boolean">false</attempt_3dsecure>
</transaction>
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying the 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 |
❯ transaction_type | The type of transaction, e.g., Authorization , Capture , Credit |
❯ merchant_profile_key | The token of the Merchant Profile associated with the gateway used for the transaction |
❯ required_action | The required action in the 3DS 2 flow, e.g., none , device_fingerprint , challenge , etc |
List
GET /v1/transactions.<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
{
"transactions": [
{
"token": "XWV55noINCMAAjXhr1ppj0kjvCd",
"created_at": "2017-06-22T13:19:11Z",
"updated_at": "2017-06-22T13:19:11Z",
"succeeded": true,
"transaction_type": "AddGateway",
"state": "succeeded",
"gateway": {
"token": "CtehwikoMnllHsr3XFfAY1EzPkN",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2017-06-22T13:19:11Z",
"updated_at": "2017-11-27T21:08:11Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
},
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!"
},
{
"token": "Xqdiohe6ue8Zgb7I52j6BA843Y1",
"created_at": "2017-06-22T14:16:23Z",
"updated_at": "2017-06-22T14:16:23Z",
"succeeded": true,
"transaction_type": "AddGateway",
"state": "succeeded",
"gateway": {
"token": "7NTzuQfnaNU2Jr4cVgOt7jfTVGq",
"gateway_type": "test",
"description": null,
"merchant_profile_key": null,
"sub_merchant_key": null,
"payment_methods": [
"credit_card",
"sprel",
"third_party_token",
"bank_account",
"apple_pay",
"google_pay"
],
"state": "retained",
"created_at": "2017-06-22T14:16:23Z",
"updated_at": "2017-11-27T21:44:49Z",
"name": "Spreedly Test",
"characteristics": [
"purchase",
"authorize",
"capture",
"credit",
"general_credit",
"void",
"adjust",
"verify",
"reference_purchase",
"purchase_via_preauthorization",
"offsite_purchase",
"offsite_authorize",
"offsite_synchronous_purchase",
"offsite_synchronous_authorize",
"3dsecure_purchase",
"3dsecure_authorize",
"3dsecure_2_mpi_purchase",
"3dsecure_2_mpi_authorize",
"store",
"remove",
"network_tokenization",
"populate_mit_fields",
"transaction_retry",
"reference_authorization",
"3dsecure_2_purchase",
"3dsecure_2_authorize",
"stored_credentials"
],
"credentials": [
],
"gateway_settings": {
},
"gateway_specific_fields": [
"simulate_error",
"simulate_decline",
"idempotency_key",
"mit_override_demo"
],
"redacted": false,
"sandbox": false,
"mode": "default"
},
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!"
}
]
}
<transactions>
<transaction>
<token>XWV55noINCMAAjXhr1ppj0kjvCd</token>
<created_at type="dateTime">2017-06-22T13:19:11Z</created_at>
<updated_at type="dateTime">2017-06-22T13:19:11Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddGateway</transaction_type>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway>
<token>CtehwikoMnllHsr3XFfAY1EzPkN</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2017-06-22T13:19:11Z</created_at>
<updated_at type="dateTime">2017-11-27T21:08:11Z</updated_at>
</gateway>
</transaction>
<transaction>
<token>Xqdiohe6ue8Zgb7I52j6BA843Y1</token>
<created_at type="dateTime">2017-06-22T14:16:23Z</created_at>
<updated_at type="dateTime">2017-06-22T14:16:23Z</updated_at>
<succeeded type="boolean">true</succeeded>
<transaction_type>AddGateway</transaction_type>
<state>succeeded</state>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway>
<token>7NTzuQfnaNU2Jr4cVgOt7jfTVGq</token>
<gateway_type>test</gateway_type>
<name>Spreedly Test</name>
<description nil="true"></description>
<merchant_profile_key nil="true"></merchant_profile_key>
<sub_merchant_key nil="true"></sub_merchant_key>
<characteristics>
<supports_purchase type="boolean">true</supports_purchase>
<supports_authorize type="boolean">true</supports_authorize>
<supports_capture type="boolean">true</supports_capture>
<supports_credit type="boolean">true</supports_credit>
<supports_general_credit type="boolean">true</supports_general_credit>
<supports_void type="boolean">true</supports_void>
<supports_adjust type="boolean">true</supports_adjust>
<supports_verify type="boolean">true</supports_verify>
<supports_reference_purchase type="boolean">true</supports_reference_purchase>
<supports_purchase_via_preauthorization type="boolean">true</supports_purchase_via_preauthorization>
<supports_offsite_purchase type="boolean">true</supports_offsite_purchase>
<supports_offsite_authorize type="boolean">true</supports_offsite_authorize>
<supports_offsite_synchronous_purchase type="boolean">true</supports_offsite_synchronous_purchase>
<supports_offsite_synchronous_authorize type="boolean">true</supports_offsite_synchronous_authorize>
<supports_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
<supports_3dsecure_authorize type="boolean">true</supports_3dsecure_authorize>
<supports_3dsecure_2_mpi_purchase type="boolean">true</supports_3dsecure_2_mpi_purchase>
<supports_3dsecure_2_mpi_authorize type="boolean">true</supports_3dsecure_2_mpi_authorize>
<supports_store type="boolean">true</supports_store>
<supports_remove type="boolean">true</supports_remove>
<supports_fraud_review type="boolean">false</supports_fraud_review>
<supports_network_tokenization type="boolean">true</supports_network_tokenization>
<supports_populate_mit_fields type="boolean">true</supports_populate_mit_fields>
<supports_inquire_by_gateway_transaction_id type="boolean">false</supports_inquire_by_gateway_transaction_id>
<supports_inquire_by_order_id type="boolean">false</supports_inquire_by_order_id>
<supports_transaction_retry type="boolean">true</supports_transaction_retry>
<supports_stored_stored_credentials type="boolean">false</supports_stored_stored_credentials>
<supports_reference_authorization type="boolean">true</supports_reference_authorization>
<supports_3dsecure_2_purchase type="boolean">true</supports_3dsecure_2_purchase>
<supports_3dsecure_2_authorize type="boolean">true</supports_3dsecure_2_authorize>
<supports_stored_credentials type="boolean">true</supports_stored_credentials>
</characteristics>
<credentials>
</credentials>
<gateway_settings>
</gateway_settings>
<gateway_specific_fields>
<gateway_specific_field>simulate_error</gateway_specific_field>
<gateway_specific_field>simulate_decline</gateway_specific_field>
<gateway_specific_field>idempotency_key</gateway_specific_field>
<gateway_specific_field>mit_override_demo</gateway_specific_field>
</gateway_specific_fields>
<payment_methods>
<payment_method>credit_card</payment_method>
<payment_method>sprel</payment_method>
<payment_method>third_party_token</payment_method>
<payment_method>bank_account</payment_method>
<payment_method>apple_pay</payment_method>
<payment_method>google_pay</payment_method>
</payment_methods>
<state>retained</state>
<redacted type="boolean">false</redacted>
<sandbox type="boolean">false</sandbox>
<mode>default</mode>
<created_at type="dateTime">2017-06-22T14:16:23Z</created_at>
<updated_at type="dateTime">2017-11-27T21:44:49Z</updated_at>
</gateway>
</transaction>
</transactions>
Retrieve an ordered and paginated list of all transactions in the authenticated environment.
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) |
state | The transaction state on which to filter the returned list. Can be one of succeeded , failed , gateway_processing_failed , gateway_processing_result_unknown . |
count | The number of transactions to return. By default returns 20, maximum allowed is 100. |
Response Body
Notable response elements include:
Element | Description |
---|---|
transactions | Root element |
❯ token | The token uniquely identifying the 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 |
❯ transaction_type | The type of transaction, e.g., Authorization , Capture , Credit |
Show
GET /v1/transactions/D4EkbtWlUtWmfK5QvhttGsBktRj.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2021-06-01T16:14:14Z",
"updated_at": "2021-06-01T16:14:14Z",
"succeeded": true,
"state": "succeeded",
"token": "WYWKUodgezds18eT6xdWde6TIQ6",
"transaction_type": "Authorization",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_specific_response_fields": {
},
"gateway_transaction_id": "55",
"gateway_latency_ms": 0,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"warning": null,
"application_id": null,
"amount": 100,
"currency_code": "USD",
"retain_on_success": false,
"payment_method_added": false,
"smart_routed": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "test",
"response": {
"success": true,
"message": "Successful authorize",
"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": "2021-06-01T16:14:14Z",
"updated_at": "2021-06-01T16:14:14Z"
},
"shipping_address": {
"name": "Newfirst Newlast",
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "1rpKvP8zOUhj4Y9EDrIoIYQzzD5",
"created_at": "2017-06-26T17:04:38Z",
"updated_at": "2021-06-01T16:14: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"
},
"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,
"payment_method_type": "credit_card",
"errors": [
],
"fingerprint": "e3cef43464fc832f6e04f187df25af497994",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2021-06-01T16:14:13Z</created_at>
<updated_at type="dateTime">2021-06-01T16:14:13Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>KMRQGOgdSGyyCOimswKxSpXFG6O</token>
<transaction_type>Purchase</transaction_type>
<order_id nil="true"></order_id>
<ip nil="true"></ip>
<description nil="true"></description>
<email nil="true"></email>
<merchant_name_descriptor nil="true"></merchant_name_descriptor>
<merchant_location_descriptor nil="true"></merchant_location_descriptor>
<merchant_profile_key nil="true"></merchant_profile_key>
<gateway_specific_fields nil="true"></gateway_specific_fields>
<gateway_specific_response_fields>
</gateway_specific_response_fields>
<gateway_transaction_id>50</gateway_transaction_id>
<gateway_latency_ms type="integer">0</gateway_latency_ms>
<stored_credential_initiator nil="true"></stored_credential_initiator>
<stored_credential_reason_type nil="true"></stored_credential_reason_type>
<warning nil="true"></warning>
<application_id nil="true"></application_id>
<amount type="integer">100</amount>
<currency_code>USD</currency_code>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">false</payment_method_added>
<smart_routed type="boolean">false</smart_routed>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>test</gateway_type>
<shipping_address>
<name>Newfirst Newlast</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>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>Successful purchase</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2021-06-01T16:14:13Z</created_at>
<updated_at type="dateTime">2021-06-01T16:14:13Z</updated_at>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>1rpKvP8zOUhj4Y9EDrIoIYQzzD5</token>
<created_at>2017-06-26T17:04:38Z</created_at>
<updated_at>2021-06-01T16:14:13Z</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>
<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>
<attempt_3dsecure type="boolean">false</attempt_3dsecure>
</transaction>
Get the transaction with the given token.
Any interaction that creates or updates information via the Spreedly API, or sends information to a third party such as a gateway or receiver, will generate a corresponding transaction record that may be viewed by submitting its transaction_token
. This may be viewable in the body of the original response or by retrieving it from the Transactions List in the dashboard.
URL Parameters
Parameter | Description |
---|---|
transaction_token required |
The token identifying this transaction at Spreedly |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ token | The token uniquely identifying the 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 |
❯ transaction_type | The type of transaction. |
❯ merchant_profile_key | The token of the Merchant Profile associated with the gateway used for the transaction |
Update
PATCH /v1/transactions/Rs0JRsByYUEPqh3wL0hPzG6oBcW.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": false,
"created_at": "2022-11-04T17:15:05Z",
"updated_at": "2022-11-04T17:15:05Z",
"succeeded": true,
"state": "succeeded",
"token": "2AhGXGZpm5IqetB3PHHId7hH12s",
"transaction_type": "UpdateTransaction",
"original_transaction_updated": true,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "example_gateway_brand",
"original_transaction": {
"on_test_gateway": false,
"created_at": "2022-10-27T14:55:46Z",
"updated_at": "2022-10-27T14:55:50Z",
"succeeded": true,
"state": "succeeded",
"token": "Rs0JRsByYUEPqh3wL0hPzG6oBcW",
"transaction_type": "Purchase",
"order_id": "44837",
"gateway_transaction_id": "1309352841",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "T11bJAANtTWnxl36GYjKWvbNK0g",
"gateway_type": "example_gateway_brand",
"response": {
"success": true,
"message": "purchase complete",
"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-10-27T14:55:47Z",
"updated_at": "2022-10-27T14:55:50Z"
}
}
}
}
<transaction>
<on_test_gateway type="boolean">false</on_test_gateway>
<created_at type="dateTime">2022-11-04T17:15:05Z</created_at>
<updated_at type="dateTime">2022-11-04T17:15:05Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>2AhGXGZpm5IqetB3PHHId7hH12s</token>
<transaction_type>UpdateTransaction</transaction_type>
<original_transaction_updated type="boolean">true</original_transaction_updated>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>example_gateway_brand</gateway_type>
<original_transaction>
<on_test_gateway type="boolean">false</on_test_gateway>
<created_at type="dateTime">2022-10-27T14:55:46Z</created_at>
<updated_at type="dateTime">2022-10-27T14:55:50Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>Rs0JRsByYUEPqh3wL0hPzG6oBcW</token>
<transaction_type>Purchase</transaction_type>
<order_id>44837</order_id>
<gateway_transaction_id>1309352841</gateway_transaction_id>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>T11bJAANtTWnxl36GYjKWvbNK0g</gateway_token>
<gateway_type>example_gateway_brand</gateway_type>
<response>
<success type="boolean">true</success>
<message>purchase complete</message>
<avs_code nil="true"></avs_code>
<avs_message nil="true"></avs_message>
<cvv_code nil="true"></cvv_code>
<cvv_message nil="true"></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code nil="true"></error_code>
<error_detail nil="true"></error_detail>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"></fraud_review>
<created_at type="dateTime">2022-10-27T14:55:47Z</created_at>
<updated_at type="dateTime">2022-10-27T14:55:50Z</updated_at>
</response>
</original_transaction>
</transaction>
Run an inquiry for a transaction’s status at the gateway and update the state of the Spreedly transaction with the given token. Only for supported gateways. See our documentation for more information.
URL Parameters
Parameter | Description |
---|---|
transaction_token required |
The token identifying this transaction at Spreedly |
format required |
One of json or xml |
Response Body
Notable response elements include:
Element | Description |
---|---|
transaction | Root element |
❯ state | The state of the transaction, valid states depend on the type of transaction |
❯ token | The token uniquely identifying the 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 |
❯ transaction_type | The type of transaction, e.g., Authorization , Capture , Credit |
❯ original_transaction_updated | true if the original transaction record was ever successfully updated, false otherwise |
❯ gateway_token | The token uniquely identifying the gateway at Spreedly |
❯ gateway_type | The human-readable identifier of the brand of the gateway |
❯ original_transaction | Notable fields of the original transaction. The original transaction’s state may or may not have been updated. See our documentation for more information on why a transaction may or may not be updated. |
Transcript
GET /v1/transactions/<transaction_token>/transcript HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
HTTPS/1.1 200 OK
[*>] POST to https://spreedly-echo.herokuapp.com
Content-Type: application/json
X-App-Id: 1234
X-App-Secret: [FILTERED]
{
"product_id":"916593",
"card_number":"[FILTERED]",
"card_cvv":"[FILTERED]",
"first_name":"Newfirst",
"last_name":"Newlast",
"year":"2032",
"month":"3"
}
[<*] Response 200 received in 0s
Date: Thu, 27 Jul 2017 17:55:48 GMT
Connection: close
Host: spreedly-echo.herokuapp.com
Accept: */*
User_agent: spreedly-agent/Typhoeus 0.6.9
X_request_id: e7473785-4070-4780-9e3a-66a84bbd2ca6
X_forwarded_for: 167.88.149.182
X_forwarded_proto: https
X_forwarded_port: 443
Via: 1.1 vegur, 1.1 vegur
Connect_time: 2
X_request_start: 1501178148676
Total_route_time: 0
X-Runtime: 0.000143
Server: thin 1.6.2 codename Doc Brown
HOST: spreedly-echo.herokuapp.com
CONNECTION: close
ACCEPT: */*
USER_AGENT: spreedly-agent/Typhoeus 0.6.9
X_REQUEST_ID: e7473785-4070-4780-9e3a-66a84bbd2ca6
X_FORWARDED_FOR: 167.88.149.182
X_FORWARDED_PROTO: https
X_FORWARDED_PORT: 443
VIA: 1.1 vegur
CONNECT_TIME: 2
X_REQUEST_START: 1501178148676
TOTAL_ROUTE_TIME: 0
{
"product_id":"916593",
"card_number":"[FILTERED]",
"card_cvv":"",
"first_name":"Newfirst",
"last_name":"Newlast",
"year":"2032",
"month":"3"
}
View the exchange between Spreedly and the external service (gateway, receiver, etc…) for the given transaction in a human-readable, text format. The transcript is scrubbed of sensitive information so you can email it to external support representatives to help in debugging and other support tasks.
As of December 31, 2022, Spreedly retains transaction transcripts for 90 days after the initial date of the transaction. Transcript requests for transactions which are older than 90 days will return a 404 http response.
URL Parameters
Parameter | Description |
---|---|
transaction_token required |
The token identifying the transaction whose transcript is being requested |
Response Body
Text formatted representation of the communication between Spreedly and the external service.
Composer
Spreedly’s workflow service will determine which gateway the transaction will be processed based on the workflow evoked and send normalized fields depending on what the gateway supports. A workflow_key
should be sent in the request body or left as null to evoke the Default Workflow set in your Spreedly environment.
To learn more about how to enable workflows, please contact Spreedly at support@spreedly.com.
Pass-in credit card Verify
POST /v1/transactions/verify.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"credit_card": {
"first_name": "Joe",
"last_name": "Smith",
"number": "4111111111111111",
"verification_value": "123",
"month": "12",
"year": "2029"
},
"retain_on_success": true,
"workflow_key": "01HV4PEM4FZW5N0KY0T8AYTC2Q"
}
}
<transaction>
<credit_card>
<first_name>Joe</first_name>
<last_name>Smith</last_name>
<number>4111111111111111</number>
<verification_value>123</verification_value>
<month>12</month>
<year>2029</year>
</credit_card>
<retain_on_success>true</retain_on_success>
<workflow_key>01HV4PEM4FZW5N0KY0T8AYTC2Q</workflow_key>
</transaction>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2024-07-02T19:07:48Z",
"updated_at": "2024-07-02T19:07:49Z",
"succeeded": true,
"state": "succeeded",
"token": "3P8y4b8oPVhhYvwuxNHLqIuObd0",
"transaction_type": "Verification",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_transaction_id": "qh7vrqjt",
"sub_merchant_key": null,
"gateway_latency_ms": 1052,
"warning": null,
"application_id": "Spreedly_BT",
"risk_data": null,
"merchant_metadata": null,
"customer_data": null,
"order_data": null,
"workflow_key": "01HV4PEM4FZW5N0KY0T8AYTC2Q",
"gateway_response": {
"card_metadata": {
"issuer_country": "Unknown",
"card_type": "Unknown"
},
"merchant_data": {
"fraud_result": "Approve"
},
"raw_payment_outcome_data": {
"authorization_code": "643SBL",
"network_transaction_id": "020240702190749"
}
},
"retain_on_success": false,
"payment_method_added": true,
"smart_routed": false,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"stored_credential_alternate_gateway": null,
"populate_mit_fields": false,
"transaction_metadata": {
"risk": "low",
"type": "standard"
},
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "21SZ6WB2MN8E7TSQJHMB8G8RCB",
"gateway_type": "braintree",
"response": {
"success": true,
"message": "1000 Approved",
"avs_code": "I",
"avs_message": "Address not verified.",
"cvv_code": "M",
"cvv_message": "",
"pending": false,
"result_unknown": false,
"error_code": "1000",
"error_detail": null,
"cancelled": false,
"fraud_review": null,
"created_at": "2024-07-02T19:07:49Z",
"updated_at": "2024-07-02T19:07:49Z",
"network_transaction_id": "020240702190749"
},
"shipping_address": {
"name": null,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "1F3Z9AWA6Z9H5SHE196SZRQJYH",
"created_at": "2024-07-02T19:07:48.227Z",
"updated_at": "2024-07-02T19:07:48.227Z",
"email": null,
"data": null,
"storage_state": "cached",
"test": true,
"metadata": null,
"callback_url": null,
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "Joe",
"last_name": "Smith",
"month": 12,
"year": 2029,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "Joe Smith",
"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,
"bin_metadata": {
"card_brand": "VISA",
"issuing_bank": "CONOTOXIA SP. Z O.O",
"card_type": "DEBIT",
"card_category": "CLASSIC",
"issuing_country_iso_number": "616",
"issuing_bank_website": null,
"issuing_bank_phone_number": null,
"max_pan_length": 16,
"bin_type": "PERSONAL",
"regulated": "N"
},
"payment_method_type": "credit_card",
"errors": [
],
"fingerprint": "56168f5bde6c0454f65eb6ccfc4ff4c3b80e",
"verification_value": "XXX",
"number": "XXXX-XXXX-XXXX-1111"
}
}
}
<transaction>
<on_test_gateway type="boolean">true</on_test_gateway>
<created_at type="dateTime">2024-07-02T19:07:46Z</created_at>
<updated_at type="dateTime">2024-07-02T19:07:47Z</updated_at>
<succeeded type="boolean">true</succeeded>
<state>succeeded</state>
<token>13rQv0AkmWwi98NHkRsiFBATT2</token>
<transaction_type>Verification</transaction_type>
<order_id nil="true"/>
<ip nil="true"/>
<description nil="true"/>
<email nil="true"/>
<merchant_name_descriptor nil="true"/>
<merchant_location_descriptor nil="true"/>
<merchant_profile_key nil="true"/>
<gateway_specific_fields nil="true"/>
<gateway_transaction_id>5xh650sg</gateway_transaction_id>
<sub_merchant_key nil="true"/>
<gateway_latency_ms type="integer">809</gateway_latency_ms>
<warning nil="true"/>
<application_id>Spreedly_BT</application_id>
<risk_data nil="true"/>
<merchant_metadata nil="true"/>
<customer_data nil="true"/>
<order_data nil="true"/>
<workflow_key>01HV4PEM4FZW5N0KY0T8AYTC2Q</workflow_key>
<gateway_response>
<card_metadata>
<issuer_country>Unknown</issuer_country>
<card_type>Unknown</card_type>
</card_metadata>
<merchant_data>
<fraud_result>Approve</fraud_result>
</merchant_data>
<raw_payment_outcome_data>
<authorization_code>4CF8HZ</authorization_code>
<network_transaction_id>020240702190747</network_transaction_id>
</raw_payment_outcome_data>
</gateway_response>
<retain_on_success type="boolean">false</retain_on_success>
<payment_method_added type="boolean">true</payment_method_added>
<smart_routed type="boolean">false</smart_routed>
<stored_credential_initiator nil="true"/>
<stored_credential_reason_type nil="true"/>
<stored_credential_alternate_gateway nil="true"/>
<populate_mit_fields type="boolean">false</populate_mit_fields>
<transaction_metadata>
<risk>low</risk>
<type>standard</type>
</transaction_metadata>
<message key="messages.transaction_succeeded">Succeeded!</message>
<gateway_token>21SZ6WB2MN8E7TSQJHMB8G8RCB</gateway_token>
<gateway_type>braintree</gateway_type>
<shipping_address>
<name nil="true"/>
<address1 nil="true"/>
<address2 nil="true"/>
<city nil="true"/>
<state nil="true"/>
<zip nil="true"/>
<country nil="true"/>
<phone_number nil="true"/>
</shipping_address>
<response>
<success type="boolean">true</success>
<message>1000 Approved</message>
<avs_code>I</avs_code>
<avs_message>Address not verified.</avs_message>
<cvv_code>M</cvv_code>
<cvv_message></cvv_message>
<pending type="boolean">false</pending>
<result_unknown type="boolean">false</result_unknown>
<error_code>1000</error_code>
<error_detail nil="true"/>
<cancelled type="boolean">false</cancelled>
<fraud_review nil="true"/>
<created_at type="dateTime">2024-07-02T19:07:47Z</created_at>
<updated_at type="dateTime">2024-07-02T19:07:47Z</updated_at>
<network_transaction_id>020240702190747</network_transaction_id>
</response>
<api_urls>
</api_urls>
<payment_method>
<token>1X9PDEM9539FFRWHPJ7T1ZDZ1H</token>
<created_at>2024-07-02T19:07:46.722Z</created_at>
<updated_at>2024-07-02T19:07:46.722Z</updated_at>
<email nil="true"/>
<data nil="true"/>
<storage_state>cached</storage_state>
<test type="boolean">true</test>
<metadata nil="true"/>
<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>Joe</first_name>
<last_name>Smith</last_name>
<month type="integer">12</month>
<year type="integer">2029</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>Joe Smith</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>
<click_to_pay type="boolean">false</click_to_pay>
<managed type="boolean">true</managed>
<payment_method_type>credit_card</payment_method_type>
<errors>
</errors>
<verification_value>XXX</verification_value>
<number>XXXX-XXXX-XXXX-1111</number>
<bin_metadata>
<card_brand>VISA</card_brand>
<issuing_bank>CONOTOXIA SP. Z O.O</issuing_bank>
<card_type>DEBIT</card_type>
<card_category>CLASSIC</card_category>
<issuing_country_iso_number>616</issuing_country_iso_number>
<issuing_bank_website nil="true"/>
<issuing_bank_phone_number nil="true"/>
<max_pan_length type="integer">16</max_pan_length>
<bin_type>PERSONAL</bin_type>
<regulated>N</regulated>
</bin_metadata>
<fingerprint>56168f5bde6c0454f65eb6ccfc4ff4c3b80e</fingerprint>
</payment_method>
<attempt_3dsecure type="boolean">false</attempt_3dsecure>
</transaction>
Determine if a credit card is chargeable card and available for purchases. The retain_on_success
request parameter will automatically retain the card if it’s successfully verified.
URL Parameters
Parameter | Description |
---|---|
format required |
One of json or xml |
Request Body
Element | Description |
---|---|
transaction | Root request 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 . |
❯ workflow_key optional |
The key of the Spreedly workflow to use for this transaction. Spreedly will use the environment’s default workflow_key if no value is provided |
❯ risk_data optional |
Optional fields related to risk data that are to be passed to the gateway if the gateway supports it. Please see our normalized request guide for more info. |
❯ merchant_metadata optional |
Optional fields related to the merchant that are to be passed to the gateway if the gateway supports it. Please see our normalized request guide for more info. |
❯ customer_data optional |
Optional fields related to the cardholder that are to be passed to the gateway if the gateway supports it. Please see our normalized request guide for more info. |
❯ order_data optional |
Optional fields related to the order that are to be passed to the gateway if the gateway supports it. Please see our normalized request guide for more info. |
❯ order_id optional |
The merchant specified order id. If not provided, the Spreedly transaction token will be used. |
❯ description optional |
A human readable description of the transaction which will be passed to the gateway if it’s supported |
❯ retain_on_success optional |
If the card is verified, retain it so it can be used for future transactions |
❯ ip optional |
The IP address of the end-user customer. If one is not provided, this will default to 127.0.0.1 . To actually send a nil value, this parameter must be set to "omit" . |
❯ email optional |
Override the customer email address associated with the payment method for this transaction |
❯ sub_merchant_key optional |
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 |
❯ sca_provider_key optional |
SCA Provider token that performs a Spreedly 3DS2 Global authentication before attempting the gateway transaction. Please see our Spreedly 3DS2 Global Guide for more info. |
❯ sca_authentication_parameters optional |
Additional fields that are accepted by the Sca Authentication, including a test_scenario object to indicate valid 3DS2 test flow options and an exemption_type field to request an exemption. Please refer to our 3DS2 Global Guide to learn more. |
❯❯ three_ds_requestor_challenge_ind optional |
Indicates whether a challenge is being requested for a 3DS2 Global transaction. |
❯ callback_url optional |
The URL where Spreedly will attempt delivery of asynchronous results for 3DS and offsite transactions. Transaction results are posted in the format specified by callback_format if provided or XML if callback_format is not present or null. (default: null ) |
❯ callback_format optional |
The format in which Spreedly will deliver asynchronous results for 3DS and offsite transactions to the specified callback_url . If provided, the value must be one of json or xml . (default: xml ) |
❯ shipping_address optional |
Override the customer shipping address associated with the payment method for this transaction |
❯❯ name optional |
Customer’s name in the shipping address |
❯❯ address1 optional |
Customer’s shipping address, line 1 |
❯❯ address2 optional |
Customer’s shipping address, line 2 |
❯❯ city optional |
Customer’s shipping city |
❯❯ state optional |
Customer’s shipping state/province |
❯❯ zip optional |
Customer’s shipping zip |
❯❯ country optional |
Customer’s shipping country |
❯❯ phone_number optional |
Customer’s shipping phone |
❯ billing_address optional |
Override the customer billing address associated with the payment method for this transaction. To send a nil value, the respective parameter(s) must be set to "omit" . Note: Any values that you do not override will be set based on the existing value on the payment method. |
❯❯ name optional |
Customer’s name in the billing address |
❯❯ address1 optional |
Customer’s billing address, line 1 |
❯❯ address2 optional |
Customer’s billing address, line 2 |
❯❯ city optional |
Customer’s billing city |
❯❯ state optional |
Customer’s billing state/province |
❯❯ zip optional |
Customer’s billing zip |
❯❯ country optional |
Customer’s billing country |
❯❯ phone_number optional |
Customer’s billing phone |
❯ transaction_metadata optional |
Metadata key-value pairs used for Smart Routing. Keys must be unique and are limited to 50 characters. Values are limited to 500 characters and cannot contain compounding data types. |
❯ allow_blank_name optional |
true if this payment method should skip the name validation requirement |
❯ allow_expired_date optional |
true if this payment method should skip the expired date validation requirement |
❯ allow_blank_date optional |
true if this payment method should skip the expiration date validation requirement |
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
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_response | A hash containing normalized fields from various gateways. Please see our normalized response field documentation for more info |
❯ transaction_metadata | The hash of key/value pairs that was included in the transaction request body. |
❯ gateway_type | The gateway used for this transaction. |
❯ gateway_token | The key of the gateway used for this transaction. |
❯ workflow_key | The key of the workflow used for this transaction. |
❯ sca_authentication | The details of the SCA Authentication transaction created if performing a Spreedly Global 3DS2 transaction. See the SCA Authentication Show details for more information on this object. |
Payment Method Token Verify
POST /v1/transactions/verify.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>
{
"transaction": {
"payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
"retain_on_success": true,
"workflow_key": "01HV4PEM4FZW5N0KY0T8AYTC2Q"
}
}
<transaction>
<payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
<retain_on_success>true</retain_on_success>
<workflow_key>01HV4PEM4FZW5N0KY0T8AYTC2Q</workflow_key>
</transaction>
HTTPS/1.1 200 OK
{
"transaction": {
"on_test_gateway": true,
"created_at": "2024-07-02T19:13:39Z",
"updated_at": "2024-07-02T19:13:40Z",
"succeeded": true,
"state": "succeeded",
"token": "3t2AjIFBeLvGSqPjZapES3L3R29",
"transaction_type": "Verification",
"order_id": null,
"ip": null,
"description": null,
"email": null,
"merchant_name_descriptor": null,
"merchant_location_descriptor": null,
"merchant_profile_key": null,
"gateway_specific_fields": null,
"gateway_transaction_id": "9pxg3xqt",
"sub_merchant_key": null,
"gateway_latency_ms": 689,
"warning": null,
"application_id": "Spreedly_BT",
"risk_data": null,
"merchant_metadata": null,
"customer_data": null,
"order_data": null,
"workflow_key": "01HV4PEM4FZW5N0KY0T8AYTC2Q",
"gateway_response": {
"card_metadata": {
"issuer_country": "Unknown",
"card_type": "Unknown"
},
"merchant_data": {
"fraud_result": "Approve"
},
"raw_payment_outcome_data": {
"authorization_code": "5TYVK6",
"network_transaction_id": "020240702191340"
}
},
"retain_on_success": false,
"payment_method_added": false,
"smart_routed": false,
"stored_credential_initiator": null,
"stored_credential_reason_type": null,
"stored_credential_alternate_gateway": null,
"populate_mit_fields": false,
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"gateway_token": "21SZ6WB2MN8E7TSQJHMB8G8RCB",
"gateway_type": "braintree",
"response": {
"success": true,
"message": "1000 Approved",
"avs_code": "I",
"avs_message": "Address not verified.",
"cvv_code": "I",
"cvv_message": "",
"pending": false,
"result_unknown": false,
"error_code": "1000",
"error_detail": null,
"cancelled": false,
"fraud_review": null,
"created_at": "2024-07-02T19:13:40Z",
"updated_at": "2024-07-02T19:13:40Z",
"network_transaction_id": "020240702191340"
},
"shipping_address": {
"name": "Joe Jones",
"address1": "33 Lane Road",
"address2": "Apartment 4",
"city": "Wanaque",
"state": "NJ",
"zip": "31331",
"country": "US",
"phone_number": "919.331.3313"
},
"api_urls": [
{
"referencing_transaction": [
]
},
{
"failover_transaction": [
]
}
],
"attempt_3dsecure": false,
"payment_method": {
"token": "56G9BCQSC78W5V70JSNFNCFZR0",
"created_at": "2024-07-02T19:12:59.024Z",
"updated_at": "2024-07-02T19:13:39.529Z",
"email": "joey@example.com",
"data": null,
"storage_state": "retained",
"test": true,
"metadata": {
"another_key": 123,
"final_key": true,
"key": "string value"
},
"callback_url": null,
"last_four_digits": "1111",
"first_six_digits": "411111",
"card_type": "visa",
"first_name": "Joe",
"last_name": "Jones",
"month": 1,
"year": 2029,
"address1": "33 Lane Road",
"address2": "Apartment 4",
"city": "Wanaque",
"state": "NJ",
"zip":