POST /v1/sources

Creates a new source object.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

Request body fields

Name Type Required Description
expand[] Array No

Specifies which fields in the response should be expanded.

source_order Object No

Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.

source_order.items[] Array No
source_order.items[].description String No
source_order.items[].parent String No
source_order.items[].amount Integer No
source_order.items[].quantity Integer No
source_order.items[].type String No

Possible values:

  • "sku"
  • "shipping"
  • "discount"
  • "tax"
source_order.items[].currency String No
source_order.shipping Object No
source_order.shipping.name String No
source_order.shipping.carrier String No
source_order.shipping.phone String No
source_order.shipping.address Object Yes
source_order.shipping.address.line2 String No
source_order.shipping.address.line1 String Yes
source_order.shipping.address.postal_code String No
source_order.shipping.address.country String No
source_order.shipping.address.state String No
source_order.shipping.address.city String No
source_order.shipping.tracking_number String No
metadata Object No
currency String No

Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready.

redirect Object No

Parameters required for the redirect flow. Required if the source is authenticated by a redirect (flow is redirect).

redirect.return_url String Yes
receiver Object No

Optional parameters for the receiver flow. Can be set only if the source is a receiver (flow is receiver).

receiver.refund_attributes_method String No

Possible values:

  • "manual"
  • "email"
  • "none"
usage String No

Possible values:

  • "single_use"
  • "reusable"
customer String No

The Customer to whom the original source is attached to. Must be set when the original source is not a Source (e.g., Card).

flow String No

The authentication flow of the source to create. flow is one of redirect, receiver, code_verification, none. It is generally inferred unless a type supports multiple flows.

Possible values:

  • "receiver"
  • "code_verification"
  • "redirect"
  • "none"
amount Integer No

Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. Not supported for receiver type sources, where charge amount may not be specified until funds land.

mandate Object No

Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.

mandate.interval String No

Possible values:

  • "variable"
  • "scheduled"
  • "one_time"
mandate.amount No
mandate.notification_method String No

Possible values:

  • "manual"
  • "email"
  • "stripe_email"
  • "deprecated_none"
  • "none"
mandate.currency String No
mandate.acceptance Object No
mandate.acceptance.online Object No
mandate.acceptance.online.user_agent String No
mandate.acceptance.online.ip String No
mandate.acceptance.online.date Integer No
mandate.acceptance.type String No

Possible values:

  • "offline"
  • "online"
mandate.acceptance.user_agent String No
mandate.acceptance.offline Object No
mandate.acceptance.offline.contact_email String Yes
mandate.acceptance.status String Yes

Possible values:

  • "refused"
  • "pending"
  • "revoked"
  • "accepted"
mandate.acceptance.ip String No
mandate.acceptance.date Integer No
token String No

An optional token used to create the source. When passed, token properties will override source parameters.

original_source String No

The source to share.

type String No

The type of the source to create. Required unless customer and original_source are specified (see the Cloning card Sources guide)

owner Object No

Information about the owner of the payment instrument that may be used or required by particular source types.

owner.email String No
owner.name String No
owner.phone String No
owner.address Object No
owner.address.line2 String No
owner.address.line1 String No
owner.address.postal_code String No
owner.address.country String No
owner.address.state String No
owner.address.city String No
statement_descriptor String No

An arbitrary string to be displayed on your customer's statement. As an example, if your website is RunClub and the item you're charging for is a race ticket, you may want to specify a statement_descriptor of RunClub 5K race ticket. While many payment types will display this information, some may not display it at all.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.