---
title: "Attach source to checkout"
method: POST
path: "/checkouts/{id}/sources/{sourceId}"
tags: ["Checkouts"]
---

# Attach source to checkout

`POST /checkouts/{id}/sources/{sourceId}`

Attach source to checkout. Supply the unique identifier of the checkout.

## Path parameters

- `id` string, required
- `sourceId` string, required

## Response `200`

OK.

- Source
  - `id` string — Unique identifier for the source.
  - `clientSecret` string — Used for client-side retrieval using a public key.
  - `createdTime` string, date-time — Time when the source was created.
  - `type` 'creditCard' | 'directDebit' | 'googlePay' | 'applePay' | 'payPal' | 'payPalBilling' | 'payPalCredit' | 'wireTransfer' | 'customerCredit' | 'alipay' | 'bPay' | 'onlineBanking' | 'codJapan' | 'klarnaCredit' | 'klarnaCreditRecurring' | 'konbini' | 'bankTransfer' | 'msts' | 'bancontact' | 'giftCard' | 'ideal' | 'amazonPay' | 'afterPay' | 'ccAvenue' — The payment type of the source. The payment type will correspond to another element in the source response that contains detailed information specific to the type. For example, a type of creditCard indicates that there is an object in the response named creditCard.
  - `currency` string — Three-letter ISO currency code.
  - `amount` number, double — Amount associated with the source. Once ready, the source will be charged this amount. Required for single_use sources.
  - `reusable` boolean — If true, you can reuse this source, if false, only once.
  - `owner` Owner — The owner of the payment source.
    - `firstName` string
    - `lastName` string
    - `email` string
    - `organization` string, nullable — The organization of the payment source owner.
    - `upstreamId` string
    - `address` Address, required — Represents basic address information.
      - `line1` string, nullable — The first line of the address.
      - `line2` string — The second line of the address.
      - `city` string, nullable — The city of the address.
      - `postalCode` string, nullable — The postal code of the address.
      - `state` string, nullable — The state, county, province, or region.
      - `country` string, required — A [two-letter Alpha-2 country code](https://www.iban.com/country-codes) as described in the [ISO 3166](https://www.iso.org/iso-3166-country-codes.html) international standard.
    - `additionalAddressInfo` AdditionalAddressInfo — Captures any information that's not included in the basic address.
      - `neighborhood` string, nullable — The neighborhood of the address.
      - `division` string, nullable — A division within an organization.
      - `phoneticName` string, nullable — The phonetic spelling of a name.
  - `creditCard` CreditCard
    - `lastFourDigits` string — The last four digits of the card number.
    - `expirationMonth` number — One to two digits representing the expiration month.
    - `expirationYear` number — Four digits representing the expiration year.
    - `brand` string — The card brand.
  - `googlePay` GooglePay
    - `lastFourDigits` string — The last four digits of the card number.
    - `expirationMonth` number — One to two digits representing the expiration month.
    - `expirationYear` number — Four digits representing the expiration year.
    - `brand` string — The card brand.
  - `payPal` PayPal
    - `redirect` Redirect
      - `redirectUrl` string
      - `returnUrl` string
      - `cancelUrl` string
    - `directDebit` PayPalToken
      - `token` string
  - `payPalBilling` PayPal
    - `redirect` Redirect
      - `redirectUrl` string
      - `returnUrl` string
      - `cancelUrl` string
    - `directDebit` PayPalToken
      - `token` string
  - `payPalCredit` PayPal
    - `redirect` Redirect
      - `redirectUrl` string
      - `returnUrl` string
      - `cancelUrl` string
    - `directDebit` PayPalToken
      - `token` string
  - `directDebit` DirectDebit
    - `redirect` DirectDebitRedirect
      - `redirectUrl` string
      - `returnUrl` string
  - `wireTransfer` WireTransfer
    - `accountHolder` string — .
    - `bankName` string — .
    - `city` string — .
    - `country` string — .
    - `referenceId` string — .
    - `accountNumber` string — .
    - `additionalBankInformation` string — .
    - `iban` string — .
    - `swiftCode` string — .
  - `payCo` PaycoResponse
    - `redirectUrl` string
    - `returnUrl` string
    - `payCo` Payco
  - `alipay` Alipay
  - `applePay` ApplePay
  - `bPay` BPay
    - `accountHolder` string
    - `bankName` string
    - `city` string
    - `country` string
    - `referenceId` string
    - `accountNumber` string
    - `billId` string
    - `customerPaymentReference` string
    - `swiftCode` string
  - `onlineBanking` InternetBankPayment
    - `bankCode` string
  - `codJapan` JapanCOD
  - `klarnaCredit` Klarna
    - `shipping` KlarnaShipping
      - `recipient` string
      - `phoneNumber` string
      - `address` KlarnaAddress
        - `line1` string
        - `city` string
        - `state` string
        - `country` string
        - `postalCode` string
      - `email` string
    - `token` string
  - `klarnaCreditRecurring` KlarnaRecurring
    - `returnUrl` string
    - `cancelUrl` string
  - `konbini` Konbini
    - `storeId` string
    - `receiptNumber` string
    - `printableInvoiceUrl` string
    - `storeName` string
    - `localizedStoreName` string
    - `storeLogoUrl` string
  - `bankTransfer` BankTransfer
  - `msts` MSTS
  - `bancontact` Bancontact
  - `ideal` Ideal
  - `giftCard` GiftCard
    - `cardCurrency` string — The currency used by the card.
    - `conversionRate` number — The conversion rate of the currency.
    - `lastFourDigits` integer — The last four digits of the card.
  - `amazonPay` AmazonPay
  - `afterPay` AfterPay
  - `ccAvenue` CCAvenue
  - `flow` 'standard' | 'redirect' | 'receiver' — The authentication flow of the source.
  - `state` 'pending_funds' | 'pending_redirect' | 'requires_action' | 'chargeable' | 'consumed' | 'cancelled' | 'failed' — The status of the source, one of pending_funds, pending_redirect, requires_action, cancelled, chargeable, consumed or failed. You can only use chargeable sources to create a charge.
  - `metadata` Metadata — Key-value pairs used to store additional data. Value can be string, boolean or integer types.
  - `customerId` string — Unique identifier of a customer.
  - `paymentSessionId` string — Tracks the process of collecting a payment.
  - `liveMode` boolean — Has the value true if the object exists in live mode or the value false if the object exists in test mode.

## Other responses

- `400` — 400 Bad Request
- `401` — 401 Unauthorized
- `403` — 403 Forbidden
- `404` — 404 Not Found
- `405` — 405 Method Not Allowed
- `406` — 406 Not Acceptable
- `408` — 408 Request Timeout
- `429` — 429 Too Many Requests
- `500` — 500 Internal Server Error
- `502` — 502 Bad Gateway Error
- `503` — 503 Service Unavailable Error
- `504` — 504 Gateway Timeout Error

---

[API](https://skmtc.net/digitalriver/apis/digital-river-api-reference.md) · [All operations](https://skmtc.net/digitalriver/apis/digital-river-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalriver/digital-river-api-reference/revisions/f21981db32be/schema)
