API reference

Application Fees

Knox answers these operations with the same requests and responses as Stripe's API. Authenticate with your secret key, Authorization: Bearer sk_test_..., from your server, and send form-encoded bodies. Test mode only: live processing is currently disabled.

List all application fees

GET/v1/application_fees

Returns a list of application fees you’ve previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.

Query parameters

  • chargestring

    Only return application fees for the charge specified by this charge ID.

  • createdobject | integer

    Only return applications fees that were created during the given date interval.

    Show 4 child parameters
    • gtinteger
    • gteinteger
    • ltinteger
    • lteinteger
  • ending_beforestring

    A 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.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A 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.

Returns

A list of application_fee objects.

GET /v1/application_fees
curl -G https://api.knoxapi.com/v1/application_fees \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/application_fees",
  "has_more": false,
  "data": [
    {
      "account": "acct_1PgafTB7WZ01zgkW",
      "amount": 100,
      "amount_refunded": 0,
      "application": "ca_QXhWOVlWX7KFerjnWFSGuGR21sZjCeji",
      "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
      "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
      "created": 1234567890,
      "currency": "usd",
      "fee_source": {
        "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
        "type": "charge"
      },
      "id": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
      "livemode": false,
      "object": "application_fee",
      "originating_transaction": null,
      "refunded": false,
      "refunds": {
        "data": [],
        "has_more": false,
        "object": "list",
        "url": "/v1/application_fees/fee_1Pgc6zB7WZ01zgkWOMh2at1m/refunds"
      }
    }
  ]
}

Retrieve an application fee

GET/v1/application_fees/{id}

Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee.

Path parameters

  • idstringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The application_fee object.

GET /v1/application_fees/{id}
curl https://api.knoxapi.com/v1/application_fees/fee_1Pgc6zB7WZ01zgkWOMh2at1m \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "account": "acct_1PgafTB7WZ01zgkW",
  "amount": 100,
  "amount_refunded": 0,
  "application": "ca_QXhWOVlWX7KFerjnWFSGuGR21sZjCeji",
  "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
  "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
  "created": 1234567890,
  "currency": "usd",
  "fee_source": {
    "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
    "type": "charge"
  },
  "id": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
  "livemode": false,
  "object": "application_fee",
  "originating_transaction": null,
  "refunded": false,
  "refunds": {
    "data": [],
    "has_more": false,
    "object": "list",
    "url": "/v1/application_fees/fee_1Pgc6zB7WZ01zgkWOMh2at1m/refunds"
  }
}

POST /v1/application_fees/{id}/refund

POST/v1/application_fees/{id}/refund

Path parameters

  • idstringRequired

Body parameters

  • amountinteger
  • directivestring
  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The application_fee object.

POST /v1/application_fees/{id}/refund
curl -X POST https://api.knoxapi.com/v1/application_fees/fee_1Pgc6zB7WZ01zgkWOMh2at1m/refund \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "account": "acct_1PgafTB7WZ01zgkW",
  "amount": 100,
  "amount_refunded": 0,
  "application": "ca_QXhWOVlWX7KFerjnWFSGuGR21sZjCeji",
  "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
  "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
  "created": 1234567890,
  "currency": "usd",
  "fee_source": {
    "charge": "ch_1PgafuB7WZ01zgkWXYmPNZs8",
    "type": "charge"
  },
  "id": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
  "livemode": false,
  "object": "application_fee",
  "originating_transaction": null,
  "refunded": false,
  "refunds": {
    "data": [],
    "has_more": false,
    "object": "list",
    "url": "/v1/application_fees/fee_1Pgc6zB7WZ01zgkWOMh2at1m/refunds"
  }
}

Create an application fee refund

POST/v1/application_fees/{id}/refunds

Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can’t be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee.

Path parameters

  • idstringRequired

Body parameters

  • amountinteger

    A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • metadataobject

    Set 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

The fee_refund object.

POST /v1/application_fees/{id}/refunds
curl -X POST https://api.knoxapi.com/v1/application_fees/fr_1Pgc70B7WZ01zgkWSr1ANtFu/refunds \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount": 100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "fee": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
  "id": "fr_1Pgc70B7WZ01zgkWSr1ANtFu",
  "metadata": {},
  "object": "fee_refund"
}

List all application fee refunds

GET/v1/application_fees/{id}/refunds

You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds.

Path parameters

  • idstringRequired

Query parameters

  • ending_beforestring

    A 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.

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • limitinteger

    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

  • starting_afterstring

    A 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.

Returns

A list of fee_refund objects.

GET /v1/application_fees/{id}/refunds
curl -G https://api.knoxapi.com/v1/application_fees/fr_1Pgc70B7WZ01zgkWSr1ANtFu/refunds \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/application_fees",
  "has_more": false,
  "data": [
    {
      "amount": 100,
      "balance_transaction": null,
      "created": 1234567890,
      "currency": "usd",
      "fee": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
      "id": "fr_1Pgc70B7WZ01zgkWSr1ANtFu",
      "metadata": {},
      "object": "fee_refund"
    }
  ]
}

Update an application fee refund

POST/v1/application_fees/{fee}/refunds/{id}

Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument.

Path parameters

  • feestringRequired
  • idstringRequired

Body parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

  • metadataobject

    Set 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

The fee_refund object.

POST /v1/application_fees/{fee}/refunds/{id}
curl https://api.knoxapi.com/v1/application_fees/fee_123/refunds/fr_1Pgc70B7WZ01zgkWSr1ANtFu \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d "metadata[order_id]=6735"
Response
{
  "amount": 100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "fee": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
  "id": "fr_1Pgc70B7WZ01zgkWSr1ANtFu",
  "metadata": {},
  "object": "fee_refund"
}

Retrieve an application fee refund

GET/v1/application_fees/{fee}/refunds/{id}

By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee.

Path parameters

  • feestringRequired
  • idstringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The fee_refund object.

GET /v1/application_fees/{fee}/refunds/{id}
curl https://api.knoxapi.com/v1/application_fees/fee_123/refunds/fr_1Pgc70B7WZ01zgkWSr1ANtFu \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount": 100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "fee": "fee_1Pgc6zB7WZ01zgkWOMh2at1m",
  "id": "fr_1Pgc70B7WZ01zgkWSr1ANtFu",
  "metadata": {},
  "object": "fee_refund"
}

Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.