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.

GET /v1/topups

List all top-ups

Returns a list of top-ups.

Request parameters

ParameterLocationTypeDescription
amountqueryone of multiple schemasA positive integer representing how much to transfer.
createdqueryone of multiple schemasA filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
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.
statusquerystringOnly return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`.

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
data requiredarray of topup
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/topups

Create a top-up

Top up the balance of an account

Request parameters

FieldTypeDescription
amount requiredintegerA positive integer representing how much to transfer.
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).
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
payment_methodstringThe ID of a PaymentMethod representing the payment method to be used for the top-up. A PaymentMethod of type `us_bank_account` can be used.
payment_method_optionsobjectPayment method-specific configuration for this top-up.
sourcestringThe ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://docs.stripe.com/connect/testing#testing-top-ups)).
statement_descriptorstringExtra information about a top-up for the source's bank statement. Limited to 15 ASCII characters.
transfer_groupstringA string that identifies this top-up as part of a group.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerAmount transferred.
balance_transactionone of multiple schemasID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up.
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).
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expected_availability_dateintegerDate the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
failure_codestringError code explaining reason for top-up failure if available (see [the errors section](/api/errors) for a list of codes).
failure_messagestringMessage to user further explaining reason for top-up failure if available.
id requiredstringUnique identifier for the object.
initiated_bystringIndicates whether the top-up was initiated by Stripe or by the user.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_methodone of multiple schemasThe ID of a PaymentMethod representing the payment method used for the top-up. A PaymentMethod of type `us_bank_account` can be used.
payment_method_optionsone of multiple schemasPayment-method-specific configuration for this top-up.
sourceone of multiple schemasThe source field is deprecated. It might not always be present in the API response.
statement_descriptorstringExtra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
status requiredstringThe status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`.
transfer_groupstringA string that identifies this top-up as part of a group.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
GET /v1/topups/{topup}

Retrieve a top-up

Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.

Request parameters

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

object. See the OpenAPI specification for the complete schema.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerAmount transferred.
balance_transactionone of multiple schemasID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up.
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).
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expected_availability_dateintegerDate the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
failure_codestringError code explaining reason for top-up failure if available (see [the errors section](/api/errors) for a list of codes).
failure_messagestringMessage to user further explaining reason for top-up failure if available.
id requiredstringUnique identifier for the object.
initiated_bystringIndicates whether the top-up was initiated by Stripe or by the user.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_methodone of multiple schemasThe ID of a PaymentMethod representing the payment method used for the top-up. A PaymentMethod of type `us_bank_account` can be used.
payment_method_optionsone of multiple schemasPayment-method-specific configuration for this top-up.
sourceone of multiple schemasThe source field is deprecated. It might not always be present in the API response.
statement_descriptorstringExtra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
status requiredstringThe status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`.
transfer_groupstringA string that identifies this top-up as part of a group.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/topups/{topup}

Update a top-up

Updates the metadata of a top-up. Other top-up details are not editable by design.

Request parameters

ParameterLocationTypeDescription
topuppathstring
FieldTypeDescription
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expandarray of stringSpecifies which fields in the response should be expanded.
metadataone of multiple schemasSet 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerAmount transferred.
balance_transactionone of multiple schemasID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up.
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).
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expected_availability_dateintegerDate the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
failure_codestringError code explaining reason for top-up failure if available (see [the errors section](/api/errors) for a list of codes).
failure_messagestringMessage to user further explaining reason for top-up failure if available.
id requiredstringUnique identifier for the object.
initiated_bystringIndicates whether the top-up was initiated by Stripe or by the user.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_methodone of multiple schemasThe ID of a PaymentMethod representing the payment method used for the top-up. A PaymentMethod of type `us_bank_account` can be used.
payment_method_optionsone of multiple schemasPayment-method-specific configuration for this top-up.
sourceone of multiple schemasThe source field is deprecated. It might not always be present in the API response.
statement_descriptorstringExtra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
status requiredstringThe status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`.
transfer_groupstringA string that identifies this top-up as part of a group.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors
POST /v1/topups/{topup}/cancel

Cancel a top-up

Cancels a top-up. Only pending top-ups can be canceled.

Request parameters

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

Responses

HTTP 200: Successful response.
FieldTypeDescription
amount requiredintegerAmount transferred.
balance_transactionone of multiple schemasID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up.
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).
descriptionstringAn arbitrary string attached to the object. Often useful for displaying to users.
expected_availability_dateintegerDate the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up.
failure_codestringError code explaining reason for top-up failure if available (see [the errors section](/api/errors) for a list of codes).
failure_messagestringMessage to user further explaining reason for top-up failure if available.
id requiredstringUnique identifier for the object.
initiated_bystringIndicates whether the top-up was initiated by Stripe or by the user.
livemode requiredbooleanIf the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
metadata requiredobjectSet 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.
object requiredstringString representing the object's type. Objects of the same type share the same value.
payment_methodone of multiple schemasThe ID of a PaymentMethod representing the payment method used for the top-up. A PaymentMethod of type `us_bank_account` can be used.
payment_method_optionsone of multiple schemasPayment-method-specific configuration for this top-up.
sourceone of multiple schemasThe source field is deprecated. It might not always be present in the API response.
statement_descriptorstringExtra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter.
status requiredstringThe status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`.
transfer_groupstringA string that identifies this top-up as part of a group.
HTTP default: Error response.
FieldTypeDescription
error requiredapi_errors