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. |