NAV
json xml

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.

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": "allied_wallet",
      "name": "Allied Wallet",
      "auth_modes": [
        {
          "auth_mode_type": "default",
          "name": "Default",
          "credentials": [
            {
              "name": "merchant_id",
              "label": "Merchant",
              "safe": true
            },
            {
              "name": "site_id",
              "label": "Site",
              "safe": true
            },
            {
              "name": "oauth_bearer_token",
              "label": "Oauth Bearer Token",
              "safe": false
            }
          ]
        }
      ],
      "characteristics": [
        "purchase",
        "authorize",
        "capture",
        "credit",
        "void",
        "verify"
      ],
      "payment_methods": [
        "credit_card"
      ],
      "gateway_specific_fields": [

      ],
      "supported_countries": [
        "US"
      ],
      "supported_cardtypes": [
        "visa",
        "master",
        "american_express",
        "discover",
        "diners_club",
        "jcb",
        "maestro"
      ],
      "regions": [
        "north_america"
      ],
      "homepage": "https://www.alliedwallet.com/",
      "company_name": "Allied Wallet"
    },
    {
      "gateway_type": "authorize_net",
      "name": "Authorize.Net",
      "auth_modes": [
        {
          "auth_mode_type": "default",
          "name": "Default",
          "credentials": [
            {
              "name": "login",
              "label": "Login",
              "safe": true
            },
            {
              "name": "password",
              "label": "Password",
              "safe": false
            }
          ]
        }
      ],
      "characteristics": [
        "purchase",
        "authorize",
        "capture",
        "credit",
        "general_credit",
        "void",
        "verify",
        "store",
        "fraud_review"
      ],
      "payment_methods": [
        "credit_card",
        "bank_account",
        "apple_pay",
        "third_party_token"
      ],
      "gateway_specific_fields": [
        "customer_id",
        "customer_profile_id",
        "duplicate_window",
        "disable_partial_auth",
        "market_type",
        "recurring"
      ],
      "supported_countries": [
        "AD",
        "AT",
        "AU",
        "BE",
        "BG",
        "CA",
        "CH",
        "CY",
        "CZ",
        "DE",
        "DK",
        "EE",
        "ES",
        "FI",
        "FR",
        "GB",
        "GB",
        "GI",
        "GR",
        "HU",
        "IE",
        "IS",
        "IT",
        "LI",
        "LT",
        "LU",
        "LV",
        "MC",
        "MT",
        "NL",
        "NO",
        "PL",
        "PT",
        "RO",
        "SE",
        "SI",
        "SK",
        "SM",
        "TR",
        "US",
        "VA"
      ],
      "supported_cardtypes": [
        "visa",
        "master",
        "american_express",
        "discover",
        "diners_club",
        "jcb",
        "maestro"
      ],
      "regions": [
        "europe",
        "north_america"
      ],
      "homepage": "http://www.authorize.net/",
      "company_name": "Authorize.Net"
    }
  ]
}
<gateways>
  <gateway>
    <gateway_type>allied_wallet</gateway_type>
    <name>Allied Wallet</name>
    <auth_modes>
      <auth_mode>
        <auth_mode_type>default</auth_mode_type>
        <name>Default</name>
        <credentials>
          <credential>
            <name>merchant_id</name>
            <label>Merchant</label>
            <safe type="boolean">true</safe>
          </credential>
          <credential>
            <name>site_id</name>
            <label>Site</label>
            <safe type="boolean">true</safe>
          </credential>
          <credential>
            <name>oauth_bearer_token</name>
            <label>Oauth Bearer Token</label>
            <safe type="boolean">false</safe>
          </credential>
        </credentials>
      </auth_mode>
    </auth_modes>
    <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_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_store type="boolean">false</supports_store>
      <supports_remove type="boolean">false</supports_remove>
      <supports_fraud_review type="boolean">false</supports_fraud_review>
      <supports_disburse type="boolean">false</supports_disburse>
    </characteristics>
    <payment_methods>
      <payment_method>credit_card</payment_method>
    </payment_methods>
    <gateway_specific_fields>
    </gateway_specific_fields>
    <supported_countries>US</supported_countries>
    <supported_cardtypes>visa, master, american_express, discover, diners_club, jcb, maestro</supported_cardtypes>
    <regions>north_america</regions>
    <homepage>https://www.alliedwallet.com/</homepage>
    <company_name>Allied Wallet</company_name>
  </gateway>
  <gateway>
    <gateway_type>authorize_net</gateway_type>
    <name>Authorize.Net</name>
    <auth_modes>
      <auth_mode>
        <auth_mode_type>default</auth_mode_type>
        <name>Default</name>
        <credentials>
          <credential>
            <name>login</name>
            <label>Login</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>
    <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_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_store type="boolean">true</supports_store>
      <supports_remove type="boolean">false</supports_remove>
      <supports_fraud_review type="boolean">true</supports_fraud_review>
      <supports_disburse type="boolean">false</supports_disburse>
    </characteristics>
    <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>
    <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_fields>
    <supported_countries>AD, AT, AU, BE, BG, CA, CH, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GB, GI, GR, HU, IE, IS, IT, LI, LT, LU, LV, MC, MT, NL, NO, PL, PT, RO, SE, SI, SK, SM, TR, US, VA</supported_countries>
    <supported_cardtypes>visa, master, american_express, discover, diners_club, jcb, maestro</supported_cardtypes>
    <regions>europe, north_america</regions>
    <homepage>http://www.authorize.net/</homepage>
    <company_name>Authorize.Net</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).
❯ 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, android_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": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
      "gateway_type": "test",
      "description": null,
      "payment_methods": [
        "credit_card",
        "sprel",
        "third_party_token",
        "bank_account",
        "apple_pay",
        "android_pay"
      ],
      "state": "created",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:09:30Z",
      "name": "Spreedly Test",
      "characteristics": [
        "purchase",
        "authorize",
        "capture",
        "credit",
        "general_credit",
        "void",
        "verify",
        "reference_purchase",
        "purchase_via_preauthorization",
        "offsite_purchase",
        "offsite_authorize",
        "3dsecure_purchase",
        "3dsecure_authorize",
        "store",
        "remove",
        "disburse",
        "reference_authorization"
      ],
      "credentials": [

      ],
      "gateway_specific_fields": [

      ],
      "redacted": false
    },
    {
      "token": "VzvHi932hQzrPIpTIVQaiu4CofE",
      "gateway_type": "test",
      "description": null,
      "payment_methods": [
        "credit_card",
        "sprel",
        "third_party_token",
        "bank_account",
        "apple_pay",
        "android_pay"
      ],
      "state": "created",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:09:30Z",
      "name": "Spreedly Test",
      "characteristics": [
        "purchase",
        "authorize",
        "capture",
        "credit",
        "general_credit",
        "void",
        "verify",
        "reference_purchase",
        "purchase_via_preauthorization",
        "offsite_purchase",
        "offsite_authorize",
        "3dsecure_purchase",
        "3dsecure_authorize",
        "store",
        "remove",
        "disburse",
        "reference_authorization"
      ],
      "credentials": [

      ],
      "gateway_specific_fields": [

      ],
      "redacted": false
    }
  ]
}
<gateways>
  <gateway>
    <token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</token>
    <gateway_type>test</gateway_type>
    <name>Spreedly Test</name>
    <description nil="true"></description>
    <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_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_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
      <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_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_disburse type="boolean">true</supports_disburse>
      <supports_reference_authorization type="boolean">true</supports_reference_authorization>
    </characteristics>
    <credentials>
    </credentials>
    <gateway_specific_fields>
    </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>android_pay</payment_method>
    </payment_methods>
    <state>created</state>
    <redacted type="boolean">false</redacted>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:09:30Z</updated_at>
  </gateway>
  <gateway>
    <token>VzvHi932hQzrPIpTIVQaiu4CofE</token>
    <gateway_type>test</gateway_type>
    <name>Spreedly Test</name>
    <description nil="true"></description>
    <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_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_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
      <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_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_disburse type="boolean">true</supports_disburse>
      <supports_reference_authorization type="boolean">true</supports_reference_authorization>
    </characteristics>
    <credentials>
    </credentials>
    <gateway_specific_fields>
    </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>android_pay</payment_method>
    </payment_methods>
    <state>created</state>
    <redacted type="boolean">false</redacted>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:09:30Z</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)

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.
❯ state The storage state of the gateway (retained, redacted, etc…)
❯ redacted If this gateway is redacted or not
❯ credentials The non-sensitive credentials used for this gateway
❯ 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, android_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": "M8TBiUmc19cjV16PdMbsj65uViL",
    "gateway_type": "test",
    "description": null,
    "payment_methods": [
      "credit_card",
      "sprel",
      "third_party_token",
      "bank_account",
      "apple_pay",
      "android_pay"
    ],
    "state": "retained",
    "created_at": "2016-08-11T17:39:22Z",
    "updated_at": "2016-08-11T17:39:22Z",
    "name": "Spreedly Test",
    "characteristics": [
      "purchase",
      "authorize",
      "capture",
      "credit",
      "general_credit",
      "void",
      "verify",
      "reference_purchase",
      "purchase_via_preauthorization",
      "offsite_purchase",
      "offsite_authorize",
      "3dsecure_purchase",
      "3dsecure_authorize",
      "store",
      "remove",
      "disburse",
      "reference_authorization"
    ],
    "credentials": [

    ],
    "gateway_specific_fields": [

    ],
    "redacted": false
  }
}
<gateway>
  <token>40YHJvnhEI2hXMGIOBvMoUURKbd</token>
  <gateway_type>test</gateway_type>
  <name>Spreedly Test</name>
  <description nil="true"></description>
  <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_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_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
    <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_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_disburse type="boolean">true</supports_disburse>
    <supports_reference_authorization type="boolean">true</supports_reference_authorization>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
  </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>android_pay</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:39:22Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:22Z</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.
❯ state The storage state of the gateway (retained, redacted, etc…)
❯ redacted If this gateway is redacted or not
❯ credentials The non-sensitive credentials used for this gateway
❯ 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, android_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"
  }
}
<gateway>
  <gateway_type>stripe</gateway_type>
  <login>your api secret key</login>
</gateway>

HTTPS/1.1 201 Created
{
  "gateway": {
    "token": "ZJoCVBb4PM2Vmt24D5orq4EQV8n",
    "gateway_type": "stripe",
    "description": null,
    "payment_methods": [
      "credit_card",
      "third_party_token",
      "apple_pay",
      "android_pay",
      "bank_account"
    ],
    "state": "retained",
    "created_at": "2016-08-11T17:39:22Z",
    "updated_at": "2016-08-11T17:39:22Z",
    "name": "Stripe",
    "characteristics": [
      "purchase",
      "authorize",
      "capture",
      "credit",
      "void",
      "verify",
      "store",
      "remove"
    ],
    "credentials": [

    ],
    "gateway_specific_fields": [
      "statement_description",
      "destination",
      "idempotency_key",
      "receipt_email",
      "application_fee",
      "stripe_account",
      "metadata",
      "refund_application_fee",
      "refund_fee_amount",
      "reverse_transfer",
      "account_id",
      "customer_id",
      "validate",
      "make_default"
    ],
    "redacted": false
  }
}
<gateway>
  <token>clyRW8a9Z2VdrO7gZh0gRPJihi</token>
  <gateway_type>stripe</gateway_type>
  <name>Stripe</name>
  <description nil="true"></description>
  <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_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_store type="boolean">true</supports_store>
    <supports_remove type="boolean">true</supports_remove>
    <supports_fraud_review type="boolean">false</supports_fraud_review>
    <supports_disburse type="boolean">false</supports_disburse>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
    <gateway_specific_field>statement_description</gateway_specific_field>
    <gateway_specific_field>destination</gateway_specific_field>
    <gateway_specific_field>idempotency_key</gateway_specific_field>
    <gateway_specific_field>receipt_email</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>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_fields>
  <payment_methods>
    <payment_method>credit_card</payment_method>
    <payment_method>third_party_token</payment_method>
    <payment_method>apple_pay</payment_method>
    <payment_method>android_pay</payment_method>
    <payment_method>bank_account</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:39:22Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:22Z</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.

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.

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.
❯ state The storage state of the gateway (retained, redacted, etc…)
❯ redacted If this gateway is redacted or not
❯ credentials The non-sensitive credentials used for this gateway
❯ 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, android_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": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "gateway_type": "test",
    "description": null,
    "payment_methods": [
      "credit_card",
      "sprel",
      "third_party_token",
      "bank_account",
      "apple_pay",
      "android_pay"
    ],
    "state": "created",
    "created_at": "2016-08-11T17:09:30Z",
    "updated_at": "2016-08-11T17:09:30Z",
    "name": "Spreedly Test",
    "characteristics": [
      "purchase",
      "authorize",
      "capture",
      "credit",
      "general_credit",
      "void",
      "verify",
      "reference_purchase",
      "purchase_via_preauthorization",
      "offsite_purchase",
      "offsite_authorize",
      "3dsecure_purchase",
      "3dsecure_authorize",
      "store",
      "remove",
      "disburse",
      "reference_authorization"
    ],
    "credentials": [

    ],
    "gateway_specific_fields": [

    ],
    "redacted": false
  }
}
<gateway>
  <token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</token>
  <gateway_type>test</gateway_type>
  <name>Spreedly Test</name>
  <description nil="true"></description>
  <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_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_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
    <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_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_disburse type="boolean">true</supports_disburse>
    <supports_reference_authorization type="boolean">true</supports_reference_authorization>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
  </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>android_pay</payment_method>
  </payment_methods>
  <state>created</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:09:30Z</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.
❯ state The storage state of the gateway (retained, redacted, etc…)
❯ redacted If this gateway is redacted or not
❯ credentials The non-sensitive credentials used for this gateway
❯ 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, android_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 201 Created
{
  "gateway": {
    "token": "clyRW8a9Z2VdrO7gZh0gRPJihi",
    "gateway_type": "stripe",
    "description": null,
    "payment_methods": [
      "credit_card",
      "third_party_token",
      "apple_pay",
      "android_pay",
      "bank_account"
    ],
    "state": "retained",
    "created_at": "2016-08-11T17:39:22Z",
    "updated_at": "2016-08-11T17:39:27Z",
    "name": "Stripe",
    "characteristics": [
      "purchase",
      "authorize",
      "capture",
      "credit",
      "void",
      "verify",
      "store",
      "remove"
    ],
    "credentials": [

    ],
    "gateway_specific_fields": [
      "statement_description",
      "destination",
      "idempotency_key",
      "receipt_email",
      "application_fee",
      "stripe_account",
      "metadata",
      "refund_application_fee",
      "refund_fee_amount",
      "reverse_transfer",
      "account_id",
      "customer_id",
      "validate",
      "make_default"
    ],
    "redacted": false
  }
}
<gateway>
  <token>clyRW8a9Z2VdrO7gZh0gRPJihi</token>
  <gateway_type>stripe</gateway_type>
  <name>Stripe</name>
  <description nil="true"></description>
  <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_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_store type="boolean">true</supports_store>
    <supports_remove type="boolean">true</supports_remove>
    <supports_fraud_review type="boolean">false</supports_fraud_review>
    <supports_disburse type="boolean">false</supports_disburse>
  </characteristics>
  <credentials>
  </credentials>
  <gateway_specific_fields>
    <gateway_specific_field>statement_description</gateway_specific_field>
    <gateway_specific_field>destination</gateway_specific_field>
    <gateway_specific_field>idempotency_key</gateway_specific_field>
    <gateway_specific_field>receipt_email</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>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_fields>
  <payment_methods>
    <payment_method>credit_card</payment_method>
    <payment_method>third_party_token</payment_method>
    <payment_method>apple_pay</payment_method>
    <payment_method>android_pay</payment_method>
    <payment_method>bank_account</payment_method>
  </payment_methods>
  <state>retained</state>
  <redacted type="boolean">false</redacted>
  <created_at type="dateTime">2016-08-11T17:39:22Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:28Z</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.

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.
❯ state The storage state of the gateway (retained, redacted, etc…)
❯ redacted If this gateway is redacted or not
❯ credentials The non-sensitive credentials used for this gateway
❯ 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, android_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": "4LSKUZcARwrTR8bIs2XZyCIuBFf",
    "created_at": "2016-08-11T17:39:25Z",
    "updated_at": "2016-08-11T17:39:25Z",
    "succeeded": true,
    "transaction_type": "RetainGateway",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway": {
      "token": "PCaxWZkukVsXy3wT8lJcaKS1Wuq",
      "gateway_type": "authorize_net",
      "description": null,
      "payment_methods": [
        "credit_card",
        "bank_account",
        "apple_pay",
        "third_party_token"
      ],
      "state": "retained",
      "created_at": "2016-08-11T17:39:25Z",
      "updated_at": "2016-08-11T17:39:25Z",
      "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_specific_fields": [
        "customer_id",
        "customer_profile_id",
        "duplicate_window",
        "disable_partial_auth",
        "market_type",
        "recurring"
      ],
      "redacted": false
    }
  }
}
<transaction>
  <token>4oSg1LrQ4ml7IZPONWRaZr3qLMd</token>
  <created_at type="dateTime">2016-08-11T17:39:26Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:26Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>RetainGateway</transaction_type>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway>
    <token>234vl4X26bGDKdU8dHImO22zRdv</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_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_store type="boolean">true</supports_store>
      <supports_remove type="boolean">false</supports_remove>
      <supports_fraud_review type="boolean">true</supports_fraud_review>
      <supports_disburse type="boolean">false</supports_disburse>
    </characteristics>
    <credentials>
      <credential>
        <name>login</name>
        <value>Your Authorize.Net API Login ID</value>
      </credential>
    </credentials>
    <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_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>
    <created_at type="dateTime">2016-08-11T17:39:25Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:26Z</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": "BRCaX7Uw5acQERymVgg9C7Gl9uC",
    "created_at": "2016-08-11T17:39:25Z",
    "updated_at": "2016-08-11T17:39:25Z",
    "succeeded": true,
    "transaction_type": "RedactGateway",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway": {
      "token": "FxQVZX4a3dKAalyrV1WXd2pzu8d",
      "gateway_type": "authorize_net",
      "description": null,
      "payment_methods": [
        "credit_card",
        "bank_account",
        "apple_pay",
        "third_party_token"
      ],
      "state": "redacted",
      "created_at": "2016-08-11T17:39:24Z",
      "updated_at": "2016-08-11T17:39:25Z",
      "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_specific_fields": [
        "customer_id",
        "customer_profile_id",
        "duplicate_window",
        "disable_partial_auth",
        "market_type",
        "recurring"
      ],
      "redacted": true
    }
  }
}
<transaction>
  <token>W8fxewRUJSIbyKfWexSHvWxnN5E</token>
  <created_at type="dateTime">2016-08-11T17:39:25Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:25Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>RedactGateway</transaction_type>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway>
    <token>2wt3AJTjRgp6oRSoPJmaE1bmu5I</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_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_store type="boolean">true</supports_store>
      <supports_remove type="boolean">false</supports_remove>
      <supports_fraud_review type="boolean">true</supports_fraud_review>
      <supports_disburse type="boolean">false</supports_disburse>
    </characteristics>
    <credentials>
      <credential>
        <name>login</name>
        <value>Your Authorize.Net API Login ID</value>
      </credential>
    </credentials>
    <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_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>
    <created_at type="dateTime">2016-08-11T17:39:25Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:25Z</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": [
    {
      "token": "XemIPW7CKdBQZXFCVRudc3xkHQE",
      "created_at": "2016-08-11T17:39:21Z",
      "updated_at": "2016-08-11T17:39:21Z",
      "succeeded": false,
      "transaction_type": "UpdateGateway",
      "message_key": "errors.gateway_gateway_type_cannot_be_changed",
      "message": "You may not change the gateway_type of a gateway.",
      "gateway": {
        "token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
        "gateway_type": "test",
        "description": null,
        "payment_methods": [
          "credit_card",
          "sprel",
          "third_party_token",
          "bank_account",
          "apple_pay",
          "android_pay"
        ],
        "state": "created",
        "created_at": "2016-08-11T17:09:30Z",
        "updated_at": "2016-08-11T17:09:30Z",
        "name": "Spreedly Test",
        "characteristics": [
          "purchase",
          "authorize",
          "capture",
          "credit",
          "general_credit",
          "void",
          "verify",
          "reference_purchase",
          "purchase_via_preauthorization",
          "offsite_purchase",
          "offsite_authorize",
          "3dsecure_purchase",
          "3dsecure_authorize",
          "store",
          "remove",
          "disburse",
          "reference_authorization"
        ],
        "credentials": [

        ],
        "gateway_specific_fields": [

        ],
        "redacted": false
      }
    }
  ]
}
<transactions>
  <transaction>
    <token>XemIPW7CKdBQZXFCVRudc3xkHQE</token>
    <created_at type="dateTime">2016-08-11T17:39:21Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:21Z</updated_at>
    <succeeded type="boolean">false</succeeded>
    <transaction_type>UpdateGateway</transaction_type>
    <message key="errors.gateway_gateway_type_cannot_be_changed">You may not change the gateway_type of a gateway.</message>
    <gateway>
      <token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</token>
      <gateway_type>test</gateway_type>
      <name>Spreedly Test</name>
      <description nil="true"></description>
      <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_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_3dsecure_purchase type="boolean">true</supports_3dsecure_purchase>
        <supports_3dsecure_authorize type="boolean">true</supports_3dsecure_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_disburse type="boolean">true</supports_disburse>
        <supports_reference_authorization type="boolean">true</supports_reference_authorization>
      </characteristics>
      <credentials>
      </credentials>
      <gateway_specific_fields>
      </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>android_pay</payment_method>
      </payment_methods>
      <state>created</state>
      <redacted type="boolean">false</redacted>
      <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
      <updated_at type="dateTime">2016-08-11T17:09:30Z</updated_at>
    </gateway>
  </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)

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

Receivers

List supported receivers

GET /v1/receivers_options.<format> HTTPS/1.1
Host: core.spreedly.com

Example response has been truncated for brevity

HTTPS/1.1 200 OK
{
  "receivers": [
    {
      "receiver_type": "ace_rent_a_car",
      "name": "Acerentacar Receiver",
      "hostnames": "https://ota.acerentacar.com",
      "company_name": "Ace Rent a Car"
    },
    {
      "receiver_type": "adquira",
      "name": "Adquira Receiver",
      "hostnames": "https://www.adquiramexico.com.mx",
      "company_name": "Adquira"
    }
  ]
}
<receivers>
  <receiver>
    <receiver_type>ace_rent_a_car</receiver_type>
    <name>Acerentacar Receiver</name>
    <hostnames>https://ota.acerentacar.com</hostnames>
    <company_name>Ace Rent a Car</company_name>
  </receiver>
  <receiver>
    <receiver_type>adquira</receiver_type>
    <name>Adquira Receiver</name>
    <hostnames>https://www.adquiramexico.com.mx</hostnames>
    <company_name>Adquira</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": [
    {
      "receiver_type": "test",
      "token": "T6QCaMCtfB2bG1ObqAiB2KmN2Nb",
      "hostnames": "http://posttestserver.com",
      "state": "retained",
      "created_at": "2016-08-11T17:36:06Z",
      "updated_at": "2016-08-11T17:36:06Z",
      "credentials": null
    },
    {
      "receiver_type": "test",
      "token": "T1PMDMA6GXY6PJNajyJFb7OAKcJ",
      "hostnames": "http://api.example.com/post",
      "state": "retained",
      "created_at": "2016-08-11T17:36:07Z",
      "updated_at": "2016-08-11T17:36:07Z",
      "credentials": null
    }
  ]
}
<receivers>
  <receiver>
    <receiver_type>test</receiver_type>
    <token>T6QCaMCtfB2bG1ObqAiB2KmN2Nb</token>
    <hostnames>http://posttestserver.com</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2016-08-11T17:36:06Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:36:06Z</updated_at>
    <credentials nil="true"></credentials>
  </receiver>
  <receiver>
    <receiver_type>test</receiver_type>
    <token>T1PMDMA6GXY6PJNajyJFb7OAKcJ</token>
    <hostnames>http://api.example.com/post</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2016-08-11T17:36:07Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:36:07Z</updated_at>
    <credentials nil="true"></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
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The whitelist 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": "http://posttestserver.com",
    "credentials": [
      {
        "name": "app-id",
        "value": 1234,
        "safe": true
      },
      {
        "name": "app-secret",
        "value": 5678
      }
    ]
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <hostnames>http://posttestserver.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": {
    "receiver_type": "test",
    "token": "YRR0IQ5b1NbkWNJhFWezhOSAaML",
    "hostnames": "http://posttestserver.com",
    "state": "retained",
    "created_at": "2016-10-04T17:48:39Z",
    "updated_at": "2016-10-04T17:48:39Z",
    "credentials": [
      {
        "name": "app-id",
        "value": 1234,
        "safe": true
      },
      {
        "name": "app-secret",
        "safe": "false"
      }
    ]
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <token>4Mzsc0Y8Eqa9mmSz6VNEVUJQ390</token>
  <hostnames>http://posttestserver.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2016-10-04T17:48:39Z</created_at>
  <updated_at type="dateTime">2016-10-04T17:48:39Z</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
only required for test receivers
Whitelist of hosts that receiver can send payments to. Supports a comma seperated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., http://testing.receiver.com. 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 echoed back in API responses.

Response Body

Notable response elements include:

Element Description
receiver Root element
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The whitelist 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://posttestserver.com",
    "protocol": {
      "user": "test_user",
      "password": "test_password"
    }
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <hostnames>sftp://posttestserver.com</hostnames>
  <protocol>
    <user>test_user</user>
    <password>test_password</password>
  </protocol>
</receiver>

HTTPS/1.1 201 Created
{
  "receiver": {
    "receiver_type": "test",
    "token": "M0G63PFeDRRjlgOVpvWMUs4ECVN",
    "hostnames": "sftp://posttestserver.com",
    "state": "retained",
    "created_at": "2016-08-11T17:39:37Z",
    "updated_at": "2016-08-11T17:39:37Z",
    "credentials": null,
    "protocol": {
      "user": "test_user"
    }
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <token>9GEGKAY2dsptq8RmYRzsv2eCtsH</token>
  <hostnames>sftp://posttestserver.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2016-08-11T17:39:37Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:37Z</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.
❯ hostnames
only required for test receivers
Whitelist of hosts that receiver can send payments to. Supports a comma seperated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., sftp://testing.receiver.com. Production receivers can omit hostnames as their values are hard-coded.
❯ protocol
required for SFTP recievers
a hash of protocol values, currently only used for the SFTP protocol. e.g. sftp://user:password@127.0.0.0
❯❯ user The user value.
❯❯ password The password value.

Response Body

Notable response elements include:

Element Description
receiver Root element
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The whitelist 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

GET /v1/receivers/<receiver_token>.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==


HTTPS/1.1 200 OK
{
  "receiver": {
    "receiver_type": "test",
    "token": "bYWiJG8xURmLfykPYQFNJ33X6Y",
    "hostnames": "http://posttestserver.com",
    "state": "retained",
    "created_at": "2016-08-11T18:02:44Z",
    "updated_at": "2016-08-11T18:02:44Z",
    "credentials": null
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <token>QVy2nwrlV5NdCGiqNi4Yrgaiv1U</token>
  <hostnames>http://posttestserver.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2016-08-11T18:02:44Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:44Z</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
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The whitelist 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

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": "Ka7DKg5qBxB1GjMEQPVj8uf1gKi",
    "created_at": "2016-08-11T18:02:44Z",
    "updated_at": "2016-08-11T18:02:45Z",
    "succeeded": true,
    "transaction_type": "UpdatePaymentMethodReceiver",
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "receiver": {
      "receiver_type": "test",
      "token": "87HTB9JzQitB77Us16Pv5BeNZa3",
      "hostnames": "http://posttestserver.com",
      "state": "retained",
      "created_at": "2016-08-11T18:02:44Z",
      "updated_at": "2016-08-11T18:02:44Z",
      "credentials": [
        {
          "name": "app-id",
          "value": "abcd",
          "safe": true
        },
        {
          "name": "app-secret",
          "safe": "false"
        }
      ]
    }
  }
}
<transaction>
  <token>333XAnguBO7tTdBoKZfxqvxOT64</token>
  <created_at type="dateTime">2016-08-11T18:02:45Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:45Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>UpdatePaymentMethodReceiver</transaction_type>
  <state>succeeded</state>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <receiver>
    <receiver_type>test</receiver_type>
    <token>ED0YaeJGHq7xAw6V6UdHFqOAfdF</token>
    <hostnames>http://posttestserver.com</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2016-08-11T18:02:45Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:45Z</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 whitelist 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

PUT /v1/receivers/<receiver_token>/redact.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==


HTTPS/1.1 200 OK
{
  "transaction": {
    "token": "29WyVVyHkp0TAzTGljO4Bp3Wwmo",
    "created_at": "2016-08-11T18:02:43Z",
    "updated_at": "2016-08-11T18:02:43Z",
    "succeeded": true,
    "transaction_type": "RedactPaymentMethodReceiver",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "receiver": {
      "receiver_type": "test",
      "token": "1OyXWZnpor2AJMYfHdNbD20e9gG",
      "hostnames": "http://posttestserver.com",
      "state": "redacted",
      "created_at": "2016-08-11T18:02:43Z",
      "updated_at": "2016-08-11T18:02:43Z",
      "credentials": null
    }
  }
}
<transaction>
  <token>M5Y6d7LLppoNIXXHA4QmwBRcjKF</token>
  <created_at type="dateTime">2016-08-11T18:02:44Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:44Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>RedactPaymentMethodReceiver</transaction_type>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <receiver>
    <receiver_type>test</receiver_type>
    <token>D9rSRlgLNpHyIJbVGbFn27d2D67</token>
    <hostnames>http://posttestserver.com</hostnames>
    <state>redacted</state>
    <created_at type="dateTime">2016-08-11T18:02:44Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:44Z</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 whitelist 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": "2032"
    },
    "email": "joey@example.com"
  }
}
<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>2032</year>
  </credit_card>
  <email>joey@example.com</email>
</payment_method>

HTTPS/1.1 201 Created
{
  "transaction": {
    "token": "BoAuUiHoEUcEdDouheW7Ggt70gj",
    "created_at": "2016-08-11T17:39:30Z",
    "updated_at": "2016-08-11T17:39:30Z",
    "succeeded": true,
    "transaction_type": "AddPaymentMethod",
    "retained": false,
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "UqcTR9m2y2eyR1GrOK1uQQ28okE",
      "created_at": "2016-08-11T17:39:30Z",
      "updated_at": "2016-08-11T17:39:30Z",
      "email": "joey@example.com",
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "4444",
      "first_six_digits": "555555",
      "card_type": "master",
      "first_name": "Joe",
      "last_name": "Jones",
      "month": 3,
      "year": 2032,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Joe Jones",
      "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": "eecf1b946f958448051eb5c169030933447c",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-4444"
    }
  }
}
<transaction>
  <token>5bavRCr62Tf03p8G1jRi7O5dkvy</token>
  <created_at type="dateTime">2016-08-11T17:39:30Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:30Z</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>A6rFGhkskh5SbbMLCgqWgpT3YEQ</token>
    <created_at type="dateTime">2016-08-11T17:39:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:30Z</updated_at>
    <email>joey@example.com</email>
    <data nil="true"></data>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <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">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>Joey Jones</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>XXX</verification_value>
    <number>XXXX-XXXX-XXXX-4444</number>
    <fingerprint>eecf1b946f958448051eb5c169030933447c</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.
❯ email 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

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, android_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.
❯❯ 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

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_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"
      }
    }
  }
}
<payment_method>
  <bank_account>
    <first_name>Jon</first_name>
    <last_name>Doe</last_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>
</payment_method>

HTTPS/1.1 201 Created
{
  "transaction": {
    "token": "19pPHLLSFNgVTlBmjHAM6LBh26O",
    "created_at": "2017-01-10T15:15:38Z",
    "updated_at": "2017-01-10T15:15:38Z",
    "succeeded": true,
    "transaction_type": "AddPaymentMethod",
    "retained": false,
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "Wf5hWEdBiPqv9wfa0YVZWzSE91Y",
      "created_at": "2017-01-10T15:15:38Z",
      "updated_at": "2017-01-10T15:15:38Z",
      "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,
      "full_name": "Jon Doe",
      "bank_name": null,
      "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>B3roXmGPfmu4eAP8K905jfELZgp</token>
  <created_at type="dateTime">2017-01-10T15:15:38Z</created_at>
  <updated_at type="dateTime">2017-01-10T15:15:38Z</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>Qos30e5vEcjPfRzrSxcTXxtK3jt</token>
    <created_at type="dateTime">2017-01-10T15:15:38Z</created_at>
    <updated_at type="dateTime">2017-01-10T15:15:38Z</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>
    <full_name>Jon Doe</full_name>
    <bank_name nil="true"></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_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

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, android_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 Android Pay (βeta)

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

{
  "payment_method": {
    "android_pay": {
      "payment_data": {
        "encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE",
        "ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=",
        "tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="
      },
      "certificate_token": "Npyj0A5xbeqO1hVNJEa4nvkCHwP",
      "transaction_id": "123456789",
      "test_card_number": "4111111111111111"
    }
  }
}
<payment_method>
  <android_pay>
    <payment_data>
<![CDATA[{"encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE","ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=","tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="}]]>
    </payment_data>
    <certificate_token>Npyj0A5xbeqO1hVNJEa4nvkCHwP</certificate_token>
    <transaction_id>123456789</transaction_id>
    <test_card_number>4111111111111111</test_card_number>
  </android_pay>
</payment_method>

HTTPS/1.1 201 Created
{
  "transaction": {
    "token": "MuHOCmCJW1RXf1o8s4WmixD3j5r",
    "created_at": "2016-09-06T16:50:34Z",
    "updated_at": "2016-09-06T16:50:35Z",
    "succeeded": true,
    "transaction_type": "AddPaymentMethod",
    "retained": false,
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "BGG0cx3xZExcsHtWtNR7X0euGZC",
      "created_at": "2016-09-06T16:50:34Z",
      "updated_at": "2016-09-06T16:50:35Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": null,
      "last_name": null,
      "month": 12,
      "year": 2020,
      "full_name": "",
      "payment_method_type": "android_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <token>3Y2IIzmKohfsVOP1zqYZPNEegPj</token>
  <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
  <updated_at type="dateTime">2016-10-25T21:07:37Z</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>Wfo4JKo6mZMnJs4uoY6pmitXCsC</token>
    <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
    <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name nil="true"></first_name>
    <last_name nil="true"></last_name>
    <month type="integer">12</month>
    <year type="integer">2020</year>
    <full_name></full_name>
    <payment_method_type>android_pay</payment_method_type>
    <errors>
    </errors>
  </payment_method>
</transaction>

Add an Android Pay payment method to the authenticated environment’s vault.

To create a test Android 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
❯ android_pay Android pay element
❯❯ payment_data
required
The JSON-formatted encrypted payload Android Pay Payment Token
❯❯ certificate_token The token identifying the Certificate used by the native Android Pay app to encrypt the payment data (the certificate must exist within the same Spreedly environment as this new payment method).
❯❯ transaction_id
optional
The Google Transaction ID (required for some gateways, such as Braintree)
❯❯ test_card_number Android Pay does not provide a way to create a test payment token. To mark this as a test Android 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 Android Pay payment data.
❯ retained true if this payment method should be automatically retained on creation

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, android_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 (Android Pay alias) credit card number. This can be displayed to the user.
❯❯ first_six_digits The first six digits of the (Android Pay alias) credit card number. This can be displayed to the user.
❯❯ month The expiration month
❯❯ year The expiration year

Create Apple Pay

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

{
  "payment_method": {
    "apple_pay": {
      "payment_data": {
        "version": "EC_v1",
        "data": "QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud",
        "signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0E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qGSM49BAMCA2cAMGQCMDrPcoNRFpmxhvs1w1bKYr/0F+3ZD3VNoo6+8ZyBXkK3ifiY95tZn5jVQQ2PnenC/gIwMi3VRCGwowV3bF3zODuQZ/0XfCwhbZZPxnJpghJvVPh6fRuZy5sJiSFhBpkPCZIdAAAxggFfMIIBWwIBATCBhjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCCRD8qgGnfV3MA0GCWCGSAFlAwQCAQUAoGkwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTUwMjI0MTgzNTU5WjAvBgkqhkiG9w0BCQQxIgQgohbm8d0A42OAyMnc5fsgQoCNYjtEd/W/dW6+yezIwoAwCgYIKoZIzj0EAwIERzBFAiEAtEkap+JHypwfL1EdabD7RWPZol3na0LhMk9XzLhis0oCIGwxzOhQnMw+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",
    "address1": "12345 Example Way",
    "city": "Atlanta",
    "state": "GA",
    "zip": "30301",
    "country": "USA",
    "shipping_address1": "12345 Example Way",
    "shipping_city": "Atlanta",
    "shipping_state": "GA",
    "shipping_zip": "30301",
    "shipping_country": "USA"
  }
}
<payment_method>
  <apple_pay>
    <payment_data>
<![CDATA[{"version":"EC_v1","data":"QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud","signature":"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE0MDkyNTIyMDYxMVoXDTE5MDkyNDIyMDYxMVowXzElMCMGA1UEAwwcZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtUFJPRDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwhV37evWx7Ihj2jdcJChIY3HsL1vLCg9hGCV2Ur0pUEbg0IO2BHzQH6DMx8cVMP36zIg1rrV1O/0komJPnwPE6OCAhEwggINMEUG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QxIgQgohbm8d0A42OAyMnc5fsgQoCNYjtEd/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>
  <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": "BGKT5Yk9LUFC4Hns1YV21vamIGv",
    "created_at": "2016-08-24T19:53:10Z",
    "updated_at": "2016-08-24T19:53:11Z",
    "succeeded": true,
    "transaction_type": "AddPaymentMethod",
    "retained": false,
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "SepEV35JPdjVIMLwY7jdof3mfIv",
      "created_at": "2016-08-24T19:53:10Z",
      "updated_at": "2016-08-24T19:53:11Z",
      "email": "john.smith@example.com",
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "John",
      "last_name": "Smith",
      "month": 3,
      "year": 2018,
      "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,
      "payment_method_type": "apple_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <token>SBtCuN520OstUqQ83tJO0zuucdW</token>
  <created_at type="dateTime">2016-08-24T19:58:22Z</created_at>
  <updated_at type="dateTime">2016-08-24T19:58:22Z</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>UIsMCkbK8f2Ua3mlxsIzpvTWWNE</token>
    <created_at type="dateTime">2016-08-24T19:58:22Z</created_at>
    <updated_at type="dateTime">2016-08-24T19:58:22Z</updated_at>
    <email>joey@example.com</email>
    <data nil="true"></data>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <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">3</month>
    <year type="integer">2018</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>
    <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
❯ email The email address of the cardholder
❯ first_name The first name of the cardholder
❯ last_name The last name of the cardholder
❯ address_1 Cardholder’s address, line 1
❯ address_2 Cardholder’s address, line 2
❯ city Cardholder’s city
❯ state Cardholder’s state
❯ zip Cardholder’s zip
❯ country Cardholder’s country

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, android_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.
❯❯ 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": "7oxM50K1L8l4kNCO2ezNLDp0ioM",
    "created_at": "2016-08-11T17:39:30Z",
    "updated_at": "2016-08-11T17:39:30Z",
    "succeeded": true,
    "transaction_type": "AddPaymentMethod",
    "retained": false,
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "Hav5mUkeD2p8101ZZScVNYN0Mvv",
      "created_at": "2016-08-11T17:39:30Z",
      "updated_at": "2016-08-11T17:39:30Z",
      "gateway_type": "litle",
      "storage_state": "cached",
      "third_party_token": "MF424cE3jPVESunRNZW0oFtmyI4",
      "payment_method_type": "third_party_token",
      "errors": [

      ]
    }
  }
}
<transaction>
  <token>6F0ql2PvaNQEyz2cLkrhidxusFl</token>
  <created_at type="dateTime">2016-08-11T17:39:31Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:31Z</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>MsM5y5lChC7oVfDFgHSi4feT6uU</token>
    <created_at type="dateTime">2016-08-11T17:39:31Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:31Z</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, android_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": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:28Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Robert",
      "last_name": "Lemke",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Robert Lemke",
      "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "",
      "number": "XXXX-XXXX-XXXX-1111"
    },
    {
      "token": "ZnprV9wH3cMlHiOTbMUfrJeRYY1",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:16:14Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1881",
      "first_six_digits": "401288",
      "card_type": "visa",
      "first_name": "Mark",
      "last_name": "Buckridge",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Mark Buckridge",
      "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": "20dfe7eff8b1c51b5a8274bd0afdba9833ec",
      "verification_value": "",
      "number": "XXXX-XXXX-XXXX-1881"
    }
  ]
}
<payment_methods>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:28Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</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>Robert Lemke</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>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
  <payment_method>
    <token>ZnprV9wH3cMlHiOTbMUfrJeRYY1</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:16:14Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1881</last_four_digits>
    <first_six_digits>401288</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Mark</first_name>
    <last_name>Buckridge</last_name>
    <month type="integer">4</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>Mark Buckridge</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-1881</number>
    <fingerprint>20dfe7eff8b1c51b5a8274bd0afdba9833ec</fingerprint>
  </payment_method>
</payment_methods>

Retrieve an ordered and paginated list of all retained payment methods 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 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, android_pay, etc…
❯ errors If the payment method is invalid (missing first name, number etc…), there will be an associated error message here

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": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
    "created_at": "2016-08-11T17:09:30Z",
    "updated_at": "2016-08-11T17:39:32Z",
    "email": null,
    "data": null,
    "storage_state": "retained",
    "test": true,
    "last_four_digits": "1111",
    "first_six_digits": "411111",
    "card_type": "visa",
    "first_name": "Robert",
    "last_name": "Lemke",
    "month": 4,
    "year": 2020,
    "address1": null,
    "address2": null,
    "city": null,
    "state": null,
    "zip": null,
    "country": null,
    "phone_number": null,
    "company": null,
    "full_name": "Robert Lemke",
    "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
    "verification_value": "XXX",
    "number": "XXXX-XXXX-XXXX-1111"
  }
}
<payment_method>
  <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
  <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
  <email nil="true"></email>
  <data nil="true"></data>
  <storage_state>retained</storage_state>
  <test type="boolean">true</test>
  <last_four_digits>1111</last_four_digits>
  <first_six_digits>411111</first_six_digits>
  <card_type>visa</card_type>
  <first_name>Robert</first_name>
  <last_name>Lemke</last_name>
  <month type="integer">4</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>Robert Lemke</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>XXX</verification_value>
  <number>XXXX-XXXX-XXXX-1111</number>
  <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</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, third_party_token, etc…
❯ errors If the payment method is invalid (missing required fields, etc…), there will be associated error messages here

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"
  }
}
<payment_method>
  <first_name>Newfirst</first_name>
  <last_name>Newlast</last_name>
</payment_method>

HTTPS/1.1 200 OK
{
  "payment_method": {
    "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
    "created_at": "2016-08-11T17:09:30Z",
    "updated_at": "2016-08-11T17:39:34Z",
    "email": null,
    "data": null,
    "storage_state": "retained",
    "test": true,
    "last_four_digits": "1111",
    "first_six_digits": "411111",
    "card_type": "visa",
    "first_name": "Newfirst",
    "last_name": "Newlast",
    "month": 4,
    "year": 2020,
    "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
    "verification_value": "XXX",
    "number": "XXXX-XXXX-XXXX-1111"
  }
}
<payment_method>
  <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
  <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:34Z</updated_at>
  <email nil="true"></email>
  <data nil="true"></data>
  <storage_state>retained</storage_state>
  <test type="boolean">true</test>
  <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">4</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>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>XXX</verification_value>
  <number>XXXX-XXXX-XXXX-1111</number>
  <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
</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)

Response Body

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

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": "6wLNZVdm9fWRMJ84ZVvjI6dvSIt",
    "created_at": "2016-08-11T17:39:32Z",
    "updated_at": "2016-08-11T17:39:32Z",
    "succeeded": true,
    "transaction_type": "RetainPaymentMethod",
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:32Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Robert",
      "last_name": "Lemke",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Robert Lemke",
      "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <token>9mZ76xSGtwY0G5Ws2RJJ9aJJJLT</token>
  <created_at type="dateTime">2016-08-11T17:39:32Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:32Z</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>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</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>Robert Lemke</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>XXX</verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</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 redacted
❯❯ redacted If the payment method is redacted
❯❯ state The new state of the payment method (retained)

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 201 Created
{
  "transaction": {
    "created_at": "2016-08-11T18:02:47Z",
    "updated_at": "2016-08-11T18:02:47Z",
    "succeeded": true,
    "token": "K4rI86gLwyEtY94VgVzCTqMre0j",
    "state": "succeeded",
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "transaction_type": "Store",
    "third_party_token": null,
    "gateway_transaction_id": "53",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "payment_method": {
      "token": "FhsD0o0po7UpS3H3y8gxo2MLNDM",
      "created_at": "2016-08-11T18:02:47Z",
      "updated_at": "2016-08-11T18:02:47Z",
      "gateway_type": "test",
      "storage_state": "retained",
      "third_party_token": "test_vault:4111111111111111",
      "payment_method_type": "third_party_token",
      "errors": [

      ]
    },
    "basis_payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T18:02:47Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Newfirst",
      "last_name": "Newlast",
      "month": 4,
      "year": 2020,
      "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "",
      "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T18:02:47Z",
      "updated_at": "2016-08-11T18:02:47Z"
    }
  }
}
<transaction>
  <created_at type="dateTime">2016-08-11T18:02:47Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:47Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>DEPirq6UouIelMZ95KEQNQ7sPDi</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>51</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <payment_method>
    <token>5fz9twu9fBDXrvgnhRKW1ubYi7w</token>
    <created_at type="dateTime">2016-08-11T18:02:47Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:47Z</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>
    <errors>
    </errors>
  </payment_method>
  <basis_payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:47Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <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">4</month>
    <year type="integer">2020</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"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value></verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T18:02:47Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:47Z</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.

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 third party token payment method that references the payment method stored at the gateway
❯❯ third_party_token The token identifying the payment method at the gateway
❯ basis_payment_method The payment method vaulted at Spreedly that was copied to the gateway as part of this transaction

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": "2016-08-11T17:39:32Z",
    "updated_at": "2016-08-11T17:39:32Z",
    "succeeded": true,
    "token": "1MK2UrrBFohKLbZgcrOtxX9pDzk",
    "state": "succeeded",
    "gateway_specific_fields": {
    },
    "gateway_specific_response_fields": {
    },
    "transaction_type": "RedactPaymentMethod",
    "order_id": null,
    "ip": null,
    "gateway_transaction_id": null,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "A6rFGhkskh5SbbMLCgqWgpT3YEQ",
      "created_at": "2016-08-11T17:39:30Z",
      "updated_at": "2016-08-11T17:39:32Z",
      "email": "joey@example.com",
      "data": null,
      "storage_state": "redacted",
      "test": true,
      "last_four_digits": "4444",
      "first_six_digits": "555555",
      "card_type": "master",
      "first_name": "Joey",
      "last_name": "Jones",
      "month": 3,
      "year": 2032,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Joey Jones",
      "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": "eecf1b946f958448051eb5c169030933447c",
      "verification_value": "",
      "number": ""
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">false</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:32Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <token>HNBzGiFsuYDT25vcwK0vsP0mqLz</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>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <payment_method>
    <token>A6rFGhkskh5SbbMLCgqWgpT3YEQ</token>
    <created_at type="dateTime">2016-08-11T17:39:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
    <email>joey@example.com</email>
    <data nil="true"></data>
    <storage_state>redacted</storage_state>
    <test type="boolean">true</test>
    <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">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>Joey Jones</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></number>
    <fingerprint>eecf1b946f958448051eb5c169030933447c</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 and, if not needed, the request body can be empty.

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 redacted
❯❯ redacted If the payment method is now redacted
❯❯ state The new state of the payment method (redacted)

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 201 Created
{
  "transaction": {
    "token": "K5isn0pQi2u5X0OTzZtFVvpxFBW",
    "transaction_type": "RecacheSensitiveData",
    "succeeded": true,
    "data": null,
    "created_at": "2016-08-11T17:39:31Z",
    "updated_at": "2016-08-11T17:39:31Z",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:31Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Robert",
      "last_name": "Lemke",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Robert Lemke",
      "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <token>aNsJvxWksh31W61u4s2IrX5ynTG</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>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</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>Robert Lemke</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>XXX</verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
  <created_at type="dateTime">2016-08-11T17:39:31Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
</transaction>

Update a credit card’s verification value (CVV) so the card can be transacted against.

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

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": "9mZ76xSGtwY0G5Ws2RJJ9aJJJLT",
      "created_at": "2016-08-11T17:39:32Z",
      "updated_at": "2016-08-11T17:39:32Z",
      "succeeded": true,
      "transaction_type": "RetainPaymentMethod",
      "state": "succeeded",
      "message_key": "messages.transaction_succeeded",
      "message": "Succeeded!",
      "payment_method": {
        "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
        "created_at": "2016-08-11T17:09:30Z",
        "updated_at": "2016-08-11T17:39:32Z",
        "email": null,
        "data": null,
        "storage_state": "retained",
        "test": true,
        "last_four_digits": "1111",
        "first_six_digits": "411111",
        "card_type": "visa",
        "first_name": "Robert",
        "last_name": "Lemke",
        "month": 4,
        "year": 2020,
        "address1": null,
        "address2": null,
        "city": null,
        "state": null,
        "zip": null,
        "country": null,
        "phone_number": null,
        "company": null,
        "full_name": "Robert Lemke",
        "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": "b0a45066121c1f1a49b3a6ffc26caf2995db",
        "verification_value": "XXX",
        "number": "XXXX-XXXX-XXXX-1111"
      }
    }
  ]
}
<transactions>
  <transaction>
    <token>9mZ76xSGtwY0G5Ws2RJJ9aJJJLT</token>
    <created_at type="dateTime">2016-08-11T17:39:32Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:32Z</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>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
      <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
      <updated_at type="dateTime">2016-08-11T17:39:32Z</updated_at>
      <email nil="true"></email>
      <data nil="true"></data>
      <storage_state>retained</storage_state>
      <test type="boolean">true</test>
      <last_four_digits>1111</last_four_digits>
      <first_six_digits>411111</first_six_digits>
      <card_type>visa</card_type>
      <first_name>Robert</first_name>
      <last_name>Lemke</last_name>
      <month type="integer">4</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>Robert Lemke</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>XXX</verification_value>
      <number>XXXX-XXXX-XXXX-1111</number>
      <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
    </payment_method>
  </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

Certificates

List

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": "Qdfm6fpRawnSkkvAD7CZtMIQFSx",
      "algorithm": "ec-prime256v1",
      "cn": "www.spreedly.com",
      "o": "Spreedly, Inc.",
      "ou": null,
      "c": "US",
      "st": null,
      "l": null,
      "email_address": "applepay@spreedly.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-----\nMIIBRDCB6wIBADCBiDEZMBcGA1UEAwwQd3d3LnNwcmVlZGx5LmNvbTEXMBUGA1UE\nCgwOU3ByZWVkbHksIEluYy4xCTAHBgNVBAsMADELMAkGA1UEBhMCVVMxCTAHBgNV\nBAgMADEJMAcGA1UEBwwAMSQwIgYJKoZIhvcNAQkBFhVhcHBsZXBheUBzcHJlZWRs\neS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQhoBD6FaOXUJq3e4EoI7rW\nemTzhLaPlAdF87WzmbhWKVNJ9LAEhrBjAtj6is765Ow2dnYta0QPF9EJoubwKOjK\noAAwCgYIKoZIzj0EAwIDSAAwRQIhALvhdhMDuUTkEWoYrW7wK0PO6jUwHfllTUNS\nfZ3pbCebAiAuS0VDKJgK+PcT7dJL+x1HWKwMssR+L1HmOaEipOjW5A==\n-----END CERTIFICATE REQUEST-----\n",
      "pem": "-----BEGIN CERTIFICATE-----\nMIIEiTCCBC6gAwIBAgIIFRZ9ouKAzqwwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMM\nK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAk\nBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5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uY29tL2NlcnRpZmlj\nYXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl\nLmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk\nBiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG\nQ0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD\nQ87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0\nLDW0aLigLHbDgQcrXA==\n-----END CERTIFICATE-----\n",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:24:19Z"
    },
    {
      "token": "S5bf7jOxiS6sa10JbQyHt1ZCFCV",
      "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-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHN9lcgyvv/qitwftipyX0R2qPu2q\n6z7+65u91szaHU2HChJNSOne/Kky3pWhTmVKh3ummT0+a5Wbfz2GDKXVyg==\n-----END PUBLIC KEY-----\n",
      "public_key_hash": "6P+AXQEn0VuKWKpTRbVRcMWV7QAJJwjTSh66HcVwzEs=",
      "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ\nMAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv\ndXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHN9lcgyvv/qitwft\nipyX0R2qPu2q6z7+65u91szaHU2HChJNSOne/Kky3pWhTmVKh3ummT0+a5Wbfz2G\nDKXVyqAAMAoGCCqGSM49BAMCA0gAMEUCIQDKevIcVkoaD/ff6HVRy6EDNutvgPCE\neSBA3PJJhTB6tQIgeEMlJAO79/FypOemtW0eqECOHKQlVnwSxW27v+vLg98=\n-----END CERTIFICATE REQUEST-----\n",
      "pem": null,
      "created_at": "2016-08-11T17:24:18Z",
      "updated_at": "2016-08-11T17:24:18Z"
    }
  ]
}
<certificates>
  <certificate>
    <token>Qdfm6fpRawnSkkvAD7CZtMIQFSx</token>
    <algorithm>ec-prime256v1</algorithm>
    <cn>www.spreedly.com</cn>
    <o>Spreedly, Inc.</o>
    <ou nil="true"></ou>
    <c>US</c>
    <st nil="true"></st>
    <l nil="true"></l>
    <email_address>applepay@spreedly.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-----
MIIBRDCB6wIBADCBiDEZMBcGA1UEAwwQd3d3LnNwcmVlZGx5LmNvbTEXMBUGA1UE
CgwOU3ByZWVkbHksIEluYy4xCTAHBgNVBAsMADELMAkGA1UEBhMCVVMxCTAHBgNV
BAgMADEJMAcGA1UEBwwAMSQwIgYJKoZIhvcNAQkBFhVhcHBsZXBheUBzcHJlZWRs
eS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQhoBD6FaOXUJq3e4EoI7rW
emTzhLaPlAdF87WzmbhWKVNJ9LAEhrBjAt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LMIIBHQYDVR0gBIIBFDCCARAwggEMBgkqhkiG92NkBQEwgf4w
gcMGCCsGAQUFBwICMIG2DIGzUmVsaWFuY2Ugb24gdGhpcyBjZXJ0aWZpY2F0ZSBi
eSBhbnkgcGFydHkgYXNzdW1lcyBhY2NlcHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxp
Y2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlLCBjZXJ0
aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRpZmljYXRpb24gcHJhY3RpY2Ugc3RhdGVt
ZW50cy4wNgYIKwYBBQUHAgEWKmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj
YXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl
LmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk
BiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG
Q0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD
Q87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0
LDW0aLigLHbDgQcrXA==
-----END CERTIFICATE-----
</pem>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:24:19Z</updated_at>
  </certificate>
  <certificate>
    <token>S5bf7jOxiS6sa10JbQyHt1ZCFCV</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-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHN9lcgyvv/qitwftipyX0R2qPu2q
6z7+65u91szaHU2HChJNSOne/Kky3pWhTmVKh3ummT0+a5Wbfz2GDKXVyg==
-----END PUBLIC KEY-----
</public_key>
    <public_key_hash>6P+AXQEn0VuKWKpTRbVRcMWV7QAJJwjTSh66HcVwzEs=</public_key_hash>
    <csr>-----BEGIN CERTIFICATE REQUEST-----
MIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv
biBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ
MAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv
dXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHN9lcgyvv/qitwft
ipyX0R2qPu2q6z7+65u91szaHU2HChJNSOne/Kky3pWhTmVKh3ummT0+a5Wbfz2G
DKXVyqAAMAoGCCqGSM49BAMCA0gAMEUCIQDKevIcVkoaD/ff6HVRy6EDNutvgPCE
eSBA3PJJhTB6tQIgeEMlJAO79/FypOemtW0eqECOHKQlVnwSxW27v+vLg98=
-----END CERTIFICATE REQUEST-----
</csr>
    <pem nil="true"></pem>
    <created_at type="dateTime">2016-08-11T17:24:18Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:24:18Z</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

POST /v1/certificates.<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": "Z51pEs7B0518MzRgaNpf4J2qRGq",
    "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-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEukd1bn5G2B/bxHR/+FOQBAfRSkdx\nDrjX7oYXwhrPdpwABiWlctsb9kDPy+FRqhtwHnrf+7KvIT97HjXpo+VFhA==\n-----END PUBLIC KEY-----\n",
    "public_key_hash": "wdHe9DURiq6dJCSYgtn6ZvhJ2pw+4ms53E9XnsS0Rgw=",
    "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv\nbiBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ\nMAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv\ndXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEukd1bn5G2B/bxHR/\n+FOQBAfRSkdxDrjX7oYXwhrPdpwABiWlctsb9kDPy+FRqhtwHnrf+7KvIT97HjXp\no+VFhKAAMAoGCCqGSM49BAMCA0gAMEUCIFBU7Efbx6JRim9kCn/UTU8QvCfvEPmQ\nTEEFGZUON+4HAiEAh/FYEaslQeIPVIe8LqKx8M/TkuZX1DTgE13A98G3quU=\n-----END CERTIFICATE REQUEST-----\n",
    "pem": null,
    "created_at": "2016-08-11T17:39:16Z",
    "updated_at": "2016-08-11T17:39:16Z"
  }
}
<certificate>
  <token>ZefKAXNKZcizybSoJcz6GSkBndr</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-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYR468ELtlSVcjrz6eWTEajLlqyLR
ff241XQ/6CHX2yeEFuPtFUJknLASbJYU189Z8YkntDTUUVtZIWk1LUHJNw==
-----END PUBLIC KEY-----
</public_key>
  <public_key_hash>klZ8OpTUxZyqO4n+LXGPW5HHbVDmbGd6nJynvmUo2Z0=</public_key_hash>
  <csr>-----BEGIN CERTIFICATE REQUEST-----
MIIBSDCB7wIBADCBjDEuMCwGA1UEAwwlTXlBcHAgQXBwbGVQYXkgUHJvZHVjdGlv
biBDZXJ0aWZpY2F0ZTEJMAcGA1UECgwAMQkwBwYDVQQLDAAxCTAHBgNVBAYTADEJ
MAcGA1UECAwAMQkwBwYDVQQHDAAxIzAhBgkqhkiG9w0BCQEWFHNlY3VyaXR5QHlv
dXJvcmcuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYR468ELtlSVcjrz6
eWTEajLlqyLRff241XQ/6CHX2yeEFuPtFUJknLASbJYU189Z8YkntDTUUVtZIWk1
LUHJN6AAMAoGCCqGSM49BAMCA0gAMEUCIQCZ2UqWwGBvXb8R37CmHTNBSLtErVR1
EuqNdlU1XtgeCgIgXQdSMKwLwkclyO2cXgZ4z6GrHVnniTZf2urrhTnvbQI=
-----END CERTIFICATE REQUEST-----
</csr>
  <pem nil="true"></pem>
  <created_at type="dateTime">2016-08-11T17:39:16Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:16Z</updated_at>
</certificate>

Create 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 option is ec-prime256v1 representing the X9.62/SECG curve over a 256 bit prime field.
❯ 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 creation.

Update

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\nLlNwcmVlZGx5QXBwbGVQYXlUZXN0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NVHRMBAf8EAjAAMB8GA1UdIwQYMBaAFIS2hMw6hmJy
FlmU6BqjvUjfOt8LMIIBHQYDVR0gBIIBFDCCARAwggEMBgkqhkiG92NkBQEwgf4w
gcMGCCsGAQUFBwICMIG2DIGzUmVsaWFuY2Ugb24gdGhpcyBjZXJ0aWZpY2F0ZSBi
eSBhbnkgcGFydHkgYXNzdW1lcyBhY2NlcHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxp
Y2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlLCBjZXJ0
aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRpZmljYXRpb24gcHJhY3RpY2Ugc3RhdGVt
ZW50cy4wNgYIKwYBBQUHAgEWKmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj
YXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl
LmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk
BiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG
Q0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD
Q87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0
LDW0aLigLHbDgQcrXA==
-----END CERTIFICATE-----
]]>
  </pem>
</certificate>

HTTPS/1.1 200 OK
{
  "certificate": {
    "token": "Qdfm6fpRawnSkkvAD7CZtMIQFSx",
    "algorithm": "ec-prime256v1",
    "cn": "www.spreedly.com",
    "o": "Spreedly, Inc.",
    "ou": null,
    "c": "US",
    "st": null,
    "l": null,
    "email_address": "applepay@spreedly.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-----\nMIIBRDCB6wIBADCBiDEZMBcGA1UEAwwQd3d3LnNwcmVlZGx5LmNvbTEXMBUGA1UE\nCgwOU3ByZWVkbHksIEluYy4xCTAHBgNVBAsMADELMAkGA1UEBhMCVVMxCTAHBgNV\nBAgMADEJMAcGA1UEBwwAMSQwIgYJKoZIhvcNAQkBFhVhcHBsZXBheUBzcHJlZWRs\neS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQhoBD6FaOXUJq3e4EoI7rW\nemTzhLaPlAdF87WzmbhWKVNJ9LAEhrBjAtj6is765Ow2dnYta0QPF9EJoubwKOjK\noAAwCgYIKoZIzj0EAwIDSAAwRQIhALvhdhMDuUTkEWoYrW7wK0PO6jUwHfllTUNS\nfZ3pbCebAiAuS0VDKJgK+PcT7dJL+x1HWKwMssR+L1HmOaEipOjW5A==\n-----END CERTIFICATE REQUEST-----\n",
    "pem": "-----BEGIN CERTIFICATE-----\nMIIEiTCCBC6gAwIBAgIIFRZ9ouKAzqwwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMM\nK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAk\nBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApB\ncHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xNTAyMTkyMDMzMzBaFw0xNzAzMjAy\nMDMzMzBaMIG5MTowOAYKCZImiZPyLGQBAQwqbWVyY2hhbnQuY29tLnNlYXRnZWVr\nLlNwcmVlZGx5QXBwbGVQYXlUZXN0MUAwPgYDVQ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2QUVDMzA0MENBMkFGNzA4MEYzRTBG\nQ0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD\nQ87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0\nLDW0aLigLHbDgQcrXA==\n-----END CERTIFICATE-----\n",
    "created_at": "2016-08-11T17:09:30Z",
    "updated_at": "2016-08-11T17:39:17Z"
  }
}
<certificate>
  <token>Qdfm6fpRawnSkkvAD7CZtMIQFSx</token>
  <algorithm>ec-prime256v1</algorithm>
  <cn>www.spreedly.com</cn>
  <o>Spreedly, Inc.</o>
  <ou nil="true"></ou>
  <c>US</c>
  <st nil="true"></st>
  <l nil="true"></l>
  <email_address>applepay@spreedly.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-----
MIIBRDCB6wIBADCBiDEZMBcGA1UEAwwQd3d3LnNwcmVlZGx5LmNvbTEXMBUGA1UE
CgwOU3ByZWVkbHksIEluYy4xCTAHBgNVBAsMADELMAkGA1UEBhMCVVMxCTAHBgNV
BAgMADEJMAcGA1UEBwwAMSQwIgYJKoZIhvcNAQkBFhVhcHBsZXBheUBzcHJlZWRs
eS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQhoBD6FaOXUJq3e4EoI7rW
emTzhLaPlAdF87WzmbhWKVNJ9LAEhrBjAtj6is765Ow2dnYta0QPF9EJoubwKOjK
oAAwCgYIKoZIzj0EAwIDSAAwRQIhALvhdhMDuUTkEW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GzUmVsaWFuY2Ugb24gdGhpcyBjZXJ0aWZpY2F0ZSBi
eSBhbnkgcGFydHkgYXNzdW1lcyBhY2NlcHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxp
Y2FibGUgc3RhbmRhcmQgdGVybXMgYW5kIGNvbmRpdGlvbnMgb2YgdXNlLCBjZXJ0
aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRpZmljYXRpb24gcHJhY3RpY2Ugc3RhdGVt
ZW50cy4wNgYIKwYBBQUHAgEWKmh0dHA6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj
YXRlYXV0aG9yaXR5LzA2BgNVHR8ELzAtMCugKaAnhiVodHRwOi8vY3JsLmFwcGxl
LmNvbS9hcHBsZXd3ZHJjYTIuY3JsMA4GA1UdDwEB/wQEAwIDKDBPBgkqhkiG92Nk
BiAEQgxAODlDQjI1MDkxOTI0RDY3RjlFMEM2QUVDMzA0MENBMkFGNzA4MEYzRTBG
Q0NFMTZBOTY5RDkyMUE0QkM5RTA1RjAKBggqhkjOPQQDAgNJADBGAiEAvKYdzDtD
Q87guVNkybbcEY1Y/nXO9Ry+4fVDwXYMET0CIQDEiK1+xSSziPZ/PPQHF8MCWsD0
LDW0aLigLHbDgQcrXA==
-----END CERTIFICATE-----
</pem>
  <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:17Z</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.

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": "D4vFoB5vfFng94nCr2t6YnEek5m",
      "created_at": "2016-08-11T17:09:58Z",
      "updated_at": "2016-08-11T17:09:58Z",
      "succeeded": true,
      "transaction_type": "AddGateway",
      "state": "succeeded",
      "gateway": {
        "token": "P0M2XOlKwAsxQ4I66vhoUydE1kV",
        "gateway_type": "allied_wallet",
        "description": null,
        "payment_methods": [
          "credit_card"
        ],
        "state": "retained",
        "created_at": "2016-08-11T17:09:58Z",
        "updated_at": "2016-08-11T17:09:58Z",
        "name": "Allied Wallet",
        "site_id": "your_site_id",
        "merchant_id": "your_merchant_id",
        "characteristics": [
          "purchase",
          "authorize",
          "capture",
          "credit",
          "void",
          "verify"
        ],
        "credentials": [
          {
            "name": "site_id",
            "value": "your_site_id"
          },
          {
            "name": "merchant_id",
            "value": "your_merchant_id"
          }
        ],
        "gateway_specific_fields": [

        ],
        "redacted": false
      },
      "message_key": "messages.transaction_succeeded",
      "message": "Succeeded!"
    },
    {
      "token": "ZT5ZAesSVtlp9MfQVv4bd4A1GJn",
      "created_at": "2016-08-11T17:09:59Z",
      "updated_at": "2016-08-11T17:09:59Z",
      "succeeded": true,
      "transaction_type": "AddGateway",
      "state": "succeeded",
      "gateway": {
        "token": "KDNYJ4DpF6FXsaAxjRqVqShTUbT",
        "gateway_type": "allied_wallet",
        "description": null,
        "payment_methods": [
          "credit_card"
        ],
        "state": "retained",
        "created_at": "2016-08-11T17:09:59Z",
        "updated_at": "2016-08-11T17:09:59Z",
        "name": "Allied Wallet",
        "site_id": "your_site_id",
        "merchant_id": "your_mechant_id",
        "characteristics": [
          "purchase",
          "authorize",
          "capture",
          "credit",
          "void",
          "verify"
        ],
        "credentials": [
          {
            "name": "site_id",
            "value": "your_site_id"
          },
          {
            "name": "merchant_id",
            "value": "your_mechant_id"
          }
        ],
        "gateway_specific_fields": [

        ],
        "redacted": false
      },
      "message_key": "messages.transaction_succeeded",
      "message": "Succeeded!"
    }
  ]
}
<transactions>
  <transaction>
    <token>D4vFoB5vfFng94nCr2t6YnEek5m</token>
    <created_at type="dateTime">2016-08-11T17:09:58Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:09:58Z</updated_at>
    <succeeded type="boolean">true</succeeded>
    <transaction_type>AddGateway</transaction_type>
    <state>succeeded</state>
    <message key="messages.transaction_succeeded">Succeeded!</message>
    <gateway>
      <token>P0M2XOlKwAsxQ4I66vhoUydE1kV</token>
      <gateway_type>allied_wallet</gateway_type>
      <name>Allied Wallet</name>
      <description nil="true"></description>
      <site_id>your_site_id</site_id>
      <merchant_id>your_merchant_id</merchant_id>
      <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_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_store type="boolean">false</supports_store>
        <supports_remove type="boolean">false</supports_remove>
        <supports_fraud_review type="boolean">false</supports_fraud_review>
        <supports_disburse type="boolean">false</supports_disburse>
      </characteristics>
      <credentials>
        <credential>
          <name>site_id</name>
          <value>your_site_id</value>
        </credential>
        <credential>
          <name>merchant_id</name>
          <value>your_merchant_id</value>
        </credential>
      </credentials>
      <gateway_specific_fields>
      </gateway_specific_fields>
      <payment_methods>
        <payment_method>credit_card</payment_method>
      </payment_methods>
      <state>retained</state>
      <redacted type="boolean">false</redacted>
      <created_at type="dateTime">2016-08-11T17:09:58Z</created_at>
      <updated_at type="dateTime">2016-08-11T17:09:58Z</updated_at>
    </gateway>
  </transaction>
  <transaction>
    <token>ZT5ZAesSVtlp9MfQVv4bd4A1GJn</token>
    <created_at type="dateTime">2016-08-11T17:09:59Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:09:59Z</updated_at>
    <succeeded type="boolean">true</succeeded>
    <transaction_type>AddGateway</transaction_type>
    <state>succeeded</state>
    <message key="messages.transaction_succeeded">Succeeded!</message>
    <gateway>
      <token>KDNYJ4DpF6FXsaAxjRqVqShTUbT</token>
      <gateway_type>allied_wallet</gateway_type>
      <name>Allied Wallet</name>
      <description nil="true"></description>
      <site_id>your_site_id</site_id>
      <merchant_id>your_mechant_id</merchant_id>
      <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_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_store type="boolean">false</supports_store>
        <supports_remove type="boolean">false</supports_remove>
        <supports_fraud_review type="boolean">false</supports_fraud_review>
        <supports_disburse type="boolean">false</supports_disburse>
      </characteristics>
      <credentials>
        <credential>
          <name>site_id</name>
          <value>your_site_id</value>
        </credential>
        <credential>
          <name>merchant_id</name>
          <value>your_mechant_id</value>
        </credential>
      </credentials>
      <gateway_specific_fields>
      </gateway_specific_fields>
      <payment_methods>
        <payment_method>credit_card</payment_method>
      </payment_methods>
      <state>retained</state>
      <redacted type="boolean">false</redacted>
      <created_at type="dateTime">2016-08-11T17:09:59Z</created_at>
      <updated_at type="dateTime">2016-08-11T17:09:59Z</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)
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/VanigrPuqhuoVGWSbAJludsW14j.<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": "2016-08-11T18:02:48Z",
    "updated_at": "2016-08-11T18:02:48Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "AOI83rflejGW5ZqBa4Ow9c1ogv1",
    "transaction_type": "Authorization",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "50",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": false,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T18:02:48Z",
      "updated_at": "2016-08-11T18:02:48Z"
    },
    "shipping_address": {
      "name": "Newfirst Newlast",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T18:02:47Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Newfirst",
      "last_name": "Newlast",
      "month": 4,
      "year": 2020,
      "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": 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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T18:02:48Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:48Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>ZJjVqMOH1TqYmCWABS1uP4AuS5m</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>
  <gateway_specific_fields nil="true"></gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>68</gateway_transaction_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>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T18:02:48Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:48Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at>2016-08-11T17:09:30Z</created_at>
    <updated_at>2016-08-11T18:02:48Z</updated_at>
    <email nil="true"></email>
    <data nil="true"></data>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <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">4</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>Newfirst Newlast</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>
    <errors>
    </errors>
    <verification_value></verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Get the transaction with the given token.

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, e.g., Authorization, Capture, Credit

Transcript

GET /v1/transactions/<transaction_token>/transcript HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==


HTTPS/1.1 200 OK
[*>] POST to http://posttestserver.com/post.php
          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":"2020",
    "month":"4"
  }
        [<*] Response 200 received in 0sDate: Thu, 11 Aug 2016 18:02:49 GMT
Server: Apache
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Vary: Accept-Encoding
Content-Length: 143
Content-Type: text/html; charset=UTF-8Successfully dumped 0 post variables.
View it at http://www.posttestserver.com/data/2016/08/11/11.02.491918756816
Post body was 200 chars long.

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.

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.

Purchase

Charge a payment method a specific amount at the target gateway.

Tokenized payment method

POST /v1/gateways/<gateway_token>/purchase.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:36Z",
    "updated_at": "2016-08-11T17:39:36Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "L7hexUxRCu6dRgzXhNqHcUWROPd",
    "transaction_type": "Purchase",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "68",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": false,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:36Z",
      "updated_at": "2016-08-11T17:39:36Z"
    },
    "shipping_address": {
      "name": "Newfirst Newlast",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:34Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Newfirst",
      "last_name": "Newlast",
      "month": 4,
      "year": 2020,
      "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": 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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:36Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:36Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>JHvDuWAAyAAL9RMeC1qRXkZhYy1</token>
  <transaction_type>Purchase</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>49</gateway_transaction_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>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Newfirst Newlast</name>
    <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>Successful purchase</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:36Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:36Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:36Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <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">4</month>
    <year type="integer">2020</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 nil="true"/>
    <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"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value></verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Charge a tokenized payment method (already stored in the Spreedly environment) the specified amount. The payment method can be of any type (credit card, bank account, Apple Pay, etc…), as long as it exists in the specified environment.

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 request element
❯ payment_method_token
required
The token of the payment method to use
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Pass-in credit card

POST /v1/gateways/<gateway_token>/purchase.<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": "2018"
    },
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <credit_card>
    <first_name>Joey</first_name>
    <last_name>Jones</last_name>
    <number>4111111111111111</number>
    <verification_value>423</verification_value>
    <month>3</month>
    <year>2020</year>
  </credit_card>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:35Z",
    "updated_at": "2016-08-11T17:39:35Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "GG8k9VMPMeh0U31930huUz7r1tn",
    "transaction_type": "Purchase",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "46",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:35Z",
      "updated_at": "2016-08-11T17:39:35Z"
    },
    "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": "R0gvmCyXc9ygAF93ah5w33qlWkM",
      "created_at": "2016-08-11T17:39:35Z",
      "updated_at": "2016-08-11T17:39:35Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>TcyWSE3JzBk9RYgvKLd0IESJRfs</token>
  <transaction_type>Purchase</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>45</gateway_transaction_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">true</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Joey Jones</name>
    <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>Successful purchase</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>9kY2MIGXYikBEsmNXBhdDXVDkxY</token>
    <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <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"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
    <company nil="true"/>
    <full_name>Joey Jones</full_name>
    <eligible_for_card_updater nil="true"/>
    <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"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value>XXX</verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Pass a credit card payment method directly in to the purchase request. If the card is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 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.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone
❯ 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

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

Pass-in bank account/eCheck

POST /v1/gateways/<gateway_token>/purchase.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "bank_account": {
      "first_name": "Joe",
      "last_name": "Smith",
      "bank_routing_number": "021000021",
      "bank_account_number": "9876543210"
    },
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <bank_account>
    <first_name>Joey</first_name>
    <last_name>Jones</last_name>
    <bank_routing_number>021000021</bank_routing_number>
    <bank_account_number>9876543210</bank_account_number>
  </bank_account>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:35Z",
    "updated_at": "2016-08-11T17:39:35Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "VFvqF3JFmVr2KBiyvPbYLM4Xg35",
    "transaction_type": "Purchase",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "63",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:35Z",
      "updated_at": "2016-08-11T17:39:35Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "5n9i2YjCFrAPEcO3djmn2UAjp4g",
      "created_at": "2016-08-11T17:39:35Z",
      "updated_at": "2016-08-11T17:39:35Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "full_name": "Joe Smith",
      "bank_name": null,
      "account_type": null,
      "account_holder_type": null,
      "routing_number_display_digits": "021",
      "account_number_display_digits": "3210",
      "first_name": "Joe",
      "last_name": "Smith",
      "payment_method_type": "bank_account",
      "errors": [

      ],
      "routing_number": "021*",
      "account_number": "*3210"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>Fw1cewMkqnfexgX8i133WyEjYny</token>
  <transaction_type>Purchase</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>58</gateway_transaction_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">true</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <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>Successful purchase</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>GOGinoc0yeYkJeoLe53nZg8IouP</token>
    <created_at type="dateTime">2016-08-11T17:39:35Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <full_name>Joey Jones</full_name>
    <bank_name nil="true"/>
    <account_type nil="true"/>
    <account_holder_type nil="true"/>
    <routing_number_display_digits>021</routing_number_display_digits>
    <account_number_display_digits>3210</account_number_display_digits>
    <first_name>Joey</first_name>
    <last_name>Jones</last_name>
    <payment_method_type>bank_account</payment_method_type>
    <errors>
    </errors>
    <routing_number>021*</routing_number>
    <account_number>*3210</account_number>
  </payment_method>
</transaction>

Pass a bank account/eCheck payment method directly in to the purchase request. If the bank account is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 request 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_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.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Pass-in Android Pay (βeta)

POST /v1/gateways/<gateway_token>/purchase.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "android_pay": {
      "payment_data": {
        "encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE",
        "ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=",
        "tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="
      },
      "certificate_token": "Npyj0A5xbeqO1hVNJEa4nvkCHwP",
      "transaction_id": "123456789",
      "test_card_number": "4111111111111111"
    },
    "amount": 1199,
    "currency_code": "USD"
  }
}
<transaction>
  <android_pay>
    <payment_data>
<![CDATA[{"encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE","ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=","tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="}]]>
    </payment_data>
    <certificate_token>Npyj0A5xbeqO1hVNJEa4nvkCHwP</certificate_token>
    <transaction_id>123456789</transaction_id>
    <test_card_number>4111111111111111</test_card_number>
  </android_pay>
  <amount>1199</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-10-25T21:07:37Z",
    "updated_at": "2016-10-25T21:07:37Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "8uuQD7vFRs186gqD8WXHodb6Uuh",
    "transaction_type": "Purchase",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "55",
    "amount": 1199,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "7irpFS4AxDazpJOmuNlos2ULfb8",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-10-25T21:07:37Z",
      "updated_at": "2016-10-25T21:07:37Z"
    },
    "shipping_address": {
      "name": "",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "6vHwG0xhcl51OYiKB0nFZQF4gh0",
      "created_at": "2016-10-25T21:07:37Z",
      "updated_at": "2016-10-25T21:07:37Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": null,
      "first_name": null,
      "last_name": null,
      "month": 12,
      "year": 2020,
      "full_name": "",
      "payment_method_type": "android_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
  <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>6qd18Y0XVt7khvPbTc9syPH1kT2</token>
  <transaction_type>Purchase</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>58</gateway_transaction_id>
  <amount type="integer">1199</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>7irpFS4AxDazpJOmuNlos2ULfb8</gateway_token>
  <shipping_address>
    <name></name>
    <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>Successful purchase</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
    <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>YKyYMWCLJSkDgRSoknzy7RDqNTw</token>
    <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
    <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type nil="true"/>
    <first_name nil="true"/>
    <last_name nil="true"/>
    <month type="integer">12</month>
    <year type="integer">2020</year>
    <full_name></full_name>
    <payment_method_type>android_pay</payment_method_type>
    <errors>
    </errors>
  </payment_method>
</transaction>

Pass an Android Pay payment method directly in to the purchase request. If the Android Pay data is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 request element
❯ android_pay Android pay element
❯❯ payment_data
required
The JSON-formatted encrypted payload Android Pay Payment Token
❯❯ certificate_token The token identifying the Certificate used by the native Android Pay app to encrypt the payment data (the certificate must exist within the same Spreedly environment as this transaction attempt).
❯❯ transaction_id
optional
The Google Transaction ID (required for some gateways, such as Braintree)
❯❯ test_card_number Android Pay does not provide a way to create a test payment token. To mark this as a test Android 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 Android Pay payment data.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Pass-in Apple Pay

POST /v1/gateways/<gateway_token>/purchase.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "apple_pay": {
      "payment_data": {
        "version": "EC_v1",
        "data": "QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud",
        "signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4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CZIdAAAxggFfMIIBWwIBATCBhjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCCRD8qgGnfV3MA0GCWCGSAFlAwQCAQUAoGkwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTUwMjI0MTgzNTU5WjAvBgkqhkiG9w0BCQQxIgQgohbm8d0A42OAyMnc5fsgQoCNYjtEd/W/dW6+yezIwoAwCgYIKoZIzj0EAwIERzBFAiEAtEkap+JHypwfL1EdabD7RWPZol3na0LhMk9XzLhis0oCIGwxzOhQnMw+Td8WglTMNYcidqeYILTGzn3zMEXmW3j7AAAAAAAA",
        "header": {
          "ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQwjaSlnZ3EXpwKfWAd2e1VnbS6vmioMyF6bNcq/Qd65NLQsjrPatzHWbJzG7v5vJtAyrf6WhoNx3C1VchQxYuw==",
          "transactionId": "e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371",
          "publicKeyHash": "/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="
        }
      },
      "test_card_number": "4111111111111111"
    }
  }
}
<transaction>
  <apple_pay>
    <payment_data>
<![CDATA[{"version":"EC_v1","data":"QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL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a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371","publicKeyHash":"/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="}}
]]>
    </payment_data>
    <test_card_number>4111111111111111</test_card_number>
  </apple_pay>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:34Z",
    "updated_at": "2016-08-11T17:39:34Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "S7NN6igAXDMzJKhfkJDv6c5Upp8",
    "transaction_type": "Purchase",
    "order_id": "e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371",
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "48",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:34Z",
      "updated_at": "2016-08-11T17:39:34Z"
    },
    "shipping_address": {
      "name": "",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "PA5CFkJIkoTCz00H8awovgGPtTQ",
      "created_at": "2016-08-11T17:39:34Z",
      "updated_at": "2016-08-11T17:39:34Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": null,
      "last_name": null,
      "month": 3,
      "year": 2018,
      "full_name": "",
      "payment_method_type": "apple_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:34Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>SWO6avp5GGvP45KKPYN2Zkah7YD</token>
  <transaction_type>Purchase</transaction_type>
  <order_id>e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371</order_id>
  <ip nil="true"/>
  <description nil="true"/>
  <email nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>48</gateway_transaction_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">true</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name></name>
    <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>Successful purchase</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:34Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:35Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>TdBQ94ccLly6VTFDSHuMne53Edr</token>
    <created_at type="dateTime">2016-08-11T17:39:34Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:34Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name nil="true"/>
    <last_name nil="true"/>
    <month type="integer">3</month>
    <year type="integer">2018</year>
    <full_name></full_name>
    <payment_method_type>apple_pay</payment_method_type>
    <errors>
    </errors>
  </payment_method>
</transaction>

Pass an Apple Pay payment method directly in to the purchase request. If the Apple Pay data is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 request 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.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Reference purchase

POST /v1/transactions/<transaction_token>/purchase.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


{
  "transaction": {
    "amount": 80
  }
}
<transaction>
  <amount>80</amount>
</transaction>

HTTPS/1.1 200 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:36Z",
    "updated_at": "2016-08-11T17:39:36Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "ZzOUVU95Hsb3lHDI7eaIRVI7yNs",
    "transaction_type": "PurchaseViaReference",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "44",
    "amount": 80,
    "currency_code": "USD",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:36Z",
      "updated_at": "2016-08-11T17:39:36Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [

    ],
    "reference_token": "WGdYi9evpxpltdStan336IJI4Vo"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:37Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:37Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>NVnycvqIdcOtyXEYdZ5ZTVFByhA</token>
  <transaction_type>PurchaseViaReference</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>
  <gateway_specific_fields nil="true"></gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>68</gateway_transaction_id>
  <amount type="integer">80</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T17:39:37Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:37Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>7BJfqSB33LWiUkTRE7sKCehOCNM</reference_token>
</transaction>

Execute a purchase using the payment method utilized in a previous transaction.

URL Parameters

Parameter Description
transaction_token
required
The token identifying this transaction at Spreedly
format
required
One of json or xml

Request Body

Element Description
transaction Root request element
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Authorize

Authorize a payment method to be charged a specific amount at the target gateway. No funds are taken with an authorize – a follow-up capture transaction is required to actually move the funds.

The referenced gateway must exist in the environment whose environment key is being used to authenticate the API call.

Tokenized payment method

POST /v1/gateways/<gateway_token>/authorize.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:14Z",
    "updated_at": "2016-08-11T17:39:14Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "UaOvf3g5ToLEcr6Is5XK3C4pFWS",
    "transaction_type": "Authorization",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "63",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": false,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:14Z",
      "updated_at": "2016-08-11T17:39:14Z"
    },
    "shipping_address": {
      "name": "Robert Lemke",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:12Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Robert",
      "last_name": "Lemke",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Robert Lemke",
      "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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:14Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>7qPhaSFj4V5FM9zohrA5yLvOTzb</token>
  <transaction_type>Authorization</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>66</gateway_transaction_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>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</name>
    <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>Successful authorize</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:14Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>UAwoPyWJhwZiYe2ZY1ri6ENAjLG</token>
    <created_at type="dateTime">2016-08-11T17:09:30Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>retained</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name>Robert</first_name>
    <last_name>Lemke</last_name>
    <month type="integer">4</month>
    <year type="integer">2020</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>Robert Lemke</full_name>
    <eligible_for_card_updater nil="true"/>
    <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"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value></verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Authorize a tokenized payment method (already stored in the Spreedly environment) to be charged a specific amount.

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 request element
❯ payment_method_token
required
The token of the payment method to use
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Pass-in credit card

POST /v1/gateways/<gateway_token>/authorize.<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": "2018"
    },
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <credit_card>
    <first_name>Joey</first_name>
    <last_name>Jones</last_name>
    <number>4111111111111111</number>
    <verification_value>423</verification_value>
    <month>3</month>
    <year>2020</year>
  </credit_card>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:13Z",
    "updated_at": "2016-08-11T17:39:14Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "AnXAiF2UlPAK7qFLCkSY6RVV44E",
    "transaction_type": "Authorization",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "46",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:13Z",
      "updated_at": "2016-08-11T17:39:14Z"
    },
    "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": "42cdRZ0Suy5szNjf1jARHmdrAm9",
      "created_at": "2016-08-11T17:39:13Z",
      "updated_at": "2016-08-11T17:39:13Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "XXX",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:14Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>SCnb8ostdlzV4ixnCa6sUc4Ta6Q</token>
  <transaction_type>Authorization</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>67</gateway_transaction_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">true</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Joey Jones</name>
    <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>Successful authorize</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:14Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>23TXjOjbCcvfOP4uWXwIArN1No1</token>
    <created_at type="dateTime">2016-08-11T17:39:14Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:14Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <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"/>
    <address2 nil="true"/>
    <city nil="true"/>
    <state nil="true"/>
    <zip nil="true"/>
    <country nil="true"/>
    <phone_number nil="true"/>
    <company nil="true"/>
    <full_name>Joey Jones</full_name>
    <eligible_for_card_updater nil="true"/>
    <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"/>
    <payment_method_type>credit_card</payment_method_type>
    <errors>
    </errors>
    <verification_value>XXX</verification_value>
    <number>XXXX-XXXX-XXXX-1111</number>
    <fingerprint>b0a45066121c1f1a49b3a6ffc26caf2995db</fingerprint>
  </payment_method>
</transaction>

Pass a credit card payment method directly in to the authorize request. If the card is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 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.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone
❯ 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

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

Pass-in Android Pay (βeta)

POST /v1/gateways/<gateway_token>/authorize.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "android_pay": {
      "payment_data": {
        "encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE",
        "ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=",
        "tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="
      },
      "certificate_token": "Npyj0A5xbeqO1hVNJEa4nvkCHwP",
      "transaction_id": "123456789",
      "test_card_number": "4111111111111111"
    },
    "amount": 1199,
    "currency_code": "USD"
  }
}
<transaction>
  <android_pay>
    <payment_data>
<![CDATA[{"encryptedMessage": "V65NNwqzK0A1bi0F96HQZr4eFA8fWCatwykv3sFA8Cg4Wn4Ylk/szN6GiFTuYQFrHA7a/h0P3tfEQd09bor6pRqrM8/Bt12R0SHKtnQxbYxTjpMr/7C3Um79n0jseaPlK8+CHXljbYifwGB+cEFh/smP8IO1iw3TL/192HesutfVMKm9zpo5mLNzQ2GMU4JWUGIgrzsew6S6XshelrjE","ephemeralPublicKey": "BB9cOXHgf3KcY8dbsU6fhzqTJm3JFvzD+8wcWg0W9r+Xl5gYjoZRxHuYocAx3g82v2o0Le1E2w4sDDl5w3C0lmY=","tag": "boJLmOxDduTV5a34CO2IRbgxUjZ9WmfzxNl1lWqQ+Z0="}]]>
    </payment_data>
    <certificate_token>Npyj0A5xbeqO1hVNJEa4nvkCHwP</certificate_token>
    <transaction_id>123456789</transaction_id>
    <test_card_number>4111111111111111</test_card_number>
  </android_pay>
  <amount>1199</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-10-25T21:07:36Z",
    "updated_at": "2016-10-25T21:07:36Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "AXXWau0PybLVMmAo4RkHQNDzWts",
    "transaction_type": "Authorization",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "55",
    "amount": 1199,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "7irpFS4AxDazpJOmuNlos2ULfb8",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-10-25T21:07:36Z",
      "updated_at": "2016-10-25T21:07:36Z"
    },
    "shipping_address": {
      "name": "",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "CvZB8Fq5TPKhifPwMnNK06Qa9Pp",
      "created_at": "2016-10-25T21:07:36Z",
      "updated_at": "2016-10-25T21:07:36Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": null,
      "first_name": null,
      "last_name": null,
      "month": 12,
      "year": 2020,
      "full_name": "",
      "payment_method_type": "android_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
  <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>M6LKkrX0PIEOjozN4yXtj94AIuu</token>
  <transaction_type>Authorization</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"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>62</gateway_transaction_id>
  <amount type="integer">1199</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>7irpFS4AxDazpJOmuNlos2ULfb8</gateway_token>
  <shipping_address>
    <name></name>
    <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>Successful authorize</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
    <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>Z1YYWyIx8tq1prnbzmXqMS6gTsd</token>
    <created_at type="dateTime">2016-10-25T21:07:37Z</created_at>
    <updated_at type="dateTime">2016-10-25T21:07:37Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type nil="true"/>
    <first_name nil="true"/>
    <last_name nil="true"/>
    <month type="integer">12</month>
    <year type="integer">2020</year>
    <full_name></full_name>
    <payment_method_type>android_pay</payment_method_type>
    <errors>
    </errors>
  </payment_method>
</transaction>

Pass an Android Pay payment method directly in to the authorize request. If the Android Pay data is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 request element
❯ android_pay Android pay element
❯❯ payment_data
required
The JSON-formatted encrypted payload Android Pay Payment Token
❯❯ certificate_token The token identifying the Certificate used by the native Android Pay app to encrypt the payment data (the certificate must exist within the same Spreedly environment as this transaction attempt).
❯❯ transaction_id
optional
The Google Transaction ID (required for some gateways, such as Braintree)
❯❯ test_card_number Android Pay does not provide a way to create a test payment token. To mark this as a test Android 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 Android Pay payment data.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Pass-in Apple Pay

POST /v1/gateways/<gateway_token>/authorize.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>

{
  "transaction": {
    "apple_pay": {
      "payment_data": {
        "version": "EC_v1",
        "data": "QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnEO9UwUowlDP9C3cD21cW8osn/IKROTInGcZB0mzM5bVHM73NSFiFepNL6rQtomp034C+p9mikB4nc+vR49oVop0Pf+uO7YVq7cIWrrpgMG7ussnc3u4bmr3JhCNtKZzRQ2MqTxKv/CfDq099JQIvTj8hbqswv1t+yQ5ZhJ3m4bcPwrcyIVej5J241R7dNPu9xVjM6LSOX9KeGZQGud",
        "signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlm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3bF3zODuQZ/0XfCwhbZZPxnJpghJvVPh6fRuZy5sJiSFhBpkPCZIdAAAxggFfMIIBWwIBATCBhjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCCRD8qgGnfV3MA0GCWCGSAFlAwQCAQUAoGkwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTUwMjI0MTgzNTU5WjAvBgkqhkiG9w0BCQQxIgQgohbm8d0A42OAyMnc5fsgQoCNYjtEd/W/dW6+yezIwoAwCgYIKoZIzj0EAwIERzBFAiEAtEkap+JHypwfL1EdabD7RWPZol3na0LhMk9XzLhis0oCIGwxzOhQnMw+Td8WglTMNYcidqeYILTGzn3zMEXmW3j7AAAAAAAA",
        "header": {
          "ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQwjaSlnZ3EXpwKfWAd2e1VnbS6vmioMyF6bNcq/Qd65NLQsjrPatzHWbJzG7v5vJtAyrf6WhoNx3C1VchQxYuw==",
          "transactionId": "e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371",
          "publicKeyHash": "/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="
        }
      },
      "test_card_number": "4111111111111111"
    }
  }
}
<transaction>
  <apple_pay>
    <payment_data>
<![CDATA[{"version":"EC_v1","data":"QlzLxRFnNP9/GTaMhBwgmZ2ywntbr9iOcBY4TjPZyNrnCwsJd2cq61bDQjo3agVU0LuEot2VIHHocVrp5jdy0FkxdFhGd+j7hPvutFYGwZPcuuBgROb0beA1wfGDi09I+OWL+8x5+8QPl+y8EAGJdWHXr4CuL7hEj4CjtUhfj5GYLMceUcvwgGaWY7WzqnE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bJzG7v5vJtAyrf6WhoNx3C1VchQxYuw==","transactionId":"e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371","publicKeyHash":"/4UKqrtx7AmlRvLatYt9LDt64IYo+G9eaqqS6LFOAdI="}}
]]>
    </payment_data>
    <test_card_number>4111111111111111</test_card_number>
  </apple_pay>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:13Z",
    "updated_at": "2016-08-11T17:39:13Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "CtL0X3Of0ovABNhkiW8BFV7qwYv",
    "transaction_type": "Authorization",
    "order_id": "e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371",
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "65",
    "amount": 100,
    "currency_code": "USD",
    "retain_on_success": false,
    "payment_method_added": true,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "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": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:13Z",
      "updated_at": "2016-08-11T17:39:13Z"
    },
    "shipping_address": {
      "name": "",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "payment_method": {
      "token": "NJKEaA7uf3fbC2X8WOdQioPXWdK",
      "created_at": "2016-08-11T17:39:13Z",
      "updated_at": "2016-08-11T17:39:13Z",
      "email": null,
      "data": null,
      "storage_state": "cached",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": null,
      "last_name": null,
      "month": 3,
      "year": 2018,
      "full_name": "",
      "payment_method_type": "apple_pay",
      "errors": [

      ]
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:13Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:13Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>VAsvX933gbVhv2RYhyDSJL2vRQJ</token>
  <transaction_type>Authorization</transaction_type>
  <order_id>e220cc1504ec15835a375e9e8659e27dcbc1abe1f959a179d8308dd8211c9371</order_id>
  <ip nil="true"/>
  <description nil="true"/>
  <email nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>55</gateway_transaction_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">true</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name></name>
    <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>Successful authorize</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></error_code>
    <error_detail nil="true"/>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"/>
    <created_at type="dateTime">2016-08-11T17:39:13Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:13Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <payment_method>
    <token>IJObdArkYnLM7PG9Op5EXPBRG1c</token>
    <created_at type="dateTime">2016-08-11T17:39:13Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:13Z</updated_at>
    <email nil="true"/>
    <data nil="true"/>
    <storage_state>cached</storage_state>
    <test type="boolean">true</test>
    <last_four_digits>1111</last_four_digits>
    <first_six_digits>411111</first_six_digits>
    <card_type>visa</card_type>
    <first_name nil="true"/>
    <last_name nil="true"/>
    <month type="integer">3</month>
    <year type="integer">2018</year>
    <full_name></full_name>
    <payment_method_type>apple_pay</payment_method_type>
    <errors>
    </errors>
  </payment_method>
</transaction>

Pass an Apple Pay payment method directly in to the authorize request. If the Apple Pay data is valid, it will automatically be tokenized at Spreedly before sending to the gateway.

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 request 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.
❯ amount
required
The amount to request, as an integer. E.g., 1000 for $10.00.
❯ currency_code
required
The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.
❯ order_id The merchant specified order id. If not provided, the Spreedly transaction token will be used.
❯ description A human readable description of the transaction which will be passed to the gateway if it’s supported
❯ retain_on_success If the card is verified, retain it so it can be used for future transactions
❯ ip The IP address of the end-user customer
❯ email Override the customer email address associated with the payment method for this transaction
❯ merchant_name_descriptor Specify the merchant name that shows on the customer’s bank statement for the transaction
❯ merchant_location_descriptor Specify the merchant location that shows on the customer’s bank statement for the transaction
❯ shipping_address Override the customer shipping address associated with the payment method for this transaction
❯❯ name Customer’s name in the shipping address
❯❯ address1 Customer’s shipping address, line 1
❯❯ address2 Customer’s shipping address, line 2
❯❯ city Customer’s shipping city
❯❯ state Customer’s shipping state/province
❯❯ zip Customer’s shipping zip
❯❯ country Customer’s shipping country
❯❯ phone Customer’s shipping phone

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

Capture

Full amount

POST /v1/transactions/<transaction_token>/capture.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:15Z",
    "updated_at": "2016-08-11T17:39:15Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "8vSsLjpgTQAOIHcuPbBu1Q9bkEp",
    "transaction_type": "Capture",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": {
    },
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "61",
    "amount": 100,
    "currency_code": "USD",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful capture",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:15Z",
      "updated_at": "2016-08-11T17:39:15Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "reference_token": "LY5sxjEyNM3vFsRfBzRAZrcOp5P"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:15Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:15Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>7PEJqW0gSuCxecc6eXeaECe94O4</token>
  <transaction_type>Capture</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>
  <gateway_specific_fields>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>52</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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 capture</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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T17:39:15Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:15Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>AONqzuMocc2b7uJhrt9wlAJNtJN</reference_token>
</transaction>

Capture all funds previously reserved via an authorize.

URL Parameters

Parameter Description
transaction_token
required
The token identifying the original authorize transaction
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_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.

Partial amount

POST /v1/transactions/<transaction_token>/capture.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


{
  "transaction": {
    "amount": 50,
    "currency_code": "USD"
  }
}
<transaction>
  <amount>50</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:15Z",
    "updated_at": "2016-08-11T17:39:15Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "Bap2zmGPG6YrvDuceQxKn5e24ej",
    "transaction_type": "Capture",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "65",
    "amount": 50,
    "currency_code": "USD",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful capture",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:15Z",
      "updated_at": "2016-08-11T17:39:15Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [
      {
        "referencing_transaction": [

        ]
      }
    ],
    "reference_token": "1bGJSgyQeJJ0NFkHQLJY6E7idiM"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:16Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:16Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>4bQt6Z9aXHQ5enei6v8CCcjSQoc</token>
  <transaction_type>Capture</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>
  <gateway_specific_fields nil="true"></gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>47</gateway_transaction_id>
  <amount type="integer">50</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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 capture</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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T17:39:16Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:16Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>Ltn0lke0ATvOjHnyn8fdYx9tN4d</reference_token>
</transaction>

Capture a partial amount from an authorize by specifying an amount.

URL Parameters

Parameter Description
transaction_token
required
The token identifying the original authorize transaction
format
required
One of json or xml

Request Body

Parameter Description
transaction Root element
❯ amount The amount to capture, as an integer. E.g., 1000 for $10.00. If not provided, the full amount of the original authorize will be captured.
❯ currency_code The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.

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.

Void

POST /v1/transactions/<transaction_token>/void.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T18:02:50Z",
    "updated_at": "2016-08-11T18:02:50Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "2lOQZeQ3AvOB26nNUbI36mpaNoQ",
    "transaction_type": "Void",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": {
    },
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "62",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful void",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T18:02:50Z",
      "updated_at": "2016-08-11T18:02:50Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "reference_token": "1s2AAbw2P9xrJ77D50CBg3t4b5A"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T18:02:50Z</created_at>
  <updated_at type="dateTime">2016-08-11T18:02:50Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>FhscUpgUA5GbYdkgL5Wk2OBCVcl</token>
  <transaction_type>Void</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>
  <gateway_specific_fields>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>63</gateway_transaction_id>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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 void</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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T18:02:50Z</created_at>
    <updated_at type="dateTime">2016-08-11T18:02:50Z</updated_at>
  </response>
  <reference_token>GXa4d2yNezvqwr8hINDVVg9CaPr</reference_token>
</transaction>

Cancel an authorization transaction.

This API call can also be used to cancel a capture/purchase transaction that hasn’t yet settled at the merchant account.

URL Parameters

Parameter Description
transaction_token
required
The token identifying the original authorize or purchase transaction
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_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.

Credit (refund)

Full amount

POST /v1/transactions/<transaction_token>/credit.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:17Z",
    "updated_at": "2016-08-11T17:39:17Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "ZDUbgzCTb9ttoy2ggd98x0XZcTj",
    "transaction_type": "Credit",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": {
    },
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "56",
    "amount": 100,
    "currency_code": "USD",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful credit",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:17Z",
      "updated_at": "2016-08-11T17:39:17Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [

    ],
    "reference_token": "TUikPhZRzi3SILRGSyV3j5Pncw9"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:18Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:18Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>1EZRTjUGKUwKEBve9GUgDuurlnP</token>
  <transaction_type>Credit</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>
  <gateway_specific_fields>
  </gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>52</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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 credit</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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T17:39:18Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:18Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>X0uwwgdVvuX7Qc438boUCoAfZSi</reference_token>
</transaction>

Refund the full amount of a purchase.

URL Parameters

Parameter Description
transaction_token
required
The token identifying the original purchase transaction
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_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.

Partial amount

POST /v1/transactions/<transaction_token>/credit.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


{
  "transaction": {
    "amount": 50,
    "currency_code": "USD"
  }
}
<transaction>
  <amount>50</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:18Z",
    "updated_at": "2016-08-11T17:39:18Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "PupDfe0L5jUHnyggdvT5r2KNMEk",
    "transaction_type": "Credit",
    "order_id": null,
    "ip": null,
    "description": null,
    "email": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "45",
    "amount": 50,
    "currency_code": "USD",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful credit",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:18Z",
      "updated_at": "2016-08-11T17:39:18Z"
    },
    "shipping_address": {
      "name": null,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [

    ],
    "reference_token": "PYbXwMPALTYr0aps1yA0qheIf1B"
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:19Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:19Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>Q9fp7wCIFgfs40YUySkY7YALgd3</token>
  <transaction_type>Credit</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>
  <gateway_specific_fields nil="true"></gateway_specific_fields>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>65</gateway_transaction_id>
  <amount type="integer">50</amount>
  <currency_code>USD</currency_code>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name nil="true"></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 credit</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></error_code>
    <error_detail nil="true"></error_detail>
    <cancelled type="boolean">false</cancelled>
    <fraud_review nil="true"></fraud_review>
    <created_at type="dateTime">2016-08-11T17:39:19Z</created_at>
    <updated_at type="dateTime">2016-08-11T17:39:19Z</updated_at>
  </response>
  <api_urls>
  </api_urls>
  <reference_token>7FdCwMj9jtB4pEPhTGQI44rMg8q</reference_token>
</transaction>

Refund a partial amount of a purchase by specifying an amount.

URL Parameters

Parameter Description
transaction_token
required
The token identifying the original purchase transaction
format
required
One of json or xml

Request Body

Parameter Description
transaction Root element
❯ amount The amount to refund, as an integer. E.g., 1000 for $10.00. If not provided, the full amount of the original purchase will be refunded.
❯ currency_code The currency of the funds, as ISO 4217 alpha currency codes, e.g., USD for US dollars.

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.

General credit

POST /v1/gateways/<gateway_token>/general_credit.<format> HTTPS/1.1
Host: core.spreedly.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/<format>


{
  "transaction": {
    "payment_method_token": "56wyNnSmuA6CWYP7w0MiYCVIbW6",
    "amount": 100,
    "currency_code": "USD"
  }
}
<transaction>
  <payment_method_token>56wyNnSmuA6CWYP7w0MiYCVIbW6</payment_method_token>
  <amount>100</amount>
  <currency_code>USD</currency_code>
</transaction>

HTTPS/1.1 201 Created
{
  "transaction": {
    "on_test_gateway": true,
    "created_at": "2016-08-11T17:39:28Z",
    "updated_at": "2016-08-11T17:39:28Z",
    "succeeded": true,
    "state": "succeeded",
    "token": "D4b2aTacgHQmM5OizgKx1dAUhwP",
    "transaction_type": "GeneralCredit",
    "order_id": null,
    "ip": null,
    "description": null,
    "merchant_name_descriptor": null,
    "merchant_location_descriptor": null,
    "gateway_specific_fields": null,
    "gateway_specific_response_fields": {
    },
    "gateway_transaction_id": "64",
    "amount": 100,
    "currency_code": "USD",
    "payment_method_added": false,
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "gateway_token": "8dvNMSuDr3kTlMIQxbkIaE5KNlX",
    "response": {
      "success": true,
      "message": "Successful general_credit",
      "avs_code": null,
      "avs_message": null,
      "cvv_code": null,
      "cvv_message": null,
      "pending": false,
      "result_unknown": false,
      "error_code": "",
      "error_detail": null,
      "cancelled": false,
      "fraud_review": null,
      "created_at": "2016-08-11T17:39:28Z",
      "updated_at": "2016-08-11T17:39:28Z"
    },
    "shipping_address": {
      "name": "Robert Lemke",
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null
    },
    "api_urls": [

    ],
    "payment_method": {
      "token": "UAwoPyWJhwZiYe2ZY1ri6ENAjLG",
      "created_at": "2016-08-11T17:09:30Z",
      "updated_at": "2016-08-11T17:39:19Z",
      "email": null,
      "data": null,
      "storage_state": "retained",
      "test": true,
      "last_four_digits": "1111",
      "first_six_digits": "411111",
      "card_type": "visa",
      "first_name": "Robert",
      "last_name": "Lemke",
      "month": 4,
      "year": 2020,
      "address1": null,
      "address2": null,
      "city": null,
      "state": null,
      "zip": null,
      "country": null,
      "phone_number": null,
      "company": null,
      "full_name": "Robert Lemke",
      "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",
      "errors": [

      ],
      "fingerprint": "b0a45066121c1f1a49b3a6ffc26caf2995db",
      "verification_value": "",
      "number": "XXXX-XXXX-XXXX-1111"
    }
  }
}
<transaction>
  <on_test_gateway type="boolean">true</on_test_gateway>
  <created_at type="dateTime">2016-08-11T17:39:28Z</created_at>
  <updated_at type="dateTime">2016-08-11T17:39:28Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <state>succeeded</state>
  <token>Jw340hLjZHLGo1DysiSBwOvtRz4</token>
  <transaction_type>GeneralCredit</transaction_type>
  <order_id nil="true"/>
  <ip nil="true"/>
  <description nil="true"/>
  <merchant_name_descriptor nil="true"/>
  <merchant_location_descriptor nil="true"/>
  <gateway_specific_fields nil="true"/>
  <gateway_specific_response_fields>
  </gateway_specific_response_fields>
  <gateway_transaction_id>48</gateway_transaction_id>
  <amount type="integer">100</amount>
  <currency_code>USD</currency_code>
  <payment_method_added type="boolean">false</payment_method_added>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <gateway_token>8dvNMSuDr3kTlMIQxbkIaE5KNlX</gateway_token>
  <shipping_address>
    <name>Robert Lemke</name>
    <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>Successful general_credit</message>