---
title: "Deliver payment method"
method: POST
path: "/receivers/{receiver_token}/deliver"
tags: ["receivers"]
---

# Deliver payment method

`POST /receivers/{receiver_token}/deliver`

Deliver a payment method to the specified receiver endpoint. See the guide on [payment method distribution](https://developer.spreedly.com/docs/payment-method-distribution) to understand how to specify what is sent to the receiver. Spreedly provides an open [repository of code templates](https://github.com/spreedly/templates) for simplifying implementation of new receivers.

## Request body

- Deliver
  - `delivery` object
    - `continue_caching` boolean — An option to keep the cvv cached for a few minutes. Otherwise cvv is deleted immediately.
    - `payment_method_token` string, required — The token of the payment method to send to the receiver and whose values will be applied to the delivery template.
    - `attempt_network_token` boolean — `true` if this transaction should use a network token if able. `false` or omit this element to not use a network token for this transaction. Please see our [network tokenization guide](https://developer.spreedly.com/docs/network-tokenization#transacting-with-network-tokens) for more details on Network Token logic checks.
    - `url` string, required — The full qualified URL to send the payment method. The URL must have the same hostname as one of the allowed hostnames for the target receiver. The URL string can include distribution variable placeholders, e.g., `https://prod.receiver.com/path/book?user={{user_name}}`.
    - `request_method` string — An option to specify the HTTP method to use when contacting the receiver. Acceptable values are `PUT`, `PATCH`, and `POST`. If omitted, the default value is `POST`.
    - `headers` string — The request headers to be sent to the receiver as a [colon-delimited, new-line separated, string](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#General_format). `Host` and `Content-Length` can be omitted as they are automatically generated by Spreedly. Headers can include distribution variable placeholders, e.g., `User: {{ user_name }}`.
    - `body` string, required — The request body that will get sent to the receiver. The body can include distribution variable placeholders, e.g., `<cardNumber>{{ credit_card_number }}</cardNumber>`.
    - `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.
    - `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 `200`

Successful

- DeliverResponse
  - `transaction` object — The payment method created as part of this transaction
    - `token` string — The token of this transaction
    - `transaction_type` string — The type of transaction, e.g., DeliverPaymentMethod, Capture, Credit
    - `state` string — The current state of the transaction
    - `created_at` string — The time the transaction token was created
    - `updated_at` string — The time the transaction was last updated
    - `succeeded` boolean — `true` if the transaction request was successfully executed, `false` otherwise
    - `message` string — A human-readable string indicating the result of the transaction
    - `sub_merchant_key` string — The token of the sub-merchant associated with the transaction.
    - `url` string — The full qualified URL where the payment method was sent.
    - `deliver_time_ms` number — The time it took for the deliver transaction to process in milliseconds.
    - `response` object — The raw response status, header and body returned from the receiver. Parse these values to retrieve relevant response fields.
      - `status` number — The status code returned by the receiver.
      - `headers` string — The headers, as delivered exactly by the receiver
      - `body` string — The raw body delivered from the receiver, with account numbers and sensitive data redacted.
    - `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`
    - `payment_method` PaymentMethod
      - `token` string — The token identifying the payment method in the Spreedly vault
      - `created_at` string — The time the payment method token was created
      - `updated_at` string — The time the payment method token was last updated
      - `email` string — The email address of the customer associated with this credit card
      - `storage_state` string — The `storage_state` (retained, redacted, cached, used) of the payment method
      - `test` boolean — `true` if this payment method is a test payment method and cannot be used against real gateways or receivers
      - `metadata` object — metadata key-value pairs (limit 25). Keys are limited to 50 characters. Values are limited to 500 characters and cannot contain compounding data types
      - `callback_url` string — The URL where Spreedly will attempt delivery of asynchronous results for 3DS and offsite transactions. Transaction results are posted in the format specified by `callback_format` if provided or XML if `callback_format` is not present or null. (default: `null`)
      - `last_four_digits` string — The last four digits of the credit card number. This can be displayed to the user.
      - `first_six_digits` string — The first six digits of the credit card number. This can be displayed to the user.
      - `card_type` string — The [type](https://developer.spreedly.com/docs/supported-payment-methods), or brand, of the card. Please see the `card_type_mapping` function below for more detail.
      - `first_name` string — The first name of the cardholder
      - `last_name` string — The last name of the cardholder
      - `month` string — The expiration month
      - `year` string — The expiration year
      - `address1` string — The first line of the billing address
      - `address2` string — The second line of the billing address
      - `city` string — The city of the billing address
      - `state` string — The state of the billing address
      - `zip` string — The zip code of the billing address
      - `country` string — The country code of the billing address
      - `phone_number` string — The phone number of the billing address
      - `company` string — The company of the cardholder
      - `full_name` string — The full name of the cardholder.
      - `eligible_for_card_updater` string — `true` if this payment method should be included in Account Updater
      - `shipping_address1` string — The first line of the shipping address
      - `shipping_address2` string — The second line of the shipping address
      - `shipping_city` string — The city of the shipping address
      - `shipping_state` string — The state of the shipping address
      - `shipping_zip` string — The zip code of the shipping address
      - `shipping_country` string — The country code of the shipping address
      - `issuer_identification_number` string — The numbers of the PAN required to identify the card issuer.
      - `click_to_pay` string — `true` if the card was tokenized using Click to Pay
      - `managed` string — The value indicating the payment method's management status.
      - `payment_method_type` string — The type of this payment method, e.g., `credit_card`, `bank_account`, `apple_pay`, `google_pay`, `third_party_token`, etc…
      - `errors` string — If the payment method is invalid (missing required fields, etc…), there will be associated error messages here
      - `fingerprint` string — An identifying string that will match all cards in the environment with the same PAN
      - `verification_value` string — The obscured verification value (CVV), e.g., XXX or XXXX
      - `number` string — The obscured credit card number, e.g., XXXX-XXXX-XXXX-4444
      - `bin_metadata` object — BIN metadata is available in the response if the card is enrolled in Advanced Vault. See [BIN metadata](https://developer.spreedly.com/docs/bin-metadata) for more information.
        - `card_brand` string
        - `card_category` string
        - `card_type` string
        - `issuing_bank` string
        - `issuing_country_iso_number` string
        - `issuing_country_iso_a2_code` string
        - `issuing_country_iso_a3_code` string
        - `issuing_country_iso_name` string
        - `issuing_bank_phone_number` string
        - `issuing_bank_website` string
        - `bin_type` string
        - `regulated` string
        - `max_pan_length` string
        - `message` string
      - `subscribed_to_mastercard_abu` boolean — `true` if this payment method is subscribed to Mastercard ABU updating service
      - `last_successfully_used` string, date-time, nullable — The time (UTC) the payment method was last successfully transacted with. The following transaction types are considered: Authorization, Purchase, Verification, GeneralCredit, OffsiteVerification, or OffsitePurchase

## Other responses

- `401` — Unauthorized
- `404` — Not found
- `422` — Unknown error

---

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