NAV Navbar
json javascript php


Introduction

The API documentation will provide the information required for a Business to be able to integrate with the PumaPay Platform payment service. This documentation will cover how a business can onboard with PumaPay, generate an API key, retrieve and implement our APIs, display transaction, create and retrieve Payment Models.

PullPayment Protocol

PumaPay delivers the PullPayment protocol which utilizes a unique architecture of a smart contracts. At its essence, the PullPayment protocol allows the merchant to connect to the customer’s wallet and ‘pull’ the funds based on a set of predefined terms that were pre-approved by the customer.

PumaPay’s PullPayment protocol enables various payment scenarios, including, for example, subscriptions, top-up, pay-per-time/usage and dynamic Payment Models which were impossible on the blockchain before. So, what we have done is we have created a comprehensive system where our crypto billing can be used by both businesses and individuals.

PullPayment

The Business can onboard with the PumaPay and start offering the easy solution for the customers which only requires to scan the QR code in order to purchase the product or subscription (the recurrence of payments for the subscription will be carried automatically on a regular predefined basis without the needs of the customers' interaction).

On PumaPays' Platform such type of payment over the blockchain is called the PullPayment.

The PullPayment execution is based on the Payment Model, created by the Business, and it determines the parameters of the payment; for example: whether the payment will be recurring (subscription), if it will have a trial period, what is the amount that the customer needs to pay, how often the payments will be made, etc.)

Every time a customer executes a payment with the PumaPay payment solution a new PullPayment will be generated with a unique PullPayment ID and will have the relative information of the Payment Model and payment information.

Payment Models

Our Payment Models have been created to offer a variety of payments in different payment situations making it easy, fast and very convenient for both businesses and customers to deal with everyday payments and use cryptocurrencies while doing so.

Currently there are the 8 Payment Model variations, each configurable to reflect different payment type:

Single PullPayment

Accept a one-time payment from your customers.

e.g.: One-time payment of $5.00

Subscription PullPayment

Create a recurring Payment Model to charge customers a fixed amount at a predefined interval. Recurring Payment Model can have trial period.

e.g.: Monthly subscription of $12.99/month

Subscription PullPayment with Initial Payment

Create a recurring Payment Model to charge customers a fixed amount at a predefined interval, there is also an initial charge for a predefined period of time before the subscription begins.

e.g.: Initial charge of $2.99 for 3 days + Monthly subscription of $12.99/month

Subscription PullPayment with Initial Payment and Trial Period

Create a recurring Payment Model with trial period and the charge of a fixed amount at a predefined interval before the subscription begins.

e.g.: Free trial for 1 day, an initial charge of $2.99 for 3 days + monthly subscription of $12.99/month

Subscription PullPayment with Initial Payment and Trial Period

Create a recurring Payment Model with trial period and initial charge before the actual sucsrciption starts.

e.g.: Free trial for 7 days + 12 month subscription for $9.99 a month

Dynamic PullPayment

The dynamic PullPayment allow to dynamically inject the parameters into the QR code before it is generated, allowing to set it up per each individual case and need.

e.g.: A utility bill with fluctuating amount

Top Up PullPayment

Allows to define the bottom limit and max amount for which the customers account will be topped up when the below limit is reached. Useful for pay per minute or pay per usage services.

e.g.: Pay per minute video subscription website

Wallets

Treasury Wallet

It's your personal ERC20 compatible wallet which you assign to accept the funds from your customer for all of the purchases. To assign a wallet to be a treasury wallet the unique wallet address is required. Example of a wallet address is "0xD808D22F4f8b418faA3c4cC2D941eFCe8cB99". In case if you don't have an ERC20 compatible wallet, you can easily create one with PumaPay Mobile Wallet app, available from the App and Play Stores.

Gas Wallet

Gas wallet is generated for you automatically, but you need to top it up with some Ethereum (ETH) in order to cover your customers transactions costs (or gas fees). Once the balance in the Gas wallet is getting low, you will receive the notification to your registered e-mail address.

Onboarding

For a business to use the PumaPay solution it is required to provide business information and go through our KYB procedure protocol.

The onboarding can be easily done through PumaPay Business Console.

Business Console link: https://console.pumapay.io/login

In case if you need any help, contact our business department via email and they will walk you through the process.

To reach our business department, please contact us

API Documentation

All of the calls require the API-key (pma-api-key) in order for the business to be authorized by our servers. In the case of a loss or leak the key can be re-generated.

API Calls Endpoint

PSP Backend: https://psp-backend.pumapay.io

Enumerations

Required variables identified by the system

Payment Model Statuses

Value Description Variable Type
PND
      Pending Payment Model
String
APR
      Approved Payment Model
String
REJ
      Rejected Payment Model
String
SUP
      Suspended Payment Model
String

Payment Model Types

Value Description Variable Type
typeID
      The type of Payment Model
Integer
typeID Value       Description Variable Type
2
      Single PullPayment
Integer
  Single PullPayment - Accept a one-time payment from your customers.

Example: One-time payment of $5.00
 
3
      Subscription PullPayment
Integer
  A recurring payment model to charge customers a fixed amount at a predefined interval of time.

Example: Monthly subscription for a fixed amount of $12.99
 
4
      Subscription PullPayment with Initial
Integer
  A recurring payment model to charge customers a fixed amount at a predefined interval of time with one-time initial charge.

Example: Subscription payment with a single initial payment of $3.99 for 3-days and then monthly subscription for a fixed amount of $12.99
 
5
      Subscription PullPayment with Trial Period
Integer
  A recurring payment model to charge customers a fixed amount at a predefined interval of time with free trial of specified duration.

Example: Subscription payment with a free trial for 14 days and then monthly subscription for a fixed amount of $12.99
 
6
      Subscription PullPayment with Initial + Trial Period
Integer
  The payment model has free trial and then an initial charge before the recurring payment starts.

Example: paid streaming, 3 minutes trial, then rebill for $1 for 3 days and then $20.99 every month
 
7
      Dynamic PullPayment
Integer
  The amount to be settled is varied at every billing cycle.

Example: a utility bill which has fluctuating amount every month
 
8
      Top Up PullPayment
Integer
  Authorises the business to recharge when necessary when the internal balance of the client has dropped to the threshold.

Example: pay per minute/usage subscription service which tops up automatically for $10 every time when balance falls below $3
 

Networks

Value Description Variable Type
1
      Ethereum Mainnet
Integer
3
      Ropsten Testnet
Integer

PullPayment Statuses

Value Description Variable Type
1
      initial
Integer
2
      running
Integer
3
      stopped
Integer
4
      cancelled
Integer
5
      done
Integer
6
      processing
Integer
7
      failed
Integer

Transaction Statuses

Value Description Variable Type
1
      pending
Integer
2
      failed
Integer
3
      success
Integer

Transaction Types

Value Description Variable Type
1
      register
Integer
2
      initial
Integer
3
      execute
Integer
4
      cancel
Integer
5
      register_and_execute
Integer

Response Codes

The PumaPay APIs have the following possible response codes:

Response Code Meaning
200 Success -- Successful and valid response from the server.
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Invalid API key.
403 Forbidden -- The API requested is hidden for administrators only.
404 Not Found -- The specified request could not be found.
405 Method Not Allowed -- You tried to access an API with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The API requested has been removed from our servers.
429 Too Many Requests -- Too many requests
500 Internal Server Error -- There was a problem with the server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Glossary

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform is generated once you successfully onboard with PumaPay. The pma-api-key can be regenerated if needed (String)

x-access-token: is used as an authorization parameter to generate and retrieve the pmaApiKey. the xAccessToken (x-access-token) is generated on login to the Business Console after the successful onboarding

Product: is the representation of the product or service that is offered to the customers and is used as the category holder for the Payment Models created for that service or product.

PaymentModel is the Payment Model used to define the payment type, amount, specifications and recurrence and embed this data into the QR code or button snippet

Standalone Business is the business/merchant who has onboarded with PumaPay, but acts on its own without PSP acting as its parent and doesn't have any sub-businesses registered with it

PSP Business/Organization providing services for other businesses or acting as the business aggregator

Sub-Business a Business which is registered under the PSP/another platform which uses PumaPay Platform as the processor

businessID: The unique ID assigned to any Business on the platform (registered Merchant/PSP ID). The businessID is required for most of the API calls to differentiate among the businesses in the system. The businessID is used in the majority of the API calls to differentiate on whose behalf the actions are taken. In the case of the PSP, with extended APIs, the PSP can perform actions on behalf of their Sub-Businesses, which is especially useful if the Sub-Business uses PSPs software/tools and connects through their platform (String)

Unix timestamp: Integer value representing Unix time in seconds starting at the Unix Epoch on January 1st, 1970 at UTC




GENERAL APIs

General APIs are the Web Service APIs offered by PumaPay which can be used by all of the entities on the Platform:
Standalone Businesses, PSPs and Sub-Businesses.

API-Keys

The API-Key is the unique autogenerated key which give you the authorization on the platform and allowing to perform actions on behalf of your (or another in case of the PSP) business

   Generate API Key

api/v2/console-auth/api-keys/generate/{businessID}

Method: GET

Description:

function generateApiKey(hostUrl, xAccessToken, businessID)
{
    URL = host_url + "api/v2/console-auth/api-keys/generate/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function generateApiKey($hostUrl, $pmaApiKey, $business_id)
  {
      $url = "$host_url/api/v2/console-auth/api-keys/generate/$business_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": "unique generated API key", 
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": "unique generated API key"
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": "unique generated API key"
}

Generates the PumaPay API Key. It is used to authorize all the actions on the PumaPay APIs. Only businesses that have been registered/onboarded through PumaPay will retrieve their valid businessID and generated API Key.

Header Parameters

x-access-token: the generated token will be used for the session validation,

Query Parameters

businessID: The unique ID which is assigned for the PSP. The businessID is required for a majority of the API calls. (String)

   Retrieve API Key

api/v2/console-auth/api-keys/{businessID}

Method:GET

Description

function retrieveApiKey(hostUrl, xAccessToken, businessPostbackID, businessID)
{
    URL = host_url + "api/v2/console-auth/api-keys/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("x-access-token", xAccessToken);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveApiKey($hostUrl, $xAccessToken, $business_id, $busines_postback_id)
  {
      $url = "$host_url/api/v2/console-auth/api-keys/$business_id";

      $request_headers = array();
      $request_headers[] = "x-access-token: " . $xAccessToken;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved Api Key", 
    "data": "unique generated API key" 
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved Api Key", 
    "data": "unique generated API key" 
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved Api Key", 
    "data": "unique generated API key" 
}

Once the API key has been generated, you can retrieve it from the "developers' tools" area of your Business Console account.

Header Parameters

x-access-token: the token generated at a login to Business Console or registration with our backend. And its value will be used for the session validation. The xAccessTokens value changes after every new login/authorization.

Query Parameters

businessID: your unique business ID in the system,

Business Data

Business APIs allow you to interact with the business data.

Please note that in case of the PSP, the PSP can retrieve business data for own business, as well as for all of the registered sub-businesses

   Retrieve Business

api/v2/api-key-auth/business/{businessID}

Method: GET

Description

function retrieveBusiness(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "api/v2/api-key-auth/business/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveBusiness($hostUrl, $pmaApiKey, $business_id)
  {
      $url = "$host_url/api/v2/api-key-auth/business/$business_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business details.",
    "data": {
            "businessID": "your unique autogenerated business ID (String)",
            "companyName": "name of your company",
            "businessName": "your business name",
            "businessType": "business type/category",
            "description": "description of your business/services",
            "kycTierID": "what KYC tier you have passed",
            "countryID": "the country of your business",
            "state": "state/area",
            "city": "city",
            "zipCode": "ZIP code",
            "streetAddress1": "business address line 1",
            "streetAddress2": "business address line 2",
            "gasWallet": "the wallet address assigned to you to store ETH for the gas",
            "gasWalletIndex": "index of the gas wallet on the platform",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1",
            "industry2": "your business industry 2",
            "url": "link to your business website",
            "registrationDate": "date when the business was registered",
            "updateDate": "date when the business details were updated"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business details.",
    "data": {
            "businessID": "your unique autogenerated business ID (String)",
            "companyName": "name of your company",
            "businessName": "your business name",
            "businessType": "business type/category",
            "description": "description of your business/services",
            "kycTierID": "what KYC tier you have passed",
            "countryID": "the country of your business",
            "state": "state/area",
            "city": "city",
            "zipCode": "ZIP code",
            "streetAddress1": "business address line 1",
            "streetAddress2": "business address line 2",
            "gasWallet": "the wallet address assigned to you to store ETH for the gas",
            "gasWalletIndex": "index of the gas wallet on the platform",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1",
            "industry2": "your business industry 2",
            "url": "link to your business website",
            "registrationDate": "date when the business was registered",
            "updateDate": "date when the business details were updated"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business details.",
    "data": {
            "businessID": "your unique autogenerated business ID (String)",
            "companyName": "name of your company",
            "businessName": "your business name",
            "businessType": "business type/category",
            "description": "description of your business/services",
            "kycTierID": "what KYC tier you have passed",
            "countryID": "the country of your business",
            "state": "state/area",
            "city": "city",
            "zipCode": "ZIP code",
            "streetAddress1": "business address line 1",
            "streetAddress2": "business address line 2",
            "gasWallet": "the wallet address assigned to you to store ETH for the gas",
            "gasWalletIndex": "index of the gas wallet on the platform",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1",
            "industry2": "your business industry 2",
            "url": "link to your business website",
            "registrationDate": "date when the business was registered",
            "updateDate": "date when the business details were updated"
    }
}

Retrieve your business registration and status details.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: your unique business ID (String)

   Retrieve Business Status

api/v2/api-key-auth/business-control/status/{businessID}

Method:GET

Description

function retrievePSPStatus(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "api/v2/api-key-auth/business-control/status/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrievePSPStatus($hostUrl, $pmaApiKey, $business_id, $busines_postback_id)
{
    $url = "$host_url/api/v2/api-key-auth/business-control/status/$business_id";

    $request_headers = array();
    $request_headers[] = "pma-api-key: " . $pmaApiKey;
    $request_headers[] = "Content-Type: application/json";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_GET, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $result_json = curl_exec($curl);
    curl_close($curl);

    $result_array = json_decode($result_json, $assoc = true);

    return $result_array;
}
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business control.",
    "data": {
        "businessID": "your unique autogenerated business ID (String)",
        "businessDetailsSubmitted": "true/false (Boolean)",
        "businessDetailsApproved": "true/false (Boolean)",
        "kycSubmitted": "true/false (Boolean)",
        "kycApproved": "true/false (Boolean)",
        "kycRequested": "true/false (Boolean)",
        "kycRejected": "true/false (Boolean)",
        "treasuryWalletAddressSubmitted": "true/false (Boolean)",
        "treasuryWalletAddressApproved": "true/false (Boolean)",
        "prideAccessRequested": "true/false (Boolean)",
        "prideAccessApproved": "true/false (Boolean)",
        "gasWalletAssigned": "true/false (Boolean)",
        "businessKycFlowCompleted": "true/false (Boolean)",
        "onBoardingCompleted": "true/false (Boolean)",
        "status": "status of the business in the system",
        "updatedStatusAt": "null",
        "isTrusted": "true/false (Boolean)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business control.",
    "data": {
        "businessID": "your unique autogenerated business ID (String)",
        "businessDetailsSubmitted": "true/false (Boolean)",
        "businessDetailsApproved": "true/false (Boolean)",
        "kycSubmitted": "true/false (Boolean)",
        "kycApproved": "true/false (Boolean)",
        "kycRequested": "true/false (Boolean)",
        "kycRejected": "true/false (Boolean)",
        "treasuryWalletAddressSubmitted": "true/false (Boolean)",
        "treasuryWalletAddressApproved": "true/false (Boolean)",
        "prideAccessRequested": "true/false (Boolean)",
        "prideAccessApproved": "true/false (Boolean)",
        "gasWalletAssigned": "true/false (Boolean)",
        "businessKycFlowCompleted": "true/false (Boolean)",
        "onBoardingCompleted": "true/false (Boolean)",
        "status": "status of the business in the system",
        "updatedStatusAt": "null",
        "isTrusted": "true/false (Boolean)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved business control.",
    "data": {
        "businessID": "your unique autogenerated business ID (String)",
        "businessDetailsSubmitted": "true/false (Boolean)",
        "businessDetailsApproved": "true/false (Boolean)",
        "kycSubmitted": "true/false (Boolean)",
        "kycApproved": "true/false (Boolean)",
        "kycRequested": "true/false (Boolean)",
        "kycRejected": "true/false (Boolean)",
        "treasuryWalletAddressSubmitted": "true/false (Boolean)",
        "treasuryWalletAddressApproved": "true/false (Boolean)",
        "prideAccessRequested": "true/false (Boolean)",
        "prideAccessApproved": "true/false (Boolean)",
        "gasWalletAssigned": "true/false (Boolean)",
        "businessKycFlowCompleted": "true/false (Boolean)",
        "onBoardingCompleted": "true/false (Boolean)",
        "status": "status of the business in the system",
        "updatedStatusAt": "null",
        "isTrusted": "true/false (Boolean)"
    }
}

Retrieves the status of the business in the system. Retrieved data reflects the Business, Wallet and KYC statuses.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: your unique business ID (String),

   Retrieve Business Details

api/v2/api-key-auth/business/business-details/{businessID}

Method: GET

Description

function retrieveBusinessDetails(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "api/v2/api-key-auth/business/business-details/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveBusinessDetails($hostUrl, $pmaApiKey, $business_id)
  {
      $url = "$host_url/api/v2/api-key-auth/business/business-details/$business_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved the business details.", 
    "data": { 
            "businessID": "your unique autogenerated business ID (String)",
            "businessName": "your business name (String)", 
            "businessType": "business type/category (Integer)", 
            "description": "description of your business/services (String)", 
            "kycTierID": "what KYC tier you have passed (String)", 
            "countryID": "the country of your business (String)", 
            "state": "state/area (String)", 
            "city": "city (String)", 
            "zipCode": "ZIP code (String)", 
            "streetAddress1": "business address line 1 (String)", 
            "streetAddress2": "business address line 2 (String)",
            "gasWallet": "your Ethereum wallet (String)", 
            "gasWalletIndex": "the index of your Ethereum wallet address in your HD wallet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1 (String)", 
            "industry2": "your business industry 2 (String)", 
            "url": "link to your business website (String)", 
            "registrationDate": "date when the business was registered (String)", 
            "updateDate": "date when the business details were updated (String)", 
            "firstName": "Owners first name (String)", 
            "lastName": "Owners last name (String)", 
            "phoneNumber": "contact phone number (String)", 
            "jobTitle": "owners job title (String)", 
            "countries": [ 
                    { 
                         "countryID": "country ID from the countries list (String)", 
                         "countryName": "country name (String)" 
                    },  
                      . . . 
            ], 
            "industries": [ 
                    { 
                         "id": "autogenerated industry id as category", 
                         "industryName": "industry name (String)" 
                    },  
                      . . . 
            ], 
            "businessTypes": [ 
                    { 
                         "id": "id of the business category from the list (Integer)", 
                         "businessType": "type of the business from the list (String)" 
                    }, 
                      . . . 
            ]
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved the business details.", 
    "data": { 
            "businessID": "your unique autogenerated business ID (String)",
            "businessName": "your business name (String)", 
            "businessType": "business type/category (Integer)", 
            "description": "description of your business/services (String)", 
            "kycTierID": "what KYC tier you have passed (String)", 
            "countryID": "the country of your business (String)", 
            "state": "state/area (String)", 
            "city": "city (String)", 
            "zipCode": "ZIP code (String)", 
            "streetAddress1": "business address line 1 (String)", 
            "streetAddress2": "business address line 2 (String)",
            "gasWallet": "your Ethereum wallet (String)", 
            "gasWalletIndex": "the index of your Ethereum wallet address in your HD wallet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1 (String)", 
            "industry2": "your business industry 2 (String)", 
            "url": "link to your business website (String)", 
            "registrationDate": "date when the business was registered (String)", 
            "updateDate": "date when the business details were updated (String)", 
            "firstName": "Owners first name (String)", 
            "lastName": "Owners last name (String)", 
            "phoneNumber": "contact phone number (String)", 
            "jobTitle": "owners job title (String)", 
            "countries": [ 
                    { 
                         "countryID": "country ID from the countries list (String)", 
                         "countryName": "country name (String)" 
                    },  
                      . . . 
            ], 
            "industries": [ 
                    { 
                         "id": "autogenerated industry id as category", 
                         "industryName": "industry name (String)" 
                    },  
                      . . . 
            ], 
            "businessTypes": [ 
                    { 
                         "id": "id of the business category from the list (Integer)", 
                         "businessType": "type of the business from the list (String)" 
                    }, 
                      . . . 
            ]
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved the business details.", 
    "data": { 
            "businessID": "your unique autogenerated business ID (String)",
            "businessName": "your business name (String)", 
            "businessType": "business type/category (Integer)", 
            "description": "description of your business/services (String)", 
            "kycTierID": "what KYC tier you have passed (String)", 
            "countryID": "the country of your business (String)", 
            "state": "state/area (String)", 
            "city": "city (String)", 
            "zipCode": "ZIP code (String)", 
            "streetAddress1": "business address line 1 (String)", 
            "streetAddress2": "business address line 2 (String)",
            "gasWallet": "your Ethereum wallet (String)", 
            "gasWalletIndex": "the index of your Ethereum wallet address in your HD wallet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "industry1": "your business industry 1 (String)", 
            "industry2": "your business industry 2 (String)", 
            "url": "link to your business website (String)", 
            "registrationDate": "date when the business was registered (String)", 
            "updateDate": "date when the business details were updated (String)", 
            "firstName": "Owners first name (String)", 
            "lastName": "Owners last name (String)", 
            "phoneNumber": "contact phone number (String)", 
            "jobTitle": "owners job title (String)", 
            "countries": [ 
                    { 
                         "countryID": "country ID from the countries list (String)", 
                         "countryName": "country name (String)" 
                    },  
                      . . . 
            ], 
            "industries": [ 
                    { 
                         "id": "autogenerated industry id as category", 
                         "industryName": "industry name (String)" 
                    },  
                      . . . 
            ], 
            "businessTypes": [ 
                    { 
                         "id": "id of the business category from the list (Integer)", 
                         "businessType": "type of the business from the list (String)" 
                    }, 
                      . . . 
            ]
}

Retrieve your business details with your unique autogenerated businessID.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: your unique business ID (String)

Wallets

On the PumaPay Platform there are 2 wallets you will need to use, the Treasury wallet, which stores all of you PMAs received from the customers payments, and Gas wallet, which is used to cover the customers gas fees for the transactions.

You will need to assign the Treasury wallet, by adding your own ERC20 compatible wallet, and the Gas wallet will be autogenerated for you, but you will need to top it up with Ethereum (ETH).

In case if you don't have an ERC20 compatible wallet to assign to your Treasury, you can easily create one with PumaPay Mobile Wallet app, available from the Play and App Stores.

   Assigning the Treasury Wallet

api-key-auth/treasury-wallet

Method: POST


Body of the request
{
   “treasuryWallet”: “add your wallet address here”,
   “businessID”: “uniquely generated ID of your business”
}
Body of the request
{
   treasuryWallet: add your wallet address here,
   businessID: uniquely generated ID of your business
}
Body of the request
{
   “treasuryWallet”: “add your wallet address here”,
   “businessID”: “uniquely generated ID of your business”
}

   Confirming the Treasury Wallet

After the Treasury wallet has been added, you can confirm if it's being assigned successfully

api/v2/api-key-auth/treasury-wallet/confirm


Body of the request
{
   “businessID”: “ID of the business the wallet is added for”,
   “userID”: “your user ID” 
}
Body of the request
{
   businessID: ID of the business the wallet is added for,
   userID: your user ID 
}
Body of the request
{
   “businessID”: “ID of the business the wallet is added for”,
   “userID”: “your user ID” 
}

Products

Products APIs allow you to create/edit/delete Products which are used to store Payment Models for your products/services.

Please note, as the PSP you are able to use Product APIs on behalf of your Merchants as their parent.

   Retrieve Product Categories

api/v2/api-key-auth/product-categories/{businessID}

Description

Based on your business category, retrieves the product categories related to industry you are registered as.

{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerated ID of the category (Integer)",
           "industryID": "unique industry ID of the PSP (Integer)",
           "categoryName": "category name for the Product (String)",
       },
       . . .
   ]
}
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerated ID of the category (Integer)",
           "industryID": "unique industry ID of the PSP (Integer)",
           "categoryName": "category name for the Product (String)",
       },
       . . .
   ]
}
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerated ID of the category (Integer)",
           "industryID": "unique industry ID of the PSP (Integer)",
           "categoryName": "category name for the Product (String)",
       },
       . . .
   ]
}

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

   Create Product

api/v2/api-key-auth/products/{businessID}

Method:POST

Description

function createProduct(host_url, pmaApiKey, businessID, categoryID, tags, byte64Image, productName, productDescription, productUrl) {
    var ItemJSON;

    ItemJSON = [
                  {
                    "businessID": businessID,
                    "categoryID": categoryID,
                    "tags": ["display tags of the Merchant (array of strings/integers)"]
                    "productName": productName,
                    "productDescription": productDescription,
                    "productUrl": productUrl,
                    "byte64Image": byte64Image
                  }
    ];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "api/v2/api-key-auth/products/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createProduct($host_url, $pma_api_key, $business_id, $category_id, $tags, $byte_64_image, $product_name, $product_description, $product_url)
{
      $post_data = array(
          'categoryID' => $category_id,
          'tags' => $tags,
          'productName' => $product_name,
          'productDescription' => $productDescription,
          'productUrl' => $product_url,
          'byte64Image' => $byte_64_image
      );

      $url = "$host_url/api/v2/api-key-auth/products/$business_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pma_api_key;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request
{
    "pmaApiKey":"your API key",
    "businessID":"your autogenerated business ID",
    "categoryID":"category ID of the Product from the list based on your business type (Integer)", 
    "tags": ["array of display tags for the Product (array of strings/integers)"],  
    "productName":"the name of the Product (String)", 
    "productDescription":"the description of the Product (String)", 
    "productUrl":"url link to the Products' resource (String)",
    "byte64Image":"byte64 encoded image representing the Product"
}
Successful response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerated Product ID (String)",
        "verified": "displays if the Product has been verified/approved, true/false (Boolean)",
        "enabled": "displays if the Product is enabled, true/false (Boolean)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "businessID": "your unique auto generated business ID (String)",
        "categoryID": "category ID of the Product on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)"
    }
}
Successful response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerated Product ID (String)",
        "verified": "displays if the Product has been verified/approved, true/false (Boolean)",
        "enabled": "displays if the Product is enabled, true/false (Boolean)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "businessID": "your unique auto generated business ID (String)",
        "categoryID": "category ID of the Product on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)"
    }
}
Successful response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerated Product ID (String)",
        "verified": "displays if the Product has been verified/approved, true/false (Boolean)",
        "enabled": "displays if the Product is enabled, true/false (Boolean)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "businessID": "your unique auto generated business ID (String)",
        "categoryID": "category ID of the Product on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)"
    }
}

As the PSP you will be able to create a Product for any of your merchants using this API call. A unique autogenerated Product ID is assigned to every new created Product.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: your unique business ID (String),

Body Request Parameters

categoryID: category ID for the Product on the platform (Integer),

tags: Product display tags (array of strings/integers),

byte64Image: byte64encoded Product image (String),

productName: the name of the Product (String),

productDescription: description of the Product (String),

productUrl: url link to the Products' resource (String),

networkID: (1) for the Mainnet, (3) for the testnet (Integer),

   Retrieve Products List

Main Call URL:api/v2/api-key-auth/products/all/{businessID}/{networkID}

Method:GET

Description

function retrieveProductsList(hostUrl, pmaApiKey, businessID, networkID, categoryID=null, currency=null, orderBy=null, orderType=null, page=null, itemsPerPage=null)
{
    // please select one of the calls below
    // default call
    URL = host_url + "api/v2/api-key-auth/products/all/" + businessID + "/" + networkID;

    //call with additional filters, you can specify which filters you may need
    URL = host_url + "api/v2/api-key-auth/products/all/" + businessID + "/" + networkID + "?categoryID=" + categoryID + "&currency=" + currency + "&orderBy=" + orderBy + "&orderType=" + orderType + "&page=" + page + "&itemsPerPage=" + itemsPerPage;


    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveProductsList($host_url, $pma_api_key, $business_id, $network_id, $category_id=NULL, $currency=NULL, $order_by=NULL, $order_type=NULL, $page=NULL, $items_per_page=NULL)
{
      // please select one of the calls below
      // default call
      $url = "$host_url/api/v2/api-key-auth/products/all/$business_id/$network_id";

      //call with additional filters, you can specify which filters you may need
      $URL = $host_url + "api/v2/api-key-auth/products/all/$businessID/$networkID?categoryID=$categoryID&currency=$currency&orderBy=$orderBy&orderType=$orderType&page=$page&itemsPerPage=$itemsPerPage";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved products list.",
    "data": [{
        "productID": "unique autogenerated ID of the Product (String)",
        "businessID": "unique autogenerated ID of your business (String)",
        "categoryID": "selected Product category ID (Integer)",
        "tags": ["array of display tags for the Product (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed for the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    },
    ...
}]
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved products list.",
    "data": [{
        "productID": "unique autogenerated ID of the Product (String)",
        "businessID": "unique autogenerated ID of your business (String)",
        "categoryID": "selected Product category ID (Integer)",
        "tags": ["array of display tags for the Product (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed for the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    },
    ...
}]
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved products list.",
    "data": [{
        "productID": "unique autogenerated ID of the Product (String)",
        "businessID": "unique autogenerated ID of your business (String)",
        "categoryID": "selected Product category ID (Integer)",
        "tags": ["array of display tags for the Product (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed for the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    },
    ...
}]

The call allows you to retrieve the full list of the Products on a specified network for a particular Business. It requires the businessID (the unique autogenerated ID of the business) and networkID (1 is for the Mainnet, 3 is for the Ropsten testnet)

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: your unique autogenerated business ID (String)

networkID: (1) for the Mainnet, (3) for the testnet (Integer)

Additional filters:

main_call_url?categoryID={categoryID}&currency={currency}&verified={verified}&page={page}&itemsPerPage={itemsPerPage}&orderBy={orderBy}&orderType={orderType}

categoryID: Product category ID (Integer)

currency: filter the results by the base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)

verified: displays if the Product has been verified, true/false (Boolean)

Pagination filters:

page: page number based on the number of results (pagination)

itemsPerPage: how many items will be displayed per page in the search results

orderBy: order by filter (example: date, price)

orderType: order by ascending or descending (ASC/DESC)

   Retrieve Single Product

Main Call URL:api/v2/api-key-auth/products/single/{businessID}/{productID}/{networkID}

Method:GET

Description

function retrieveSingleProduct(hostUrl, pmaApiKey, businessID, networkID, currency=null)
{
    // please select one of the calls below
    // default call
    URL = host_url + "api/v2/api-key-auth/products/single/" + businessID + "/" + productID + "/" + networkID;

    //call with additional filters which are not required by default
    URL = host_url + "api/v2/api-key-auth/products/single/" + businessID + "/" + productID + "/" + networkID + "?currency=" + currency;


    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveSingleProduct($host_url, $pma_api_key, $business_id, $network_id, $currency=NULL)
{
    // please select one of the calls below
    // default call
    $url = "$host_url/api/v2/api-key-auth/products/single/$businessID/$productID/$networkID";

    //call with additional filters which are not required by default
    $url = "$host_url/api/v2/api-key-auth/products/single/$businessID/$productID/$networkID?currency=$currency";

    $request_headers = array();
    $request_headers[] = "pma-api-key: " . $pmaApiKey;
    $request_headers[] = "Content-Type: application/json";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_GET, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $result_json = curl_exec($curl);
    curl_close($curl);

    $result_array = json_decode($result_json, $assoc = true);

    return $result_array;
}
body of the request is not required
Sample response
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Product details.",
    "data": {
        "productID": "unique autogenerated ID of the Product on the platform (String)",
        "businessID": "unique autogenerated ID of the business (String)",
        "categoryID": "Product category ID on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed to the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": {
        "productID": "unique autogenerated ID of the Product on the platform (String)",
        "businessID": "unique autogenerated ID of the business (String)",
        "categoryID": "Product category ID on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed to the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": {
        "productID": "unique autogenerated ID of the Product on the platform (String)",
        "businessID": "unique autogenerated ID of the business (String)",
        "categoryID": "Product category ID on the platform (Integer)",
        "tags": ["array of Product display tags (array of strings/integers)"],
        "productName": "the name of the Product (String)",
        "productDescription": "the description of the Product (String)",
        "creationTimestamp": "Unix timestamp, refers to when the Product was created (Integer)",
        "lastUpdateTimestamp": "Unix timestamp, refers to when the Product was updated (Integer)",
        "productUrl": "url link to the Products' resource (String)",
        "imageUrl": "link to the Products' image (logo for example) (String)",
        "verified": "displays if the Product has been verified, true/false (Boolean)",
        "enabled": "displays if the Product record is enabled, true/false (Boolean)",
        "usdTotalEarnings": "value of the amount of the earning converted to USD (String)",
        "eurTotalEarnings": "value of the amount of the earning converted to EUR (String)",
        "jpyTotalEarnings": "value of the amount of the earning converted to JPY (String)",
        "gbpTotalEarnings": "value of the amount of the earning converted to GPB (String)",
        "activeCustomers": "number of the customers subscribed to the Product (String)",
        "numOfBilling": "the total number of the Payment Models the Product has (String)",
        "totalEarnings": "total amount of the earnings for the Product in base fiat currency in cents (Integer)"
    }
}

The call allows to retrieve a single Products' details by its unique autogenerated ProductID.

The required parameters are the businessID (the unique autogenerated ID of the business on the platform), productID and networkID (1 is for the Ethereum Mainnet, 3 is for the Ropsten testnet).

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: the unique business ID (String)

productID: the unique ID of the Product (String)

networkID: (1) for the Mainnet, (3) for the testnet (Integer)

Additional filters:

main_call_url?currency={currency}

currency: filter the results by the base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)

   Update Product

Main Call URL: api/v2/api-key-auth/products/{business_id}/{productID}

Method:PUT

Description

function updateProduct(hostUrl, pmaApiKey, productID, businessID, networkID=null, categoryID=null, productName=null, merchantDescription=null, productUrl=null, tags=null, productUrl=null, byte64Image=null, imageUrl=null)
{
    var ItemJSON;

    ItemJSON = [
                 {
                    "categoryID": categoryID,
                    "tags": ["an", "array", "of", "tags"],
                    "productName": productName,
                    "byte64Image": "NO_IMAGE_CHANGE", // or a variable
                    "productDescription": merchantDescription,
                    "productUrl": productUrl,
                    "networkID": networkID
                  }
    ];

    ItemJSON = Json.stringify(ItemJSON);

    // please select one of the calls below
    // standart call
    URL = host_url + "api/v2/api-key-auth/products/" + businessID + "/" + productID;

    //call with additional filters which are not required by default unless you want to be more specific
    URL = host_url + "api/v2/api-key-auth/products/all/" + businessID + "/" + networkID + "?categoryID=" + categoryID + "&currency=" + currency + "&orderBy=" + orderBy + "&orderType=" + orderType + "&page=" + page + "&itemsPerPage=" + itemsPerPage;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function updateProduct($host_url, $pma_api_key, $product_id, $business_id, $network_id=NULL, $category_id=NULL, $product_name=NULL, $product_description=NULL, $product_url=NULL, $tags=NULL, $product_url=NULL, $byte_64_image=NULL, $image_url=NULL)
{
    $post_data = array(
        'categoryID' => $category_id,
        'tags' => $tags,
        'productName' => $product_name,
        'byte64Image' => "NO_IMAGE_CHANGE", // or a variable
        'productDescription' => $product_description,
        'productUrl' => $product_url,
        'networkID' => $network_id
    );

    $url = "$host_url/api/v2/api-key-auth/products/$business_id/$product_id";

    $request_headers = array();
    $request_headers[] = "pma-api-key: " . $pma_api_key;
    $request_headers[] = "Content-Type: application/json";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_PUT, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $result_json = curl_exec($curl);
    curl_close($curl);

    $result_array = json_decode($result_json, $assoc = true);

    return $result_array;
}
body of the request
{
    "productID": "autogenerated ID of the product (String)",
    "tags": ["array of Products' display tags (array of strings/integers)"],
    "categoryID": "Products category ID on the platform (Integer)",
    "productName": "the name of the Product (String)",
    "byte64Image": "NO_IMAGE_CHANGE", // if you wish to update the image, you can enter the new byte64encoded image code here
    "productDescription": "the description of the Product (String)",
    "productUrl": "url link to the Products' resource (String)",
    "networkID": "ID of the network, 1 for the Ethereum Mainnet, 3 for Ropsten testnet",

}
Sample response
{
    "success": true,
    "status": 200,
    "message": "Successfully updated product.",
    "data": true
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully updated product.",
    "data": true
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully updated product.",
    "data": true
} 

Allows you to update the existing Products' details. Requires the business ID (the unique autogenerated ID on the platform) and the product ID (unique autogenerated ID of the Product).

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: the unique business ID (String)

productID: unique Product ID (String)

productName: the name of the Product (String),

productDescription: description of the Product (String),

tags: Products display tags (array of strings/integers)

byte64Image: byte64encoded Product image (String)

   Delete Product

api/v2/api-key-auth/products/{businessID}/{productID}/hide

Method:PATCH

Description

function deleteProduct(hostUrl, pmaApiKey, businessID, productID)
{
    var ItemJSON;

    ItemJSON = [
                  {
                    "enabled": false,
                  }
    ];

    URL = host_url + "api/v2/api-key-auth/products/" + businessID + "/" + productID + "/hide";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PATCH", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function deleteProduct($host_url, $pma_api_key, $businessID, $product_id)
{
    $post_data = array(
        'enabled' => false
    );

    $url = "$host_url/api/v2/api-key-auth/products/$businessID/$productID/hide";

    $request_headers = array();
    $request_headers[] = "pma-api-key: " . $pmaApiKey;
    $request_headers[] = "Content-Type: application/json";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_PATCH, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $result_json = curl_exec($curl);
    curl_close($curl);

    $result_array = json_decode($result_json, $assoc = true);

    return $result_array;
}
body of the request
{
    "enabled":"displays if the Product is enabled, true/false (Boolean)"
}
Sample response
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully deleted product" 
} 
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully deleted product" 
} 
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully deleted product", 
} 

The call deletes a Product under a given business. The Business ID and the Product ID are required for this.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

"businessID": the unique ID of the business (String)

"productID": the ID of the Product you wish to delete (String)

Payment Models

Payment models are used to define what type of payment is required for you products/services and how it is going to be executed, e.g.: single payment, monthly based subscription, top up payment for pay per time/use services etc.

In order to start creating the Payment Models, you need to create at least one Product to define your product/service and store the Payment Models in it.

   Create Payment Model

/api/v2/api-key-auth/pull-payment-models

Method:POST

Description

function createPaymentModel(hostUrl, pmaApiKey, productID, businessID, title, internalTitle, description, amount, initialPaymentAmount, numberOfPayments, currency, typeID, frequency, destination, networkID, trialPeriod, treasuryWallet)
{
    var ItemJSON;

    ItemJSON = [
                  {
                    "productID": productID,
                    "businessID": businessID,
                    "title": title,
                    "internalTitle": "the internal Merchants title",
                    "description": description,
                    "amount": amount,
                    "initialPaymentAmount": initialPaymentAmount,
                    "numberOfPayments": numberOfPayments,
                    "currency": currency,
                    "typeID": typeID,
                    "frequency": frequency,
                    "networkID": networkID,
                    "destination": "Treasury",
                    "trialPeriod": trialPeriod,
                    "treasuryWallet": treasuryWallet
                  }
    ];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/pull-payment-models/";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createPaymentModel($hostUrl, $pma_api_key, $product_id, $business_id, $title, $internal_title, $description, $amount, $initial_payment_amount, $number_of_payments, $currency, $type_id, $frequency, $network_id, $destination, $trial_period, $treasury_wallet)
{
    $post_data = array(
        "productID" => $product_id,
        "businessID" => $business_id,
        "title" => $title,
        "internalTitle" => $internal_title,
        "description" => $description,
        "amount" => $amount,
        "initialPaymentAmount" => $initial_payment_amount,
        "numberOfPayments" => $number_of_payments,
        "currency" => $currency,
        "typeID" => $type_id,
        "frequency" => $frequency,
        "networkID" => $network_id,
        "destination" => $destination,
        "trialPeriod" => $trial_period,
        "treasuryWallet" => $treasury_wallet
    );

    $url = "$host_url/api/v2/api-key-auth/pull-payment-models/";

    $request_headers = array();
    $request_headers[] = "pma-api-key: " . $pma_api_key;
    $request_headers[] = "Content-Type: application/json";
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    $result_json = curl_exec($curl);
    curl_close($curl);

    $result_array = json_decode($result_json, $assoc = true);

    return $result_array;
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successful Payment Model inserted.",
    "data": {
        "id": "autogenerated ID of the Payment Model (String)",
        "fiatSettlementOptIn": "true/false, defines whether the funds should be settled in fiat through Kemix or in PMAs to the Treasury (Boolean)",
        "productID": "unique ID of the Product (String)",
        "smartContractID": "id of the smart contract the Payment Model will use based on its type (Integer)",
        "title": "title of the Payment Model as the customer sees it (String)",
        "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
        "description": "description of the Payment Model as the customer sees it (String)",
        "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
        "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
        "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
        "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
        "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
        "statusID": "autogenerated status of the Payment Model, please refer to Payment Model Statuses (String)",
        "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
        "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
        "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
        "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
        "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "deletedAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successful Payment Model inserted.",
    "data": {
        "id": "autogenerated ID of the Payment Model (String)",
        "fiatSettlementOptIn": "true/false, defines whether the funds should be settled in fiat through Kemix or in PMAs to the Treasury (Boolean)",
        "productID": "unique ID of the Product (String)",
        "smartContractID": "id of the smart contract the Payment Model will use based on its type (Integer)",
        "title": "title of the Payment Model as the customer sees it (String)",
        "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
        "description": "description of the Payment Model as the customer sees it (String)",
        "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
        "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
        "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
        "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
        "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
        "statusID": "autogenerated status of the Payment Model, please refer to Payment Model Statuses (String)",
        "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
        "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
        "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
        "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
        "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "deletedAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successful Payment Model inserted.",
    "data": {
        "id": "autogenerated ID of the Payment Model (String)",
        "fiatSettlementOptIn": "true/false, defines whether the funds should be settled in fiat through Kemix or in PMAs to the Treasury (Boolean)",
        "productID": "unique ID of the Product (String)",
        "smartContractID": "id of the smart contract the Payment Model will use based on its type (Integer)",
        "title": "title of the Payment Model as the customer sees it (String)",
        "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
        "description": "description of the Payment Model as the customer sees it (String)",
        "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
        "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
        "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
        "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
        "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
        "statusID": "autogenerated status of the Payment Model, please refer to Payment Model Statuses (String)",
        "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
        "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
        "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
        "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
        "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
        "deletedAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
    }
}

with this call you are able to create a Payment Model for any of your Merchants. Payment Models represent merchants Payment Models and types for each of the created Products.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Body Request Parameters

productID: the Product ID (String),

businessID: the unique business ID (String),

title: Payment Model name (String),

description: Payment Model description (String),

amount: payment amount in base currency in cents (String),

initialPaymentAmount: Initial charge of the Payment Model (String),

currency: base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String),

numberOfPayments: number of recurring payment cycles of the Payment Model (Integer),

typeID:

    2 = Single PullPayment,

    3 = Subscription PullPayment,

    4 = Single + Subscription PullPayment,

    5 = Subscription PullPayment with Trial period,

    6 = for Single + Subscription PullPayment type with Trial period,

    7 = Dynamic PullPayment,

    8 = Top Up PullPayment

frequency: how often a recurring payment will be made. Displayed in Unix timestamp in seconds (Integer),

networkID: (1) for the Mainnet, (3) for the testnet (Integer),

trialPeriod: trial period of a Payment Model (Integer),

destination: destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)

In order to create a Payment Model, you need to define the required fields for each specific Payment Model type in a certain way, please see below

   Single PullPayment

Single Payment Model requires exactly one-time payment and is used to buy products or services instantly without subscription or any initial charge.

The required parameters with predefined values for the Single payment model to differentiate from the other payment models are the following:

initialPaymentAmount: has to be 0 as there is no initial payment,

numberOfPayments: has to be 1 as it is a single payment,

trialPeriod: has to be 0 as the Single Payment has no trial period

frequency: 1, // the payment is executed instantly

typeID: 2 // 2 is Single Payment Model

   Recurring (Subscription) PullPayment

Recurring Payment Model is the model for the services with subscription which have a fixed amount charge on a predefined period of time basis .

The required parameters with predefined values for the Subscription payment model to differentiate from the other payment models are the following:

initialPaymentAmount: has to be 0 as there is no initial payment

numberOfPayments: has to be at least 2

trialPeriod: has to be 0 as it's not required for simple subscription with no trial

frequency: value in Unix timestamp, this value is custom

typeID: 3

   Recurring PullPayment with Initial

Recurring with Initial payment model can be used for the subscription services where the customer gets the chance to try the service for a certain period of time for a specified amount before the actual subscription starts (for example, 3 days for $1.99 and then $12.99 a month).

The required parameters with predefined values for the Subscription with Initial payment model to differentiate from the other payment models are the following:

initialPaymentAmount: has to be more than 0 and the amount should be specified in cents of the base chosen currency for that payment model,

numberOfPayments:, has to be at least 2,

trialPeriod: has to be 0 is this model doesn't have a trial period

frequency: value in Unix timestamp, this value is custom,

typeID: 4

   Recurring PullPayment with Trial

Recurring with Trial payment model can be used for the subscription services where the customer gets the chance to try the service for a certain period of time for free before the actual subscription starts (for example, 3 days for free and then $12.99 a month)

The required parameters with predefined values for the Subscription with Trial payment model to differentiate from the other payment models are the following:

initialPaymentAmount: has to be 0 as there is no initial payment,

numberOfPayments: has to be at least 2,

trialPeriod: 0, (is not required for simple subscription without no trial),

frequency: value in Unix timestamp, this value is custom,

typeID: 5

   Recurring PullPayment with Trial and Initial

Recurring with Trial and Initial payment model can be used for the subscription services where the customer gets a free trial for a certain period of time and then an initial payment for one price before on the first period of the subscription (for example, a video streaming service of 3 minutes free trial, then 1 week for $12.99, and then $8.99 a week)

The required parameters with predefined values for the Recurring with Trial and Initial payment model to differentiate from the other payment models are the following:

initialPaymentAmount: has to be more than 0 to specify the initial amount,

numberOfPayments: has to be at least 2,

trialPeriod: value in Unix timestamp, this value is custom specifying the trial period,

frequency: value in Unix timestamp, this value is custom,

typeID: 6

   Dynamic PullPayment

The Dynamic Payment Model is the one which allows the injection of the dynamic values into the smart contract before the QR code is generated and presented to the user. This type of the payment model is suitable for the payments such as utility bills which, in most cases, have fluctuating amount and can not be predefined before the bill is issued.

The required parameters with predefined values for the Dynamic Payment Model to differentiate from the other payment models are the following:

productID”: “autogenerated ID of the product (string)”,

businessID”: “autogenerated ID od the business”,

internalTitle”: “internal title of the payment model for personal reference",

treasuryWallet”: “the ERC20 token wallet address added by you”,

destination: “either Tresury or Kemix”,

typeID: 7,

networkID: 3

All other parameters can be either predefined from the start or defined as null and then injected on your side, at the moment when the QR is generated.

   Top Up PullPayment

With the Top Up Payment Model, you can specify the amount and threshold when the account needs to be topped up if the balance reaches the threshold. It is useful for such services as pay per minute and usage.

The require body parameters for the Top Up payment model are the following:

businessID: autogenerated ID of the business,

paymentID: autogenerated ID of the payment the Top Up will be used for,

topUpThreshold: the minimum threshold in base currency specifying that the account needs to be topped up every time when it has been reached,

topUpThresholdCurrency: the base fiat currency which is used for the payment model,

topUpSuggestedTotalLimit: suggested funding limit defined by you for how much the account will be topped up,

typeID: 8

   Retrieve Payment Models List

Main Call URL:api/v2/api-key-auth/pull-payment-models/all/{businessID}/{networkID}/{productID}

Method:GET

Description

function retrievePaymentModelsList(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "api/v2/api-key-auth/pull-payment-models/all/" + businessID + "/" + networkID + "/" + productID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrievePaymentModelsList($hostUrl, $pmaApiKey, $business_id)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/api-key-auth/pull-payment-models/all/$business_id/$network_id/$product_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Models",
    "data": [
        {
            "id": "autogenerated ID of the Payment Model (String)",
            "productID": "unique ID of the Product (String)",
            "title": "title of the Payment Model as the customer sees it (String)",
            "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
            "description": "description of the Payment Model as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
            "statusName": "refers to the status of the Payment Model (String)",
            "statusCode": "short code for the Payment Model status (String)",
            "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
            "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
        },
        {
             . . .
        }
    ]
}
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Models",
    "data": [
        {
            "id": "autogenerated ID of the Payment Model (String)",
            "productID": "unique ID of the Product (String)",
            "title": "title of the Payment Model as the customer sees it (String)",
            "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
            "description": "description of the Payment Model as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
            "statusName": "refers to the status of the Payment Model (String)",
            "statusCode": "short code for the Payment Model status (String)",
            "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
            "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
        },
        {
             . . .
        }
    ]
}
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Models",
    "data": [
        {
            "id": "autogenerated ID of the Payment Model (String)",
            "productID": "unique ID of the Product (String)",
            "title": "title of the Payment Model as the customer sees it (String)",
            "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
            "description": "description of the Payment Model as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
            "statusName": "refers to the status of the Payment Model (String)",
            "statusCode": "short code for the Payment Model status (String)",
            "networkID": 1 "for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
            "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
        },
        {
             . . .
        }
    ]
}

Retrieve all Payment Models for a single Product on a specific network for a particular Business.

Please note that when creating the Payment Models for testing on the Ropsten testnet (network 3), these Payment Models are not reflected on the Mainnet, and vice-versa.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

networkID: (1) for the Ethereum Mainnet, (3) for the Ropsten testnet (Integer),

businessID: the unique business ID (String),

productID: the autogenerated ID of the Product (String)

Additional Filters:

main_call_url?estimageGas={estimateGas}&currencyEstimateGas={currencyEstimateGas}

estimateGas: whether to estimate the gas for the transaction or not (True/False)

currencyEstimateGas: the gas transaction amount in base currency

Pagination filters:

page: page number based on the number of results (pagination)

ItemsPerPage: how many items will be displayed per page in the search results

orderBy: order by filter (example: date, price)

orderType: order by ascending or descending (ASC/DESC)

   Retrieve Single Payment Model

Main Call URL:api/v2/pull-payment-models/single/{businessID}/{networkID}/{paymentModelID}

Method:GET

Description

function retrieveSinglePaymentModel(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveSinglePaymentModel($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Models",
    "data": {
              "id": "autogenerated ID of the Payment Model (String)",
              "productID": "unique ID of the Product (String)",
              "title": "title of the Payment Model as the customer sees it (String)",
              "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
              "description": "description of the Payment Model as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
              "statusName": "refers to the status of the Payment Model (String)",
              "statusCode": "short code for the Payment Model status (String)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
              "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
              "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
            }
}
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Models",
    "data": {
              "id": "autogenerated ID of the Payment Model (String)",
              "productID": "unique ID of the Product (String)",
              "title": "title of the Payment Model as the customer sees it (String)",
              "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
              "description": "description of the Payment Model as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
              "statusName": "refers to the status of the Payment Model (String)",
              "statusCode": "short code for the Payment Model status (String)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
              "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
              "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
            }
}
Sample Response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved Payment Model",
    "data": {
              "id": "autogenerated ID of the Payment Model (String)",
              "productID": "unique ID of the Product (String)",
              "title": "title of the Payment Model as the customer sees it (String)",
              "internalTitle": "the title of the Payment Model for the internal use which can only be seen through the Console or the APIs (String)",
              "description": "description of the Payment Model as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "typeID": "type of Payment Model, please refer to the Payment Model Types (Integer)",
              "statusName": "refers to the status of the Payment Model (String)",
              "statusCode": "short code for the Payment Model status (String)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
              "estimatedGasResultETH": "estimated transaction cost in ETH (decimal)",
              "estimatedGasResultFial": "estimated transaction cost in fiat (decimal)"
            }
}

Retrieve all Billing (Payment) Models for a single Product on a specified network for a particular Business.

Please note that when creating the Payment Models for testing on the Ropsten testnet (network 3), these Payment Models are not reflected on the Mainnet, and vice-versa.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

networkID: (1) for the Ethereum Mainnet, (3) for the Ropsten testnet (Integer),

businessID: the unique business ID (String),

paymentModelID: ID of the Billing (Payment) Model you wish to retrieve the data for

estimateGas: whether to estimate the gas for the transaction or not (True/False),

currencyEstimateGas: the gas transaction amount in base currency

Additional Filters:

main_call_url?typeID={typeID}&statusCode={statusCode}&currency={currency}&estimateGas={estimateGas}&currencyEstimateGas={currencyEstimateGas}&page={page}&itemsPerPage={itemsPerPage}&orderBy={orderBy}&orderType={orderType}

typeID: (Integer)

    2 = Single PullPayment,

    3 = Subscription PullPayment,

    4 = Single + Subscription PullPayment,

    5 = Subscription PullPayment with Trial period,

    6 = for Single + Subscription PullPayment type with Trial period,

    7 = Dynamic PullPayment,

    8 = Top Up PullPayment

currency: base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String),

statusCode: filter by the status of the Payment Model. "PND" = Pending Payment Model, "APR" = Approved Payment Model, "REJ" = Rejected Payment Model , "SUP" = Suspended Payment Model (String),

PullPayments

Once the customer scans the QR code of the Payment Model, which you provide in order for the customer to buy your product or subscribe to your service, the proper authorization is given and the smart contract gets executed on the blockchain defining the dates and amount of payment(s).

   Retrieve PullPayments List

api/v2/api-key-auth/pull-payments/business/{businessID}

Method:GET

Description

function retrievePullPaymentsList(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrievePullPaymentsList($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved all payments", 
    "data": [
        {
            "id": "autogenerated ID of the PullPayment (String)",
            "title": "title of the PullPayment as the customer sees it (String)",
            "productID": "unique ID of the Product (String)",
            "businessID": "unique ID of the registered Business/Merchant on the platform (String)",
            "description": "description of the PullPayment as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "hdWalletIndex": "index of the wallet on the platform (Integer)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
            "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
            "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
            "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in the PostBack to monitor and differentiate the customers payments (String)",
            "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "deletedAt": "the date when the Payment Model was deleted in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
        },
        . . . 
    ] 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved all payments", 
    "data": [
        {
            "id": "autogenerated ID of the PullPayment (String)",
            "title": "title of the PullPayment as the customer sees it (String)",
            "productID": "unique ID of the Product (String)",
            "businessID": "unique ID of the registered Business/Merchant on the platform (String)",
            "description": "description of the PullPayment as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "hdWalletIndex": "index of the wallet on the platform (Integer)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
            "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
            "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
            "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in the PostBack to monitor and differentiate the customers payments (String)",
            "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "deletedAt": "the date when the Payment Model was deleted in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
        },
        . . . 
    ] 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved all payments", 
    "data": [
        {
            "id": "autogenerated ID of the PullPayment (String)",
            "title": "title of the PullPayment as the customer sees it (String)",
            "productID": "unique ID of the Product (String)",
            "businessID": "unique ID of the registered Business/Merchant on the platform (String)",
            "description": "description of the PullPayment as the customer sees it (String)",
            "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
            "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
            "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "hdWalletIndex": "index of the wallet on the platform (Integer)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
            "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
            "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
            "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
            "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
            "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
            "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in the PostBack to monitor and differentiate the customers payments (String)",
            "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
            "deletedAt": "the date when the Payment Model was deleted in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
        },
        . . . 
    ] 
}

Once a customer executes a payment with the PumaPay payment solution, a new PullPayments will be created, this call will retrieve the list of all existing PullPayments and the details. You are able to filter the data by the Product ID, PullPayment ID, Payment Model ID, Payment Model type and PullPayment status.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: the unique business ID in the system,

Additional filters (optional)

main_call_url?networkID=1&billingModels=[{billingID},{billingID}]&billingTypes=[{typeID}, {typeID}]&products=[{productID},{productID}]&statuses=[{paymentStatusID},{paymentStatusID}]&uniqueReferenceID={customeruniqueReferenceID}&page={page}&itemsPerPage={itemsPerPage}

networkID: (1) for the Mainnet, (3) for the testnet (Integer),

products: filter by Product ID,

billingModels: filter by Payment Model ID,

billingTypes: filter by Payment Model Type ID,

statuses: status of the PullPayment. 1 = "initial", 2 = "running", 3 = "stopped", 4 = "cancelled", 5 = "done", 6 = "processing", 7 = "failed",

uniqueReferenceID: unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)

Pagination filters:

page: page number based on the number of results (pagination),

ItemsPerPage: how many items will be displayed per page in the search results,

   Retrieve a Single PullPayment

api/v2/api-key-auth/pull-payments/{pullPaymentID}

Method:GET

Description

function retrieveSinglePullPayment(hostUrl, pmaApiKey, paymentID)
{
    URL = host_url + "api/v2/pull-payments/" paymentID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveSinglePullPayment($hostUrl, $pma_api_key, $payment_id)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payments/$payment_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved payment", 
    "data": {
              "id": "autogenerated ID of the PullPayment (String)",
              "title": "title of the PullPayment as the customer sees it (String)",
              "productID": "unique ID of the Product (String)",
              "businessID": "unique ID of the PSP on the platform (String)",
              "description": "description of the PullPayment as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "hdWalletIndex": "index of the wallet on the platform (Integer)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
              "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
              "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
              "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
              "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
              "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
              "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "deletedAt": "the date when the Payment Model was deleted in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
            } 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved payment", 
    "data": {
              "id": "autogenerated ID of the PullPayment (String)",
              "title": "title of the PullPayment as the customer sees it (String)",
              "productID": "unique ID of the Product (String)",
              "businessID": "unique ID of the PSP on the platform (String)",
              "description": "description of the PullPayment as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "hdWalletIndex": "index of the wallet on the platform (Integer)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
              "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
              "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
              "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
              "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
              "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
              "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "deletedAt": "the date when the Payment Model was deleted in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
            } 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved payment", 
    "data": {
              "id": "autogenerated ID of the PullPayment (String)",
              "title": "title of the PullPayment as the customer sees it (String)",
              "productID": "unique ID of the Product (String)",
              "businessID": "unique ID of the PSP on the platform (String)",
              "description": "description of the PullPayment as the customer sees it (String)",
              "amount": "the PullPayment amount in cents in base fiat currency (Integer)",
              "initialPaymentAmount": "if there is the initial payment for the Payment Model, it is specified here in cents in base fiat currency (Integer)",
              "trialPeriod": "if there is a trial period, its duration is defined in seconds in Unix timestamp format (Integer)",
              "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
              "hdWalletIndex": "index of the wallet on the platform (Integer)",
              "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)",
              "type": "type of the PullPayment, for more please refer to PullPayment Types (Integer)",
              "status": "status of the PullPayment. 1 = “initial”, 2 = “running”, 3 = “stopped”, 4 = “cancelled”, 5 = “done”, 6 = “processing”, 7 = “failed” (Integer)",
              "networkID": "1 for the Ethereum Mainnet, 3 for Ropsten testnet (Integer)",
              "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
              "lastPaymentDate": "date/time when the last payment has taken place, defined in seconds in Unix timestamp format (String)",
              "startTimestamp": "date/time of the initial payment, defined in seconds in Unix timestamp format (String)",
              "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
              "pullPaymentAddress": "address of the PullPayments smart contract used for the payments execution (String)",
              "treasuryWallet": "main wallet where the funds will be delivered (Treasury option for 'destination') and it's the base index ([0]) wallet of the HD wallet (String)",
              "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
              "updatedAt": "the date when the Payment Model was updated in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "createdAt": "the date when the Payment Model was created in the following format: YYYY-MM-DDTH:m:s6z (String)",
              "deletedAt": "the date when the Payment Model was deleted, in the following format: YYYY-MM-DDTH:m:s6z (String/null)"
            } 
}

Once a customer executes a payment with the PumaPay payment solution, a new PullPayments will be created, this call will retrieve a single existing PullPayment with the unique paymentID and the payments details.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

paymentID: autogenerated ID of the PullPayment (String),

Transactions

Transactions are the funds transfers which come from the PullPayments execution. Transaction APIs allow you to keep the track of the transactions history, success and possible failure states.

   Retrieve All Transactions

api/v2/api-key-auth/transactions/report/all/{businessID}/{networkID}

Method:GET

Description

function retrieveAllTransactions(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveAllTransactions($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved transactions", 
    "data": [ 
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the PSP on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        },
        . . . 
    ] 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved transactions", 
    "data": [ 
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the PSP on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        },
        . . . 
    ] 
}
Sample response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved transactions", 
    "data": [ 
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the PSP on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        },
        . . . 
    ] 
}

Retrieves all of the transactions for a business on a specified network with additional customizable filters.

Requires the businessID and network ID (Ethereum Mainnet (1) and Ropsten testnet (3) used for the testing transactions) for the history of the received payments.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: the unique business ID (String),

networkID: (1) for the Mainnet, (3) for the testnet (Integer),

Additional optional filters:

main_call_url?products=[{productID}, {productID}]&billingModels=[{billingModelID}, {billingModelID}]&transactionStatuses=[{txStatusID},{txStatusID}]&transactionTypes=[{txTypeID},{txTypeID}]&paymentTypes=[{billingModelTypeID},{billingModelTypeID}]&currency={currency}&startTimestamp={startTimestamp}&endTimestamp={endTimestamp}&page={page}&itemsPerPage={itemsPerPage}&uniqueReferenceID={uniqueReferenceID}

products: Filter by a list of Products (String[]),

billingModels: Filter by a list of Payment Models (String[]),

transactionStatuses: filter by Transaction status. 1 = "pending", 2 = "failed", 3 = "success" (Integer[]),

transactionTypes: filter by Transaction types. 1 = " register", 2 = " initial ", 3 = " execute ", 4="cancel", 5="register_and_execute" (Integer[]),

startTimestamp: the start date to filter executed transactions. with "endTimestamp" they form the time range of the payments which happened between the specified dates. Displayed in Unix timestamp (Integer),

endTimestamp: the end date to filter executed transactions. with "startTimestamp" they form the time range of the payments which happened between those dates. Displayed in Unix timestamp (Integer),

uniqueReferenceID: unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String),

currency: base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)

paymentTypes: 2 = for Single PullPayment, 3 = for Subscription PullPayment, 4 = for Single + Subscription PullPayment, 5 = for Subscription PullPayment with Trial period, 6 = for Single + Subscription PullPayment with Trial period, 7 = for Dynamic PullPayment(Integer[])

Pagination filters:

page: page number based on the number of results (pagination),

ItemsPerPage: how many items will be displayed per page in the search results,

   Transactions by PullPaymentID

api/v2/api-key-auth/transactions/pull-payment/{businessID}/{pullpaymentID}

Method:GET

Description

function transactionsByPullPayment(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function transactionsByPullPayment($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury wallet (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury wallet (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury wallet (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}

Retrieve all transactions by PullPaymentID

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

pullpaymentID: PullPayment unique ID,

Additional filters:

statusID: filter by PullPayment status. 1 = "pending", 2 = "failed", 3 = "success" (Integer),

typeID: filter by PullPayment type. 1 = "register", 2 = "initial", 3 = "execute", 4="cancel", 5="register_and_execute" (Integer[]),

Pagination filters:

page: page number based on the number of results (pagination),

ItemsPerPage: how many items will be displayed per page in the search results,

   Single Transaction by Hash

api/v2/api-key-auth/transactions/single/{transactionHash}

Method:GET

Description

function transactionsByHash(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function transactionsByHash($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}

Retrieve all transactions for a PullPayment with the PullPaymentID

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

transactionHash: unique transaction hash on the blockchain (String)

   Transaction Report by Business

api/v2/api-key-auth/transactions/report/all/{business_id}/{network_id}

Method:GET

Description

function transactionReportByBusiness(hostUrl, pmaApiKey, businessID, networkID, paymentModelID, estimateGas=null, currencyEstimateGas=null)
{
    URL = host_url + "api/v2/pull-payment-models/single/" + businessID + "/" + networkID + "/" + paymentModelID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function transactionReportByBusiness($hostUrl, $pma_api_key, $business_id, $estimate_gas=NULL, $currency_estimate_gas=NULL)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/pull-payment-models/single/$business_id/$network_id/$payment_model_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
body of the request is not required
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}
Sample response 
{
    "success": true,
    "status": 200,
    "data": [
        {
            "id": "autogenerated ID of the transaction (String)",
            "paymentID": "autogenerated ID of the PullPayment (String)",
            "billingID": "autogenerated ID of the Payment Model (String)",
            "businessID": "unique ID of the business on the platform (String)",
            "executionDate": "date/time when the transaction was executed, defined in seconds in Unix timestamp format (String)",
            "productName": "the name of the Product (String)",
            "billingName": "the name of the Payment Model (String)",
            "numberOfPayments": "number of recurring payment cycles of the Payment Model (Integer)",
            "customerID": "the same with the uniqueReferenceID used for the postback to uniquely identify the payee (String)",
            "customerAddress": "wallet address of the customer from which the funds are transferred (String)",
            "referenceNo": "unique autogenerated value on the platform (Integer)",
            "txHash": "the transaction hash on the Ethereum blockchain (String)",
            "pmaBalance": "current PMA balance in the Treasury (String)",
            "currency": "base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)",
            "fiatAmount": "the transaction amount in cents in base fiat currency (decimal)",
            "destination": "destination of the funds after payment (Treasury for PMA / Kemix for fiat settlement) (String)",
            "transactionStatus": "status of the transaction. 1 = “pending”, 2 = “failed”, 3 = “success” (Integer)",
            "transactionType": "the type of the transaction. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel”, 5 = ”register_and_execute” (Integer)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (String)",
            "paymentType": "2 = ”Single PullPayment”, 3 = ”Subscription PullPayment”, 4 = ”Single + Subscription PullPayment”, 5 = ”Subscription PullPayment with Trial period”, 6 = ”Single + Subscription PullPayment with Trial period”, 7 = ”Dynamic PullPayment” (Integer[])",
            "nextPaymentDate": "date/time when the next payment will occur, defined in seconds in Unix timestamp format (String)",
            "lastPaymentDate": "date/time when the previous payment has taken place, defined in seconds in Unix timestamp format (String)",
            "frequency": "how often the payment will be executed, defined in seconds in the Unix timestamp format (Integer)"
        }
    ]
}

Retrieve all transactions for a PullPayment with the PullPaymentID.

Please note, if you are a PSP, you are able to retrieve the data for any of your sub-businesses by specifying their businessID

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

pullpaymentID: PullPayment unique ID

Additional filters:

statusID: filter by PullPayment status. 1 = "pending", 2 = "failed", 3 = "success" (Integer)

typeID: filter by PullPayment type. 1 = "register", 2 = "initial", 3 = "execute", 4 = "cancel" (Integer)

Pagination filters:

page: page number based on the number of results (pagination)

ItemsPerPage: how many items will be displayed per page in the search results

Postback URLs

Postback URLs are used by the Merchants to retrieve the transaction data. There is a set of CRUD operations to deal with the postback URLs either through the PumaPay Business Console (read more) or via the API calls.

Also, there are 3 postback control operations allowing to enable or to disable the postback notifications.

There are 5 CRUD operations for the postback APIs and 3 for the postback-control.

API Call Base URL for postbacks: api/v2/api-key-auth/postback

API Call Base URL for postback control: api/v2/api-key-auth/postback-control

   Create Postback URL

This can be done via the Business Console Interface

Create the new postback URL

Method – POST

{
  "businessID": "{{business_id}}",
  "url": "http://merchants_defined_postback_url",
  "authorization": {
    "pma-api-key":"bearer token authorization defined by the merchant or the PSP"
  },
  "environment": "Ropsten" // "Ropsten" or "Mainnet"
}
function createPostbackURL(hostUrl, pmaApiKey, businessID, URL)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "url": url, // merchant defined postback url
                        "authorization": {
                            "pma-api-key": "bearer token authorization defined by the merchant or the PSP"
                        },
                        "environment": environment // "Ropsten" or "Mainnet"
                    }
                }];

    ItemJSON = Json.stringify(ItemJSON);

    //here you need to specify the host and the port of the server you are calling
    //as well as the network 3 for testnet and 1 for Mainnet
    URL = host_url + "/api/v2/api-key-auth/postback";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", "bearer token authorization defined by the merchant or the PSP");
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createPostbackUrl($hostUrl, $pmaApiKey, $businessID, $URL, $network)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/api-key-auth/business/postback";

      $post_data = array(
          'businessID' => $businessID,
          'url' => $URL, // merchant defined postback url 
          'pma-api-key' => $pmaApiKey,
          'environment' => $network // "Ropsten" or "Mainnet"
      );

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . "bearer token authorization defined by the merchant or the PSP";
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
Sample response
{
   "success": true,
   "status": 200,
   "message": "Successfully created postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
  }
Sample response
{
   "success": true,
   "status": 200,
   "message": "Successfully created postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
  }
Sample response
{
   "success": true,
   "status": 200,
   "message": "Successfully created postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}

api/v2/api-key-auth/business/postback

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"url": url of the defined postback

"authorization": bearer token authorization defined by the merchant or the PSP

"environment": Ropsten testnet or Ethereum Mainnet

   Edit Postback URL

This can be done via the Business Console Interface

Edit the existing postback URL

Method – PUT

{
  "id":"{{business_postback_id}}",
  "businessID": "{{business_id}}",
  "url": "http://merchants_postback_url",
  "authorization": {
    "pma-api-key":"bearer token authorization defined by the merchant or the PSP"
  },
  "environment": "network" // testnet or Mainnet (String)
}
function editPostbackURL(hostUrl, pmaApiKey, businessID, postbackID, businessPostbackUrl, URL, network)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "id": postbackID,
                        "businessID": businessID,
                        "id": businessPostbackUrl,
                        "url": URL, // merchant defined postback url
                        "authorization": {
                            "pma-api-key": "bearer token authorization defined by the merchant or the PSP"
                        },
                        "environment": network // 1 or 3 for Mainnet or testnet
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    //here you need to specify the host and the port of the server you are calling
    //as well as the network 3 for testnet and 1 for Mainnet
    URL = host_url + "/api/v2/api-key-auth/business/postback";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", "bearer token authorization defined by the merchant or the PSP");
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function editPostbackUrl($hostUrl, $pmaApiKey, $businessID, $businessPostbackUrl, $URL, $network)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/api-key-auth/business/postback";

      $post_data = array(
          'businessID' => $businessID,
          'id' => 'business_postback_id',
          'url' => $URL, // merchant defined postback url 
          'pma-api-key' => $pmaApiKey,
          'environment' => $network
      );

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback url",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}

api/v2/api-key-auth/business/postback

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

“pma-api-key”: merchants authorization API key (String)

"businessID": unique generate ID of the business on the platform (String)

"id": autogenerated unique ID of the Postback (String)

"url": postback url to the Merchants resource (String)

"authorization": {pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)

"environment": Ropsten or Mainnet (String)

   Delete Postback URL

This can be done via the Business Console Interface

Delete the selected postback URL

Method – DELETE

body of the request is not required
function deletePostbackURL(hostUrl, pmaApiKey, businessPostbackID, businessID, URL)
{
    URL = host_url + "api/v2/api-key-auth/business/postback/" + business_postback_id + "/" + business_ID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function deletePostbackUrl($host_url, $pma_api_key, $businessPostbackID, $businessID)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/api-key-auth/business/postback/$business_postback_id/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pma_api_key;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_DELETE, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
**Sample response**
{
    "success": true,
    "status": 200,
    "message": "Successfully deleted business postback.",
    "data": {
        "businessID": "the business ID the postback was deleted for"
    }
}
**Sample response**
{
    "success": true,
    "status": 200,
    "message": "Successfully deleted business postback.",
    "data": {
        "businessID": "the business ID the postback was deleted for"
    }
}
**Sample response**
{
    "success": true,
    "status": 200,
    "message": "Successfully deleted business postback.",
    "data": {
        "businessID": "the business ID the postback was deleted for"
    }
}

api/v2/api-key-auth/business/postback/{businessPostbackID}/{businessID}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"businessPostbackID": ID of the business postback

"businessID": ID of the business the postback is used for

   Get Postback

Get the postback URL data

Method – GET

api/v2/api-key-auth/business/postback/{postbackID}/{businessID}

body of the request is not required
function getPostbackURL(hostUrl, pmaApiKey, postbackID, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + postbackID + "/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getPostbackUrl($hostUrl, $pmaApiKey, $business_id, $postback_id)
  {
      //here you need to pass the host and the port of the server you are calling
      //as well as the network 3 for testnet and 1 for Mainnet
      $url = "$host_url/api/v2/api-key-auth/business/postback/$postbackID/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"postbackID": ID of the postback

"businessID": ID of the business the postback is used for

   Get All Postbacks by Business

Get all of the postback URLs by business ID

Method – GET

api/v2/api-key-auth/business/postback/{businessID}

body of the request is not required
function getPostbacksByBusiness(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getPostbacksByBusiness($hostUrl, $pmaApiKey, $businessID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"businessID": ID of the business the postback is used for

   Create/Update Postback for a Product

Method – PUT

api/v2/api-key-auth/business/postback/product

Header Parameters

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "productID": "ID of the created Product (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function createUpdatePostbackForProduct(hostUrl, pmaApiKey, businessID, productID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "productID": productID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/product";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createUpdatePotbackForProduct($hostUrl, $pmaApiKey, $businessID, $productID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'productID' => $productID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/product";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"productID": ID of the product the postback is used for

"businessPostbackID": ID of the business postback

   Remove Postback for a Product

Method – PUT

api/v2/api-key-auth/business/postback/product/remove

Header Parameters

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "productID": "ID of the created Product (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function removePostbackForProduct(hostUrl, pmaApiKey, businessID, productID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "productID": productID, // merchant defined postback url
                        "businessPostbackID": businessPostbackID // 1 or 3 for Mainnet or testnet
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);
    URL = host_url + "/api/v2/api-key-auth/business/postback/product/remove";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function removePostbackForProduct($hostUrl, $pmaApiKey, $businessID, $productID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'productID' => $productID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/product/remove";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback product",
   "data": [
     1,
     [
        {
            "productID": "autogenerated unique ID of the Postback (String)",
            "businessID": "autogenerated unique ID of the business on the platform (String)",
            "categoryID": "ID of the category the Product is created under (String|null)",
            "tags": ["the tags for the Product (array of strings)"],
            "productName": "Ropsten or Mainnet (String)",
            "productDescription": "description of the product",
            "creationTimestamp": "Unix timestamp representing the date when the Product was created",
            "lastUpdateTimestamp": "Unix timestamp representing the date when the Product was updated last",
            "productUrl": "url link to the product representing the Web address (String)",
            "imageUrl": "link to the product image (String)",
            "verified": "whether the postback is verified",
            "enabled": "whether the postback is enabled (Boolean)",
            "businessPostbackID": "ID of the business the postback is created for (String)"
        }
     ]
   ]
}

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"productID": ID of the product the postback is used for

"businessPostbackID": ID of the business postback

   Create/Update Payment Model Postback

Method – PUT

api/v2/api-key-auth/business/postback/paymentmodel

Header Parameters

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "paymentModelID": "ID of the created Payment Model (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function getPostbackControlForBusiness(hostUrl, pmaApiKey, businessID, paymentModelID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "paymentModelID": paymentModelID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/paymentmodel";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function getPostbackControlForBusiness($hostUrl, $pmaApiKey, $businessID, $paymentModelID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'paymentModelID' => $paymentModelID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/paymentmodel";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"paymentModelID": ID of the Payment Model the postback is used for

"businessPostbackID": ID of the business postback

   Remove Payment Model Postback

Method – PUT

api/v2/api-key-auth/business/postback/paymentmodel/remove

Header Parameters

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "paymentModelID": "ID of the created Payment Model (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function removePaymentModelPostback(hostUrl, pmaApiKey, businessID, paymentModelID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "paymentModelID": paymentModelID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/paymentmodel/remove";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function removePaymentModelPostback($hostUrl, $pmaApiKey, $businessID, $paymentModelID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'paymentModelID' => $paymentModelID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/paymentmodel/remove";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully removed business postback",
   "data": [
     1,
     [
        {
            "id": "ID of the postback (String)",
            "productID": "autogenerated unique ID of the Postback (String)",
            "title": "title of the Payment Model (String)",
            "description": "description of the Payment Model (String)",
            "amount": "payment amount specified in the Payment Model (Integer)",
            "initialAmount": "specifies the amount the client needs to pay initially (Integer)",
            "trialPeriod": "duration of the trial period if exists in Unix timestamp format (String)",
            "currency": "base currency for the Payment Model (String)",
            "numberOfPayments": "the number of payments specifying whether the payment is recurring or single",
            "frequency": "how often the payment will be executed if recurring (Integer)",
            "typeID": "type of the Payment Model (Integer)",
            "networkID": "specifies whether the Payment Model is created on the Mainnet or the testnet (Integer)",
            "automatedCashOut": "whether the cash out is automated or not (Boolean)",
            "cashOutFrequency": "cycle of payments after which the cashout is made (Integer)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "internalTitle": "unique personal reference title of the Payment Model (String)",
            "statusID": "status of the Payment Model",
            "createdAt": "date of the Payment Model creation (String)",
            "updatedAt": "date when the Payment Model was updated last (String|null)",
            "deletedAt": "date when the Payment Model was deleted (String|null)",
            "destination": "either the 'Treasury' or 'Kemix' for fiat cashout (String)",
            "smartContactID": "ID of the smart contract which is used for the current Payment Model",
            "fiatSettlementOptIn": "specifies if the cashout to fiat was selected (Boolean)",
            "businessPostbackID": "ID of the business postback (String)",
            "topUpThreshold": "the limit of how much to top up (Integer|null)",
            "topUpThresholdCurrency": "currency to top up with (String|null)",
            "topUpSuggestedTotalLimit": "total limit suggested for the top up (Integer|null)"
        }
     ]
   ]
}

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"paymentModelID": ID of the Payment Model the postback is used for

"businessPostbackID": ID of the business postback

QR Code APIs

The QR codes are used to allow your customers to pay for your products/services with easy by simply scanning the QR from their mobile wallet and approving the payment.

The QR codes can be generated for each of the Payment Models.

   Generate QR Code

api/v2/api-key-auth/qr/pull-payment/{pullPaymentModelID}/{uniqueReferenceID}

Description

Method – GET

function generateQRCode(hostUrl, pmaApiKey pullPaymentModelID, uniqueReferenceID, title=null, description=null, amount=null, currency=null)
{
    URL = host_url + "/api/v2/open-auth/qr/pull-payment/" + pullPaymenModelID + "/" + "/" + uniqueReferenceID + "?amount=" + amount;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function generateQRCode($hostUrl, $pmaApiKey, $pullPaymentModelID, $uniqueReferenceID, $title=NULL, $description=NULL, $amount=NULL, $currency=NULL)
  {
      $url = "$host_url/api/v2/open-auth/qr/settlement/$businessID/$pullPaymentModelID/$uniqueReferenceID?amount=$amount";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request is not required
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully generated QR code",
    "data": "data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAKgALAAAAAA9AEQAAAj/AFEJHEiwoMGDCBMqXMiwocAbBww4nEhxoYkUpzJGrMixogkfGUNqlNixJEIDB0SqHGmyJSojM1bKZOmyop0gM3Oe2liTISKMOoPy7GnwY9CjIYcSRYm0aVKSLmE6nfq05QycVLPuhDrxBlCtYJUqNAq2bNWEBj6ZXRuyxZyDRtqwnXvkhACDV+euTeJm1Ki7A73qNWtFiF+/gA95Gly2CJLDhwEHMOUAAuOpLYDEgBxZ4GRTlC1fDnpkM+fOqD6DDj1aZpITp0dtGCDhr+fVuCu3zlg49ijaokTZTo27uG7Gjn2P+hI8+PDPERoUB318bWbfAJ5sUNFcuGRTYUqV/3ogfXp1rWlMc6awJjiAAd2fm4ogXjz56aypOoIde4OE5u/F9x199dlXnnGiHZWEYbGpsAEA3QXYnHwEFliKAgswgJ8LPeiUXGwedCAKABACCN+EA1pYIIYaFlcDhytd51sGAJbo3onOpajiihlO92KHGaUXGwWjUBChjSPiWJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="
}
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully generated QR code",
    "data": "data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAKgALAAAAAA9AEQAAAj/AFEJHEiwoMGDCBMqXMiwocAbBww4nEhxoYkUpzJGrMixogkfGUNqlNixJEIDB0SqHGmyJSojM1bKZOmyop0gM3Oe2liTISKMOoPy7GnwY9CjIYcSRYm0aVKSLmE6nfq05QycVLPuhDrxBlCtYJUqNAq2bNWEBj6ZXRuyxZyDRtqwnXvkhACDV+euTeJm1Ki7A73qNWtFiF+/gA95Gly2CJLDhwEHMOUAAuOpLYDEgBxZ4GRTlC1fDnpkM+fOqD6DDj1aZpITp0dtGCDhr+fVuCu3zlg49ijaokTZTo27uG7Gjn2P+hI8+PDPERoUB318bWbfAJ5sUNFcuGRTYUqV/3ogfXp1rWlMc6awJjiAAd2fm4ogXjz56aypOoIde4OE5u/F9x199dlXnnGiHZWEYbGpsAEA3QXYnHwEFliKAgswgJ8LPeiUXGwedCAKABACCN+EA1pYIIYaFlcDhytd51sGAJbo3onOpajiihlO92KHGaUXGwWjUBChjSPiWJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="
}
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully generated QR code",
    "data": "data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAKgALAAAAAA9AEQAAAj/AFEJHEiwoMGDCBMqXMiwocAbBww4nEhxoYkUpzJGrMixogkfGUNqlNixJEIDB0SqHGmyJSojM1bKZOmyop0gM3Oe2liTISKMOoPy7GnwY9CjIYcSRYm0aVKSLmE6nfq05QycVLPuhDrxBlCtYJUqNAq2bNWEBj6ZXRuyxZyDRtqwnXvkhACDV+euTeJm1Ki7A73qNWtFiF+/gA95Gly2CJLDhwEHMOUAAuOpLYDEgBxZ4GRTlC1fDnpkM+fOqD6DDj1aZpITp0dtGCDhr+fVuCu3zlg49ijaokTZTo27uG7Gjn2P+hI8+PDPERoUB318bWbfAJ5sUNFcuGRTYUqV/3ogfXp1rWlMc6awJjiAAd2fm4ogXjz56aypOoIde4OE5u/F9x199dlXnnGiHZWEYbGpsAEA3QXYnHwEFliKAgswgJ8LPeiUXGwedCAKABACCN+EA1pYIIYaFlcDhytd51sGAJbo3onOpajiihlO92KHGaUXGwWjUBChjSPiWJuOO/LYIm4v1tXfE6J4gCSJEZ7YgRYUNrkji9P55sF/ogxw5ZkSqIDaZBV6aSGYq/lGZplndkckZ98xoICbTcIJGQAZcNmdmUc210hs35nCyJ58fgmIKX5RQGOZowxaZwYA+JaoKQwswGijBV4C6SiTUmpphMspJx9unX4KaimjDv9aaXOEBteBqmuuxgEHoLX6Kqx+yXqqBANsgCtit4FWQAEkrNbpq7HSOmtwag5w57GrmlJBASEU18ADjUYb3ADTinIttsgSB1oJFfA63bduimuqKB1keqwUhoCSK374wbujvOSu4QG6UvxBRydcpKsav++Ca6G8A6Pr1x2kVMyHwsVxUALDq/krnrhPSOzXG1lUTIoffqGR7Goi2MAxbv6O2kEG56I7CSlRsEFKFVyovDJoIRTg7sugNRDGqCJzJgcKE0ywc0ELm6KBCCJo8DIPFeCWNGcyqNFE06ToAfV0HBRgxsvLThHn1oddQMrXj5DyAQgjEHSAJMWZwS3HPxT/QMbabI/iBCliMLEJKX2EEkomBAUCxRi42VDADxyTYDVogV+wSChqmKxEKCDAYFDFj4OmwbY7bDGdBhtrnTQYOigeChUmc1K3QTnAUfEgGFgAWt88hKA6aCRIXhxnQ1yg3BCayK44EWdkUQcBByEQChFXfCB776aQsG0BIlQgQgE8qO26X1h8cEUep8ngRBnOy74E9QgRgEAC8SvOfQkh7FDBDmS43PmGoIiKUUEGkMEC/PJHgxw0xH74yx/3XnaYRJgMB8obxQW6kL9QYEJ0FIFgByfIL7/IQAlvQwEpnAC7DtLNJCKUoO/w45c44GwCXiAFB/OXAATQryUxdN4LfFiwgjCNYg+kYMIEFkCKDs6PKAIJouyGWMS1FSKJOMRB/BoIxYJIUXFUxNwoIkEKPAgCBZSQHQ1A2EWDfDEUVLyADj5AChSIQW6gu10bE/JG2VnCZGfo4R4d0sdQoBAHhPjhIB94v/wRoRKQWGRHgrhGSQJxCS+0pCZbEhAAOw=="
}

Generates QR code for a Payment Model in base64 image format.

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: The unique ID assigned to the Merchant/PSP. The businessID is required for most of the API calls. (String)

paymentModelID: ID of the Billing (Payment) Model you wish to retrieve the data for (String),

uniqueReferenceID: unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String),

title: (optional) title of the Payment Model (String),

description: (optional) description of the Payment Model (String),

amount: (optional, required for the dynamic Payment Model, described in the Dynamic Payment Model block below) the PullPayment amount in cents in base fiat currency (String),

currency: (optional) the base fiat currency of the Payment Model (USD, EUR, JPY or GPB) (String)

Parameters for the Dynamic Payment Model

title: optional only if the title for the Payment Model was preset,

description: optional only if the description for the Payment Model was preset,

amount: required for the dynamic Payment Model,

currency: optional only if the currency for the Payment Model was preset

Please note that the QR Code can be generate only for theapprovedPayment Models

   Get Settlement QR Code

api/v2/open-auth/qr/settlement/{businessID}/{settlementID}/{currency}

Description

Method – GET

function getSettlementQRCode(hostUrl, pmaApiKey, businessID, settlementID, currency)
{
    URL = host_url + "/api/v2/open-auth/qr/settlement/" + businessID + "/" + settlementID + "/" + currency;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function getSettlementQRCode($hostUrl, $pmaApiKey, $businessID, $settlmentID, $currency)
  {
      $url = "$host_url/api/v2/open-auth/qr/settlement/$businessID/$settlementID/$currency";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request is not required
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved the QR code.",
    "data": {
        "pullPaymentModelID": "PullPayment autogenerated unique ID (String)",
        "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
        "amount": "settlement amount in PMAs received in the transaction (decimal)",
        "currency": "currency the settlement is made from, ex.: PMA (String)",
        "typeID": "type of the Payment Model (Integer)"
    }
}
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved the QR code.",
    "data": {
        "pullPaymentModelID": "PullPayment autogenerated unique ID (String)",
        "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
        "amount": "settlement amount in PMAs received in the transaction (decimal)",
        "currency": "currency the settlement is made from, ex.: PMA (String)",
        "typeID": "type of the Payment Model (Integer)"
    }
}
Successful Response
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved the QR code.",
    "data": {
        "pullPaymentModelID": "PullPayment autogenerated unique ID (String)",
        "uniqueReferenceID": "unique ID of the Customer in the Merchants system. This can be used in our PostBack system to monitor the customers payments (String)",
        "amount": "settlement amount in PMAs received in the transaction (decimal)",
        "currency": "currency the settlement is made from, ex.: PMA (String)",
        "typeID": "type of the Payment Model (Integer)"
    }
}

QR code generator for settlement

Header Parameters

pma-api-key: authorization API key, the unique key that identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

businessID: The unique ID assigned to the business (Merchant/PSP). The businessID is required for most of the API calls. (String)

settlementID: unique fiat settlement id (String),

currency: base fiat currency chosen for the Payment Model (String)

Settlement Layer APIs

   Create Settlement

api/v2/reports/fiat/settlement/{businessID}/{currency}

Method – POST

Description:

{
    "message": "Successful fiat settlement inserted.",
    "status": 200,
    "success": true,
    "data": {
        "assetAmount": "settlement amount",
        "businessID": "unique autogenerated ID of the business on the platform",
        "currency": "settlement currency",
        "deletedAt": "the date when postback was deleted, otherwise null",
        "documentPath": "path to the pdf settlement report",
        "feeAmount": "settlement fee",
        "id": "settlement ID",
        "paymentID": "ID of the PullPayment",
        "referenceNo": "unique reference number on the platform (Integer)",
        "status": "status of the settlement",
        "totalFiatAmount": "total amount of the settlement in fiat in specified currency",
        "txHash": "the transaction hash",
        "createdAt": "the data when the postback was created, defined in the following format: 2019-08-08T08:54:34.644Z",
        "updatedAt": "date/time when the settlement should take place, defined in the following format: 2019-08-08T08:54:34.644Z"
    }
}
{
    "message": "Successful fiat settlement inserted.",
    "status": 200,
    "success": true,
    "data": {
        "assetAmount": "settlement amount",
        "businessID": "unique autogenerated ID of the business on the platform",
        "currency": "settlement currency",
        "deletedAt": "the date when postback was deleted, otherwise null",
        "documentPath": "path to the pdf settlement report",
        "feeAmount": "settlement fee",
        "id": "settlement ID",
        "paymentID": "ID of the PullPayment",
        "referenceNo": "unique reference number on the platform (Integer)",
        "status": "status of the settlement",
        "totalFiatAmount": "total amount of the settlement in fiat in specified currency",
        "txHash": "the transaction hash",
        "createdAt": "the data when the postback was created, defined in the following format: 2019-08-08T08:54:34.644Z",
        "updatedAt": "date/time when the settlement should take place, defined in the following format: 2019-08-08T08:54:34.644Z"
    }
}
{
    "message": "Successful fiat settlement inserted.",
    "status": 200,
    "success": true,
    "data": {
        "assetAmount": "settlement amount",
        "businessID": "unique autogenerated ID of the business on the platform",
        "currency": "settlement currency",
        "deletedAt": "the date when postback was deleted, otherwise null",
        "documentPath": "path to the pdf settlement report",
        "feeAmount": "settlement fee",
        "id": "settlement ID",
        "paymentID": "ID of the PullPayment",
        "referenceNo": "unique reference number on the platform (Integer)",
        "status": "status of the settlement",
        "totalFiatAmount": "total amount of the settlement in fiat in specified currency",
        "txHash": "the transaction hash",
        "createdAt": "the data when the postback was created, defined in the following format: 2019-08-08T08:54:34.644Z",
        "updatedAt": "date/time when the settlement should take place, defined in the following format: 2019-08-08T08:54:34.644Z"
    }
}

The API call will display if the Merchant is able to create a Fiat Settlement based on defined settlement rules and thresholds.

Parameters

businessID: your unique business ID (String),

currency: currency of the fiat settlement in EUR or USD (String),

   Retrieve Fiat Settlement Balance

api/v2/reports/fiat/total/{businessID}/{currency}

Method: GET

Description:

function retrieveFiatSettlementBalance(hostUrl, pmaApiKey, businessID, currency)
{
    URL = host_url + "/api/v2/reports/fiat/total/" + businessID + "/" + currency;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function retrieveFiatSettlementBalance($hostUrl, $pmaApiKey, $businessID, $currency)
  {
      $url = "$host_url/api/v2/reports/fiat/total/$businessID/$currency";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request is not required
"status": 200 
"success": true 
"message": "Successfully retrieved total fiat amount" 
"data": { 
    "pendingFiatBalance": "balance in fiat for a fiat settlement that is pending (Integer)", 
    "settledFiatBalance": "balance in fiat for a fiat settlement that is settled (Integer)" ,
    "unsettledFiatBalance": "balance in fiat for a fiat settlement that is unsettled (Integer)"  
} 
"status": 200 
"success": true 
"message": "Successfully retrieved total fiat amount" 
"data": { 
    "pendingFiatBalance": "balance in fiat for a fiat settlement that is pending (Integer)", 
    "settledFiatBalance": "balance in fiat for a fiat settlement that is settled (Integer)" ,
    "unsettledFiatBalance": "balance in fiat for a fiat settlement that is unsettled (Integer)"
} 
"status": 200 
"success": true 
"message": "Successfully retrieved total fiat amount" 
"data": { 
    "pendingFiatBalance": "balance in fiat for a fiat settlement that is pending (Integer)", 
    "settledFiatBalance": "balance in fiat for a fiat settlement that is settled (Integer)" ,
    "unsettledFiatBalance": "balance in fiat for a fiat settlement that is unsettled (Integer)" 
} 

Retrieve all Fiat Settlement status and balance by using your businessID and settlement wallet currency.

Parameters

businessID: your unique business ID (String),

currency: currency of the fiat settlement in EUR or USD (String),

   Retrieve Fiat Settlements

api/v2/reports/fiat/all/{businessID}

Method: GET

Description:

function retrieveFiatSettlement(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "/api/v2/reports/fiat/all/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function retrieveFiatSettlement($hostUrl, $pmaApiKey, $businessID)
  {
      $url = "$host_url/api/v2/reports/fiat/all/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request is not required
Sample Response
{
  "status": 200 
  "success": true 
  "message": "Successfully retrieved fiat settlement transactions" 
  "data": [ 
      { 
          "assetAmount": "value of the fiat settlement in PMA (Integer)", 
          "businessID": "your unique business ID (String)", 
          "createdAt": "date when the fiat settlement was created (Integer)",  
          "currency": "the currency of the fiat settlement (Integer)", 
          "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
          "id": "unique" "fiat settlement id (String)",  
          "paymentID": "unique PullPayment ID (String)",  
          "referenceNo": "unique fiat settlement reference number (Integer)", 
          "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
          "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
          "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",  
          "updatedAt": "date/time when thesettlement was updated, defined in the following format: Year-Month-25T08:27:24.196Z (String)" 
      },
      ... 
  ]
}
Sample Response
"status": 200 
"success": true 
"message": "Successfully retrieved fiat settlement transactions" 
"data": [ 
    { 
        "assetAmount": "value of the fiat settlement in PMA (Integer)", 
        "businessID": "your unique business ID (String)", 
        "createdAt": "date when the fiat settlement was created (Integer)",  
        "currency": "the currency of the fiat settlement (Integer)", 
        "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
        "id": "unique" "fiat settlement id (String)",  
        "paymentID": "unique PullPayment ID (String)",  
        "referenceNo": "unique fiat settlement reference number (Integer)", 
        "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
        "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
        "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",  
        "updatedAt": "date/time when thesettlement was updated, defined in the following format: Year-Month-25T08:27:24.196Z (String)" 
    },
    ... 
]
Sample Response
"status": 200 
"success": true 
"message": "Successfully retrieved fiat settlement transactions" 
"data": [ 
    { 
        "assetAmount": "value of the fiat settlement in PMA (Integer)", 
        "businessID": "your unique business ID (String)", 
        "createdAt": "date when the fiat settlement was created (Integer)",  
        "currency": "the currency of the fiat settlement (Integer)", 
        "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
        "id": "unique" "fiat settlement id (String)",  
        "paymentID": "unique PullPayment ID (String)",  
        "referenceNo": "unique fiat settlement reference number (Integer)", 
        "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
        "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
        "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",  
        "updatedAt": "date/time when thesettlement was updated, defined in the following format: Year-Month-25T08:27:24.196Z (String)" 
    },
    ... 
]

Retrieve all Fiat Settlement transactions by using your businessID.

Parameters

businessID: your unique business ID (String),

Query Parameters

statuses: display fiat settlement states. They can be pending, settled, unsettled (String),

currency: currency of the fiat settlement in EUR or USD (String),

Pagination Filters

page: page number based on the number of results (pagination),

itemsPerPage: how many items will be displayed per page in the search results,

orderBy: order by filter (example: date, price), order by ascending or descending (ASC/DESC)

   Retrieve All Transactions From a Single Fiat Settlement

api/v2/reports/fiat/transactions/{businessID}/{fiatSettlementID}

Method: GET

Description:

function retrieveAllTransactionsFromFiatSettlement(hostUrl, pmaApiKey, businessID, fiatSettlementID)
{
    URL = host_url + "/api/v2/reports/fiat/transactions/" + businessID + "/" + fiatSettlementID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function retrieveAllTransactionsFromFiatSettlement($hostUrl, $pmaApiKey, $businessID, $fiatSettlementID)
  {
      $url = "$host_url/api/v2/reports/fiat/transactions/$businessID/$fiatSettlementID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request is not required
Sample Response 
"status": 200 
"success": true 
"data": { 
    "assetAmount": "value of the fiat settlement in PMA (Integer)", 
    "currency": "the currency of the fiat settlement (Integer)", 
    "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
    "id": "unique fiat settlement id (String)",  
    "referenceNo": "unique fiat settlement reference number (Integer)", 
    "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
    "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
    "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",     
    "updatedAt": "date of when the settlement was last updated (Integer)", 
    "transactions": [ 
        { 
            "billingID": "unique Payment Model ID (String)",  
            "billingName": "Payment Model name (String)",  
            "businessID": "your unique business ID (String)", 
            "currentPayment": "number of transaction executions (Integer)",  
            "customerAddress": "customer wallet address (String)",   
            "customerID": "the unique reference ID of the customer (String)",  
            "executionDate": "the date that a transaction was executed. Displays in unixtimestamp (Integer)",  
            "fiatAmount": "amount of transaction in base currency in cents (Integer)",  
            "id": "Transaction unique ID (String)", 
            "lastPaymentDate": "the last date the PullPayment was executed. Displayed in Unix timestamp in seconds (Integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in Unix timestamp in seconds (Integer)",   
            "paymentID": "unique payment ID (String)",  
            "paymentType": "Payment Model types. 2 = Single PullPayment, 3 = Subscription PullPayment, 4 = Single + Subscription PullPayment, 5 = Subscription PullPayment with Trial period, 6 = for Single + Subscription PullPayment type with Trial period, 7 = Dynamic PullPayment(Integer)",  
            "pmaBalance": "transaction amount in PMA (Integer)",  
            "productName": "name of the product (String)",  
            "referenceNo": "reference number of the transaction (String)",  
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",  
            "transactionType": "transaction types. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel” (Integer[])",  
            "txHash":  "unique transaction hash on the blockchain (String)",   
        },
        ... 
    ] 
} 
Sample Response 
"status": 200 
"success": true 
"data": { 
    "assetAmount": "value of the fiat settlement in PMA (Integer)", 
    "currency": "the currency of the fiat settlement (Integer)", 
    "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
    "id": "unique fiat settlement id (String)",  
    "referenceNo": "unique fiat settlement reference number (Integer)", 
    "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
    "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
    "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",     
    "updatedAt": "date of when the settlement was last updated (Integer)", 
    "transactions": [ 
        { 
            "billingID": "unique Payment Model ID (String)",  
            "billingName": "Payment Model name (String)",  
            "businessID": "your unique business ID (String)", 
            "currentPayment": "number of transaction executions (Integer)",  
            "customerAddress": "customer wallet address (String)",   
            "customerID": "the unique reference ID of the customer (String)",  
            "executionDate": "the date that a transaction was executed. Displays in unixtimestamp (Integer)",  
            "fiatAmount": "amount of transaction in base currency in cents (Integer)",  
            "id": "Transaction unique ID (String)", 
            "lastPaymentDate": "the last date the PullPayment was executed. Displayed in Unix timestamp in seconds (Integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in Unix timestamp in seconds (Integer)",   
            "paymentID": "unique payment ID (String)",  
            "paymentType": "Payment Model types. 2 = Single PullPayment, 3 = Subscription PullPayment, 4 = Single + Subscription PullPayment, 5 = Subscription PullPayment with Trial period, 6 = for Single + Subscription PullPayment type with Trial period, 7 = Dynamic PullPayment(Integer)",  
            "pmaBalance": "transaction amount in PMA (Integer)",  
            "productName": "name of the product (String)",  
            "referenceNo": "reference number of the transaction (String)",  
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",  
            "transactionType": "transaction types. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel” (Integer[])",  
            "txHash":  "unique transaction hash on the blockchain (String)",   
        },
        ... 
    ] 
} 
Sample Response 
"status": 200 
"success": true 
"data": { 
    "assetAmount": "value of the fiat settlement in PMA (Integer)", 
    "currency": "the currency of the fiat settlement (Integer)", 
    "documentPath": "URLs displaying transfer receipts from the fiat settlement provider (String)", 
    "id": "unique fiat settlement id (String)",  
    "referenceNo": "unique fiat settlement reference number (Integer)", 
    "status": "display fiat settlement states. They can be pending, settled, unsettled (String)", 
    "totalFiatAmount": "total amount of the fiat settlement (Integer)", 
    "txHash": "the transaction hash generated from scanning the fiat settlement QR code (String)",     
    "updatedAt": "date of when the settlement was last updated (Integer)", 
    "transactions": [ 
        { 
            "billingID": "unique Payment Model ID (String)",  
            "billingName": "Payment Model name (String)",  
            "businessID": "your unique business ID (String)", 
            "currentPayment": "number of transaction executions (Integer)",  
            "customerAddress": "customer wallet address (String)",   
            "customerID": "the unique reference ID of the customer (String)",  
            "executionDate": "the date that a transaction was executed. Displays in unixtimestamp (Integer)",  
            "fiatAmount": "amount of transaction in base currency in cents (Integer)",  
            "id": "Transaction unique ID (String)", 
            "lastPaymentDate": "the last date the PullPayment was executed. Displayed in Unix timestamp in seconds (Integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in Unix timestamp in seconds (Integer)",   
            "paymentID": "unique payment ID (String)",  
            "paymentType": "Payment Model types. 2 = Single PullPayment, 3 = Subscription PullPayment, 4 = Single + Subscription PullPayment, 5 = Subscription PullPayment with Trial period, 6 = for Single + Subscription PullPayment type with Trial period, 7 = Dynamic PullPayment(Integer)",  
            "pmaBalance": "transaction amount in PMA (Integer)",  
            "productName": "name of the product (String)",  
            "referenceNo": "reference number of the transaction (String)",  
            "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
            "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",  
            "transactionType": "transaction types. 1 = ”register”, 2 = ”initial”, 3 = ”execute”, 4 = ”cancel” (Integer[])",  
            "txHash":  "unique transaction hash on the blockchain (String)",   
        },
        ... 
    ] 
} 

with this call you will be able to retrieve all transactions from a single Fiat Settlement. The call will display all PullPayment transactions that occurred for a certain settlement.

Parameters

businessID: your unique business ID (String),

fiatsettlementID: unique fiat settlement id (String),

Top Up Payment

api/v2/api-key-auth/pull-payments

Method: PUT

api/v2/api-key-auth/postback-control/{business_id}

body of the request is not required
function createTopUpPayment(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createTopUpPayment($hostUrl, $pmaApiKey, $businessID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created payment",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created payment",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created payment",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)"
    },
    . . .
}






PSP APIs

Sub-Business

This section describes how the PSP can create child businesses, for example Merchants or other PSPs based on the business model and business type.

Create Sub Business

Description:

api/v2/api-key-auth/register/sub/business

Method: POST

function createSubBuseinss(host_url, pmaApiKey, parentID, company, email, password) {
    var ItemJSON;

    ItemJSON = [
                  {
                    "companyName": company,
                    "email": email,
                    "password": password,
                    "parentID": parentID
                  }
    ];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "api/v2/api-key-auth/register/sub/business/";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createSubBuseinss($host_url, $pma_api_key, $parent_id, $company, $email, $password)
{
      $post_data = array(
                    "companyName" => $company,
                    "email" => $email,
                    "password" => $password,
                    "parentID" => $parent_id
      );

      $url = "$host_url/api/v2/api-key-auth/register/sub/business";

      $request_headers = array();
      $request_headers[] = "Content-Type: application/json";
      $request_headers[] = "pma-api-key: " . $pma_api_key;
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request
{
    "company":"your API key",
    "email":"your autogenerated business ID",
    "password":"category ID of the Product from the list based on your business type (Integer)" 
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully created the child", 
    "data": {
                "businessID": "unique generated API key"
    }
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully created the child", 
    "data": {
                "businessID": "unique generated API key"
    }
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully created the child", 
    "data": {
                "businessID": "unique generated API key"
    }
}

Description

As the PSP you will be able to create a Merchant using this API call. This will generate the unique Business ID and the User ID of the new Merchant. The User ID is the Merchants Admin that will have login access to the Business Console by providing an email and password (it is optional for the PSP to disclosure this based on their business model).

Header Parameters

pma-api-key: authorization API key, the unique key that Identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Body Request Parameters

company: Company Name (String),

email: The email that the Merchant Admin will use (String),

password: The password that the Merchant Admin will use (String),

parentID: your unique parent ID (String),

Update Sub Business

Description:

api/v2/api-key-auth/business/business-details/sub/business

Method: <u>PUT</b>

function updateSubBuseinss(host_url, pmaApiKey, businessID, parentID, userID, businessName, buisnessType, description, countryID, city, zipCode, streetAddress1, industry1, url, firstName, lastName, jobTitle, phoneNumber) {
    var ItemJSON;

    ItemJSON = [
                  {
                    "parentID": parentID,
                    "businessID": businessID, 
                    "userID": userID, 
                    "businessName": businessName,
                    "businessType": businessType,
                    "description": description, 
                    "countryID": countryID, 
                    "city": city, 
                    "zipCode": zipCode, 
                    "streetAddress1": streetAddress1,
                    "industry1": industry1, 
                    "url": url,
                    "firstName": firstname,
                    "lastName": lastName,
                    "jobTitle": jobTitle,
                    "phoneNumber": phoneNumber 
                  }
    ];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "api/v2/api-key-auth/register/sub/business/" + parentID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function updateSubBuseinss($host_url, $pma_api_key, $parentID, $businessID, $businessType, $description, $countryID, $city, $zipCode, $streetAdress1, $industry1, $url, $firstName, $lastName, $jobTitle, $phoneNumber)
{
      $post_data = array(
                    "parentID" => $parentID,
                    "businessID" => $businessID, 
                    "userID" => $userID, 
                    "businessName" => $businessName,
                    "businessType" => $businessType,
                    "description" => $description, 
                    "countryID" => $countryID, 
                    "city" => $city, 
                    "zipCode" => $zipCode, 
                    "streetAddress1" => $streetAddress1,
                    "industry1" => $industry1, 
                    "url" => $url,
                    "firstName" => $firstname,
                    "lastName" => $lastName,
                    "jobTitle" => $jobTitle,
                    "phoneNumber" => $phoneNumber
      );

      $url = "$host_url/api/v2/api-key-auth/register/sub/business/$parent_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pma_api_key;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
Body of the request
{
    "parentID": "PSP unique ID (String)",
    "businessID": "Merchant unique business ID (String)",
    "userID": "unique Merchant user ID (String)",
    "business name": "the name of the Merchant",
    "business type": "the type of the Merchant",
    "description": "a short description of the Merchant",
    "countryID": "the country that the business is registered",
    "city": "the name of the city the Merchant is registered",
    "zipCode": "the zip code of the Merchant",
    "streetAddress1": "the address of the Merchant",
    "industry1": "the industry of the Merchant",
    "url": "the url of the Merchant website",
    "firstname": "the name of the Merchant admin",
    "lastname": "the last name of the Merchant admin",
    "jobTitle": "the job title of the Merchant",
    "phoneNumber": "the contact number of the Merchant"
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully updated the child", 
    "data": {
                "businessID": "uniquly generated business ID"
    }
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully updated the child", 
    "data": {
                "businessID": "uniquly generated business ID"
    }
}
Successful response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully updated the child", 
    "data": {
                "businessID": "uniquly generated business ID"
    }
}

Description

As the PSP you will be able to update the Merchants details of a created Merchant. Here the PSP will be able to add the Merchants business name, business type, location and user information.

Header Parameters

pma-api-key: authorization API key, the unique key that Identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Body Request Parameters

parentID: PSP unique ID (String),

businessID: Merchant unique business ID (String),

userID: unique Merchant user ID (String),

business name: the name of the Merchant

business type: the type of the Merchant

description: a short description of the Merchant

countryID: the country that the business is registered

city: the name of the city the Merchant is registered

zipCode: the zip code of the Merchant

streetAddress1: the address of the Merchant

industry1: the industry of the Merchant

url: the url of the Merchant website

firstname: the name of the Merchant admin

lastname: the last name of the Merchant admin

jobTitle: the job title of the Merchant

phoneNumber:the contact number of the Merchant

   Retrieve All Businesses

api/v2/api-key-auth/business/sub/business/parentID

Method: <u>GET</b>

Description:

The API will retrieve all Businesses/Merchants under the PSP. It requires the parentID (the businessID) of the PSP.

Header Parameters

pma-api-key: authorization API key, the unique key that Identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

parentID: your unique parent ID (String),

{
    "businessID": "ID of the business to retrieve the businesses for (String)"
}
function retrieveAllBusinesses(hostUrl, pmaApiKey, parentID)
{
    URL = host_url + "api/v2/api-key-auth/business/sub/businesses/" + parentID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function retrieveAllBusinesses($hostUrl, $pmaApiKey, $parent_id)
  {
      $url = "$host_url/api/v2/api-key-auth/business/sub/businesses/$parent_id";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
  }
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved sub business details.",
    "data": [
        {
            "businessID": "unique autogenerated ID of the registered business (String)",
            "parentID": "unique autogenerated ID of the parent business/PSP (String)",
            "companyName": "name of the child company (String)",
            "businessName": "name of the business (String)",
            "businessType": "business category/type from the predefined categories list (Integer)",
            "description": "description of the business (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "countryID": "country ID from the predefined list (String)",
            "state": "for US countries, ID from the predefined list (Integer)",
            "city": "city where the business is located (String)",
            "zipCode": "zip code at the businesses address (Integer)",
            "streetAddress1": "legal address of the business (String)",
            "streetAddress2": "legal address of the business, continued(String|null)",
            "gasWallet": "ERC20 compatible wallet address assigned to the business which needs to be topped up with Ethereum (ETH) to cover the customers transactions (String)",
            "gasWalletIndex": "wallet index on the platform (Integer)",
            "treasuryWallet": "ERC20 compatible wallet assigned by the business which will store the PMA tokens received from the customers as the products/services payments (String)",
            "industry1": "industry category of the business from the predefined categories list (String)",
            "industry2": "secondary industry category of the business from the predefined categories list(String|null)",
            "url": "url of the business website (String)",
            "registrationDate": "registration date in Unix timestamp (Integer)",
            "updateDate": "the data when the business details got updated, in Unix timestamp (Integer)",
            "businessPostbackID": "unique autogenerated ID of the business postback (String|null)"
        },
        . . .
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved sub business details.",
    "data": [
        {
            "businessID": "unique autogenerated ID of the registered business (String)",
            "parentID": "unique autogenerated ID of the parent business/PSP (String)",
            "companyName": "name of the child company (String)",
            "businessName": "name of the business (String)",
            "businessType": "business category/type from the predefined categories list (Integer)",
            "description": "description of the business (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "countryID": "country ID from the predefined list (String)",
            "state": "for US countries, ID from the predefined list (Integer)",
            "city": "city where the business is located (String)",
            "zipCode": "zip code at the businesses address (Integer)",
            "streetAddress1": "legal address of the business (String)",
            "streetAddress2": "legal address of the business, continued(String|null)",
            "gasWallet": "ERC20 compatible wallet address assigned to the business which needs to be topped up with Ethereum (ETH) to cover the customers transactions (String)",
            "gasWalletIndex": "wallet index on the platform (Integer)",
            "treasuryWallet": "ERC20 compatible wallet assigned by the business which will store the PMA tokens received from the customers as the products/services payments (String)",
            "industry1": "industry category of the business from the predefined categories list (String)",
            "industry2": "secondary industry category of the business from the predefined categories list(String|null)",
            "url": "url of the business website (String)",
            "registrationDate": "registration date in Unix timestamp (Integer)",
            "updateDate": "the data when the business details got updated, in Unix timestamp (Integer)",
            "businessPostbackID": "unique autogenerated ID of the business postback (String|null)"
        },
        . . .
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved sub business details.",
    "data": [
        {
            "businessID": "unique autogenerated ID of the registered business (String)",
            "parentID": "unique autogenerated ID of the parent business/PSP (String)",
            "companyName": "name of the child company (String)",
            "businessName": "name of the business (String)",
            "businessType": "business category/type from the predefined categories list (Integer)",
            "description": "description of the business (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "countryID": "country ID from the predefined list (String)",
            "state": "for US countries, ID from the predefined list (Integer)",
            "city": "city where the business is located (String)",
            "zipCode": "zip code at the businesses address (Integer)",
            "streetAddress1": "legal address of the business (String)",
            "streetAddress2": "legal address of the business, continued(String|null)",
            "gasWallet": "ERC20 compatible wallet address assigned to the business which needs to be topped up with Ethereum (ETH) to cover the customers transactions (String)",
            "gasWalletIndex": "wallet index on the platform (Integer)",
            "treasuryWallet": "ERC20 compatible wallet assigned by the business which will store the PMA tokens received from the customers as the products/services payments (String)",
            "industry1": "industry category of the business from the predefined categories list (String)",
            "industry2": "secondary industry category of the business from the predefined categories list(String|null)",
            "url": "url of the business website (String)",
            "registrationDate": "registration date in Unix timestamp (Integer)",
            "updateDate": "the data when the business details got updated, in Unix timestamp (Integer)",
            "businessPostbackID": "unique autogenerated ID of the business postback (String|null)"
        },
        . . .

Disable Business

api/v2/api-key-auth/business-control/sub/business/disabled

Method: <u>POST</b>

Header Parameters

pma-api-key: authorization API key, the unique key that Identifies and authorizes your actions on the platform. The pma-api-key can be regenerated if needed (String)

Query Parameters

parentID: your unique parent ID (String),

Body Request Parameters

parentID: your unique parent ID (String),

businessID: your unique Merchant (String),

disabled: toggle true/false. True to disable the Merchant (Boolean)

PullPayments

   PullPayment Cancellation

Method – DELETE

api/v2/api-key-auth/business/stop/paymentID

body of the request is not required
function stopPullPayment(hostUrl, pmaApiKey, payment)
{
    URL = host_url + "/api/v2/api-key-auth/business/stop/paymentID/" + paymentID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("DELETE", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function stopPullPayment($hostUrl, $pmaApiKey, $paymentID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/stop/paymentID/$paymentID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_DELETE, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved sub business details",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved sub business details",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved sub business details",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}






SUB-BUSINESS APIs

Sub-Businesses APIs extend the functionality of the General APIs by providing additional features which the Sub-Businesses can use.

Postback URL APIs

   Create/Update Postback for a Business

Method: PUT

api/v2/api-key-auth/business/postback/business

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function createUpdatePostbackForBusiness(hostUrl, pmaApiKey, businessID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/business";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createUpdatePostbackForBusiness($hostUrl, $pmaApiKey, $businessID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/business";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully rupdated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"businessPostbackID": ID of the business postback

   Remove Postback for a Business

Method – PUT

api/v2/api-key-auth/business/postback/business/remove

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function removePostbackForBusiness(hostUrl, pmaApiKey, businessID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/business/remove";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function removePostbackForBusiness($hostUrl, $pmaApiKey, $businessID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/business/remove";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback business",
   "data": [
      1,
      [
        {
            "businessID": "unique generate ID of the business on the platform (String)",
            "companyName": "the name of the company (String)",
            "businessName": "business name of the company as the customers see it in the system (String)",
            "businessType": "business category (Integer)",
            "description": "description of the company and services",
            "countryID": "ID of the country from the list (String)",
            "kycTierID": "ID of the KYC tier (String)",
            "state": "part of the address, particularly for US (String|null)",
            "city": "part of the address, city where the business is located (String)",
            "zipCode": "part of the address, zip code (String)",
            "streetAddress1": "part of the address (String)",
            "streetAddress2": "part of the address (String|null)",
            "treasuryWallet": "the ERC20 PMA wallet to which all the payments are made (String)",
            "gasWallet": "ETH wallet used for the payment of the users transactions (String)",
            "gasWalletIndex": "index of the gas wallet (Integer)",
            "industry1": "main industry category of the business (Integer)",
            "industry2": "secondary industry category of the business (Integer|null)",
            "url": "postback url to the Merchants resource (String)",
            "registrationDate": "date when the business was registered (String)",
            "updateDate": "date when the business details were updated (String|null)",
            "parentID": "ID of the business parent (String|null)",
            "businessPostbackID": "ID of the business postback (String)"
        }
      ]
  ]
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"businessPostbackID": ID of the business postback

   Create/Update Postback for a Parent Business

Method – PUT

api/v2/api-key-auth/business/postback/parent

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "parentBusinessPostbackID": "postback ID of the parent business (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function createPostbackForParent(hostUrl, pmaApiKey, businessID, parentBusinessPostbackID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "parentBusinessPostbackID": parentBusinessPostbackID,
                        "businessPostbackID": businessPostbackID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/parent";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createPostbackForParent($hostUrl, $pmaApiKey, $businessID, $parentBusinessPostbackID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'parentBusinessPostbackID' => $parentBusinessPostbackID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/parent";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback parent",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved postback control",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved postback control",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"parentBusinessPostbackID": postback ID of the parent business

"businessPostbackID": ID of the business postback

   Retrieve All Postback Controls for a Business

Method – GET

api/v2/api-key-auth/business/postback-control/{business_id}

body of the request is not required
function getPostbackControlForBusiness(hostUrl, pmaApiKey, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback-control/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getPostbackControlForBusiness($hostUrl, $pmaApiKey, $businessID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback-control/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback control",
   "data": {
        "businessID": "autogenerated unique ID of the Postback (String)",
        "product": "true/false, specifies whether the postback url is valid for the Product (Boolean)",
        "paymentModel": "true/false, specifies whether the postback url is valid for the Payment Model (Boolean)",
        "business": "true/false, specifies whether the postback url is valid for the business (Boolean)",
        "parentBusiness": "true/false, specifies whether the postback url is valid for the Parent (Boolean)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback control",
   "data": {
        "businessID": "autogenerated unique ID of the Postback (String)",
        "product": "true/false, specifies whether the postback url is valid for the Product (Boolean)",
        "paymentModel": "true/false, specifies whether the postback url is valid for the Payment Model (Boolean)",
        "business": "true/false, specifies whether the postback url is valid for the business (Boolean)",
        "parentBusiness": "true/false, specifies whether the postback url is valid for the Parent (Boolean)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback control",
   "data": {
        "businessID": "autogenerated unique ID of the Postback (String)",
        "product": "true/false, specifies whether the postback url is valid for the Product (Boolean)",
        "paymentModel": "true/false, specifies whether the postback url is valid for the Payment Model (Boolean)",
        "business": "true/false, specifies whether the postback url is valid for the business (Boolean)",
        "parentBusiness": "true/false, specifies whether the postback url is valid for the Parent (Boolean)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"postbackID": ID of the postback

"businessID": ID of the business the postback is used for

   Create/Update Postback Notificatoin

Method – PUT

api/v2/api-key-auth/business/postback-control/

{
    "businessID": "unique generate ID of the business on the platform the postback will be used by (String)",
    "product": "ID of the product to set the postback for (String|Boolean)",
    "paymentModel": "Payment Model to set the postback for (String|Boolean)",
    "business": "business to set the postback url for (String|Boolean)",
    "parentBusiness": "ID of the parent business (String|Boolean)"
}
function updatePostbackControl(hostUrl, pmaApiKey, businessID, product, paymentModel, business, parentBusiness)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "product": product,
                        "paymentModel": paymentModel,
                        "business": business,
                        "parentBusiness": parentBusiness
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback-control/";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function updatePostbackControl($hostUrl, $pmaApiKey, $businessID, $product, $paymentModel, $business, $parentBusiness)
  {

      $post_data = array(
          'businessID' => $businessID,
          'product' => $product,
          'paymentModel' => $paymentModel, // merchant defined postback url 
          'business' => $business,
          'parentBusiness' => $parentBusiness
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback-control/";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback control",
   "data": {
        "businessID": "unique generate ID of the business on the platform the postback will be used by (String)",
        "product": "ID of the product to set the postback for (String|Boolean)",
        "paymentModel": "Payment Model to set the postback for (String|Boolean)",
        "business": "business to set the postback url for (String|Boolean)",
        "parentBusiness": "ID of the parent business (String|Boolean)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback control",
   "data": {
        "businessID": "unique generate ID of the business on the platform the postback will be used by (String)",
        "product": "ID of the product to set the postback for (String|Boolean)",
        "paymentModel": "Payment Model to set the postback for (String|Boolean)",
        "business": "business to set the postback url for (String|Boolean)",
        "parentBusiness": "ID of the parent business (String|Boolean)"
    },
    . . .
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated postback control",
   "data": {
        "businessID": "unique generate ID of the business on the platform the postback will be used by (String)",
        "product": "ID of the product to set the postback for (String|Boolean)",
        "paymentModel": "Payment Model to set the postback for (String|Boolean)",
        "business": "business to set the postback url for (String|Boolean)",
        "parentBusiness": "ID of the parent business (String|Boolean)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"product": Product the postback is used for

"paymentModel": Payment Model the postback is used for

"business": name of the business using the postback

"parentBusiness": parent business of the business using the postback

   Get All Postbacks for a Business

Method – GET

api/v2/api-key-auth/business/postback/businessID

body of the request is not required
function getAllPostbacksForBusiness(hostUrl, pmaApiKey, businessID, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getAllPostbacksForBusiness($hostUrl, $pmaApiKey, $businessID, $businessID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"businessID": ID of the business the postback is used for

"postbackID": ID of the postback that needs to be deleted

   Create Postback

Method – POST

api/v2/api-key-auth/business/postback

{
    "businessID": "unique generate ID of the business on the platform (String)",
    "url": "postback url to the Merchants resource (String)",
    "authorization": "pma-api-key: bearer token authorization defined by the merchant or the PSP (String)",
    "environment": "Ropsten or Mainnet (String)"
}
function createPostback(hostUrl, pmaApiKey, businessID, url, authorization, environment)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "url": URL, // merchant defined postback url
                        "authorization": {
                            "pma-api-key": "bearer token authorization defined by the merchant or the PSP"
                        },
                        "environment": network // 1 or 3 for Mainnet or testnet
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function createPostback($hostUrl, $pmaApiKey, $businessID, $url, array $authorization, $environment)
  {
      $post_data = array(
          'businessID' => $businessID,
          'url' => $url,
          'authorization' => $authorization,
          'environment' => $environemtn
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_POST, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusienssPostbackID": "id of the related parent business postback"

    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusienssPostbackID": "id of the related parent business postback"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully created business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusienssPostbackID": "id of the related parent business postback"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"url": the postback url

"authorization": authorization token defined by the PSP

"environment": Ropsten testnet or Ethereum Mainnet

   Update Postback

Method – PUT

api/v2/api-key-auth/business/postback

{
    "id": "ID of the postback (String)",
    "businessID": "unique generate ID of the business on the platform (String)",
    "url": "postback url to the Merchants resource (String)",
    "authorization": "pma-api-key: bearer token authorization defined by the merchant or the PSP (String)",
    "environment": "Ropsten or Mainnet (String)"
}
function updatePostback(hostUrl, pmaApiKey, id, businessID, url, authorization, environment)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "id": id,
                        "businessID": businessID,
                        "url": URL, // merchant defined postback url
                        "authorization": {
                            "pma-api-key": "bearer token authorization defined by the merchant or the PSP"
                        },
                        "environment": network // 1 or 3 for Mainnet or testnet
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/postback/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function updatePostback($hostUrl, $pmaApiKey, $id, $businessID, $url, $authorization, $environment)
  {
      $post_data = array(
          'id' => $id,
          'businessID' => $businessID,
          'url' => $url,
          'authorization' => $authorization,
          'environment' => $environment
      );

      $url = "$host_url/api/v2/api-key-auth/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_PUT, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true or false, checks whether the postback is valid (Boolean)",
        "parentBusinessPostbackID": "ID of the parent of the business who has created the postback url (String|null)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true or false, checks whether the postback is valid (Boolean)",
        "parentBusinessPostbackID": "ID of the parent of the business who has created the postback url (String|null)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "postback url to the Merchants resource (String)",
        "authorization": "{pma-api-key:bearer token authorization defined by the merchant or the PSP} (String)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true or false, checks whether the postback is valid (Boolean)",
        "parentBusinessPostbackID": "ID of the parent of the business who has created the postback url (String|null)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"id": ID of the postback that needs to be updated

"businessID": ID of the business the postback is used for

"url": the postback url

"authorization": authorization token defined by the PSP

"environment": Ropsten testnet or Ethereum Mainnet

   Remove Postback for Parent

Method – PUT

api/v2/api-key-auth/business/postback/parent/remove

{
    "businessID": "uniquely generated ID of the business on the platform (String)",
    "businessPostbackID": "ID of the created business postback (String)"
}
function removePostbackForParent(hostUrl, pmaApiKey, businessID, businessPostbackID)
{
    var ItemJSON;

    ItemJSON = [{
                    {
                        "businessID": businessID,
                        "businessParentID": businessParentID
                    }
    }];

    ItemJSON = Json.stringify(ItemJSON);

    URL = host_url + "/api/v2/api-key-auth/business/postback/parent/remove";

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("PUT", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    promise = xmlhttp.send(ItemJSON);
}
function removePostbackForParent($hostUrl, $pmaApiKey, $businessID, $businessPostbackID)
  {
      $post_data = array(
          'businessID' => $businessID,
          'businessPostbackID' => $businessPostbackID
      );

      $url = "$host_url/api/v2/api-key-auth/business/postback/parent";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback parent",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback parent",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully updated business postback parent",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Body Parameters

"businessID": ID of the business the postback is used for

"businessPostbackID": ID of the business postback

   Get Postback by ID for Business

Method – GET

api/v2/api-key-auth/business/postback/{postbackID}/{business_id}

body of the request is not required
function getPostbackByID(hostUrl, pmaApiKey, businessID, postbackID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + postbackID + "/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getPostbackByID($hostUrl, $pmaApiKey, $businessID, $postbackID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback/$postbackID/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"businessID": ID of the business the postback is used for

"postbackID": ID of the postback that needs to be deleted

   Get All Postbacks for a Business

Method – GET

api/v2/api-key-auth/business/postback/businessID

body of the request is not required
function getAllPostbacksForBusiness(hostUrl, pmaApiKey, businessID, businessID)
{
    URL = host_url + "/api/v2/api-key-auth/business/postback/" + businessID;

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
    xmlhttp.open("GET", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/json");
    xmlhttp.setRequestHeader("pma-api-key", pmaApiKey);
    xmlhttp.onreadystatechange = callbackFunction(xmlhttp);
}
function getAllPostbacksForBusiness($hostUrl, $pmaApiKey, $businessID, $businessID)
  {
      $url = "$host_url/api/v2/api-key-auth/business/postback/$businessID";

      $request_headers = array();
      $request_headers[] = "pma-api-key: " . $pmaApiKey;
      $request_headers[] = "Content-Type: application/json";
      $curl = curl_init($url);
      curl_setopt($curl, CURL_GET, 1);
      curl_setopt($curl, CURLOPT_HTTPHEADER, $request_headers)
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result_json = curl_exec($curl);
      curl_close($curl);

      $result_array = json_decode($result_json, $assoc = true);

      return $result_array;
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}
**Sample response**
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved business postback",
   "data": {
        "id": "autogenerated unique ID of the Postback (String)",
        "businessID": "unique generate ID of the business on the platform (String)",
        "url": "url of the postback (String)",
        "authorization": "how the authorization is handled (String|null)",
        "environment": "Ropsten or Mainnet (String)",
        "valid": "true/false, specifies whether the postback url is valid or not (String)",
        "parentBusinessPostbackID": "ID of the postback of the parent (String)"
    }
}

Header Parameters

“pma-api-key”: merchants authorization API key

"Content-Type": should be "application/json"

Query Parameters

"businessID": ID of the business the postback is used for

"postbackID": ID of the postback that needs to be deleted

Postback URL Data

The request data is sent to the Merchant/PSP through the provided Postback URL



Body of the Request
{
   "transactionData": {
   "blockHash": "hash of the block on the blockchain",
   "blockNumber": "number of the block on the blockchain",
   "contractAddress": "address of the payment contract on the blockchain",
   "cumulativeGasPrice": "amount of the gas spent for the transaction",
   "from": "address from which the payment was made",
   "gasUsed": "amount of the gas spent for the transaction",
   "logs": "[an array of logs]", 
   "logsBloom": "0x00000000000000000000000 - ethereum blockchain related data",  
   "status": "true",
   "to": "address where the money are sent",
   "transactionHash": "hash of the transaction",
   "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
   "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
},
   "paymentData": {
      "paymentID": "ID of the payment in PumaPay system",
      "businessID": "ID of the business the payment is for",
      "uniqueReferenceID": "unique identifier of the customer inside the merchants system to uniquely identify the payment",
      "customerAddress": "the address the customer uses to pay to the merchant",
      "treasuryWallet": "the merchants address receiving the funds",
      "pullPaymentExecutorAddress": "the contract address of the PullPayment model being executed on the blockchain",
      "currency": "base currency of the PullPayment model (USD, EUR, JPY, GBP)", 
      "endTimestamp": "unixtimestamp value when the contract will finish the execution",
      "fiatAmountInCents": "the amount specified on the Payment Model in the base currency in cents",
      "initialPaymentAmount": "used for payments like subscription with initial payment",
      "frequency": "how often will the payment be made, value of the period in unixtimestamp",
      "numberOfPayments": "how many times the payment will be made (recurring payment for exampel)",
      "startTimestamp": "the time of the first execution of the payment",
      "signature": "the encrypted signature of the transaction",
      "encryptedPaymebntDetails": "some encrypte data with the transaction details which shouldn't be publicly exposed",
      "type": "identifies whether the payment was successfull (3), failed(2) or pending (1)",
      "networkID": "ID of the network (1 for the Mainnet, and 3 for the Testnet"
   } 
}
Body of the Request
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved postback url",
   "transactionData": {
   "blockHash": "hash of the block on the blockchain",
   "blockNumber": "number of the block on the blockchain",
   "contractAddress": "address of the payment contract on the blockchain",
   "cumulativeGasPrice": "amount of the gas spent for the transaction",
   "from": "address from which the payment was made",
   "gasUsed": "amount of the gas spent for the transaction",
   "logs": "[an array of logs]", 
   "logsBloom": "0x000000000000000000000000000000000000000000......",
   "status": "true",
   "to": "address where the money are sent",
   "transactionHash": "hash of the transaction",
   "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
   "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
},
   "paymentData": {
      "paymentID": "ID of the payment in PumaPay system",
      "businessID": "ID of the business the payment is for",
      "uniqueReferenceID": "unique identifier of the customer inside the merchants system to uniquely identify the payment",
      "customerAddress": "the address the customer uses to pay to the merchant",
      "treasuryWallet": "the merchants address receiving the funds",
      "pullPaymentExecutorAddress": "the contract address of the PullPayment model being executed on the blockchain",
      "currency": "base currency of the PullPayment model (USD, EUR, JPY, GBP)", 
      "endTimestamp": "unixtimestamp value when the contract will finish the execution",
      "fiatAmountInCents": "the amount specified on the Payment Model in the base currency in cents",
      "initialPaymentAmount": "used for payments like subscription with initial payment",
      "frequency": "how often will the payment be made, value of the period in unixtimestamp",
      "numberOfPayments": "how many times the payment will be made (recurring payment for exampel)",
      "startTimestamp": "the time of the first execution of the payment",
      "signature": "the encrypted signature of the transaction",
      "encryptedPaymebntDetails": "some encrypte data with the transaction details which shouldn't be publicly exposed",
      "type": "identifies whether the payment was successfull (3), failed(2) or pending (1)",
      "networkID": "ID of the network (1 for the Mainnet, and 3 for the Testnet"
   } 
}
Body of the Request
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved postback url",
   "transactionData": {
   "blockHash": "hash of the block on the blockchain",
   "blockNumber": "number of the block on the blockchain",
   "contractAddress": "address of the payment contract on the blockchain",
   "cumulativeGasPrice": "amount of the gas spent for the transaction",
   "from": "address from which the payment was made",
   "gasUsed": "amount of the gas spent for the transaction",
   "logs": "[an array of logs]", 
   "logsBloom": "0x000000000000000000000000000000000000000000......",
   "status": "true",
   "to": "address where the money are sent",
   "transactionHash": "hash of the transaction",
   "transactionType": "the type of the transaction, please refer to the Transaction Types (String)",
   "transactionIndex": "index of the transaction under the same PullPayment contract (Integer)",
},
   "paymentData": {
      "paymentID": "ID of the payment in PumaPay system",
      "businessID": "ID of the business the payment is for",
      "uniqueReferenceID": "unique identifier of the customer inside the merchants system to uniquely identify the payment",
      "customerAddress": "the address the customer uses to pay to the merchant",
      "treasuryWallet": "the merchants address receiving the funds",
      "pullPaymentExecutorAddress": "the contract address of the PullPayment model being executed on the blockchain",
      "currency": "base currency of the PullPayment model (USD, EUR, JPY, GBP)", 
      "endTimestamp": "unixtimestamp value when the contract will finish the execution",
      "fiatAmountInCents": "the amount specified on the Payment Model in the base currency in cents",
      "initialPaymentAmount": "used for payments like subscription with initial payment",
      "frequency": "how often will the payment be made, value of the period in unixtimestamp",
      "numberOfPayments": "how many times the payment will be made (recurring payment for exampel)",
      "startTimestamp": "the time of the first execution of the payment",
      "signature": "the encrypted signature of the transaction",
      "encryptedPaymebntDetails": "some encrypte data with the transaction details which shouldn't be publicly exposed",
      "type": "identifies whether the payment was successfull (3), failed(2) or pending (1)",
      "networkID": "ID of the network (1 for the Mainnet, and 3 for the Testnet"
   } 
}

Changelog

Version 2.5.1

November 20, 2019

What's new:

Updated:

Version 2.4.1

September 3, 2019

What's new:

Updated:

Version 2.3.0

July 15, 2019

What's new:

Updated:

Version 2.2.5

April 23, 2019

What's new:

Updated:

Version 2.1.8

February 18, 2019

What's new:

Updated:

Version 2.0.0

November 12, 2018

What's new: