API reference
Finance
Balance, settlements, payouts, fees and statements.
Your balance, per currency
GET /v1/balance
Live figures from your financial history: what is held, available and paid out.
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/balance \
-H "Authorization: Bearer sw_test_…"200 — The balances
| Field | Type | Description |
|---|---|---|
balances | array of object | |
balances[].activity_totals | object | |
balances[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
balances[].figures_as_of | string (date-time) | |
balances[].operational | object | |
balances[].pending_adjustments | object | |
balances[].pending_adjustments.fee_recovery_pending | object | |
balances[].pending_adjustments.fee_recovery_pending.amount | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
balances[].pending_adjustments.fee_recovery_pending.count | integer | |
balances[].positions | object |
Errors answer with the error object.
Monthly statements
GET /v1/statements
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/statements \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
currency | string (query) | no | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
200 — The statements
| Field | Type | Description |
|---|---|---|
statements | array of object | |
statements[].closing_positions | object | |
statements[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
statements[].figures_as_of | string (date-time) | |
statements[].id | string | |
statements[].opening_positions | object | |
statements[].period_end | string | pattern ^\d{4}-\d{2}-\d{2}$ |
statements[].period_start | string | pattern ^\d{4}-\d{2}-\d{2}$ |
statements[].status | GENERATING, ISSUED, SUPERSEDED | |
statements[].version | integer |
Errors answer with the error object.
A statement with its entries
GET /v1/statements/{id}
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/statements/pay_01M6XF0H2MAC63MEKQAT4K3AXF \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string (path) | yes | The statement id |
200 — The statement
| Field | Type | Description |
|---|---|---|
closing_positions | object | |
currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
entries | array of object | |
entries[].amount_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
entries[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
entries[].date | string | pattern ^\d{4}-\d{2}-\d{2}$ |
entries[].description | string or null | |
entries[].id | string | |
entries[].order | integer | |
entries[].prior_period_correction | boolean | |
entries[].status | string or null | |
figures_as_of | string (date-time) | |
id | string | |
opening_positions | object | |
operational | object | |
period_activity | object | |
period_end | string | pattern ^\d{4}-\d{2}-\d{2}$ |
period_start | string | pattern ^\d{4}-\d{2}-\d{2}$ |
status | GENERATING, ISSUED, SUPERSEDED | |
version | integer |
Errors answer with the error object.
A statement as CSV
GET /v1/statements/{id}/export
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/statements/pay_01M6XF0H2MAC63MEKQAT4K3AXF/export \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
id | string (path) | yes | The statement id |
200 — The CSV file
A text/csv file.
Errors answer with the error object.
Payouts to your bank account
GET /v1/payouts
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/payouts \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
currency | string (query) | no | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
200 — The payouts
| Field | Type | Description |
|---|---|---|
payouts | array of object | |
payouts[].amount_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
payouts[].created_at | string (date-time) | |
payouts[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
payouts[].id | string | |
payouts[].status | PENDING, PROCESSING, COMPLETED, FAILED, CANCELED | COMPLETED: it left our account (not: it arrived in yours) |
Errors answer with the error object.
Fees charged to you
GET /v1/fees
The most recent 100, newest first.
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/fees \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
currency | string (query) | no | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
200 — The fees
| Field | Type | Description |
|---|---|---|
fees | array of object | |
fees[].assessed_at | string (date-time) | |
fees[].base_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
fees[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
fees[].gross_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
fees[].id | string | |
fees[].is_adjustment | boolean | |
fees[].tax_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
Errors answer with the error object.
Settlements
GET /v1/settlements
Permission: finance:read
curl -X GET https://api.sw-staging.dev/v1/settlements \
-H "Authorization: Bearer sw_test_…"Parameters
| Field | Type | Required | Description |
|---|---|---|---|
currency | string (query) | no | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
200 — The settlements
| Field | Type | Description |
|---|---|---|
settlements | array of object | |
settlements[].currency | string | ISO 4217 currency code, upper case. pattern ^[A-Z]{3}$ |
settlements[].id | string | |
settlements[].net_entitlement_minor | string | Minor units as a decimal string (exact at any size). pattern ^-?[0-9]+$ |
settlements[].period_end | string | pattern ^\d{4}-\d{2}-\d{2}$ |
settlements[].period_start | string | pattern ^\d{4}-\d{2}-\d{2}$ |
settlements[].status | PENDING, SETTLED, REVISED |
Errors answer with the error object.