Skip to content

Latest commit

 

History

History
114 lines (76 loc) · 2.95 KB

BusinessManagementApi.md

File metadata and controls

114 lines (76 loc) · 2.95 KB

WhatsApi.BusinessManagementApi

All URIs are relative to /api

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

APIResponse fetchCatlog(instanceKey)

Fetches the catlog.

Gets list of all products registered by you.

Example

import WhatsApi from 'WhatsAPI';
let defaultClient = WhatsApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new WhatsApi.BusinessManagementApi();
let instanceKey = "instanceKey_example"; // String | Instance key
apiInstance.fetchCatlog(instanceKey, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
instanceKey String Instance key

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

sendPaymentRequest

APIResponse sendPaymentRequest(instanceKey, data)

Send a payment request.

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

Example

import WhatsApi from 'WhatsAPI';
let defaultClient = WhatsApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new WhatsApi.BusinessManagementApi();
let instanceKey = "instanceKey_example"; // String | Instance key
let data = new WhatsApi.PaymentRequestPayload(); // PaymentRequestPayload | Data
apiInstance.sendPaymentRequest(instanceKey, data, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
instanceKey String Instance key
data PaymentRequestPayload Data

Return type

APIResponse

Authorization

ApiKeyAuth

HTTP request headers

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