API reference
Test mode. Use your secret key on your server; live processing is currently disabled.
https://api.knoxapi.comSend form-encoded requests with Authorization: Bearer sk_test_....
Complete OpenAPI specification · Integration guide
Operations and schemas are based on the pinned Stripe OpenAPI specification (MIT). Nested object definitions and enums are available in the complete specification.
POST /v1/customer_sessions
Create a Customer Session
Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
Request parameters
| Field | Type | Description |
|---|---|---|
components required | object | Configuration for each component. At least 1 component must be enabled. |
customer | string | The ID of an existing customer for which to create the Customer Session. |
customer_account | string | The ID of an existing Account for which to create the Customer Session. |
expand | array of string | Specifies which fields in the response should be expanded. |
Responses
HTTP 200: Successful response.
| Field | Type | Description |
|---|---|---|
client_secret required | string | The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`. The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. |
components | customer_session_resource_components | |
created required | integer | Time at which the object was created. Measured in seconds since the Unix epoch. |
customer required | one of multiple schemas | The Customer the Customer Session was created for. |
customer_account | string | The Account that the Customer Session was created for. |
expires_at required | integer | The timestamp at which this Customer Session will expire. |
livemode required | boolean | If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. |
object required | string | String representing the object's type. Objects of the same type share the same value. |
HTTP default: Error response.
| Field | Type | Description |
|---|---|---|
error required | api_errors |