POST
/
v1
/
c
/
customer
/
{customer_id}
/
payment
/
session
curl --request POST \
  --url http://127.0.0.1:8080/v1/c/customer/{customer_id}/payment/session \
  --header 'Content-Type: application/json' \
  --header 'wb-key: <api-key>' \
  --data '{
  "address": true,
  "detach_previous_on_success": true,
  "operation": "add_method",
  "plan_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
  "pricing_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
  "provider": "stripe"
}'
{
  "address": true,
  "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
  "detach_previous_on_success": true,
  "operation": "add_method",
  "provider": "stripe",
  "setup_intent": {
    "address": true,
    "customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
    "stripe": {
      "client_secret": "<string>",
      "connected_account_id": "<string>",
      "pk_key": "<string>"
    },
    "wb_customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
  },
  "status": "<string>",
  "token": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670",
  "wb_customer_id": "Cust_c40bea18-c0c9-44b1-bd0c-43f5283e1670"
}

Authorizations

wb-key
string
header
required

Path Parameters

customer_id
string
required

Id of the customer

Body

application/json

An inbound payment session for creation (a different one is used for updating, see FI-360)

address
boolean
required

whether to collect billing address

operation
enum<string>
required

The purpose of a payment session:

  • AddMethod - add a new payment method
Available options:
add_method
detach_previous_on_success
boolean | null
plan_id
string

Unique identifier of an object. Consists of object class prefix and a UUID

pricing_id
string

Unique identifier of an object. Consists of object class prefix and a UUID

provider
enum<string>

The payment providers known by the backend.

Those variants MUST be kept identical to the variants of the payment_provider enum of the postgres database

Available options:
authorize,
self_handled,
stripe

Response

200 - application/json
payment session

Payment Session used to configure Payment Method

address
boolean
required

Indicates whether address is required

customer_id
string
required

Unique identifier of an object. Consists of object class prefix and a UUID

detach_previous_on_success
boolean
required

Determines whether previous payment method will be disabled and deregistered once current setup succeeds

operation
enum<string>
required

The purpose of a payment session:

  • AddMethod - add a new payment method
Available options:
add_method
provider
enum<string>
required

The payment providers known by the backend.

Those variants MUST be kept identical to the variants of the payment_provider enum of the postgres database

Available options:
authorize,
self_handled,
stripe
status
string
required

Payment Session Status

token
string
required

Unique identifier of an object. Consists of object class prefix and a UUID

wb_customer_id
string
required

Unique identifier of an object. Consists of object class prefix and a UUID

setup_intent
object

Payment Configuration setup intent