Receivers

List supported receivers

GET /v1/receivers_options.<format>?published=true HTTPS/1.1
Host: core.spreedly.com

Example response has been truncated for brevity

HTTPS/1.1 200 OK
{
  "receivers": [
    {
      "receiver_type": "a1_payments",
      "name": "A1payments Receiver",
      "hostnames": "https://www.a1payments.com",
      "company_name": "A1 Payments"
    },
    {
      "receiver_type": "abg_direct",
      "name": "Abgdirect Receiver",
      "hostnames": "https://services.carrental.com,https://qaservices.carrental.com",
      "company_name": "ABG Direct"
    }
  ]
}
<receivers>
  <receiver>
    <receiver_type>a1_payments</receiver_type>
    <name>A1payments Receiver</name>
    <hostnames>https://www.a1payments.com</hostnames>
    <company_name>A1 Payments</company_name>
  </receiver>
  <receiver>
    <receiver_type>abg_direct</receiver_type>
    <name>Abgdirect Receiver</name>
    <hostnames>https://services.carrental.com,https://qaservices.carrental.com</hostnames>
    <company_name>ABG Direct</company_name>
  </receiver>
</receivers>

Retrieve a list of all payment method distribution receivers, and their properties, supported by Spreedly.

URL Parameters

Parameter Description
format
required
One of json or xml

Response Body

Notable response elements include:

Element Description
receivers Root element
❯ name The human readable name of the receiver
❯ receiver_type The type (short name) of the receiver. Use this value when provisioning a receiver.
❯ hostnames The urls used to interact with the receiver
❯ company_name The name of the company providing the receiver

List created receivers

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

Example response has been truncated for brevity

HTTPS/1.1 200 OK
{
  "receivers": [
    {
      "company_name": "TEST",
      "receiver_type": "test",
      "token": "2kAEQYkLqRJLJZoyGvF9c8gVieo",
      "hostnames": "https://spreedly-echo.herokuapp.com/",
      "state": "retained",
      "created_at": "2017-06-22T21:17:45Z",
      "updated_at": "2018-04-20T12:10:52Z",
      "credentials": null
    },
    {
      "company_name": "TEST",
      "receiver_type": "test",
      "token": "XYEV709EQHWUkwFyTcRx1N6WXKz",
      "hostnames": "https://spreedly-echo.herokuapp.com/",
      "state": "retained",
      "created_at": "2017-06-22T21:20:21Z",
      "updated_at": "2018-04-20T12:12:38Z",
      "credentials": [
        {
          "name": "app-id",
          "value": "1234",
          "safe": "true"
        },
        {
          "name": "app-secret",
          "safe": "false"
        }
      ]
    }
  ]
}
<receivers>
  <receiver>
    <company_name>TEST</company_name>
    <receiver_type>test</receiver_type>
    <token>2kAEQYkLqRJLJZoyGvF9c8gVieo</token>
    <hostnames>https://spreedly-echo.herokuapp.com/</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2017-06-22T21:17:45Z</created_at>
    <updated_at type="dateTime">2018-04-20T12:10:52Z</updated_at>
    <credentials nil="true"></credentials>
  </receiver>
  <receiver>
    <company_name>TEST</company_name>
    <receiver_type>test</receiver_type>
    <token>XYEV709EQHWUkwFyTcRx1N6WXKz</token>
    <hostnames>https://spreedly-echo.herokuapp.com/</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2017-06-22T21:20:21Z</created_at>
    <updated_at type="dateTime">2018-04-20T12:12:38Z</updated_at>
    <credentials type="array">
      <credential>
        <name>app-id</name>
        <value>1234</value>
        <safe>true</safe>
      </credential>
      <credential>
        <name>app-secret</name>
        <safe>false</safe>
      </credential>
    </credentials>
  </receiver>
</receivers>

Retrieve an ordered and paginated list of all receivers in the authenticated environment.

URL Parameters

Parameter Description
format
required
One of json or xml
order The order of the returned list. Default is asc, which returns the oldest records first. To list newer records first, use desc.
since_token The token of the item to start from (e.g., the last token received in the previous list if iterating through records)

Response Body

Notable response elements include:

Element Description
receivers Root element
❯ company_name The name of the company providing the receiver
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.

Create HTTP receiver

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

{
  "receiver": {
    "receiver_type": "test",
    "hostnames": "https://spreedly-echo.herokuapp.com",
    "credentials": [
      {
        "name": "app-id",
        "value": 1234,
        "safe": true
      },
      {
        "name": "app-secret",
        "value": 5678
      }
    ]
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <hostnames>https://spreedly-echo.herokuapp.com</hostnames>
  <credentials>
    <credential>
      <name>app-id</name>
      <value>1234</value>
      <safe>true</safe>
    </credential>
    <credential>
      <name>app-secret</name>
      <value>5678</value>
    </credential>
  </credentials>
</receiver>

HTTPS/1.1 201 Created
{
  "receiver": {
    "company_name": "TEST",
    "receiver_type": "test",
    "token": "TdXjq6sqBHpD1200iIvUhYy9x50",
    "hostnames": "https://spreedly-echo.herokuapp.com",
    "state": "retained",
    "created_at": "2020-02-13T18:38:04Z",
    "updated_at": "2020-02-13T18:38:04Z",
    "credentials": [
      {
        "name": "app-id",
        "value": 1234,
        "safe": true
      },
      {
        "name": "app-secret",
        "safe": false
      }
    ]
  }
}
<receiver>
  <company_name>TEST</company_name>
  <receiver_type>test</receiver_type>
  <token>NG7rSGp3MPJIWEXwKxZ5sr7tgvj</token>
  <hostnames>https://spreedly-echo.herokuapp.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2020-02-13T18:38:04Z</created_at>
  <updated_at type="dateTime">2020-02-13T18:38:04Z</updated_at>
  <credentials type="array">
    <credential>
      <name>app-id</name>
      <value>1234</value>
      <safe>true</safe>
    </credential>
    <credential>
      <name>app-secret</name>
      <safe>false</safe>
    </credential>
  </credentials>
</receiver>

Create a receiver for use in payment method distribution.

URL Parameters

Parameter Description
format
required
One of json or xml

Request Body

Parameter Description
receiver Root element
❯ receiver_type
required
The type of receiver to provision. Can be test for a test receiver, or any one of the other supported production receiver types.
❯ hostnames Allowed list of hosts that the receiver can send payments to. Supports a comma separated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., https://testing.receiver.com (https is required). If provided for a test receiver, we will validate the delivery URL against the list of hostnames when simulating delivery to the receiver. Production receivers can omit hostnames as their values are hard-coded.
❯ credentials Sensitive values that should be securely stored and made available to the request template at time of delivery
❯❯ name The name of the credential. This will be the name of the variable in the delivery request template.
❯❯ value The value of the credential. This will be the value substituted in for the credential variable in the delivery request template.
❯❯ safe
default: false
Set to true if the credential is not a sensitive value (e.g., a user name). Otherwise it is assumed to be a sensitive value and will not be echoed back in API responses.

Response Body

Notable response elements include:

Element Description
receiver Root element
❯ company_name The name of the company providing the receiver
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.
❯ credentials One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed.

Create SFTP receiver

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

{
  "receiver": {
    "receiver_type": "test",
    "hostnames": "sftp://testserver.com",
    "protocol": {
      "user": "test_user",
      "password": "test_password"
    }
  }
}
<receiver>
  <receiver_type>test</receiver_type>
  <hostnames>sftp://testserver.com</hostnames>
  <protocol>
    <user>test_user</user>
    <password>test_password</password>
  </protocol>
</receiver>

HTTPS/1.1 201 Created
{
  "receiver": {
    "company_name": "TEST",
    "receiver_type": "test",
    "token": "Rz3rhs0J7V2UW41egNYTBJiMpUQ",
    "hostnames": "sftp://testserver.com",
    "state": "retained",
    "created_at": "2018-04-20T12:58:03Z",
    "updated_at": "2018-04-20T12:58:03Z",
    "credentials": null,
    "protocol": {
      "user": "test_user"
    }
  }
}
<receiver>
  <company_name>TEST</company_name>
  <receiver_type>test</receiver_type>
  <token>9X7emTBWC90OjvcYBkmuJZM6HbC</token>
  <hostnames>sftp://testserver.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2018-04-20T12:58:02Z</created_at>
  <updated_at type="dateTime">2018-04-20T12:58:02Z</updated_at>
  <credentials nil="true"></credentials>
  <protocol>
    <user>test_user</user>
  </protocol>
</receiver>

Create a receiver for use in payment method distribution.

URL Parameters

Parameter Description
format
required
One of json or xml

Request Body

Parameter Description
receiver Root element
❯ receiver_type
required
The type of receiver to provision. Can be test for a test receiver, or any one of the other supported production receiver types.
❯ protocol
required for SFTP receivers
a hash of protocol values, currently only used for the SFTP protocol. e.g. sftp://user:password@127.0.0.0
❯ hostnames Allowed list of hosts that the receiver can send payments to. Supports a comma separated list of hostnames if multiple are required. Hostnames should include the protocol and domain, but not the path, e.g., sftp://testing.receiver.com. If provided for a test receiver, we will validate the delivery URL against the list of hostnames when simulating delivery to the receiver. Production receivers can omit hostnames as their values are hard-coded.
❯❯ user The user value.
❯❯ password The password value.

Response Body

Notable response elements include:

Element Description
receiver Root element
❯ company_name The name of the company providing the receiver
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.
❯ protocol_user The user value used to authenticate with the SFTP receiver.

Show receiver

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


HTTPS/1.1 200 OK
{
  "receiver": {
    "company_name": "TEST",
    "receiver_type": "test",
    "token": "JhGsltr85iI0C2CnrSFA2nmjAOO",
    "hostnames": "https://spreedly-echo.herokuapp.com",
    "state": "retained",
    "created_at": "2017-07-27T17:55:34Z",
    "updated_at": "2017-07-27T17:55:34Z",
    "credentials": null
  }
}
<receiver>
  <company_name>TEST</company_name>
  <receiver_type>test</receiver_type>
  <token>T4WSwkjLmmBnnKYNeeGCb7FmPxB</token>
  <hostnames>https://spreedly-echo.herokuapp.com</hostnames>
  <state>retained</state>
  <created_at type="dateTime">2018-04-04T15:36:17Z</created_at>
  <updated_at type="dateTime">2018-04-04T15:36:17Z</updated_at>
  <credentials nil="true"></credentials>
</receiver>

Get a receiver with the given token.

URL Parameters

Parameter Description
receiver_token
required
The token of the receiver at Spreedly
format
required
One of json or xml

Response Body

Notable response elements include:

Element Description
receiver Root element
❯ company_name The name of the company providing the receiver
❯ token The token uniquely identifying this receiver at Spreedly
❯ receiver_type The type of receiver
❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.

Update receiver

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


{
  "receiver": {
    "credentials": [
      {
        "name": "app-id",
        "value": "abcd",
        "safe": true
      },
      {
        "name": "app-secret",
        "value": "efgh"
      }
    ]
  }
}
<receiver>
  <credentials>
    <credential>
      <name>app-id</name>
      <value>abcd</value>
      <safe>true</safe>
    </credential>
    <credential>
      <name>app-secret</name>
      <value>efgh</value>
    </credential>
  </credentials>
</receiver>

HTTPS/1.1 200 OK
{
  "transaction": {
    "token": "4844UmKDKTnRLSu203SjJ5vaHSH",
    "created_at": "2017-07-27T17:55:36Z",
    "updated_at": "2017-07-27T17:55:36Z",
    "succeeded": true,
    "transaction_type": "UpdatePaymentMethodReceiver",
    "state": "succeeded",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "receiver": {
      "company_name": "TEST",
      "receiver_type": "test",
      "token": "IXPvgTDJUxCKwzXdYn6shVVjPrd",
      "hostnames": "https://spreedly-echo.herokuapp.com",
      "state": "retained",
      "created_at": "2017-07-27T17:55:35Z",
      "updated_at": "2017-07-27T17:55:36Z",
      "credentials": [
        {
          "name": "app-id",
          "value": "abcd",
          "safe": true
        },
        {
          "name": "app-secret",
          "safe": "false"
        }
      ]
    }
  }
}
<transaction>
  <token>BIqYM6q9kideDE8Xwj8LbMKGvvF</token>
  <created_at type="dateTime">2017-07-27T17:55:37Z</created_at>
  <updated_at type="dateTime">2017-07-27T17:55:37Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>UpdatePaymentMethodReceiver</transaction_type>
  <state>succeeded</state>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <receiver>
    <company_name>TEST</company_name>
    <receiver_type>test</receiver_type>
    <token>I915nS7vmJnqPN9twDHW9blRaq0</token>
    <hostnames>https://spreedly-echo.herokuapp.com</hostnames>
    <state>retained</state>
    <created_at type="dateTime">2017-07-27T17:55:36Z</created_at>
    <updated_at type="dateTime">2017-07-27T17:55:37Z</updated_at>
    <credentials type="array">
      <credential>
        <name>app-id</name>
        <value>abcd</value>
        <safe>true</safe>
      </credential>
      <credential>
        <name>app-secret</name>
        <safe>false</safe>
      </credential>
    </credentials>
  </receiver>
</transaction>

Update a receiver with new credentials.

URL Parameters

Parameter Description
receiver_token
required
The token of the receiver at Spreedly
format
required
One of json or xml

Request Body

Parameter Description
receiver Root element
❯ credentials
required
Sensitive values that should be securely stored and made available to the request template at time of delivery

Response Body

Notable response elements include:

Element Description
transaction Root element
❯ receiver Updated receiver
❯❯ token The token uniquely identifying this receiver at Spreedly
❯❯ receiver_type The type of receiver
❯❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.
❯❯ credentials One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed.

Redact receiver

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


HTTPS/1.1 200 OK
{
  "transaction": {
    "token": "GX7M1jZKAdsYGVrQSvvMw2gLHQx",
    "created_at": "2017-07-27T17:55:33Z",
    "updated_at": "2017-07-27T17:55:33Z",
    "succeeded": true,
    "transaction_type": "RedactPaymentMethodReceiver",
    "message_key": "messages.transaction_succeeded",
    "message": "Succeeded!",
    "receiver": {
      "company_name": "TEST",
      "receiver_type": "test",
      "token": "BDNVxsYWxxDVrMQhTsC14r6qASy",
      "hostnames": "https://spreedly-echo.herokuapp.com",
      "state": "redacted",
      "created_at": "2017-07-27T17:55:32Z",
      "updated_at": "2017-07-27T17:55:33Z",
      "credentials": null
    }
  }
}
<transaction>
  <token>2fetQVEr2aIn9f9lM1tCd2xjUJG</token>
  <created_at type="dateTime">2017-07-27T17:55:33Z</created_at>
  <updated_at type="dateTime">2017-07-27T17:55:33Z</updated_at>
  <succeeded type="boolean">true</succeeded>
  <transaction_type>RedactPaymentMethodReceiver</transaction_type>
  <message key="messages.transaction_succeeded">Succeeded!</message>
  <receiver>
    <company_name>TEST</company_name>
    <receiver_type>test</receiver_type>
    <token>J3jPlZXbgZIhLjPGxYqmRiqBQKA</token>
    <hostnames>https://spreedly-echo.herokuapp.com</hostnames>
    <state>redacted</state>
    <created_at type="dateTime">2017-07-27T17:55:33Z</created_at>
    <updated_at type="dateTime">2017-07-27T17:55:33Z</updated_at>
    <credentials nil="true"></credentials>
  </receiver>
</transaction>

Redact (strip of any sensitive credentials and make inactive) a receiver.

URL Parameters

Parameter Description
receiver_token
required
The token of the receiver at Spreedly
format
required
One of json or xml

Response Body

Notable response elements include:

Element Description
transaction Root element
❯ receiver Updated receiver
❯❯ token The token uniquely identifying this receiver at Spreedly
❯❯ receiver_type The type of receiver
❯❯ hostnames The allowed list of hostnames to which payment methods can be delivered
❯❯ state The storage state of the payment method. Can be one of retained or redacted. By default, receivers are created in the retained state and must be explicitly redacted if they are no longer required.
❯❯ credentials One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed.