Menu

## Client
in package

Client.php : 66

Client class to interact with the BitPay API.

##### Tags

author

  BitPay Integrations integrations@bitpay.com

license

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

### Table of Contents

#### Properties

$restCli : RESTcli
$tokenCache : Tokens

#### Methods

__construct() : mixed
  Client constructor.
cancelInvoice() : Invoice
  Cancel a BitPay invoice.
cancelInvoiceByGuid() : Invoice
  Cancel a BitPay invoice.
cancelPayout() : bool
  Cancel a BitPay Payout.
cancelPayoutGroup() : PayoutGroup
cancelRefund() : Refund
  Cancel a previously submitted refund request on a BitPay invoice.
cancelRefundByGuid() : Refund
  Cancel a previously submitted refund request on a BitPay invoice.
createBill() : Bill
  Create a BitPay Bill.
createInvoice() : Invoice
  Create a BitPay invoice.
createPayoutGroup() : PayoutGroup
createRefund() : Refund
  Create a refund for a BitPay invoice.
createWithData() : Client
  Constructor for use if the keys and SIN are managed by this library.
createWithFile() : Client
  Constructor for use if the keys and SIN are managed by this library.
deletePayoutRecipient() : bool
  Delete a Payout Recipient.
deliverBill() : bool
  Deliver a BitPay Bill.
getBill() : Bill
  Retrieve a BitPay bill by bill id using the specified facade.
getBills() : array<string|int, Bill>
  Retrieve a collection of BitPay bills.
getCurrencyPairRate() : Rate
  Retrieve the rate for a cryptocurrency / fiat pair
getCurrencyRates() : Rates
  Retrieve all the rates for a given cryptocurrency
getInvoice() : Invoice
  Retrieve a BitPay invoice by invoice id using the specified facade. The client must have been previously authorized for the specified facade (the public facade requires no authorization).
getInvoiceByGuid() : Invoice
  Retrieve a BitPay invoice by guid using the specified facade.
getInvoices() : array<string|int, Invoice>
  Retrieve a collection of BitPay invoices.
getLedgerEntries() : array<string|int, LedgerEntry>
  Retrieve a list of ledgers by date range using the merchant facade.
getLedgers() : array<string|int, Ledger>
  Retrieve a list of ledgers using the merchant facade.
getPayout() : Payout
  Retrieve a BitPay payout by payout id using. The client must have been previously authorized for the payout facade.
getPayoutRecipient() : PayoutRecipient
  Retrieve a BitPay payout recipient by batch id using. The client must have been previously authorized for the payout facade.
getPayoutRecipients() : array<string|int, PayoutRecipient>
  Retrieve a collection of BitPay Payout Recipients.
getPayouts() : array<string|int, Payout>
  Retrieve a collection of BitPay payouts.
getRates() : Rates
  Retrieve the exchange rate table maintained by BitPay.
getRefund() : Refund
  Retrieve a previously made refund request on a BitPay invoice.
getRefundByGuid() : Refund
  Retrieve a previously made refund request on a BitPay invoice.
getRefunds() : array<string|int, Refund>
  Retrieve all refund requests on a BitPay invoice.
getSettlement() : Settlement
  Retrieves a summary of the specified settlement.
getSettlementReconciliationReport() : Settlement
  Gets a detailed reconciliation report of the activity within the settlement period.
getSettlements() : array<string|int, Settlement>
  Retrieves settlement reports for the calling merchant filtered by query.
getSupportedWallets() : array<string|int, Wallet>
  Retrieve all supported wallets.
getTokens() : array<string|int, mixed>
  Get Tokens.
payInvoice() : Invoice
  Pay an invoice with a mock transaction
requestInvoiceNotification() : bool
  Request a BitPay Invoice Webhook.
requestPayoutNotification() : bool
  Notify BitPay Payout.
requestPayoutRecipientNotification() : bool
  Notify BitPay Payout Recipient.
sendRefundNotification() : bool
  Send a refund notification.
submitPayout() : Payout
  Submit a BitPay Payout.
submitPayoutRecipients() : array<string|int, PayoutRecipient>
  Submit BitPay Payout Recipients.
updateBill() : Bill
  Update a BitPay Bill.
updateInvoice() : Invoice
  Update a BitPay invoice.
updatePayoutRecipient() : PayoutRecipient
  Update a Payout Recipient.
updateRefund() : Refund
  Update the status of a BitPay invoice.
updateRefundByGuid() : Refund
  Update the status of a BitPay invoice.
getBillClient() : BillClient
  Gets bill client
getInvoiceClient() : InvoiceClient
  Gets invoice client
getLedgerClient() : LedgerClient
  Gets ledger client
getPayoutClient() : PayoutClient
  Gets payout client
getPayoutRecipientsClient() : PayoutRecipientsClient
  Gets payout recipients client
getRateClient() : RateClient
  Gets rate client
getRefundClient() : RefundClient
  Gets refund client
getSettlementClient() : SettlementClient
  Gets settlement client
getWalletClient() : WalletClient
  Gets wallet client
getConfigData() : array<string|int, mixed>
getTokenClient() : TokenClient
  Gets token client
initKeys() : PrivateKey|null

### Properties

#### $restCli

Client.php : 69
`protected RESTcli $restCli`

#### $tokenCache

Client.php : 68
`protected Tokens $tokenCache`

### Methods

#### __construct()

Client.php : 74

Client constructor.

`public __construct(RESTcli $restCli, Tokens $tokenCache) : mixed`

##### Parameters

$restCli : RESTcli
$tokenCache : Tokens

#### cancelInvoice()

Client.php : 299

Cancel a BitPay invoice.

`public cancelInvoice(string $invoiceId[, bool $forceCancel = false ]) : Invoice`

##### Parameters

$invoiceId : string

  The id of the invoice to updated.

$forceCancel : bool = false

##### Tags

see
  https://developer.bitpay.com/reference/cancel-an-invoice

  Cancel an Invoice

throws
  InvoiceCancellationException
throws
  BitPayException

##### Return values

Invoice —

$invoice Cancelled invoice object.

#### cancelInvoiceByGuid()

Client.php : 318

Cancel a BitPay invoice.

`public cancelInvoiceByGuid(string $guid[, bool $forceCancel = false ]) : Invoice`

##### Parameters

$guid : string

  The guid of the invoice to cancel.

$forceCancel : bool = false

##### Tags

see
  https://developer.bitpay.com/reference/cancel-an-invoice-by-guid

  Cancel an Invoice by GUID

throws
  InvoiceCancellationException
throws
  BitPayException

##### Return values

Invoice —

$invoice Cancelled invoice object.

#### cancelPayout()

Client.php : 884

Cancel a BitPay Payout.

`public cancelPayout(string $payoutId) : bool`

##### Parameters

$payoutId : string

  The id of the payout to cancel.

##### Tags

see
  https://developer.bitpay.com/reference/cancel-a-payout

  Cancel a Payout

throws
  PayoutCancellationException

##### Return values

bool

#### cancelPayoutGroup()

Client.php : 929
`public cancelPayoutGroup(string $groupId) : PayoutGroup`

##### Parameters

$groupId : string

##### Tags

see
  https://developer.bitpay.com/reference/cancel-a-payout-group

  Cancel a Payout Group

throws
  PayoutCancellationException

##### Return values

PayoutGroup

#### cancelRefund()

Client.php : 498

Cancel a previously submitted refund request on a BitPay invoice.

`public cancelRefund(string $refundId) : Refund`

##### Parameters

$refundId : string

  The refund Id for the refund to be canceled.

##### Tags

see
  https://developer.bitpay.com/reference/cancel-a-refund-request

  Cancel a Refund Request

throws
  RefundCancellationException
throws
  BitPayException

##### Return values

Refund —

$refund Cancelled refund Object.

#### cancelRefundByGuid()

Client.php : 516

Cancel a previously submitted refund request on a BitPay invoice.

`public cancelRefundByGuid(string $guid) : Refund`

##### Parameters

$guid : string

  The refund Guid for the refund to be canceled.

##### Tags

see
  https://developer.bitpay.com/reference/cancel-a-refund-by-guid-request

  Cancel a Refund by GUID Request

throws
  RefundCancellationException
throws
  BitPayException

##### Return values

Refund —

$refund Cancelled refund Object.

#### createBill()

Client.php : 551

Create a BitPay Bill.

`public createBill(Bill $bill[, string $facade = Facade::MERCHANT ][, bool $signRequest = true ]) : Bill`

##### Parameters

$bill : Bill

  A Bill object with request parameters defined.

$facade : string = Facade::MERCHANT

  The facade used to create it.

$signRequest : bool = true

  Signed request.

##### Tags

see
  https://developer.bitpay.com/reference/create-a-bill

  Create a Bill

throws
  BitPayException

##### Return values

Bill

#### createInvoice()

Client.php : 161

Create a BitPay invoice.

`public createInvoice(Invoice $invoice[, string $facade = Facade::MERCHANT ][, bool $signRequest = true ]) : Invoice`

##### Parameters

$invoice : Invoice

  An Invoice object with request parameters defined.

$facade : string = Facade::MERCHANT

  The facade used to create it.

$signRequest : bool = true

  Signed request.

##### Tags

see
  https://developer.bitpay.com/reference/create-an-invoice

  Create an Invoice

throws
  BitPayException

##### Return values

Invoice

#### createPayoutGroup()

Client.php : 915
`public createPayoutGroup(array<string|int, Payout> $payouts) : PayoutGroup`

##### Parameters

$payouts : array<string|int, Payout>

##### Tags

see
  https://developer.bitpay.com/reference/create-payout-group

  Create Payout Group

throws
  PayoutCreationException

##### Return values

PayoutGroup

#### createRefund()

Client.php : 363

Create a refund for a BitPay invoice.

`public createRefund(string $invoiceId, float $amount, string $currency[, bool $preview = false ][, bool $immediate = false ][, bool $buyerPaysRefundFee = false ][, string|null $guid = null ]) : Refund`

##### Parameters

$invoiceId : string

  The BitPay invoice Id having the associated refund to be created.

$amount : float

  Amount to be refunded in the currency indicated.

$currency : string

  Reference currency used for the refund, usually the same as the currency used to create the invoice.

$preview : bool = false

  Whether to create the refund request as a preview (which will not be acted on until status is updated)

$immediate : bool = false

  Whether funds should be removed from merchant ledger immediately on submission or at time of processing

$buyerPaysRefundFee : bool = false

  Whether the buyer should pay the refund fee (default is merchant)

$guid : string|null = null

##### Tags

see
  https://developer.bitpay.com/reference/create-a-refund-request

  Create a Refund Request

throws
  RefundCreationException

  RefundCreationException class

throws
  BitPayException

  BitPayException class

##### Return values

Refund —

$refund An updated Refund Object

#### createWithData()

Client.php : 92

Constructor for use if the keys and SIN are managed by this library.

`public static createWithData(string $environment, string $privateKey, Tokens $tokens[, string|null $privateKeySecret = null ][, string|null $proxy = null ]) : Client`

##### Parameters

$environment : string

  Target environment. Options: Env.Test / Env.Prod

$privateKey : string

  Private Key file path or the HEX value.

$tokens : Tokens

  Tokens containing the available tokens.

$privateKeySecret : string|null = null

  Private Key encryption password.

$proxy : string|null = null

  The url of your proxy to forward requests through. Example: http://********.com:3128

##### Tags

throws
  BitPayException

##### Return values

Client

#### createWithFile()

Client.php : 118

Constructor for use if the keys and SIN are managed by this library.

`public static createWithFile(string $configFilePath) : Client`

##### Parameters

$configFilePath : string

  The path to the configuration file.

##### Tags

throws
  BitPayException

  BitPayException class

##### Return values

Client

#### deletePayoutRecipient()

Client.php : 790

Delete a Payout Recipient.

`public deletePayoutRecipient(string $recipientId) : bool`

##### Parameters

$recipientId : string

  The recipient id for the recipient to be deleted.

##### Tags

see
  https://developer.bitpay.com/reference/remove-a-recipient

  Remove a Recipient

throws
  PayoutRecipientCancellationException

##### Return values

bool —

True if the recipient was successfully deleted, false otherwise.

#### deliverBill()

Client.php : 620

Deliver a BitPay Bill.

`public deliverBill(string $billId, string $billToken[, bool $signRequest = true ]) : bool`

##### Parameters

$billId : string

  The id of the requested bill.

$billToken : string

  The token of the requested bill.

$signRequest : bool = true

  Allow unsigned request

##### Tags

see
  https://developer.bitpay.com/reference/deliver-a-bill-via-email

  Deliver a Bill Via Email

throws
  BitPayException

##### Return values

bool

#### getBill()

Client.php : 569

Retrieve a BitPay bill by bill id using the specified facade.

`public getBill( $billId[, $facade = Facade::MERCHANT ][, $signRequest = true ]) : Bill`

##### Parameters

$billId :

  string The id of the bill to retrieve.

$facade : = Facade::MERCHANT

  string The facade used to retrieve it.

$signRequest : = true

  bool Signed request.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-bill

  Retrieve a Bill

throws
  BitPayException

##### Return values

Bill

#### getBills()

Client.php : 585

Retrieve a collection of BitPay bills.

`public getBills([string $status = null ]) : array<string|int, Bill>`

##### Parameters

$status : string = null

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-bills-by-status

  Retrieve Bills by Status

throws
  BitPayException

##### Return values

array<string|int, Bill>

#### getCurrencyPairRate()

Client.php : 671

Retrieve the rate for a cryptocurrency / fiat pair

`public getCurrencyPairRate(string $baseCurrency, string $currency) : Rate`

##### Parameters

$baseCurrency : string

  The cryptocurrency for which you want to fetch the fiat-equivalent rate. Current supported values are BTC, BCH, ETH, XRP, DOGE and LTC

$currency : string

  The fiat currency for which you want to fetch the baseCurrency rate

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-the-rates-for-a-cryptocurrency-fiat-pair

  Retrieve the rates for a cryptocurrency / fiat pair

throws
  BitPayException

##### Return values

Rate —

A Rate object populated with the currency rate for the requested baseCurrency.

#### getCurrencyRates()

Client.php : 652

Retrieve all the rates for a given cryptocurrency

`public getCurrencyRates(string $baseCurrency) : Rates`

##### Parameters

$baseCurrency : string

  The cryptocurrency for which you want to fetch the rates. Current supported values are BTC, BCH, ETH, XRP, DOGE and LTC

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-all-the-rates-for-a-given-cryptocurrency

  Retrieve all the rates for a given cryptocurrency

throws
  BitPayException

##### Return values

Rates —

A Rates object populated with the currency rates for the requested baseCurrency.

#### getInvoice()

Client.php : 209

Retrieve a BitPay invoice by invoice id using the specified facade. The client must have been previously authorized for the specified facade (the public facade requires no authorization).

`public getInvoice(string $invoiceId[, string $facade = Facade::MERCHANT ][, bool $signRequest = true ]) : Invoice`

##### Parameters

$invoiceId : string

  The id of the invoice to retrieve.

$facade : string = Facade::MERCHANT

  The facade used to create it.

$signRequest : bool = true

  Signed request.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-an-invoice-by-guid

  Retrieve an Invoice by GUID

throws
  InvoiceQueryException

##### Return values

Invoice

#### getInvoiceByGuid()

Client.php : 232

Retrieve a BitPay invoice by guid using the specified facade.

`public getInvoiceByGuid(string $guid[, string $facade = Facade::MERCHANT ][, bool $signRequest = true ]) : Invoice`

The client must have been previously authorized for the specified facade.

##### Parameters

$guid : string

  The guid of the invoice to retrieve.

$facade : string = Facade::MERCHANT

  The facade used to create it.

$signRequest : bool = true

  Signed request.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-an-invoice-by-guid

  Retrieve an Invoice by GUID

throws
  InvoiceQueryException

##### Return values

Invoice

#### getInvoices()

Client.php : 259

Retrieve a collection of BitPay invoices.

`public getInvoices(string $dateStart, string $dateEnd[, string|null $status = null ][, string|null $orderId = null ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, Invoice>`

##### Parameters

$dateStart : string

  The start of the date window to query for invoices. Format YYYY-MM-DD.

$dateEnd : string

  The end of the date window to query for invoices. Format YYYY-MM-DD.

$status : string|null = null

  The invoice status you want to query on.

$orderId : string|null = null

  The optional order id specified at time of invoice creation.

$limit : int|null = null

  Maximum results that the query will return (useful for paging results).

$offset : int|null = null

  Number of results to offset (ex. skip 10 will give you results starting with the 11th result).

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-invoices-filtered-by-query

  Retrieve Invoices Filtered by Query

throws
  BitPayException

##### Return values

array<string|int, Invoice>

#### getLedgerEntries()

Client.php : 689

Retrieve a list of ledgers by date range using the merchant facade.

`public getLedgerEntries(string $currency, string $startDate, string $endDate) : array<string|int, LedgerEntry>`

##### Parameters

$currency : string

  The three digit currency string for the ledger to retrieve.

$startDate : string

  The first date for the query filter.

$endDate : string

  The last date for the query filter.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-ledger-entries

  Retrieve Ledger Entries

throws
  BitPayException

##### Return values

array<string|int, LedgerEntry> —

A Ledger object populated with the BitPay ledger entries list.

#### getLedgers()

Client.php : 704

Retrieve a list of ledgers using the merchant facade.

`public getLedgers() : array<string|int, Ledger>`

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-account-balances

  Retrieve Account Balances

throws
  BitPayException

##### Return values

array<string|int, Ledger> —

A list of Ledger objects populated with the currency and current balance of each one.

#### getPayout()

Client.php : 840

Retrieve a BitPay payout by payout id using. The client must have been previously authorized for the payout facade.

`public getPayout(string $payoutId) : Payout`

##### Parameters

$payoutId : string

  The id of the payout to retrieve.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-payout

  Retrieve a Payout

throws
  PayoutQueryException

##### Return values

Payout

#### getPayoutRecipient()

Client.php : 738

Retrieve a BitPay payout recipient by batch id using. The client must have been previously authorized for the payout facade.

`public getPayoutRecipient(string $recipientId) : PayoutRecipient`

##### Parameters

$recipientId : string

  The id of the recipient to retrieve.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-recipient

  Retrieve a Recipient

throws
  PayoutQueryException
throws
  PayoutRecipientQueryException

##### Return values

PayoutRecipient

#### getPayoutRecipients()

Client.php : 757

Retrieve a collection of BitPay Payout Recipients.

`public getPayoutRecipients([string|null $status = null ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, PayoutRecipient>`

##### Parameters

$status : string|null = null

  The recipient status you want to query on.

$limit : int|null = null

  Maximum results that the query will return (useful for paging results).

$offset : int|null = null

  Number of results to offset (ex. skip 10 will give you results starting with the 11th result).

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-recipients-by-status

  Retrieve Recipients by Status

throws
  BitPayException

##### Return values

array<string|int, PayoutRecipient>

#### getPayouts()

Client.php : 862

Retrieve a collection of BitPay payouts.

`public getPayouts([string|null $startDate = null ][, string|null $endDate = null ][, string|null $status = null ][, string|null $reference = null ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, Payout>`

##### Parameters

$startDate : string|null = null

  The start date to filter the Payout Batches.

$endDate : string|null = null

  The end date to filter the Payout Batches.

$status : string|null = null

  The status to filter the Payout Batches.

$reference : string|null = null

  The optional reference specified at payout request creation.

$limit : int|null = null

  Maximum results that the query will return (useful for paging results).

$offset : int|null = null

  Number of results to offset (ex. skip 10 will give you results starting with the 11th result).

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-payouts-filtered-by-query

  Retrieve Payouts Filtered by Query

throws
  PayoutQueryException

##### Return values

array<string|int, Payout>

#### getRates()

Client.php : 634

Retrieve the exchange rate table maintained by BitPay.

`public getRates() : Rates`

##### Tags

see
  https://bitpay.com/bitcoin-exchange-rates
throws
  BitPayException

##### Return values

Rates

#### getRefund()

Client.php : 445

Retrieve a previously made refund request on a BitPay invoice.

`public getRefund(string $refundId) : Refund`

##### Parameters

$refundId : string

  The BitPay refund ID.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-refund-request

  Retrieve a Refund Request

throws
  RefundQueryException
throws
  BitPayException

##### Return values

Refund —

$refund BitPay Refund object with the associated Refund object.

#### getRefundByGuid()

Client.php : 463

Retrieve a previously made refund request on a BitPay invoice.

`public getRefundByGuid(string $guid) : Refund`

##### Parameters

$guid : string

  The BitPay refund Guid

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-refund-by-guid-request

  Retrieve a Refund by GUID Request

throws
  BitPayException
throws
  RefundQueryException

##### Return values

Refund —

BitPay Refund object with the associated Refund object.

#### getRefunds()

Client.php : 427

Retrieve all refund requests on a BitPay invoice.

`public getRefunds(string $invoiceId) : array<string|int, Refund>`

##### Parameters

$invoiceId : string

  The BitPay invoice object having the associated refunds.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-refunds-of-an-invoice

  Retrieve Refunds of an Invoice

throws
  RefundQueryException
throws
  BitPayException

##### Return values

array<string|int, Refund>

#### getSettlement()

Client.php : 974

Retrieves a summary of the specified settlement.

`public getSettlement(string $settlementId) : Settlement`

##### Parameters

$settlementId : string

  Settlement Id.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-a-settlement

  Retrieve a Settlement

throws
  BitPayException

##### Return values

Settlement

#### getSettlementReconciliationReport()

Client.php : 990

Gets a detailed reconciliation report of the activity within the settlement period.

`public getSettlementReconciliationReport(Settlement $settlement) : Settlement`

##### Parameters

$settlement : Settlement

  Settlement to generate report for.

##### Tags

see
  https://developer.bitpay.com/reference/fetch-a-reconciliation-report

  Fetch a Reconciliation Report

throws
  BitPayException

##### Return values

Settlement

#### getSettlements()

Client.php : 952

Retrieves settlement reports for the calling merchant filtered by query.

`public getSettlements( $currency, $dateStart, $dateEnd[, string|null $status = null ][, int|null $limit = null ][, int|null $offset = null ]) : array<string|int, Settlement>`

The `limit` and `offset` parameters specify pages for large query sets.

##### Parameters

$currency :

  string The three digit currency string for the ledger to retrieve.

$dateStart :

  string The start date for the query.

$dateEnd :

  string The end date for the query.

$status : string|null = null

  string Can be `processing`, `completed`, or `failed`.

$limit : int|null = null

  int Maximum number of settlements to retrieve.

$offset : int|null = null

  int Offset for paging.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-settlements

  Retrieve Settlements

throws
  BitPayException

##### Return values

array<string|int, Settlement>

#### getSupportedWallets()

Client.php : 533

Retrieve all supported wallets.

`public getSupportedWallets() : array<string|int, Wallet>`

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-the-supported-wallets

  Retrieve the Supported Wallets

throws
  WalletQueryException
throws
  BitPayException

##### Return values

array<string|int, Wallet>

#### getTokens()

Client.php : 143

Get Tokens.

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

##### Tags

throws
  BitPayException
throws
  JsonException

##### Return values

array<string|int, mixed>

#### payInvoice()

Client.php : 336

Pay an invoice with a mock transaction

`public payInvoice(string $invoiceId[, string $status = 'confirmed' ]) : Invoice`

##### Parameters

$invoiceId : string

  The id of the invoice.

$status : string = 'confirmed'

  Status the invoice will become. Acceptable values are confirmed (default) and complete.

##### Tags

throws
  InvoicePaymentException
throws
  BitPayException

##### Return values

Invoice —

$invoice Invoice object.

#### requestInvoiceNotification()

Client.php : 282

Request a BitPay Invoice Webhook.

`public requestInvoiceNotification(string $invoiceId) : bool`

##### Parameters

$invoiceId : string

  A BitPay invoice ID.

##### Tags

see
  https://developer.bitpay.com/reference/retrieve-an-event-token

  Retrieve an Event Token

throws
  InvoiceQueryException
throws
  BitPayException

##### Return values

bool —

True if the webhook was successfully requested, false otherwise.

#### requestPayoutNotification()

Client.php : 901

Notify BitPay Payout.

`public requestPayoutNotification(string $payoutId) : bool`

##### Parameters

$payoutId : string

  The id of the Payout to notify.

##### Tags

see
  https://developer.bitpay.com/reference/request-a-payout-webhook-to-be-resent

  Request a Payout Webhook to be Resent

throws
  PayoutNotificationException

  BitPayException class

##### Return values

bool

#### requestPayoutRecipientNotification()

Client.php : 807

Notify BitPay Payout Recipient.

`public requestPayoutRecipientNotification(string $recipientId) : bool`

##### Parameters

$recipientId : string

  The id of the recipient to notify.

##### Tags

see
  https://developer.bitpay.com/reference/request-a-recipient-webhook-to-be-resent

  Request a Recipient Webhook to be Resent

throws
  PayoutRecipientNotificationException

##### Return values

bool —

True if the notification was successfully sent, false otherwise.

#### sendRefundNotification()

Client.php : 481

Send a refund notification.

`public sendRefundNotification(string $refundId) : bool`

##### Parameters

$refundId : string

  A BitPay refund ID.

##### Tags

see
  https://developer.bitpay.com/reference/request-a-refund-notification-to-be-resent

  Request a Refund Notification to be Resent

throws
  RefundCreationException
throws
  BitPayException

##### Return values

bool —

$result An updated Refund Object

#### submitPayout()

Client.php : 823

Submit a BitPay Payout.

`public submitPayout(Payout $payout) : Payout`

##### Parameters

$payout : Payout

  A Payout object with request parameters defined.

##### Tags

see
  https://developer.bitpay.com/reference/create-a-payout

  Create a Payout

throws
  PayoutCreationException

##### Return values

Payout

#### submitPayoutRecipients()

Client.php : 720

Submit BitPay Payout Recipients.

`public submitPayoutRecipients(PayoutRecipients $recipients) : array<string|int, PayoutRecipient>`

##### Parameters

$recipients : PayoutRecipients

  A PayoutRecipients object with request parameters defined.

##### Tags

see
  https://developer.bitpay.com/reference/invite-recipients

  Invite Recipients

throws
  PayoutRecipientCreationException

##### Return values

array<string|int, PayoutRecipient> —

A list of BitPay PayoutRecipients objects.

#### updateBill()

Client.php : 602

Update a BitPay Bill.

`public updateBill(Bill $bill, string $billId) : Bill`

##### Parameters

$bill : Bill

  A Bill object with the parameters to update defined.

$billId : string

  The Id of the Bill to update.

##### Tags

see
  https://developer.bitpay.com/reference/update-a-bill

  Update a Bill

throws
  BitPayException

##### Return values

Bill

#### updateInvoice()

Client.php : 185

Update a BitPay invoice.

`public updateInvoice(string $invoiceId, string|null $buyerSms, string|null $smsCode, string|null $buyerEmail[, bool $autoVerify = false ]) : Invoice`

##### Parameters

$invoiceId : string

  The id of the invoice to updated.

$buyerSms : string|null

  The buyer's cell number.

$smsCode : string|null

  The buyer's received verification code.

$buyerEmail : string|null

  The buyer's email address.

$autoVerify : bool = false

  Skip the user verification on sandbox ONLY.

##### Tags

see
  https://developer.bitpay.com/reference/update-an-invoice

  Update an Invoice

throws
  BitPayException
throws
  InvoiceUpdateException

##### Return values

Invoice

#### updatePayoutRecipient()

Client.php : 774

Update a Payout Recipient.

`public updatePayoutRecipient(string $recipientId, PayoutRecipient $recipient) : PayoutRecipient`

##### Parameters

$recipientId : string

  The recipient id for the recipient to be updated.

$recipient : PayoutRecipient

  A PayoutRecipient object with updated parameters defined.

##### Tags

see
  https://developer.bitpay.com/reference/update-a-recipient

  Update a Recipient

throws
  PayoutRecipientUpdateException

##### Return values

PayoutRecipient

#### updateRefund()

Client.php : 388

Update the status of a BitPay invoice.

`public updateRefund(string $refundId, string $status) : Refund`

##### Parameters

$refundId : string

  BitPay refund ID.

$status : string

  The new status for the refund to be updated.

##### Tags

see
  https://developer.bitpay.com/reference/update-a-refund-request

  Update a Refund Request

throws
  RefundUpdateException
throws
  BitPayException

##### Return values

Refund —

$refund Refund A BitPay generated Refund object.

#### updateRefundByGuid()

Client.php : 408

Update the status of a BitPay invoice.

`public updateRefundByGuid(string $guid, string $status) : Refund`

##### Parameters

$guid : string

  BitPay refund Guid.

$status : string

  The new status for the refund to be updated.

##### Tags

see
  https://developer.bitpay.com/reference/update-a-refund-by-guid-request

  Update a Refund by GUID Request

throws
  RefundUpdateException
throws
  BitPayException

##### Return values

Refund —

$refund Refund A BitPay generated Refund object.

#### getBillClient()

Client.php : 1089

Gets bill client

`protected getBillClient() : BillClient`

##### Return values

BillClient —

the bill client

#### getInvoiceClient()

Client.php : 1059

Gets invoice client

`protected getInvoiceClient() : InvoiceClient`

##### Return values

InvoiceClient —

the invoice client

#### getLedgerClient()

Client.php : 1109

Gets ledger client

`protected getLedgerClient() : LedgerClient`

##### Return values

LedgerClient —

the ledger client

#### getPayoutClient()

Client.php : 1129

Gets payout client

`protected getPayoutClient() : PayoutClient`

##### Return values

PayoutClient —

the payout client

#### getPayoutRecipientsClient()

Client.php : 1119

Gets payout recipients client

`protected getPayoutRecipientsClient() : PayoutRecipientsClient`

##### Return values

PayoutRecipientsClient —

the payout recipients client

#### getRateClient()

Client.php : 1099

Gets rate client

`protected getRateClient() : RateClient`

##### Return values

RateClient —

the rate client

#### getRefundClient()

Client.php : 1069

Gets refund client

`protected getRefundClient() : RefundClient`

##### Return values

RefundClient —

the refund client

#### getSettlementClient()

Client.php : 1139

Gets settlement client

`protected getSettlementClient() : SettlementClient`

##### Return values

SettlementClient —

the settlements client

#### getWalletClient()

Client.php : 1079

Gets wallet client

`protected getWalletClient() : WalletClient`

##### Return values

WalletClient —

the wallet client

#### getConfigData()

Client.php : 1029
`private static getConfigData(string $configFilePath) : array<string|int, mixed>`

##### Parameters

$configFilePath : string

##### Tags

throws
  BitPayException

##### Return values

array<string|int, mixed>

#### getTokenClient()

Client.php : 1049

Gets token client

`private getTokenClient() : TokenClient`

##### Return values

TokenClient

#### initKeys()

Client.php : 1004
`private static initKeys(string|null $privateKey, string|null $privateKeySecret) : PrivateKey|null`

##### Parameters

$privateKey : string|null
$privateKeySecret : string|null

##### Tags

throws
  BitPayException
throws
  Exception

##### Return values

PrivateKey|null

## Search results