Menu

## Settlement
in package

Settlement.php : 19

Settlement data object.

##### Tags

author

  BitPay Integrations integrations@bitpay.com

license

  http://www.opensource.org/licenses/mit-license.php MIT

see
  https://bitpay.readme.io/reference/settlements

  Settlements

### Table of Contents

#### Properties

$accountId : string|null
$closingDate : string|null
$currency : string|null
$dateCompleted : string|null
$dateCreated : string|null
$dateExecuted : string|null
$id : string|null
$ledgerEntries : array<string|int, mixed>
$ledgerEntriesSum : float|null
$openingBalance : float|null
$openingDate : string|null
$payoutInfo : PayoutInfo|null
$status : string|null
$token : string|null
$totalAmount : float|null
$withHoldings : array<string|int, mixed>
$withHoldingsSum : float|null

#### Methods

__construct() : mixed
getAccountId() : string|null
  Gets account id
getClosingDate() : string|null
  Gets closing date.
getCurrency() : string|null
  Gets currency
getDateCompleted() : string|null
  Gets date completed
getDateCreated() : string|null
  Gets date created
getDateExecuted() : string|null
  Gets date executed
getId() : string|null
  Gets id
getLedgerEntries() : array<string|int, SettlementLedgerEntry>
  Gets Array of ledger entries listing the various debits and credits which are settled in the report.
getLedgerEntriesSum() : float|null
  Gets ledger entries sum.
getOpeningBalance() : float|null
  Gets Balance of the ledger at the openingDate
getOpeningDate() : string|null
  Gets opening date
getPayoutInfo() : PayoutInfo|null
  Gets Object containing the settlement info provided by the Merchant in his BitPay account settings
getStatus() : string|null
  Gets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".
getToken() : string|null
  Gets API token for the corresponding settlement resource.
getTotalAmount() : float|null
  Gets total amount sent to the merchant; 2 decimals.
getWithHoldings() : array<string|int, WithHoldings>
  Gets with holdings
getWithHoldingsSum() : float|null
  Gets Sum of all amounts that are withheld from settlement
setAccountId() : void
  Sets account id
setClosingDate() : void
  Sets closing date.
setCurrency() : void
  Sets currency
setDateCompleted() : void
  Sets date completed
setDateCreated() : void
  Sets date created
setDateExecuted() : void
  Sets date executed
setId() : void
  Sets id
setLedgerEntries() : void
  Sets Array of ledger entries listing the various debits and credits which are settled in the report.
setLedgerEntriesSum() : void
  Sets ledger entries sum.
setOpeningBalance() : void
  Sets Balance of the ledger at the openingDate
setOpeningDate() : void
  Sets opening date
setPayoutInfo() : void
  Sets Object containing the settlement info provided by the Merchant in his BitPay account settings
setStatus() : void
  Sets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".
setToken() : void
  Sets API token for the corresponding settlement resource.
setTotalAmount() : void
  Sets total amount sent to the merchant; 2 decimals.
setWithHoldings() : void
  Sets with holdings
setWithHoldingsSum() : void
  Sets Sum of all amounts that are withheld from settlement
toArray() : array<string|int, mixed>
  Returns the Settlement object as array

### Properties

#### $accountId

Settlement.php : 22
`protected string|null $accountId = null`

#### $closingDate

Settlement.php : 30
`protected string|null $closingDate = null`

#### $currency

Settlement.php : 23
`protected string|null $currency = null`

#### $dateCompleted

Settlement.php : 28
`protected string|null $dateCompleted = null`

#### $dateCreated

Settlement.php : 26
`protected string|null $dateCreated = null`

#### $dateExecuted

Settlement.php : 27
`protected string|null $dateExecuted = null`

#### $id

Settlement.php : 21
`protected string|null $id = null`

#### $ledgerEntries

Settlement.php : 36
`protected array<string|int, mixed> $ledgerEntries = []`

#### $ledgerEntriesSum

Settlement.php : 32
`protected float|null $ledgerEntriesSum = null`

#### $openingBalance

Settlement.php : 31
`protected float|null $openingBalance = null`

#### $openingDate

Settlement.php : 29
`protected string|null $openingDate = null`

#### $payoutInfo

Settlement.php : 24
`protected PayoutInfo|null $payoutInfo = null`

#### $status

Settlement.php : 25
`protected string|null $status = null`

#### $token

Settlement.php : 37
`protected string|null $token = null`

#### $totalAmount

Settlement.php : 35
`protected float|null $totalAmount = null`

#### $withHoldings

Settlement.php : 33
`protected array<string|int, mixed> $withHoldings = []`

#### $withHoldingsSum

Settlement.php : 34
`protected float|null $withHoldingsSum = null`

### Methods

#### __construct()

Settlement.php : 39
`public __construct() : mixed`

#### getAccountId()

Settlement.php : 74

Gets account id

`public getAccountId() : string|null`

String identifying the BitPay merchant. For internal use, this field can be ignored in merchant implementations.

##### Return values

string|null

#### getClosingDate()

Settlement.php : 264

Gets closing date.

`public getClosingDate() : string|null`

Date & time for last ledger entry used for the settlement. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Return values

string|null

#### getCurrency()

Settlement.php : 99

Gets currency

`public getCurrency() : string|null`

ISO 4217 3-character currency code. This is the currency associated with the settlement. Supported settlement currencies are listed on https://bitpay.com/docs/settlement

##### Return values

string|null

#### getDateCompleted()

Settlement.php : 212

Gets date completed

`public getDateCompleted() : string|null`

Timestamp when the settlement was completed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Return values

string|null

#### getDateCreated()

Settlement.php : 164

Gets date created

`public getDateCreated() : string|null`

Timestamp when the settlement was created. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Return values

string|null

#### getDateExecuted()

Settlement.php : 188

Gets date executed

`public getDateExecuted() : string|null`

Timestamp when the settlement was executed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Return values

string|null

#### getId()

Settlement.php : 50

Gets id

`public getId() : string|null`

String identifying the settlement; this id will also be in the description of the corresponding bank settlement.

##### Return values

string|null

#### getLedgerEntries()

Settlement.php : 412

Gets Array of ledger entries listing the various debits and credits which are settled in the report.

`public getLedgerEntries() : array<string|int, SettlementLedgerEntry>`

The total sum of all ledger entries is reported in the field ledgerEntriesSum. A description of all ledger codes can be found

##### Return values

array<string|int, SettlementLedgerEntry>

#### getLedgerEntriesSum()

Settlement.php : 309

Gets ledger entries sum.

`public getLedgerEntriesSum() : float|null`

Sum of all ledger entries in the settlement, this means all the debits & credits which happened between openingDate and closingDate

##### Return values

float|null

#### getOpeningBalance()

Settlement.php : 286

Gets Balance of the ledger at the openingDate

`public getOpeningBalance() : float|null`

##### Return values

float|null

#### getOpeningDate()

Settlement.php : 238

Gets opening date

`public getOpeningDate() : string|null`

corresponds to the closingDate of the previous settlement executed. For the first settlement of an account the value will be the BitPay merchant account creation date. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Return values

string|null

#### getPayoutInfo()

Settlement.php : 122

Gets Object containing the settlement info provided by the Merchant in his BitPay account settings

`public getPayoutInfo() : PayoutInfo|null`

##### Return values

PayoutInfo|null

#### getStatus()

Settlement.php : 142

Gets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".

`public getStatus() : string|null`

##### Return values

string|null

#### getToken()

Settlement.php : 444

Gets API token for the corresponding settlement resource.

`public getToken() : string|null`

This token is actually derived from the merchant facade token used during the query. This token is required to fetch the reconciliation report

##### Return values

string|null

#### getTotalAmount()

Settlement.php : 387

Gets total amount sent to the merchant; 2 decimals.

`public getTotalAmount() : float|null`

totalAmount = openingBalance + ledgerEntriesSum - withholdingsSum

##### Return values

float|null

#### getWithHoldings()

Settlement.php : 335

Gets with holdings

`public getWithHoldings() : array<string|int, WithHoldings>`

Array of withholdings. Withholdings are kept on the ledger to be used later and thus withheld from this settlement. Each withholding is a JSON object containing a code, amount and description field.

##### Return values

array<string|int, WithHoldings>

#### getWithHoldingsSum()

Settlement.php : 365

Gets Sum of all amounts that are withheld from settlement

`public getWithHoldingsSum() : float|null`

##### Return values

float|null

#### setAccountId()

Settlement.php : 86

Sets account id

`public setAccountId(string $accountId) : void`

String identifying the BitPay merchant. For internal use, this field can be ignored in merchant implementations.

##### Parameters

$accountId : string

#### setClosingDate()

Settlement.php : 276

Sets closing date.

`public setClosingDate(string $closingDate) : void`

Date & time for last ledger entry used for the settlement. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Parameters

$closingDate : string

#### setCurrency()

Settlement.php : 112

Sets currency

`public setCurrency(string $currency) : void`

ISO 4217 3-character currency code. This is the currency associated with the settlement. Supported settlement currencies are listed on https://bitpay.com/docs/settlement

##### Parameters

$currency : string

#### setDateCompleted()

Settlement.php : 224

Sets date completed

`public setDateCompleted(string $dateCompleted) : void`

Timestamp when the settlement was completed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Parameters

$dateCompleted : string

#### setDateCreated()

Settlement.php : 176

Sets date created

`public setDateCreated(string $dateCreated) : void`

Timestamp when the settlement was created. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Parameters

$dateCreated : string

#### setDateExecuted()

Settlement.php : 200

Sets date executed

`public setDateExecuted(string $dateExecuted) : void`

Timestamp when the settlement was executed. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Parameters

$dateExecuted : string

#### setId()

Settlement.php : 62

Sets id

`public setId(string $id) : void`

String identifying the settlement; this id will also be in the description of the corresponding bank settlement.

##### Parameters

$id : string

#### setLedgerEntries()

Settlement.php : 426

Sets Array of ledger entries listing the various debits and credits which are settled in the report.

`public setLedgerEntries(array<string|int, SettlementLedgerEntry> $ledgerEntries) : void`

The total sum of all ledger entries is reported in the field ledgerEntriesSum. A description of all ledger codes can be found

##### Parameters

$ledgerEntries : array<string|int, SettlementLedgerEntry>

##### Tags

throws
  SettlementException

#### setLedgerEntriesSum()

Settlement.php : 322

Sets ledger entries sum.

`public setLedgerEntriesSum(float $ledgerEntriesSum) : void`

Sum of all ledger entries in the settlement, this means all the debits & credits which happened between openingDate and closingDate

##### Parameters

$ledgerEntriesSum : float

#### setOpeningBalance()

Settlement.php : 296

Sets Balance of the ledger at the openingDate

`public setOpeningBalance(float $openingBalance) : void`

##### Parameters

$openingBalance : float

#### setOpeningDate()

Settlement.php : 252

Sets opening date

`public setOpeningDate(string $openingDate) : void`

corresponds to the closingDate of the previous settlement executed. For the first settlement of an account the value will be the BitPay merchant account creation date. UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ

##### Parameters

$openingDate : string

#### setPayoutInfo()

Settlement.php : 132

Sets Object containing the settlement info provided by the Merchant in his BitPay account settings

`public setPayoutInfo(PayoutInfo $payoutInfo) : void`

##### Parameters

$payoutInfo : PayoutInfo

#### setStatus()

Settlement.php : 152

Sets Status of the settlement. Possible statuses are "new", "processing", "rejected" and "completed".

`public setStatus(string $status) : void`

##### Parameters

$status : string

#### setToken()

Settlement.php : 457

Sets API token for the corresponding settlement resource.

`public setToken(string $token) : void`

This token is actually derived from the merchant facade token used during the query. This token is required to fetch the reconciliation report

##### Parameters

$token : string

#### setTotalAmount()

Settlement.php : 399

Sets total amount sent to the merchant; 2 decimals.

`public setTotalAmount(float $totalAmount) : void`

totalAmount = openingBalance + ledgerEntriesSum - withholdingsSum

##### Parameters

$totalAmount : float

#### setWithHoldings()

Settlement.php : 349

Sets with holdings

`public setWithHoldings(array<string|int, WithHoldings> $withHoldings) : void`

Array of withholdings. Withholdings are kept on the ledger to be used later and thus withheld from this settlement. Each withholding is a JSON object containing a code, amount and description field.

##### Parameters

$withHoldings : array<string|int, WithHoldings>

##### Tags

throws
  SettlementException

#### setWithHoldingsSum()

Settlement.php : 375

Sets Sum of all amounts that are withheld from settlement

`public setWithHoldingsSum(float $withHoldingsSum) : void`

##### Parameters

$withHoldingsSum : float

#### toArray()

Settlement.php : 467

Returns the Settlement object as array

`public toArray() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

## Search results