Knox Docs Sign in

API reference

Test mode. Use your secret key on your server; live processing is currently disabled.

https://api.knoxapi.com

Send 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/test_helpers/confirmation_tokens

Create a test Confirmation Token

Creates a test mode Confirmation Token server side for your integration tests.

Request parameters

FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
payment_methodstringID of an existing PaymentMethod.
payment_method_dataobjectIf provided, this hash will be used to create a PaymentMethod.
payment_method_optionsobjectPayment-method-specific configuration for this ConfirmationToken.
return_urlstringReturn URL used to confirm the Intent.
setup_future_usagestringIndicates that you intend to make future payments with this ConfirmationToken's payment method. The presence of this property will [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
shippingobjectShipping information for this ConfirmationToken.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
expires_atintegerTime at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
mandate_dataone of multiple schemasData used for generating a Mandate.
metadataobjectSet of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_intentstringID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
payment_method_optionsone of multiple schemasPayment-method-specific configuration for this ConfirmationToken.
payment_method_previewone of multiple schemasPayment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.
return_urlstringReturn URL used to confirm the Intent.
setup_future_usagestringIndicates that you intend to make future payments with this ConfirmationToken's payment method. The presence of this property will [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.
setup_intentstringID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.
shippingone of multiple schemasShipping information collected on this ConfirmationToken.
use_stripe_sdk requiredbooleanIndicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/test_helpers/test_clocks

List all test clocks

Returns a list of your test clocks.

Request parameters

ParameterLocationTypeDescription
ending_beforequerystringA cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
expandqueryarray of stringSpecifies which fields in the response should be expanded.
limitqueryintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterquerystringA cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of test_helpers.test_clock
has_more requiredbooleanTrue if this list has another page of items after this one that can be fetched.
object requiredstringString representing the object's type. Objects of the same type share the same value. Always has the value `list`.
url requiredstringThe URL where this list can be accessed.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/test_helpers/test_clocks

Create a test clock

Creates a new test clock that can be attached to new customers and quotes.

Request parameters

FieldTypeDescription
customerstringExisting customer this test clock will be attached to. Once attached, customers can't be removed from a test clock.
expandarray of stringSpecifies which fields in the response should be expanded.
frozen_time requiredintegerThe initial frozen time for this test clock.
namestringThe name for this test clock.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
deletes_after requiredintegerTime at which this clock is scheduled to auto delete.
frozen_time requiredintegerTime at which all objects belonging to this clock are frozen.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
namestringThe custom name supplied at creation.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe status of the Test Clock.
status_details requiredbilling_clocks_resource_status_details_status_details
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/test_helpers/customers/{customer}/fund_cash_balance

Fund a test mode cash balance

Create an incoming testmode bank transfer

Request parameters

ParameterLocationTypeDescription
customerpathstring
FieldTypeDescription
amount requiredintegerAmount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency).
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
expandarray of stringSpecifies which fields in the response should be expanded.
referencestringA description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://docs.stripe.com/payments/customer-balance/reconciliation) applies to different user inputs.

Responses

HTTP 200: Successful response.
FieldTypeDescription
adjusted_for_overdraftcustomer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft
applied_to_paymentcustomer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customer requiredone of multiple schemasThe customer whose available cash balance changed as a result of this transaction.
customer_accountstringThe ID of an Account representing a customer whose available cash balance changed as a result of this transaction.
ending_balance requiredintegerThe total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
fundedcustomer_balance_resource_cash_balance_transaction_resource_funded_transaction
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
net_amount requiredintegerThe amount by which the cash balance changed, represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance.
object requiredstringString representing the object's type. Objects of the same type share the same value.
refunded_from_paymentcustomer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction
transferred_to_balancecustomer_balance_resource_cash_balance_transaction_resource_transferred_to_balance
type requiredstringThe type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://docs.stripe.com/payments/customer-balance#types) to learn more about these types.
unapplied_from_paymentcustomer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/test_helpers/refunds/{refund}/expire

Expire a pending refund.

Expire a refund with a status of requires_action.

Request parameters

ParameterLocationTypeDescription
refundpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerAmount, in cents (or local equivalent).
balance_transactionone of multiple schemasBalance transaction that describes the impact on your account balance.
chargeone of multiple schemasID of the charge that's refunded.
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
currency requiredstringThree-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customerone of multiple schemasID of the customer of this refund.
customer_accountstringID of the account of this refund.
descriptionstringAn arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only).
destination_detailsrefund_destination_details
failure_balance_transactionone of multiple schemasAfter the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
failure_reasonstringProvides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`.
id requiredstringUnique identifier for the object.
instructions_emailstringFor payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.
metadataobjectSet of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_actionrefund_next_action
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_intentone of multiple schemasID of the PaymentIntent that's refunded.
payment_methodone of multiple schemasID of the payment method associated with this refund.
pending_reasonstringProvides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`.
presentment_detailspayment_flows_payment_intent_presentment_details
reasonstringReason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).
receipt_numberstringThis is the transaction number that appears on email receipts sent for this refund.
source_transfer_reversalone of multiple schemasThe transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account.
statusstringStatus of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://docs.stripe.com/refunds#failed-refunds).
transfer_reversalone of multiple schemasThis refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
DELETE /v1/test_helpers/test_clocks/{test_clock}

Delete a test clock

Deletes a test clock.

Request parameters

ParameterLocationTypeDescription
test_clockpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
deleted requiredbooleanAlways true for a deleted object
id requiredstringUnique identifier for the object.
object requiredstringString representing the object's type. Objects of the same type share the same value.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/test_helpers/test_clocks/{test_clock}

Retrieve a test clock

Retrieves a test clock.

Request parameters

ParameterLocationTypeDescription
expandqueryarray of stringSpecifies which fields in the response should be expanded.
test_clockpathstring

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
deletes_after requiredintegerTime at which this clock is scheduled to auto delete.
frozen_time requiredintegerTime at which all objects belonging to this clock are frozen.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
namestringThe custom name supplied at creation.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe status of the Test Clock.
status_details requiredbilling_clocks_resource_status_details_status_details
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/test_helpers/test_clocks/{test_clock}/advance

Advance a test clock

Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.

Request parameters

ParameterLocationTypeDescription
test_clockpathstring
FieldTypeDescription
expandarray of stringSpecifies which fields in the response should be expanded.
frozen_time requiredintegerThe time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future.

Responses

HTTP 200: Successful response.
FieldTypeDescription
created requiredintegerTime at which the object was created. Measured in seconds since the Unix epoch.
deletes_after requiredintegerTime at which this clock is scheduled to auto delete.
frozen_time requiredintegerTime at which all objects belonging to this clock are frozen.
id requiredstringUnique identifier for the object.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
namestringThe custom name supplied at creation.
object requiredstringString representing the object's type. Objects of the same type share the same value.
status requiredstringThe status of the Test Clock.
status_details requiredbilling_clocks_resource_status_details_status_details
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors