API reference

Transfers

A Transfer object is created when you move funds between Stripe accounts as part of Connect. Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a card or bank account. This behavior has since been split out into a Payout object, with corresponding payout endpoints. For more information, read about the transfer/payout split. Related guide: Creating separate charges and transfers

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.

Create a transfer

POST/v1/transfers

To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.

Body parameters

  • currencystringRequired

    Three-letter ISO code for currency in lowercase. Must be a supported currency.

  • destinationstringRequired

    The ID of a connected Stripe account. See the Connect documentation for details.

  • amountinteger

    A positive integer in cents (or local equivalent) representing how much to transfer.

  • descriptionstring

    An arbitrary string attached to the object. Often useful for displaying to users.

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

  • source_transactionstring

    You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. See the Connect documentation for details.

  • source_typestring

    The source balance to use for this transfer. One of bank_account, card, or fpx. For most users, this will default to card.

    Possible values
    • bank_account
    • card
    • fpx
  • transfer_groupstring

    A string that identifies this transaction as part of a group. See the Connect documentation for details.

Returns

The transfer object.

POST /v1/transfers
curl https://api.knoxapi.com/v1/transfers \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d currency=usd \
  -d destination=acct_1PgafTB7WZ01zgkW
Response
{
  "amount": 1100,
  "amount_reversed": 0,
  "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
  "created": 1234567890,
  "currency": "usd",
  "description": null,
  "destination": "acct_1PgafTB7WZ01zgkW",
  "destination_payment": "py_QXhWZR8SdWquhf",
  "id": "tr_1Pgc7BB7WZ01zgkWVJfE40RX",
  "livemode": false,
  "metadata": {},
  "object": "transfer",
  "reversals": {
    "data": [],
    "has_more": false,
    "object": "list",
    "url": "/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals"
  },
  "reversed": false,
  "source_transaction": null,
  "source_type": "card",
  "transfer_group": null
}

List all transfers

GET/v1/transfers

Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first.

Query parameters

  • createdobject | integer

    Only return transfers that were created during the given date interval.

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

    Only return transfers for the destination specified by this account ID.

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

  • transfer_groupstring

    Only return transfers with the specified transfer group.

Returns

A list of transfer objects.

GET /v1/transfers
curl -G https://api.knoxapi.com/v1/transfers \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/transfers",
  "has_more": false,
  "data": [
    {
      "amount": 1100,
      "amount_reversed": 0,
      "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
      "created": 1234567890,
      "currency": "usd",
      "description": null,
      "destination": "acct_1PgafTB7WZ01zgkW",
      "destination_payment": "py_QXhWZR8SdWquhf",
      "id": "tr_1Pgc7BB7WZ01zgkWVJfE40RX",
      "livemode": false,
      "metadata": {},
      "object": "transfer",
      "reversals": {
        "data": [],
        "has_more": false,
        "object": "list",
        "url": "/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals"
      },
      "reversed": false,
      "source_transaction": null,
      "source_type": "card",
      "transfer_group": null
    }
  ]
}

Update a transfer

POST/v1/transfers/{transfer}

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

Path parameters

  • transferstringRequired

Body parameters

  • descriptionstring

    An arbitrary string attached to the object. Often useful for displaying to users.

  • 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 transfer object.

POST /v1/transfers/{transfer}
curl https://api.knoxapi.com/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d "metadata[order_id]=6735"
Response
{
  "amount": 1100,
  "amount_reversed": 0,
  "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
  "created": 1234567890,
  "currency": "usd",
  "description": null,
  "destination": "acct_1PgafTB7WZ01zgkW",
  "destination_payment": "py_QXhWZR8SdWquhf",
  "id": "tr_1Pgc7BB7WZ01zgkWVJfE40RX",
  "livemode": false,
  "metadata": {},
  "object": "transfer",
  "reversals": {
    "data": [],
    "has_more": false,
    "object": "list",
    "url": "/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals"
  },
  "reversed": false,
  "source_transaction": null,
  "source_type": "card",
  "transfer_group": null
}

Retrieve a transfer

GET/v1/transfers/{transfer}

Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information.

Path parameters

  • transferstringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The transfer object.

GET /v1/transfers/{transfer}
curl https://api.knoxapi.com/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount": 1100,
  "amount_reversed": 0,
  "balance_transaction": "txn_1PgaxNB7WZ01zgkWEV3TLf40",
  "created": 1234567890,
  "currency": "usd",
  "description": null,
  "destination": "acct_1PgafTB7WZ01zgkW",
  "destination_payment": "py_QXhWZR8SdWquhf",
  "id": "tr_1Pgc7BB7WZ01zgkWVJfE40RX",
  "livemode": false,
  "metadata": {},
  "object": "transfer",
  "reversals": {
    "data": [],
    "has_more": false,
    "object": "list",
    "url": "/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals"
  },
  "reversed": false,
  "source_transaction": null,
  "source_type": "card",
  "transfer_group": null
}

Create a transfer reversal

POST/v1/transfers/{id}/reversals

When you create a new reversal, you must specify a transfer to create it on. When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can’t be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer.

Path parameters

  • idstringRequired

Body parameters

  • amountinteger

    A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount.

  • descriptionstring

    An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value.

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

  • refund_application_feeboolean

    Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed.

Returns

The transfer_reversal object.

POST /v1/transfers/{id}/reversals
curl -X POST https://api.knoxapi.com/v1/transfers/trr_1Pgc7BB7WZ01zgkWsU61ufNC/reversals \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount": 1100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "destination_payment_refund": null,
  "id": "trr_1Pgc7BB7WZ01zgkWsU61ufNC",
  "metadata": {},
  "object": "transfer_reversal",
  "source_refund": null,
  "transfer": "tr_1Pgc7BB7WZ01zgkWVJfE40RX"
}

List all reversals

GET/v1/transfers/{id}/reversals

You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer 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 reversals.

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 transfer_reversal objects.

GET /v1/transfers/{id}/reversals
curl -G https://api.knoxapi.com/v1/transfers/trr_1Pgc7BB7WZ01zgkWsU61ufNC/reversals \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  --data-urlencode limit=3
Response
{
  "object": "list",
  "url": "/v1/transfers",
  "has_more": false,
  "data": [
    {
      "amount": 1100,
      "balance_transaction": null,
      "created": 1234567890,
      "currency": "usd",
      "destination_payment_refund": null,
      "id": "trr_1Pgc7BB7WZ01zgkWsU61ufNC",
      "metadata": {},
      "object": "transfer_reversal",
      "source_refund": null,
      "transfer": "tr_1Pgc7BB7WZ01zgkWVJfE40RX"
    }
  ]
}

Update a reversal

POST/v1/transfers/{transfer}/reversals/{id}

Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments.

Path parameters

  • idstringRequired
  • transferstringRequired

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 transfer_reversal object.

POST /v1/transfers/{transfer}/reversals/{id}
curl https://api.knoxapi.com/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals/trr_1Pgc7BB7WZ01zgkWsU61ufNC \
  -H "Authorization: Bearer $KNOX_SECRET_KEY" \
  -d "metadata[order_id]=6735"
Response
{
  "amount": 1100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "destination_payment_refund": null,
  "id": "trr_1Pgc7BB7WZ01zgkWsU61ufNC",
  "metadata": {},
  "object": "transfer_reversal",
  "source_refund": null,
  "transfer": "tr_1Pgc7BB7WZ01zgkWVJfE40RX"
}

Retrieve a reversal

GET/v1/transfers/{transfer}/reversals/{id}

By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer.

Path parameters

  • idstringRequired
  • transferstringRequired

Query parameters

  • expandarray of strings

    Specifies which fields in the response should be expanded.

Returns

The transfer_reversal object.

GET /v1/transfers/{transfer}/reversals/{id}
curl https://api.knoxapi.com/v1/transfers/tr_1Pgc7BB7WZ01zgkWVJfE40RX/reversals/trr_1Pgc7BB7WZ01zgkWsU61ufNC \
  -H "Authorization: Bearer $KNOX_SECRET_KEY"
Response
{
  "amount": 1100,
  "balance_transaction": null,
  "created": 1234567890,
  "currency": "usd",
  "destination_payment_refund": null,
  "id": "trr_1Pgc7BB7WZ01zgkWsU61ufNC",
  "metadata": {},
  "object": "transfer_reversal",
  "source_refund": null,
  "transfer": "tr_1Pgc7BB7WZ01zgkWVJfE40RX"
}

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.