---
title: "Export payment methods"
method: POST
path: "/receivers/{receiver_token}/export"
tags: ["receivers"]
---

# Export payment methods

`POST /receivers/{receiver_token}/export`

Export multiple payment methods in a single, asynchronous, batch call to an SFTP receiver endpoint.

## Request body

- ExportProperties
  - `export` object
    - `payment_method_tokens` string[] — An array of payment method tokens to include in the export
    - `payment_method_data` object — A hash of key/value pairs. For each pair, the key is a payment_method_token and the value is a hash of information specific to the associated payment method. This payment method specific information is made available to the request template at time of export.
    - `url` string — The fully qualified URL for the SFTP server. The URL must have the same hostname as one of the allowed hostnames for the target receiver. The path of the url will be used as the file name, e.g., `sftp://prod.receiver.com/path/to/file.txt`.
    - `body` string — The request body that will get sent to the receiver e.g., `{{#payment_methods}}<cardNumber>{{ credit_card_number }}</cardNumber>{{/payment_methods}}`.
    - `callback_url` string — The url where Spreedly will attempt delivery of transaction results. Transaction results are posted in JSON format.
    - `sub_merchant_key` string — The token of the [sub-merchant](https://developer.spreedly.com/reference/create-sub-merchant) to associate with the current transaction. If an invalid `sub_merchant_key` is passed through, the value defaults to `null`.

## Response `202`

Accepted

- ExportResponse
  - `transaction` object — The receiver the payment method was exported to
    - `token` string — The token of this transaction
    - `transaction_type` string — The type of transaction, e.g., ExportPaymentMethods, Capture, Credit
    - `state` string — The state of this transaction. The state will be “pending” until the transaction has completed processing. Once processed, the state can be either “succeeded” or “failed”
    - `created_at` string — The time the transaction was created
    - `updated_at` string — The time the transaction was last updated
    - `succeeded` boolean — Shows if the transaction completed with a non error status. While the transaction is pending, this value will be false.
    - `message` string — A brief description of the results of the transaction.
    - `payment_methods_submitted` unknown[] — The payment method tokens in the original export request
      - unknown
    - `payment_method_data` object — A hash of key/value pairs. For each pair, the key is a payment_method_token and the value is a hash of information specific to the associated payment method. This payment method specific information is made available to the request template at time of export.
    - `payment_methods_included` unknown[] — The payment method tokens included in the export to the receiver. This value is null while the transaction is pending. Once the transaction is processed, this value will be an array of payment method tokens.
      - unknown
    - `encode_response` boolean — _Default:_ `false`. If `true`, the `response_body` value in the delivery transaction response will be base64 encoded. This is useful if there are characters in the response known to cause encoding or other formatting issues.
    - `callback_url` string — The url where Spreedly attempted delivery of transaction results. Transaction results are posted in JSON format.
    - `url` string — The fully qualified URL for the SFTP server. The URL must have the same hostname as one of the allowed hostnames for the target receiver. The path of the url will be used as the file name, e.g., `sftp://prod.receiver.com/path/to/file.txt`.
    - `payment_methods_excluded` object — The payment methods that were not included in the export to the receiver. The value is null while the transaction is pending. Once the transaction is processed, this value will be a hash with key/value pairs. The keys are payment method tokens, the values are the reason the payment method was not included in the export to the receiver.
    - `response` string — The response status returned from the receiver. The response is null while the transaction is pending.
    - `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

- `404` — Not found

---

[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)
