cURL
Python
JavaScript
PHP
Go
Java
curl --request GET \
--url https://api.copper.co/platform/clearloop/settlements
{
"pagination" : {
"limit" : "<string>" ,
"page" : "<string>" ,
"pages" : "<string>" ,
"totalItems" : "<string>"
} ,
"settlements" : [
{
"completedAt" : "<string>" ,
"createdAt" : "<string>" ,
"cycleEndTimestamp" : "<string>" ,
"cycleStartTimestamp" : "<string>" ,
"deadline" : "<string>" ,
"exchange" : "<string>" ,
"exchangeId" : "<string>" ,
"failureReason" : "<string>" ,
"settlementDetails" : [
{
"clientAccountId" : "<string>" ,
"exchangeSettlementId" : "<string>" ,
"organizationId" : "<string>" ,
"portfolioId" : "<string>" ,
"settlementInstructions" : [
{
"balance" : "<string>" ,
"blockchainTransactionId" : "<string>" ,
"currency" : "<string>" ,
"orderId" : "<string>" ,
"orderStatus" : "new" ,
"settlementAmount" : "<string>" ,
"settlementAmountUSD" : "<string>" ,
"settlementInstructionId" : "<string>" ,
"status" : "new"
}
]
}
] ,
"settlementId" : "<string>" ,
"settlementStatus" : "new"
}
]
}
P&L is settled for all clients at the same time. If an exchange lacks sufficient collateral to meet all client settlement requirements, a margin call is issued, and client orders remain pending until the exchange tops up its account.
Note that Copper does not act as a calculation agent – P&L is always calculated by the exchange.
There is a dedicated section for settlements cycles in the user interface of every ClearLoop account, as shown below.
To obtain information about past settlements, use the Settlements API with the following parameters:
Copper portfolio unique identifier for which records can be retrieved
Exchange account unique identifier for which records can be retrieved
Exchange settlement identifier per client. Every client has a different settlement id
Unix timestamp in milliseconds to filter settlements created after this time
Unix timestamp in milliseconds to filter settlements created before this time
Unix timestamp down to the millisecond granularity that can be used to retrieve records for this cycle timestamp
Last number of cycles that you want to retrieve for every exchange. For example for 1 cycle, it would mean to bring back the last settlement for every exchange
clearLoopSettlementStatuses
Comma separated list with statuses to be included. See details
Available options:
new
,
pending-exchange-confirmation
,
in-progress
,
completed
,
failed
,
cancelled
,
partially-completed
clearLoopSettlementStatusesNotIn
Comma separated list with statuses not to be included. See details
Available options:
new
,
pending-exchange-confirmation
,
in-progress
,
completed
,
failed
,
cancelled
,
partially-completed
Parameter to sort data in 'asc' ascending or 'desc' descending order according to 'created_at'
settlements. cycleEndTimestamp
Unix timestamp at millisecond precision specific to when the settlement cycle ends
settlements. cycleStartTimestamp
Unix timestamp at millisecond precision specific to when the settlement cycle has started
Unix timestamp at millisecond precision specific to the settlement deadline
Unique Copper settlement identifier
settlements. settlementStatus
Available options:
new
,
pending-exchange-confirmation
,
in-progress
,
completed
,
failed
,
cancelled
,
partially-completed
settlements. settlementSubStatus
SubStatus describing the settlement
Unix timestamp at millisecond precision specific to when the settlement was fully completed
Unix timestamp at millisecond precision specific to when the settlement started
settlements. failureReason
settlements. settlementDetails
Settlement details for every client that is part of the settlement.
settlements.settlementDetails. clientAccountId
Unique exchange account identifier
settlements.settlementDetails. exchangeSettlementId
Exchange unique identifier of settlement
settlements.settlementDetails. portfolioId
Unique Copper account identifier
settlements.settlementDetails. settlementInstructions
Array of instructions containing the PnL of the client in the current settlement cycle
settlements.settlementDetails.settlementInstructions. currency
settlements.settlementDetails.settlementInstructions. settlementAmount
PnL of the client in the settlement period. This amount is the aggregation between mainAccount and subaccounts in the exchange
settlements.settlementDetails.settlementInstructions. balance
Client Delegated Balance in Copper fetched at the moment of the settlement
settlements.settlementDetails.settlementInstructions. blockchainTransactionId
For external clients outside of Copper, it represents the onChain transactionId
settlements.settlementDetails.settlementInstructions. orderId
Order id associated to the settlement
settlements.settlementDetails.settlementInstructions. orderStatus
Available options:
new
,
waiting-funds
,
reserved
,
working
,
waiting-approve
,
co-sign-require
,
approved
,
processing
,
executed
,
canceled
,
rejecting
,
rejected
,
declining
,
declined
,
blocked
,
action-required
,
require-initializer-approve
,
waiting-counterparty-approve
,
require-counterparty-approve
,
ready-for-settlement
,
settled
,
part-signed-tx-added
,
full-signed-tx-added
,
rejected-part-signed-tx-added
,
rejected-full-signed-tx-added
,
awaiting-settlement
,
master-password-required
,
manual-resolving
,
error
,
pending-atomic-settlement-confirmation
,
atomic-settlement-reservation-completed
settlements.settlementDetails.settlementInstructions. settlementAmountUSD
Same as the settlementAmount but calculated in USD
settlements.settlementDetails.settlementInstructions. settlementInstructionId
settlements.settlementDetails.settlementInstructions. status
Available options:
new
,
pending-exchange-confirmation
,
in-progress
,
completed
,
failed
,
cancelled
,
partially-completed
settlements.settlementDetails. organizationId