---
title: "Create a receiver"
method: POST
path: "/receivers"
tags: ["receivers"]
---

# Create a receiver

`POST /receivers`

Create a receiver for use in [payment method distribution](https://developer.spreedly.com/docs/payment-method-distribution)

## Request body

- union
  - HttpReceiver
    - `receiver` object
      - `receiver_type` string, 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` string — The allowed list of hostnames to which payment methods can be delivered
      - `credentials` object[] — Sensitive values that should be securely stored and made available to the request template at time of delivery
        - `name` string — The name of the credential. This will be the name of the variable in the delivery request template.
        - `value` string — The value of the credential. This will be the value substituted in for the credential variable in the delivery request template.
        - `safe` boolean — _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.
  - SftpReceiver
    - `receiver` object
      - `receiver_type` string, 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` object, required — A hash of protocol values, currently only used for the SFTP protocol. e.g. `sftp://user:password@127.0.0.0`
        - `user` string — The user value
        - `password` string — The password value
      - `hostnames` string — Allowed list of hosts that the receiver can send payments to. Supports a comma sepaerated 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.

## Response `201`

Created

- ReceiverResponse
  - `receiver` ReceiverProperties
    - `company_name` string — The name of the company providing the receiver
    - `receiver_type` string — The type of the receiver
    - `state` string — The storage state of the receiver. 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.
    - `token` string — The token uniquely identifying this receiver at Spreedly
    - `created_at` string — The time the receiver was created
    - `updated_at` string — The time the receiver was last updated
    - `credentials` unknown[] — One or more name/value pairs used to authenticate with the receiver. Only credentials marked as safe will have their values echoed.
      - unknown
    - `hostnames` string — The allowed list of hostnames to which payment methods can be delivered
    - `sub_merchant_key` string — The token of the [sub-merchant](https://developer.spreedly.com/reference/create-sub-merchant) to associate with the current receiver. If an invalid `sub_merchant_key` is passed through, the value defaults to `null`

## Other responses

- `403` — Forbidden
- `422` — Unprocessable Entity

---

[API](https://skmtc.dev/spreedly/apis/spreedly-api-v1.md) · [All operations](https://skmtc.dev/spreedly/apis/spreedly-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spreedly/spreedly-api-v1/revisions/72ba4e23e65c/schema)
