Skip to content

Commit

Permalink
added documentation for the partner api section
Browse files Browse the repository at this point in the history
  • Loading branch information
devops-blockchyp committed Oct 27, 2023
1 parent ce7131b commit 61d393b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 40 deletions.
71 changes: 44 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4397,20 +4397,38 @@ echo 'Response: ' . print_r($response, true) . PHP_EOL;

These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio.

Use of these APIs requires partner scoped API credentials
with special roles and permissions that may require a special arrangement with BlockChyp.
Most of the APIs below are for portfolio reporting and range from basic partner commission statements
to individual statements with all underlying card brand data.

We also provide a pricing policy API that enables partners to pull down the current pricing rules
in force for any merchant in their portfolio.

<aside class="info">
<b>Currency Data</b>
<p>
All partner APIs return currency and percentage values in two formats: floating point and formatted strings.
</p>
<p>
It's recommended that all developers use the formatted string as this will ensure the most precise values.
Floating point numbers are usually not appropriate for currency or fixed point decimal numbers as
the underlying binary encoding can lead to errors in precision. We provide floating point values
only as a convenience for developers want to save development time and can live with approximated
values in their use case.
</p>
</aside>

#### Partner Statements


#### Retrieve Pricing Policy



* **API Credential Types:** Partner
* **Required Role:** Partner API Access

The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters can filter statements to a specific date range.
The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and `merchantId` is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the `id` parameter.



Expand All @@ -4435,29 +4453,27 @@ $request = [
];


$response = BlockChyp::partnerStatements($request);
$response = BlockChyp::pricingPolicy($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;

```

#### Merchant Invoices
#### Partner Statements



* **API Credential Types:** Partner or Merchant
* **Required Role:** Partner API Access or Merchant API
* **API Credential Types:** Partner
* **Required Role:** Partner API Access

The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters can filter statements to a specific date range.






```php
<?php

Expand All @@ -4478,22 +4494,25 @@ $request = [
];


$response = BlockChyp::merchantInvoices($request);
$response = BlockChyp::partnerStatements($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;

```

#### Merchant Invoice Detail
#### Merchant Invoices



* **API Credential Types:** Partner
* **Required Role:** Partner API Access
* **API Credential Types:** Partner or Merchant
* **Required Role:** Partner API Access or Merchant API

The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters can filter statements to a specific date range.


The API returns detailed information about a specific merchant statement.



Expand All @@ -4518,24 +4537,22 @@ $request = [
];


$response = BlockChyp::merchantInvoiceDetail($request);
$response = BlockChyp::merchantInvoices($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;

```

#### Partner Statement Detail
#### Merchant Invoice Detail



* **API Credential Types:** Partner
* **Required Role:** Partner API Access

The API returns detailed information about a specific partner statement. The optional `includeMerchantStatement` and
`includeInterchange` parameters can be used to return low level detail about how the
residuals or commissions were computed.
The API returns detailed information about a specific merchant statement.



Expand All @@ -4560,24 +4577,24 @@ $request = [
];


$response = BlockChyp::partnerStatementDetail($request);
$response = BlockChyp::merchantInvoiceDetail($request);


// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;

```

#### Retrieve Pricing Policy
#### Partner Statement Detail



* **API Credential Types:** Partner
* **Required Role:** Partner API Access

The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and `merchantId` is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the `id` parameter.
The API returns detailed information about a specific partner statement. The optional `includeMerchantStatement` and
`includeInterchange` parameters can be used to return low level detail about how the
residuals or commissions were computed.



Expand All @@ -4602,7 +4619,7 @@ $request = [
];


$response = BlockChyp::pricingPolicy($request);
$response = BlockChyp::partnerStatementDetail($request);


// View the result
Expand Down
26 changes: 13 additions & 13 deletions lib/BlockChyp.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,19 @@ public static function transactionHistory($request)
{
return self::gatewayRequest('POST', '/api/tx-history', $request);
}
/**
* Returns pricing policy for a merchant.
*
* @param array $request The request body.
*
* @throws \BlockChyp\Exception\ConnectionException if the connection fails.
*
* @return array The API response.
*/
public static function pricingPolicy($request)
{
return self::gatewayRequest('POST', '/api/read-pricing-policy', $request);
}
/**
* Returns a list of partner statements.
*
Expand Down Expand Up @@ -567,19 +580,6 @@ public static function partnerStatementDetail($request)
{
return self::gatewayRequest('POST', '/api/partner-statement-detail', $request);
}
/**
* Returns pricing policy for a merchant.
*
* @param array $request The request body.
*
* @throws \BlockChyp\Exception\ConnectionException if the connection fails.
*
* @return array The API response.
*/
public static function pricingPolicy($request)
{
return self::gatewayRequest('POST', '/api/read-pricing-policy', $request);
}
/**
* Returns low level details for how partner commissions were calculated for a
* specific merchant statement.
Expand Down

0 comments on commit 61d393b

Please sign in to comment.