Skip to content

Latest commit

 

History

History
135 lines (92 loc) · 4.02 KB

File metadata and controls

135 lines (92 loc) · 4.02 KB

WhatsAPI\BusinessManagementApi

All URIs are relative to /api, except if the operation defines another base path.

Method HTTP request Description
fetchCatlog() GET /instances/{instance_key}/business/catalog Fetches the catlog.
sendPaymentRequest() POST /instances/{instance_key}/business/payment-request Send a payment request.

fetchCatlog()

fetchCatlog($instance_key): \WhatsAPI\models\APIResponse

Fetches the catlog.

Gets list of all products registered by you.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new WhatsAPI\Api\BusinessManagementApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$instance_key = 'instance_key_example'; // string | Instance key

try {
    $result = $apiInstance->fetchCatlog($instance_key);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BusinessManagementApi->fetchCatlog: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
instance_key string Instance key

Return type

\WhatsAPI\models\APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: */*

[Back to top] [Back to API list] [Back to Model list] [Back to README]

sendPaymentRequest()

sendPaymentRequest($instance_key, $data): \WhatsAPI\models\APIResponse

Send a payment request.

Sends an payment request to a user. Feature is still in beta.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: ApiKeyAuth
$config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhatsAPI\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new WhatsAPI\Api\BusinessManagementApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$instance_key = 'instance_key_example'; // string | Instance key
$data = new \WhatsAPI\models\PaymentRequestPayload(); // \WhatsAPI\models\PaymentRequestPayload | Data

try {
    $result = $apiInstance->sendPaymentRequest($instance_key, $data);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BusinessManagementApi->sendPaymentRequest: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
instance_key string Instance key
data \WhatsAPI\models\PaymentRequestPayload Data

Return type

\WhatsAPI\models\APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: */*

[Back to top] [Back to API list] [Back to Model list] [Back to README]