### GET /invoices?guid={guid}&facade={facade} Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Retrieves a BitPay invoice by its GUID and a specified facade. Requires signing the request. ```APIDOC ## GET /invoices?guid={guid}&facade={facade} ### Description Retrieve a BitPay invoice by guid using the specified facade. The client must have been previously authorized for the specified facade. ### Method GET ### Endpoint /invoices?guid={guid}&facade={facade} ### Parameters #### Query Parameters - **guid** (string) - Required - The guid of the invoice to retrieve. - **facade** (Facade) - Required - The facade used to create it. - **signRequest** (boolean) - Required - Signed request. ### Request Example ```json { "guid": "someGuid", "facade": "someFacade", "signRequest": true } ``` ### Response #### Success Response (200) - **invoice** (Invoice) - A BitPay Invoice object. #### Response Example ```json { "invoice": { "id": "someInvoiceId", "guid": "someGuid", "status": "paid" } } ``` #### Errors - **BitPayGenericException** - Thrown for generic BitPay errors. - **BitPayApiException** - Thrown for API-specific errors. ``` -------------------------------- ### Get Refund by GUID (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Retrieves a previously made refund request using its GUID. Requires the refund GUID as a string. Returns a BitPay Refund object. Throws BitPayApiException or BitPayGenericException on failure. ```java public Refund getRefundByGuid(String guid) throws BitPayGenericException, BitPayApiException ``` -------------------------------- ### PayoutRecipients Methods Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/payout/PayoutRecipients.html This section details the methods available for the PayoutRecipients class, including getting and setting GUID, instructions, and tokens. ```APIDOC ## PayoutRecipients Class Methods ### Description Provides methods for managing payout recipients, including setting and retrieving GUID, instructions, and tokens. ### Methods #### getToken ##### Description Gets the Payout recipients token. ##### Method GET (Conceptual) ##### Endpoint N/A (This is a getter method within the Java client) ##### Response - **token** (String) - The payout recipients token. #### setGuid ##### Description Sets the GUID for payout recipients. ##### Method POST (Conceptual) ##### Endpoint N/A (This is a setter method within the Java client) ##### Parameters - **guid** (String) - Required - The GUID to set. #### setInstructions ##### Description Sets the payout instructions with a list of recipients. ##### Method POST (Conceptual) ##### Endpoint N/A (This is a setter method within the Java client) ##### Parameters - **recipients** (List) - Required - A list of PayoutRecipient objects. #### setToken ##### Description Sets the Payout recipients token. ##### Method POST (Conceptual) ##### Endpoint N/A (This is a setter method within the Java client) ##### Parameters - **token** (String) - Required - The token to set. ### Fields #### guid ##### Description Represents the GUID associated with payout recipients. ##### Type String #### recipients ##### Description Represents the list of payout recipients. ##### Type List #### token ##### Description Represents the token for payout recipients. ##### Type String ### Constructor #### PayoutRecipients ##### Description Constructor to create a PayoutBatch object with a list of recipients. ##### Parameters - **recipients** (List) - Required - An array of JSON objects, each containing the following parameters. ### Request Example ```json { "recipients": [ { "amount": 1000, "currency": "USD", "recipient": "recipient@example.com", "token": "some_token" } ] } ``` ### Response Example ```json { "guid": "some_guid", "token": "some_token", "instructions": [ { "amount": 1000, "currency": "USD", "recipient": "recipient@example.com", "token": "some_token" } ] } ``` ``` -------------------------------- ### WalletClient - Get Instance Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/WalletClient.html Factory method to get an instance of the WalletClient. This is the recommended way to obtain a client object. ```APIDOC ## GET /wallet/instance ### Description Factory method for Wallet Client. Use this to obtain an instance of the WalletClient. ### Method GET ### Endpoint /wallet/instance ### Parameters #### Query Parameters - **bitPayClient** (BitPayClient) - Required - The BitPay client instance to associate with this wallet client. ### Request Example ```json { "bitPayClient": "" } ``` ### Response #### Success Response (200) - **WalletClient** (WalletClient) - An instance of the WalletClient. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Create POS Client with Environment and Platform Info (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Creates a POS (Point of Sale) client using a PosToken, a specified BitPay environment, and platform information. This provides the most flexibility for POS client creation. ```java public static Client createPosClient(PosToken token, Environment environment, String platformInfo) throws BitPayGenericException ``` -------------------------------- ### GET /invoices/guid/{guid} Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Retrieve a BitPay invoice by its GUID using the specified facade. ```APIDOC ## GET /invoices/guid/{guid} ### Description Retrieve a BitPay invoice by its GUID using the specified facade. ### Method GET ### Endpoint /invoices/guid/{guid} ### Parameters #### Path Parameters - **guid** (String) - Required - The GUID of the invoice. #### Query Parameters - **facade** (Facade) - Optional - The facade to use for retrieval (e.g., 'merchant', 'public'). Defaults to 'public'. ### Response #### Success Response (200) - **Invoice** (Invoice) - The retrieved invoice object. #### Response Example ```json { "id": "someInvoiceId", "guid": "someGuid", "status": "paid", "price": 100.00, "currency": "USD" } ``` ``` -------------------------------- ### Get Invoice by GUID Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayApiException.html Retrieves a BitPay invoice using its GUID and the public facade. ```APIDOC ## GET /bitpay/invoices?guid={guid} ### Description Retrieves a BitPay invoice by its GUID using the public facade. ### Method GET ### Endpoint `/bitpay/invoices` ### Parameters #### Query Parameters - **guid** (String) - Required - The GUID of the invoice. ### Response #### Success Response (200) - **Invoice** (com.bitpay.sdk.model.invoice.Invoice) - The retrieved invoice object. #### Response Example ```json { "id": "invoiceFromGuid", "status": "complete", "price": 50.00, "currency": "USD" } ``` ``` -------------------------------- ### Client Initialization with PrivateKey and Proxy Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/PrivateKey.html Illustrates the constructor for initializing the BitPay client when keys and SIN are managed by the library, including proxy configuration. ```APIDOC ## POST /bitpay/sdk/Client ### Description Initializes a BitPay client when the private key and SIN are managed internally. Supports proxy configuration. ### Method POST ### Endpoint /bitpay/sdk/Client ### Parameters #### Query Parameters - **environment** (Environment) - Required - The BitPay environment (e.g., Test, Production). - **privateKey** (PrivateKey) - Required - The private key object for authentication. - **tokenContainer** (TokenContainer) - Required - Container for API tokens. - **proxyDetails** (HttpHost) - Optional - Details of the HTTP proxy to use. - **proxyCredentials** (CredentialsProvider) - Optional - Credentials for the HTTP proxy. ### Request Example ```json { "environment": "PRODUCTION", "privateKey": "", "tokenContainer": "", "proxyDetails": { "host": "proxy.example.com", "port": 8080 }, "proxyCredentials": "" } ``` ### Response #### Success Response (200) - **Client** (Client) - An initialized BitPay client object. #### Response Example ```json { "client": "" } ``` ``` -------------------------------- ### BitPayClient GET Method (URI and Parameters) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/class-use/HttpResponse.html This method in the BitPayClient class sends a GET request to a specified URI with optional parameters, returning an HttpResponse. ```APIDOC ## GET /api/resource ### Description Send GET request to the specified URI with optional parameters. ### Method GET ### Endpoint /api/resource ### Parameters #### Path Parameters None #### Query Parameters - **uri** (String) - Required - The URI to send the GET request to. - **parameters** (List) - Optional - A list of parameters to include in the request. ### Request Example ```json { "uri": "/invoices", "parameters": [ {"name": "status", "value": "paid"} ] } ``` ### Response #### Success Response (200) - **HttpResponse** (HttpResponse) - The response from the GET request. #### Response Example ```json { "status": 200, "data": [ { "id": "invoice_id_1", "status": "paid" } ] } ``` ``` -------------------------------- ### Initialize BitPay Client with Environment, Keys, and Proxy (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Constructs a BitPay client for scenarios where keys and SIN are managed internally. This overload requires the BitPay environment, private key, token container, proxy details, and proxy credentials. ```java Client.Client(Environment environment, PrivateKey privateKey, TokenContainer tokenContainer, org.apache.http.HttpHost proxyDetails, org.apache.http.client.CredentialsProvider proxyCredentials) ``` -------------------------------- ### Get GUID (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/invoice/RefundWebhook.html Retrieves the Globally Unique Identifier (GUID) associated with the transaction or refund. This method returns a String representing the GUID. ```java public String getGuid() { // Implementation details omitted return null; } ``` -------------------------------- ### RefundClient - Get Refund by GUID Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayApiException.html Retrieve a refund request on a BitPay invoice by its unique GUID. ```APIDOC ## GET /refunds/{guid} ### Description Retrieve a refund request on a BitPay invoice using its GUID. ### Method GET ### Endpoint /refunds/{guid} ### Parameters #### Path Parameters - **guid** (String) - Required - The unique identifier (GUID) of the refund request. ### Response #### Success Response (200) - **refund** (Refund) - The Refund object associated with the provided GUID. #### Response Example { "id": "someRefundId", "invoiceId": "someInvoiceId", "amount": 100.00, "currency": "USD" } ``` -------------------------------- ### Client Creation with PrivateKey Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/PrivateKey.html Demonstrates how to create a BitPay client using a PrivateKey object, along with token container and environment details. ```APIDOC ## POST /bitpay/sdk/Client ### Description Creates a BitPay client instance using a provided PrivateKey, TokenContainer, and Environment. ### Method POST ### Endpoint /bitpay/sdk/Client ### Parameters #### Query Parameters - **privateKey** (PrivateKey) - Required - The private key object for authentication. - **tokenContainer** (TokenContainer) - Required - Container for API tokens. - **environment** (Environment) - Required - The BitPay environment (e.g., Test, Production). - **platformInfo** (String) - Optional - Additional platform information. ### Request Example ```json { "privateKey": "", "tokenContainer": "", "environment": "TEST", "platformInfo": "JavaClient/1.0" } ``` ### Response #### Success Response (200) - **Client** (Client) - An initialized BitPay client object. #### Response Example ```json { "client": "" } ``` ``` -------------------------------- ### GET /invoices/guid/{guid} Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Retrieve a BitPay invoice by its GUID, specifying the facade and signing request option. ```APIDOC ## GET /invoices/guid/{guid} ### Description Retrieve a BitPay invoice by its GUID, specifying the facade and whether to sign the request. ### Method GET ### Endpoint /invoices/guid/{guid} ### Parameters #### Path Parameters - **guid** (String) - Required - The GUID of the invoice. #### Query Parameters - **facade** (Facade) - Required - The facade to use for retrieval (e.g., 'merchant', 'public'). - **signRequest** (Boolean) - Required - Whether to sign the request. ### Response #### Success Response (200) - **Invoice** (Invoice) - The retrieved invoice object. #### Response Example ```json { "id": "someInvoiceId", "guid": "someGuid", "status": "paid", "price": 100.00, "currency": "USD" } ``` ``` -------------------------------- ### Create POS Client with Environment (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Creates a POS (Point of Sale) client using a PosToken and a specified BitPay environment (e.g., Test or Production). This allows for selecting the target BitPay API environment. ```java public static Client createPosClient(PosToken token, Environment environment) throws BitPayGenericException ``` -------------------------------- ### Invoice GUID Management (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/invoice/Invoice.html Methods for getting and setting the invoice GUID. The GUID is a passthru variable used by merchants to correlate invoices with their order IDs for easier lookup. ```java public String getGuid() { // Gets a passthru variable provided by the merchant and designed to be used by the merchant to correlate the invoice with an order ID in their system, which can be used as a lookup variable in Retrieve Invoice by GUID. // Returns: the guid } public void setGuid(String guid) { // Sets a passthru variable provided by the merchant and designed to be used by the merchant to correlate the invoice with an order ID in their system, which can be used as a lookup variable in Retrieve Invoice by GUID. // Parameters: // `guid` - the guid } ``` -------------------------------- ### Initialize BitPay Client in Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Provides multiple ways to create a BitPay client instance. These methods allow initialization using configuration file paths or private keys, with options for specifying platform information and environment. ```java ConfigFilePath configFilePath = new ConfigFilePath("path/to/config.json"); Client client = Client.createClientByConfigFilePath(configFilePath); ``` ```java ConfigFilePath configFilePath = new ConfigFilePath("path/to/config.json"); String platformInfo = "MyPlatform/1.0"; Client client = Client.createClientByConfigFilePath(configFilePath, platformInfo); ``` ```java PrivateKey privateKey = new PrivateKey("path/to/private.key"); TokenContainer tokenContainer = new TokenContainer("your_token"); Environment environment = Environment.TEST; Client client = Client.createClientByPrivateKey(privateKey, tokenContainer, environment); ``` ```java PrivateKey privateKey = new PrivateKey("path/to/private.key"); TokenContainer tokenContainer = new TokenContainer("your_token"); Environment environment = Environment.TEST; String platformInfo = "MyPlatform/1.0"; Client client = Client.createClientByPrivateKey(privateKey, tokenContainer, environment, platformInfo); ``` -------------------------------- ### BitPayClient GET Method (URI, Parameters, and Signature Requirement) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/class-use/HttpResponse.html This method in the BitPayClient class sends a GET request to a specified URI with optional parameters and allows specifying whether a signature is required. ```APIDOC ## GET /api/resource ### Description Send GET request to the specified URI with optional parameters, and control signature requirement. ### Method GET ### Endpoint /api/resource ### Parameters #### Path Parameters None #### Query Parameters - **uri** (String) - Required - The URI to send the GET request to. - **parameters** (List) - Optional - A list of parameters to include in the request. - **signatureRequired** (boolean) - Required - Whether a signature is required for this request. ### Request Example ```json { "uri": "/settlements", "parameters": [ {"name": "date", "value": "2023-01-01"} ], "signatureRequired": true } ``` ### Response #### Success Response (200) - **HttpResponse** (HttpResponse) - The response from the GET request. #### Response Example ```json { "status": 200, "data": [ { "id": "settlement_id_1", "date": "2023-01-01" } ] } ``` ``` -------------------------------- ### Create POS Client with Platform Info (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Creates a POS (Point of Sale) client using a PosToken and platform information. This method is suitable for lightweight integrations where specific environment details are provided. ```java public static Client createPosClient(PosToken token, String platformInfo) throws BitPayGenericException ``` -------------------------------- ### GET /invoices?guid={guid} Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Retrieves a BitPay invoice by its GUID. This method uses a default facade and requires signing the request. ```APIDOC ## GET /invoices?guid={guid} ### Description Retrieve a BitPay invoice by guid using the specified facade. The client must have been previously authorized for the specified facade. ### Method GET ### Endpoint /invoices?guid={guid} ### Parameters #### Query Parameters - **guid** (string) - Required - The guid of the invoice to retrieve. ### Request Example ```json { "guid": "someGuid" } ``` ### Response #### Success Response (200) - **invoice** (Invoice) - A BitPay Invoice object. #### Response Example ```json { "invoice": { "id": "someInvoiceId", "guid": "someGuid", "status": "paid" } } ``` #### Errors - **BitPayGenericException** - Thrown for generic BitPay errors. - **BitPayApiException** - Thrown for API-specific errors. ``` -------------------------------- ### Initialize BitPay Client with Config File, Proxy, and Platform Info (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Initializes the BitPay client with a configuration file, proxy settings, and platform information. This constructor is used when the library manages keys and SIN, and additional platform-specific details need to be provided. ```java Client.Client(ConfigFilePath configFilePath, org.apache.http.HttpHost proxy, org.apache.http.client.CredentialsProvider proxyCredentials, String platformInfo) ``` -------------------------------- ### Client Initialization Source: https://context7.com/bitpay/java-bitpay-client/llms.txt Demonstrates different ways to initialize the BitPay client, including using a configuration file, a POS token, or a private key. ```APIDOC ## Client Initialization ### Create Client with Configuration File Initializes the client using a JSON configuration file containing API credentials, private key path, and environment settings. This is the recommended method for Merchant facade integrations. ### Method `Client.createClientByConfigFilePath()` ### Endpoint N/A (Local configuration file) ### Parameters #### Path Parameters - **configFilePath** (ConfigFilePath) - Required - The path to the BitPay configuration JSON file. ### Request Example ```java import com.bitpay.sdk.Client; import com.bitpay.sdk.ConfigFilePath; import com.bitpay.sdk.exceptions.BitPayGenericException; public class ClientSetup { public static Client createClient() throws BitPayGenericException { Client client = Client.createClientByConfigFilePath( new ConfigFilePath("/path/to/BitPay.config.json") ); return client; } } ``` ### Response #### Success Response (Client Object) - **client** (Client) - The initialized BitPay client object. ### Create POS Client with Token Initializes a lightweight POS client suitable for basic invoice creation, using only a POS token. ### Method `new Client(PosToken)` or `new Client(PosToken, Environment)` ### Endpoint N/A (POS integration) ### Parameters #### Path Parameters - **posToken** (PosToken) - Required - The POS token for authentication. - **environment** (Environment) - Optional - Specifies the environment (e.g., `Environment.TEST`, `Environment.PROD`). Defaults to production. ### Request Example ```java import com.bitpay.sdk.Client; import com.bitpay.sdk.Environment; import com.bitpay.sdk.PosToken; import com.bitpay.sdk.exceptions.BitPayGenericException; public class PosClientSetup { public static Client createPosClient() throws BitPayGenericException { // Create POS client with token (production environment) Client client = new Client(new PosToken("yourPosToken")); // Or specify environment explicitly Client testClient = new Client( new PosToken("yourTestPosToken"), Environment.TEST ); return client; } } ``` ### Response #### Success Response (Client Object) - **client** (Client) - The initialized BitPay POS client object. ### Create Client with Private Key Initializes the client directly with a private key and token container for full Merchant API access. ### Method `Client.createClientByPrivateKey()` ### Endpoint N/A (Direct key initialization) ### Parameters #### Path Parameters - **privateKey** (PrivateKey) - Required - The merchant's private key in hexadecimal format. - **tokenContainer** (TokenContainer) - Required - A container holding the merchant token. - **environment** (Environment) - Required - Specifies the environment (e.g., `Environment.TEST`, `Environment.PROD`). ### Request Example ```java import com.bitpay.sdk.Client; import com.bitpay.sdk.Environment; import com.bitpay.sdk.PrivateKey; import com.bitpay.sdk.util.TokenContainer; import com.bitpay.sdk.exceptions.BitPayGenericException; public class PrivateKeyClientSetup { public static Client createWithPrivateKey() throws BitPayGenericException { TokenContainer tokenContainer = new TokenContainer(); tokenContainer.addMerchant("yourMerchantToken"); Client client = Client.createClientByPrivateKey( new PrivateKey("yourPrivateKeyHex"), tokenContainer, Environment.PROD ); return client; } } ``` ### Response #### Success Response (Client Object) - **client** (Client) - The initialized BitPay client object. ``` -------------------------------- ### GET /invoices/{guid} Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/index-all.html Retrieve a BitPay invoice by GUID using the specified facade. This endpoint allows fetching specific invoice details. ```APIDOC ## GET /invoices/{guid} ### Description Retrieve a BitPay invoice by GUID using the specified facade. This endpoint allows fetching specific invoice details. ### Method GET ### Endpoint /invoices/{guid} ### Parameters #### Path Parameters - **guid** (String) - Required - The unique identifier (GUID) of the invoice. - **facade** (Facade) - Required - The facade to use for retrieving the invoice (e.g., 'merchant', 'pos'). #### Query Parameters - **isTest** (Boolean) - Optional - Specifies if the invoice is for testing purposes. ### Response #### Success Response (200) - **invoice** (Object) - The invoice object containing details like ID, status, amount, currency, etc. #### Response Example ```json { "id": "someInvoiceId", "guid": "someGuid", "status": "paid", "amount": 100.50, "currency": "USD", "url": "https://bitpay.com/invoice?id=someInvoiceId" } ``` ``` -------------------------------- ### Get Invoice by GUID with Facade and Signature Option Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayApiException.html Retrieves a BitPay invoice by its GUID, allowing specification of the facade and whether to sign the request. ```APIDOC ## GET /bitpay/invoices?guid={guid}&facade={facade}&signRequest={signRequest} ### Description Retrieves a BitPay invoice by its GUID. Allows specifying the facade and a boolean to indicate if the request should be signed. ### Method GET ### Endpoint `/bitpay/invoices` ### Parameters #### Query Parameters - **guid** (String) - Required - The GUID of the invoice. - **facade** (Facade) - Required - The facade to use for retrieving the invoice. - **signRequest** (Boolean) - Required - A flag indicating whether to sign the request. ### Response #### Success Response (200) - **Invoice** (com.bitpay.sdk.model.invoice.Invoice) - The retrieved invoice object. #### Response Example ```json { "id": "invoiceFromGuid2", "status": "new", "price": 75.00, "currency": "EUR" } ``` ``` -------------------------------- ### Configuration Loading Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/ConfigFilePath.html Details on how to load BitPay client configuration from a file path. ```APIDOC ## Load Configuration from File ### Description This section describes the method used to load the BitPay client configuration from a specified JSON file path. ### Method #### `protected Config buildConfigFromFile(ConfigFilePath configFilePath)` * **Description**: Loads the BitPay client configuration from a JSON file located at the given `ConfigFilePath`. * **Method**: `protected Config` * **Endpoint**: N/A (Library method) * **Parameters**: * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None * **Request Example**: None * **Response**: * **Success Response (200)**: A `Config` object populated with data from the configuration file. * **Response Example**: None ### Error Handling * Specific error handling details are not provided in the source text. Refer to the BitPay SDK documentation for potential exceptions related to file I/O or JSON parsing. ``` -------------------------------- ### Initialize BitPay Client with Config File and Proxy (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Constructs a BitPay client instance when keys and SIN are managed by the library. This constructor requires a configuration file path, proxy details (HttpHost), and proxy credentials. It's suitable for environments where configuration is file-based. ```java Client.Client(ConfigFilePath configFilePath, org.apache.http.HttpHost proxy, org.apache.http.client.CredentialsProvider proxyCredentials) ``` -------------------------------- ### Create BitPay Client by Config File Path (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Creates a standard BitPay client using a configuration file path. This method is useful for initializing the client with predefined settings. It takes a ConfigFilePath object as input. ```java Client client = Client.createClientByConfigFilePath(configFilePath); ``` ```java Client client = Client.createClientByConfigFilePath(configFilePath, platformInfo); ``` -------------------------------- ### Get GUID Method - Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/Token.html Retrieves the GUID (Globally Unique Identifier) associated with the token. This GUID is a merchant-provided variable used to correlate invoices with their corresponding order IDs in the merchant's system. ```java public String getGuid() ``` -------------------------------- ### Get and Set PayPro Payment Protocol (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/wallet/Currencies.html Offers methods to get and set the PayPro status, indicating whether BitPay Payment Protocol is supported for a currency option. These are standard Java getter and setter methods with no specific external dependencies. ```Java public Boolean getPayPro() Gets pay pro. Whether or not BitPay Payment Protocol is supported on this particular currency option. Returns: the pay pro public void setPayPro(Boolean payPro) Sets pay pro. Whether or not BitPay Payment Protocol is supported on this particular currency option. Parameters: `payPro` - the pay pro ``` -------------------------------- ### Client Constructor with Config File Path, Proxy, and Platform Info (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Initializes the BitPay client with a configuration file path, proxy details, and platform information. This constructor is used when the library manages keys and SIN and may throw a `BitPayGenericException`. ```java public Client(ConfigFilePath configFilePath, HttpHost proxy, CredentialsProvider proxyCredentials, String platformInfo) throws BitPayGenericException ``` -------------------------------- ### Get Refund by GUID - Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/invoice/class-use/Refund.html Retrieves a refund request on a BitPay invoice by its Global Unique Identifier (GUID). The method returns a Refund object if found. ```java RefundClient refundClient = new RefundClient(api); // Assuming api is an initialized BitPay API client String guid = "some_guid"; Refund refund = refundClient.getByGuid(guid); ``` -------------------------------- ### Create BitPay POS Client (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Creates a POS (light) client for BitPay using a PosToken. This method can be initialized with just the token, or with the token, environment, and an optional platformInfo string. ```java Client client = Client.createPosClient(token); ``` ```java Client client = Client.createPosClient(token, environment); ``` ```java Client client = Client.createPosClient(token, environment, platformInfo); ``` -------------------------------- ### Get Refund by GUID (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/RefundClient.html Retrieves a refund request on a BitPay invoice using its Global Unique Identifier (GUID). The method accepts the GUID as a string and returns the corresponding Refund object. ```Java Refund getByGuid(String guid) ``` -------------------------------- ### Get Invoice by GUID API Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/InvoiceClient.html Retrieves a specific BitPay invoice using its GUID and facade. Requires the client to be authorized for the specified facade. ```APIDIDOC ## GET /invoices/guid/{guid} ### Description Retrieve a BitPay invoice by guid using the specified facade. The client must have been previously authorized for the specified facade. ### Method GET ### Endpoint /invoices/guid/{guid} ### Parameters #### Path Parameters - **guid** (String) - Required - The guid of the invoice to retrieve. #### Query Parameters - **facade** (Facade) - Required - The facade used to create it. - **signRequest** (Boolean) - Required - Signed request. #### Request Body None ### Request Example None ### Response #### Success Response (200) - **Invoice** (Invoice) - A BitPay Invoice object. #### Response Example ```json { "id": "someInvoiceId", "guid": "someGuid", "url": "https://bitpay.com/invoice?id=someInvoiceId", "status": "confirmed", "price": 100, "currency": "USD", "orderId": "order123", "invoiceTime": 1678886400000, "expirationTime": 1678972800000, "currentTime": 1678886400000, "paymentUrls": { "B2ించాలి": "bitcoin:1ABC...", "B2B": "bitcoin:1XYZ..." }, "createdTime": 1678886400000, "token": "someToken" } ``` ### Throws - **BitPayValidationException** - BitPayValidationException class - **BitPayGenericException** - BitPayGenericException class - **BitPayApiException** - BitPayApiException class ``` -------------------------------- ### Initialize POS Facade Client (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Constructors for initializing the POS facade client. These require a POS token and either an environment or platform information. They can throw a BitPayGenericException. ```java public Client(PosToken token, String platformInfo) throws BitPayGenericException public Client(PosToken token, Environment environment) throws BitPayGenericException public Client(PosToken token, Environment environment, String platformInfo) throws BitPayGenericException ``` -------------------------------- ### Initialize BitPay Client with Configuration File (Java) Source: https://context7.com/bitpay/java-bitpay-client/llms.txt Initializes the BitPay client using a JSON configuration file. This method is recommended for Merchant facade integrations and requires the path to the configuration file containing API credentials, private key, and environment settings. ```java import com.bitpay.sdk.Client; import com.bitpay.sdk.ConfigFilePath; import com.bitpay.sdk.exceptions.BitPayGenericException; public class ClientSetup { public static Client createClient() throws BitPayGenericException { // Create client from configuration file (recommended for Merchant facade) Client client = Client.createClientByConfigFilePath( new ConfigFilePath("/path/to/BitPay.config.json") ); return client; } } ``` -------------------------------- ### Client Constructor with Environment, Key, and Token (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Initializes the BitPay client when private keys and SIN are managed by the library. It accepts environment, private key, token container, and optional proxy settings. This constructor can throw a `BitPayGenericException`. ```java public Client(Environment environment, String privateKey, TokenContainer tokenContainer, HttpHost proxy, CredentialsProvider proxyCredentials, PlatformInfo platformInfo) throws BitPayGenericException ``` -------------------------------- ### Cancel Invoice by GUID - Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Allows merchants to cancel an invoice using its GUID. Cancellation typically requires prior SMS or email setup unless the `forceCancel` parameter is used. It returns an Invoice object upon successful cancellation and can throw BitPayApiException or BitPayGenericException. ```java public Invoice cancelInvoiceByGuid(String guid, Boolean forceCancel) throws BitPayGenericException, BitPayApiException ``` -------------------------------- ### Client Creation with Config File Path Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/ConfigFilePath.html This section details methods for creating a BitPay client using a configuration file path. It includes options for specifying proxy settings and platform information. ```APIDOC ## Client Creation using ConfigFilePath ### Description Methods for creating a BitPay client instance using a configuration file path. These methods allow for initialization with or without proxy settings and platform information. ### Methods #### `static Client createClientByConfigFilePath(ConfigFilePath configFilePath)` * **Description**: Creates a standard BitPay client using the provided configuration file path. * **Method**: `static Client` * **Endpoint**: N/A (Library method) * **Parameters**: * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None * **Request Example**: None * **Response**: * **Success Response (200)**: A `Client` object initialized with the configuration. * **Response Example**: None #### `static Client createClientByConfigFilePath(ConfigFilePath configFilePath, String platformInfo)` * **Description**: Creates a standard BitPay client using the provided configuration file path and platform information. * **Method**: `static Client` * **Endpoint**: N/A (Library method) * **Parameters**: * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None * **Request Example**: None * **Response**: * **Success Response (200)**: A `Client` object initialized with the configuration and platform info. * **Response Example**: None #### `Client(ConfigFilePath configFilePath, HttpHost proxy, CredentialsProvider proxyCredentials)` * **Description**: Constructor for creating a `Client` instance when keys and SIN are managed by the library, with specified proxy settings. * **Method**: Constructor * **Endpoint**: N/A (Library method) * **Parameters**: * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None * **Request Example**: None * **Response**: * **Success Response (200)**: A `Client` object initialized with the configuration and proxy settings. * **Response Example**: None #### `Client(ConfigFilePath configFilePath, HttpHost proxy, CredentialsProvider proxyCredentials, String platformInfo)` * **Description**: Constructor for creating a `Client` instance when keys and SIN are managed by the library, with specified proxy settings and platform information. * **Method**: Constructor * **Endpoint**: N/A (Library method) * **Parameters**: * **Path Parameters**: None * **Query Parameters**: None * **Request Body**: None * **Request Example**: None * **Response**: * **Success Response (200)**: A `Client` object initialized with the configuration, proxy settings, and platform info. * **Response Example**: None ### Error Handling * Specific error handling details are not provided in the source text. Refer to the BitPay SDK documentation for potential exceptions. ``` -------------------------------- ### Get Forced Buyer Selected Wallet (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/invoice/Invoice.html Retrieves the wallet that the merchant has pre-selected on behalf of the buyer. This is used to guide the buyer's payment choice. ```java public String getForcedBuyerSelectedWallet() Gets merchant pre-selects wallet on behalf of buyer. Returns: the forced buyer selected wallet ``` -------------------------------- ### Get Invoice Client Instance - Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/InvoiceClient.html Factory method to obtain an instance of the InvoiceClient. This method requires a BitPayClient instance, an access token container, and a GUID generator. It is the entry point for interacting with invoice-related operations. ```java public static InvoiceClient getInstance(BitPayClient bitPayClient, TokenContainer accessTokens, GuidGenerator guidGenerator) ``` -------------------------------- ### Initialize BitPay Client with POS Token and Platform Info - Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Constructs a BitPay client instance for POS facade, accepting a POS token and platform information. This constructor is used for advanced client initialization. ```java public Client(PosToken token, String platformInfo) ``` -------------------------------- ### Load Configuration from File (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Loads the BitPay client configuration from a specified JSON file. This method takes a ConfigFilePath object as input and returns a configuration object. ```java client.buildConfigFromFile(configFilePath); ``` -------------------------------- ### Get BitPay Payouts (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/PayoutClient.html Retrieves a collection of BitPay payouts. This method accepts various parameters for filtering and pagination, including start date, end date, status, reference, limit, and offset. It requires a configured BitPay client and appropriate access tokens. ```java public PayoutClient getPayouts(String startDate, String endDate, String status, String reference, Integer limit, Integer offset, String groupId) ``` -------------------------------- ### Create BitPay Client using Config File Path (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/Client.html Demonstrates how to create a standard BitPay client by providing a configuration file path. This method is useful for initializing the client with pre-defined settings. It can optionally accept platform information. ```java Client client = Client.createClientByConfigFilePath(configFilePath); Client clientWithPlatform = Client.createClientByConfigFilePath(configFilePath, platformInfo); ``` -------------------------------- ### Get List of BitPay Payouts (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/client/PayoutClient.html Retrieves a list of BitPay payouts based on specified criteria such as date range, status, reference, and limit. Returns a List of Payout objects. The method signature indicates parameters for start date, end date, status, reference, and limit. ```java public List getPayouts(String startDate, String endDate, String status, String reference, Integer limit) ``` -------------------------------- ### Token GUID Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/index-all.html Retrieves the GUID for a token. ```APIDOC ## GET /tokens/guid/{guid} ### Description Retrieves a token using its GUID. ### Method GET ### Endpoint /tokens/guid/{guid} ### Parameters #### Path Parameters - **guid** (string) - Required - The GUID of the token. ### Response #### Success Response (200) - **tokenData** (object) - The token details. #### Response Example { "tokenData": { "guid": "token_guid" } } ``` -------------------------------- ### Initialize Advanced Client with Private Key (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/Client.html Constructors for initializing an advanced client using a private key, token container, and optional proxy settings. These are suitable when keys are managed by the library and can throw a BitPayGenericException. ```java public Client(Environment environment, PrivateKey privateKey, TokenContainer tokenContainer, HttpHost proxyDetails, org.apache.http.client.CredentialsProvider proxyCredentials) throws BitPayGenericException public Client(Environment environment, PrivateKey privateKey, TokenContainer tokenContainer, HttpHost proxyDetails, org.apache.http.client.CredentialsProvider proxyCredentials, String platformInfo) throws BitPayGenericException ``` -------------------------------- ### Create BitPay Client using Private Key (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/class-use/Client.html Shows how to instantiate a BitPay client using a private key, token container, and environment settings. This approach allows for programmatic client creation with specific security and environment configurations. An optional platform info parameter can also be provided. ```java Client client = Client.createClientByPrivateKey(privateKey, tokenContainer, environment); Client clientWithPlatform = Client.createClientByPrivateKey(privateKey, tokenContainer, environment, platformInfo); ``` -------------------------------- ### Set GUID (Java) Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/invoice/RefundWebhook.html Sets the Globally Unique Identifier (GUID) for the transaction or refund. This method accepts a String value to assign a GUID. ```java public void setGuid(String guid) { // Implementation details omitted } ``` -------------------------------- ### BitPayClient GET Request Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Sends a GET request to the BitPay API. This is a general-purpose method for making GET requests with optional parameters and signature requirement. ```APIDOC ## GET /bitpay/java-bitpay-client ### Description Sends a GET request to the BitPay API with specified URI, parameters, and signature requirement. ### Method GET ### Endpoint /bitpay/java-bitpay-client ### Parameters #### Query Parameters - **uri** (String) - Required - The URI to send the GET request to. - **parameters** (List) - Optional - A list of parameters to include in the request. - **signatureRequired** (boolean) - Required - Whether a signature is required for the request. ### Request Example ```json { "uri": "/some/endpoint", "parameters": [ {"name": "param1", "value": "value1"} ], "signatureRequired": true } ``` ### Response #### Success Response (200) - **response** (Object) - The response from the GET request. #### Response Example ```json { "response": { "data": "some data" } } ``` ``` -------------------------------- ### ParameterAdder Constructor Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/util/ParameterAdder.html Initializes a new instance of the ParameterAdder class. ```APIDOC ## ParameterAdder Constructor ### Description Initializes a new instance of the ParameterAdder class. ### Method `ParameterAdder()` ### Endpoint N/A (Constructor) ### Parameters None ### Request Example ```json // No request body for constructor ``` ### Response #### Success Response (200) An instance of the ParameterAdder class. #### Response Example ```json // No direct response body for constructor, returns an object instance ``` ``` -------------------------------- ### Client Creation Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/exceptions/class-use/BitPayGenericException.html Methods for creating a BitPay client instance using different configuration options. ```APIDOC ## Client Creation Methods ### Description Provides static methods to create a `Client` instance for interacting with the BitPay API. Different methods cater to various authentication and configuration needs. ### Methods #### `createClientByConfigFilePath` * **Description**: Creates a standard BitPay client using a configuration file path. * **Parameters**: * `configFilePath` (ConfigFilePath) - Required - The path to the client configuration file. * **Returns**: `Client` - An instance of the BitPay client. #### `createClientByConfigFilePath` (with platform info) * **Description**: Creates a standard BitPay client using a configuration file path and platform information. * **Parameters**: * `configFilePath` (ConfigFilePath) - Required - The path to the client configuration file. * `platformInfo` (String) - Optional - Information about the platform. * **Returns**: `Client` - An instance of the BitPay client. #### `createClientByPrivateKey` * **Description**: Creates a standard BitPay client using a private key, token container, and environment. * **Parameters**: * `privateKey` (PrivateKey) - Required - The private key for authentication. * `tokenContainer` (TokenContainer) - Required - A container for API tokens. * `environment` (Environment) - Required - The BitPay environment (e.g., TEST, PROD). * **Returns**: `Client` - An instance of the BitPay client. #### `createClientByPrivateKey` (with platform info) * **Description**: Creates a standard BitPay client using a private key, token container, environment, and platform information. * **Parameters**: * `privateKey` (PrivateKey) - Required - The private key for authentication. * `tokenContainer` (TokenContainer) - Required - A container for API tokens. * `environment` (Environment) - Required - The BitPay environment (e.g., TEST, PROD). * `platformInfo` (String) - Optional - Information about the platform. * **Returns**: `Client` - An instance of the BitPay client. #### `createPosClient` * **Description**: Creates a POS (light) client using a POS token. * **Parameters**: * `token` (PosToken) - Required - The POS token for authentication. * **Returns**: `Client` - An instance of the POS client. #### `createPosClient` (with environment) * **Description**: Creates a POS (light) client using a POS token and environment. * **Parameters**: * `token` (PosToken) - Required - The POS token for authentication. * `environment` (Environment) - Required - The BitPay environment (e.g., TEST, PROD). * **Returns**: `Client` - An instance of the POS client. #### `createPosClient` (with environment and platform info) * **Description**: Creates a POS (light) client using a POS token, environment, and platform information. * **Parameters**: * `token` (PosToken) - Required - The POS token for authentication. * `environment` (Environment) - Required - The BitPay environment (e.g., TEST, PROD). * `platformInfo` (String) - Optional - Information about the platform. * **Returns**: `Client` - An instance of the POS client. ``` -------------------------------- ### Payout Recipient GUID Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/index-all.html Retrieves the GUID for a payout recipient. ```APIDOC ## GET /payout_recipients/guid/{guid} ### Description Retrieves a payout recipient using their GUID. ### Method GET ### Endpoint /payout_recipients/guid/{guid} ### Parameters #### Path Parameters - **guid** (string) - Required - The GUID of the payout recipient. ### Response #### Success Response (200) - **recipientData** (object) - The payout recipient details. #### Response Example { "recipientData": { "guid": "recipient_guid" } } ``` -------------------------------- ### Instantiate Buyer in Java Source: https://github.com/bitpay/java-bitpay-client/blob/10.2.x/docs/com/bitpay/sdk/model/ledger/Buyer.html This code snippet demonstrates how to create a new instance of the Buyer class. It requires no arguments and is used to initialize a Buyer object for further manipulation. ```java Buyer buyer = new Buyer(); ```