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/refunds

List all refunds

Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.

Request parameters

ParameterLocationTypeDescription
chargequerystringOnly return refunds for the charge specified by this charge ID.
createdqueryone of multiple schemasOnly return refunds that were created during the given date interval.
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.
payment_intentquerystringOnly return refunds for the PaymentIntent specified by this ID.
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 refund
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/refunds

Create a refund

When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded. Once entirely refunded, a charge can’t be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.

Request parameters

FieldTypeDescription
amountinteger
chargestringThe identifier of the charge to refund.
currencystringThree-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).
customerstringCustomer whose customer balance to refund from.
expandarray of stringSpecifies which fields in the response should be expanded.
instructions_emailstringFor payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions.
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`.
originstringOrigin of the refund
payment_intentstringThe identifier of the PaymentIntent to refund.
reasonstringString indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://docs.stripe.com/radar/lists), and will also help us improve our fraud detection algorithms.
refund_application_feebooleanBoolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.
reverse_transferbooleanBoolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount).A transfer can be reversed only by the application that created the charge.

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
GET /v1/refunds/{refund}

Retrieve a refund

Retrieves the details of an existing refund.

Request parameters

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

object. See the OpenAPI specification for the complete schema.

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
POST /v1/refunds/{refund}

Update a refund

Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don’t provide remain unchanged. This request only accepts metadata as an argument.

Request parameters

ParameterLocationTypeDescription
refundpathstring
FieldTypeDescription
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, 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
POST /v1/refunds/{refund}/cancel

Cancel a refund

Cancels a refund with a status of requires_action. You can’t cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.

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