NAV Navbar
json javascript php


Introduction

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

PullPayment Protocol

PumaPay is based on 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 and dynamic billing models which were impossible on the blockchain before. So, what we have done is we have created a comprehensive system where our cryptobilling can be used by both businesses and individuals.

PullPayment

A Billing Model needs to be created to determine the parameters of the PullPayment (for example: whether the PullPayment will be recurring, if it will have a trial period, what is the amount that the customer needs to pay PullPayment, etc.)

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

Billing Models

Our billing 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.

There are the 4 main billing model variations each configurable for payment type reflection:

Dynamic Single PullPayment

Accept a one-time payment from your customers, dynamically set up per case.

Example: One-time payment of a dynamic price with a dynamic name and description.

Single PullPayment

Accept a one-time payment from your customers.

Example: One-time payment of $5.00

Subscription PullPayment

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

Example: Monthly subscription of $12.99

Single + Subscription PullPayment

Accept a single payment followed by a subscription.

Example: Single payment for 3-day trial and then monthly subscription

Treasury

It's your wallet which has been assigned to accept all funds from the PumaPay payment solution. To assign a wallet to be a treasury wallet the unique wallet address is required. Example of a wallet address is "0xD808D22F4f8b418faA3c4cC2D941eFCe8cB99"

Onboarding

For a business to be able to use the PumaPay solution it is required to provide business information and pass our KYB protocol.

Contact our business department via email and they will walk you through the process.

Business department email: [email protected]

You can also register on our PumaPay Business Console and submit your details and KYC.

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

API Documentation

All the calls require the API-key (pma-api-key). The API key authorizes and identifies each merchant to retrieve their business data from the PumaPay servers. In the case of 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

Billing Model Statuses

Value Description Variable Type
PND
      Pending Billing Model
string
APR
      Approved Billing Model
string
REJ
      Rejected Billing Model
string
SUP
      Suspended Billing Model
string

Billing Model Types

Value Description Variable Type
typeID
      The type of Billing Model
integer
typeID Value       Description Variable Type
2
      Single PullPayment
integer
3
      Subscription PullPayment
integer
4
      Single + Subscription
integer
5
      Subscription PullPayment
integer
6
      Single + Subscription PullPayment
integer
7
      Dynamic Single PullPayment
integer

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 a 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. 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 a successful onboarding

productID: represents the Product in the Business Console API calls and the Merchant in PSP API calls as every Merchant is the product of the PSP.

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

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

PSP APIs

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
Successfull response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": "unique generated API key", 
}
Successfull response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": "unique generated API key"
}
Successfull 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 magority 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 your account for further server-side validations.

Header Parameters

x-access-token: the token generated at a login to Business Console or registration with out 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,

Retrieve PSP

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

Method: GET

Description

function retrievePSP(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 retrievePSP($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 autogenerted 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 autogenerted 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 autogenerted 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 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 PSP Details

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

Method: GET

Description

function retrievePSPDetails(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 retrievePSPDetails($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 autogenerted 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 autogenerted 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 autogenerted 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),

Retrieve PSP 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 autogenerted 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 autogenerted 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 autogenerted 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 your business in the system. The retrieved data reflects the Wallet and the KYC related 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),

Merchants

When adding merchants, use the products API calls, as every merchant is the product of the PSP

Retrieve Merchant Categories

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

Description

Retrieves the business industries categories

{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerted ID of the category (integer)",
           "industryID": "unique industry ID of the PSP (integer)",
           "categoryName": "category of the Merchant (string)",
       },
       . . .
   ]
}
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerted ID of the category (integer)",
           "industryID": "unique industry ID of the PSP (integer)",
           "categoryName": "category of the Merchant (string)",
       },
       . . .
   ]
}
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved product categories.",
   "data": [
       {
           "id": "autogenerted ID of the category (integer)",
           "industryID": "unique industry ID of the PSP (integer)",
           "categoryName": "category of the Merchant (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 Merchant

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

Method:POST

Description

function createMerchant(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 createMerchant($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 Merchant on the platform (integer)", 
    "tags": ["array of display tags for the Merchant (array of strings/integers)"],  
    "productName":"the name of the Merchant (string)", 
    "productDescription":"the description of the Merchant (string)", 
    "productUrl":"url link to the Merchants website (string)",
    "byte64Image":"byte64 encoded image representing the merchants business"
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted business ID (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (boolean)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant 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 Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)"
    }
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted business ID (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (boolean)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "businessID": "your unique auto generated business ID (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)"
    }
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted business ID (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (boolean)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "businessID": "your unique auto generated business ID (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)"
    }
}

As the PSP you will be able to create a Merchant using this API call. A unique product ID (unique autogenerated ID substituting for the merchant ID) which is assigned to every new Merchant when created.

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 of the Merchant on the platform (integer),

tags: display tags of the Merchant (array of strings/integers),

byte64Image: Merchant image (string),

productName: the name of the Merchant (string),

productDescription: description of the Merchant (string),

productUrl: url link to the Merchants website (string),

networkID: (1) for the mainnet, (3) for the testnet (integer),

Retrieve Merchants List

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

Method:GET

Description

function retrieveMerchantsList(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 retrieveMerchantsList($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 product details.",
    "data": [{
        "productID": "unique autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    },
    ...
}]
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": [{
        "productID": "unique autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    },
    ...
}]
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": [{
        "productID": "unique autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    },
    ...
}]

The call allows you to retrieve the list of all your Merchants. It requires the businessID (your unique autogenerated ID on the platform) 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: Merchant category ID (integer)

currency: filter the results by the base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string)

verified: displays if the Merchant 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 Merchant

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

Method:GET

Description

function retrieveSingleMerchant(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 retrieveSingleMerchant($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 autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": {
        "productID": "unique autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    }
}
Sample response 
{
    "success": true,
    "status": 200,
    "message": "Successfully retrieved product details.",
    "data": {
        "productID": "unique autogenerted ID of the Merchant on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "category ID of the Merchant on the platform (integer)",
        "tags": ["array of display tags for the Merchant (array of strings/integers)"],
        "productName": "the name of the Merchant (string)",
        "productDescription": "the description of the Merchant (string)",
        "creationTimestamp": "unix timestamp, refers to when the Merchant was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the Merchant was updated (integer)",
        "productUrl": "url link to the Merchants website (string)",
        "imageUrl": "link to the Merchants brand image (for example logo) on the platform (string)",
        "verified": "displays if the Merchant has been verified, true/false (boolean)",
        "enabled": "displays if the Merchant record is enabled, true/true (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 Merchant (string)",
        "numOfBilling": "the total number of the Billing Models the Merchant has (string)",
        "totalEarnings": "total amount of the Merchants earnings in base fiat currency in cents (integer)"
    }
}

The call allows to retrieve a single Merchant by his unique autogenerated merchants ID. It requires the businessID (your unique autogenerated ID on the platform), productID (substituting for the merchant ID) 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: your unique business ID (string)

merchantID: the unique ID of your merchant (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 Billing Model (USD, EUR, JPY oer GPB) (string)

Update Merchant

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

Method:PUT

Description

function updateMerchant(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 updateMerchant($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 display tags for the Merchant (array of strings/integers)"],
    "categoryID": "category ID of the Merchant on the platform (integer)",
    "productName": "the name of the Merchant (string)",
    "byte64Image": "NO_IMAGE_CHANGE",
    "productDescription": "the description of the Merchant (string)",
    "productUrl": "url link to the Merchants website (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 merchants details. Requires your business ID (your unique autogenerated ID on the platform) and the product ID (unique autogenerated ID substituting for the merchant ID).

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)

productID: unique merchants ID (string)

productName: the name of the Merchant (string),

productDescription: description of the Merchant (string),

tags: display tags of the Merchant (array of strings/integers)

byte64Image: base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string)

Delete Merchant

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

Method:PATCH

Description

function deleteMerchant(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 deleteMerchant($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 Merchant record is enabled, true/true (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 Merchant by the productID (substituting the merchants ID)

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)

"productID": the ID of the merchant you wish to delete (string)

Create Billing Model

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

Method:POST

Description

function createBillingModel(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 createBillingModel($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 billing 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 Merchant on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the billing model, please refer to Billing Model Statuses (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing 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 billing 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 Merchant on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the billing model, please refer to Billing Model Statuses (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing 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 billing 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 Merchant on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the billing model, please refer to Billing Model Statuses (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string/null)"
    }
}

With this call you are able to create a Billing Model under each Merchant (productID) representing merchants payment models and types.

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 Merchants ID (string),

businessID: your unique business ID (string),

title: Billing Model name (string),

description: Billing Model description (string),

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

initialPaymentAmount: Initial charge of the Billing Model (string),

currency: base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string),

numberOfPayments: number of recurring payment cycles of the Billing 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 Single PullPayment,

frequency: how often a recurring payment will be made. Displayed in unixtimestamp in seconds (integer),

networkID: (1) for the mainnet, (3) for the testnet (integer),

trialPeriod: trial period of a Billing Model (integer),

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

Retrieve Billing Models List

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

Method:GET

Description

function retrieveBillingModelsList(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 retrieveBillingModelsList($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 billing model (string)",
            "productID": "unique ID of the Merchant on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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 billing model (string)",
            "productID": "unique ID of the Merchant on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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 billing model (string)",
            "productID": "unique ID of the Merchant on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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 Models for a single Merchant on a specific network. Please note that when creating the billing models for testing on the Ropsten testnet (network 3), these billing 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: your unique business ID (string),

productID: in this case the Merchants ID (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 Billing Model

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

Method:GET

Description

function retrieveSingleBillingModel(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 retrieveSingleBillingModel($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 billing model (string)",
              "productID": "unique ID of the Merchant on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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 billing model (string)",
              "productID": "unique ID of the Merchant on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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 billing model (string)",
              "productID": "unique ID of the Merchant on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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 Merchant on a specific network. Please note that when creating the billing models for testing on the Ropsten testnet (network 3), these billing 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: your 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 Single PullPayment,

currency: base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string),

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

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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing 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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing 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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing 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 Merchant, PullPayment ID, Billing Model ID, Billing 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: your 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 Merchant ID,

billingModels: filter by Billing Model ID,

billingTypes: filter by Billing 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 retrieveSinglePayment(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 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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing 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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing 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 Merchant on the platform (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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing 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),

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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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.

By provide your businessID and selecting between the Ethereum mainnet (1) for the history of the received payments or the testnet (3) used for the testing transactions.

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),

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 Merchant (string[]),

billingModels: Filter by a list of Billing 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 unixtimestamp (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 unixtimestamp (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 Billing Model (USD, EUR, JPY oer 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 Single 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/{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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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": "aautogenerated ID of the Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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)

Qeury 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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

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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing 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 Merchant (string)",
            "billingName": "the name of the Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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

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

Business Console APIs

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
Successfull response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": { 
            "unique generated API key", 
       }
}
Successfull response 
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully generated the API key. You can now retrieve it", 
    "data": { 
            "unique generated API key", 
       }
}
Successfull 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 Merchant. The businessID is required for a magority 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 your account for further server-side validations.

Header Parameters

x-access-token: the token generated at a login to Business Console or registration with out 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,

Retrieve Merchant

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

Method: GET

Description

function retrieveMerchant(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 retrieveMerchant($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 autogenerted business ID (string)",
            "businessName": "name of your business",
            "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",
            "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 autogenerted business ID (string)",
            "businessName": "name of your business",
            "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",
            "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 autogenerted business ID (string)",
            "businessName": "name of your business",
            "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",
            "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 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 Merchant Details

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

Method: GET

Description

function retrieveMerchantDetails(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 retrieveMerchantDetails($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 autogenerted 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": "your wallet address at index 0 (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": "generated 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 autogenerted 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": "your wallet address at index 0 (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": "generated 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 autogenerted 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": "your wallet address at index 0 (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": "generated 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),

Retrieve Merchant Status

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

Method:GET

Description

function retrieveMerchantStatus(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 retrieveMerchantStatus($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 autogenerted 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 autogenerted 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 autogenerted 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 your business in the system. The retrieved data reflects the Wallet and the KYC related 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),

Create a 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 Products (array of strings/numbers)"],
                    "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":"ID of the product category on the platform (integer)", 
    "tags": ["display tags of the Products (array of strings/integers)"], 
    "productName":"the name of the Product (string)", 
    "productDescription": "description of the Product (string)", 
    "productUrl":"url link to the product on the merchants website (string)",
    "byte64Image":"byte64 encoded image representing the Products business"
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted Product ID (string)",
        "verified": "displays if the Product has been verified, 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 autogenerted business ID (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "the description of the Product (string)", 
        "productUrl": "url link to the product on the merchants website (string)",
        "imageUrl": "image location where it can be accessed on the PumaPay platform (string)"
    }
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted Product ID (string)",
        "enabled": "displays if the Product record is enabled, true/true (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 autogenerted business ID (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "description of the Product (string)", 
        "productUrl": "url link to the product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)"
    }
}
Successfull response 
{
    "success": true,
    "status": 200,
    "message": "Product record created",
    "data": {
        "productID": "your unique autogenerted Product ID (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 autogenerted business ID (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "description of the product which the customers will see (string)",
        "productUrl": "url link to the product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)"
    }
}

As the Merchant you will be able to create a Product using this API call.

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: ID of the product category on the platform (integer),

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

byte64Image: Product image (string),

productName: the name of the Product (string),

productDescription: description of the Product (string),

productUrl: url link to the product on the merchants website (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 product details.",
    "data": {
        "productID": "unique autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (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 product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of 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 autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (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 product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of 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 autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (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 product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of earnings for the Product in base fiat currency in cents (integer)"
    }
}

The call allows you to retrieve the list of all your Products. It requires the businessID (your unique autogenerated ID on the platform) 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: ID of the product category on the platform (integer)

currency: filter the results by the base fiat currency of the Billing Model (USD, EUR, JPY oer 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 autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (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 product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of 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 autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (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 product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of 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 autogenerted ID of the Product on the platform (string)",
        "businessID": "unique autogenerted ID of your business (string)",
        "categoryID": "ID of the product category on the platform (integer)",
        "tags": ["display tags of the Products (array of strings/integers)"],
        "productName": "the name of the Product (string)",
        "productDescription": "Products description as the customer will see it (string)",
        "creationTimestamp": "unix timestamp, refers to when the product was created (integer)",
        "lastUpdateTimestamp": "unix timestamp, refers to when the product was updated (integer)",
        "productUrl": "turl link to the product on the merchants website (string)",
        "imageUrl": "link to the Products image (for example logo) on the platform (string)",
        "verified": "displays if the Product has been verified, true/false (boolean)",
        "enabled": "displays if the Product record is enabled, true/true (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 Billing Models the Product has (string)",
        "totalEarnings": "total amount of earnings for the Product in base fiat currency in cents (integer)"
    }
}

The call allows to retrieve a single Product by its unique ID. It requires the businessID (your unique autogenerated ID on the platform) 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: your unique business ID (string)

merchantID: the unique ID of your merchant (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 Billing Model (USD, EUR, JPY oer 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, productDescription=null, productUrl=null, tags=null, productUrl=null, byte64Image=null, imageUrl=null)
{
    var ItemJSON;

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

    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,
        'productName' => $product_name,
        'productDescription' => $product_description,
        'productUrl' => $product_url,
        'tags' => $tags,
        'productUrl' => $product_url,
        'byte64Image' => $byte_64_image,
        'imageUrl' => $image_url
    );

    $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": "productID",
    "businessID": "businessID",
    "networkID": "networkID",
    "categoryID": "categoryID",
    "productName": "productName",
    "productDescription": "productDescription",
    "productUrl": "productUrl",
    "tags": ["display tags of the Products (array of strings/integers)"],
    "productUrl": "productUrl",
    "byte64Image": "byte64Image",
    "imageUrl": "imageUrl"
}
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 Products details. Requires your business ID (your unique autogenerated ID on the platform) and the product ID.

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)

productID: unique Products ID (string)

productName: the name of the Product (string),

productDescription: description of the Product (string),

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

byte64Image: selected currency (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":"false"
}
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 by the productID

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)

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

Create Billing Model

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

Method:POST

Description

function createBillingModel(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 Products title",
                    "description": description,
                    "amount": amount,
                    "initialPaymentAmount": initialPaymentAmount,
                    "numberOfPayments": numberOfPayments,
                    "currency": currency,
                    "typeID": typeID,
                    "frequency": frequency,
                    "networkID": networkID,
                    "destination": "Treasury",
                    "trialPeriod": trialPeriod,
                    "treasuryWallet": "0x854dF9714123B4e08f5Bb7ce9aFEeC731dA1D937"
                  }
    ];

    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 createBillingModel($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": "autogenerted ID of the billing 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 autogenerted ID of the Product on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the Billing Model.  Statuses are “PND” = Pending, “APR” = Approved, “REJ” = Rejected, “SUP” = Suspended (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing 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": "autogenerted ID of the billing 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 autogenerted ID of the Product on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the Billing Model.  Statuses are “PND” = Pending, “APR” = Approved, “REJ” = Rejected, “SUP” = Suspended (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing 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": "autogenerted ID of the billing 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 autogenerted ID of the Product on the platform (string)",
        "smartContractID": "id of the smart contract the billing model will use based on its type (integer)",
        "title": "title of the Billing Model as the customer sees it (string)",
        "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
        "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
        "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
        "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
        "statusID": "autogenerated status of the Billing Model.  Statuses are “PND” = Pending, “APR” = Approved, “REJ” = Rejected, “SUP” = Suspended (string)",
        "typeID": "type of billing model, please refer to the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
        "deletedAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string/null)"
    }
}

With this call you are able to create a Billing Model under each 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)

Body Request Parameters

productID: the Products ID (string),

businessID: your unique business ID (string),

title: Billing Model name (string),

description: Billing Model description (string),

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

initialPaymentAmount: Initial charge of the Billing Model (string),

currency: base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string),

numberOfPayments: number of recurring payment cycles of the Billing 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 Single PullPayment,

frequency: how often a recurring payment will be made. Displayed in unixtimestamp in seconds (integer),

networkID: (1) for the mainnet, (3) for the testnet (integer),

trialPeriod: trial period of a Billing Model (integer),

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

Retrieve Billing Models list

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

Method:GET

Description

function retrieveBillingModelsList(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 retrieveBillingModelsList($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": "autogenerted ID of the billing model (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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": "autogenerted ID of the billing model (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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": "autogenerted ID of the billing model (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "title": "title of the Billing Model as the customer sees it (string)",
            "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
            "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
            "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
            "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
            "statusName": "refers to the status of the Billing Model (string)",
            "statusCode": "short code for the Billing 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 Models for a single Product on a specific network. Please note that when creating the billing models for testing on the Ropsten testnet (network 3), these billing 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: your unique business ID (string),

productID: unique 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 Billing Model

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

Method:GET

Description

function retrieveSingleBillingModel(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 retrieveSingleBillingModel($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": "autogenerted ID of the billing model (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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": "autogenerted ID of the billing model (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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": "autogenerted ID of the billing model (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "title": "title of the Billing Model as the customer sees it (string)",
              "internalTitle": "the title of the Billing Model for the internal use which can only be seen through the Console or the APIs (string)",
              "description": "description of the Billing 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "numberOfPayments": "number of recurring payment cycles of the Billing Model (integer)",
              "frequency": "how often the payment will be executed, defined in seconds in the unix timestamp format (integer)",
              "typeID": "type of billing model, please refer to the Billing Model Types (integer)",
              "statusName": "refers to the status of the Billing Model (string)",
              "statusCode": "short code for the Billing 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 specific network. Please note that when creating the billing models for testing on the Ropsten testnet (network 3), these billing 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: your 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: filter by Billing Model type (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 Single PullPayment,

currency: selected currency (string),

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

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 Pull Payment (string)",
            "title": "title of the PullPayment as the customer sees it (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing model was created 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 Pull Payment (string)",
            "title": "title of the PullPayment as the customer sees it (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing model was created 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 Pull Payment (string)",
            "title": "title of the PullPayment as the customer sees it (string)",
            "productID": "unique autogenerted ID of the Product on the platform (string)",
            "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
            "hdWalletIndex": "index of the wallet on the platform (integer)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
            "deletedAt": "the date when the billing model was created 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 is created, this call will retrieve the list of all existing PullPayments and the details. You are able to filter the data by the Product, Billing Model, PullPayment ID 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: your 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 Billing Model ID,

billingTypes: filter by Billing 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 retrieveSinglePayment(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 all payments", 
    "data": {
              "id": "autogenerated ID of the Pull Payment (string)",
              "title": "title of the PullPayment as the customer sees it (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing model was created 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 Pull Payment (string)",
              "title": "title of the PullPayment as the customer sees it (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing model was created 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 Pull Payment (string)",
              "title": "title of the PullPayment as the customer sees it (string)",
              "productID": "unique autogenerted ID of the Product on the platform (string)",
              "businessID": "unique autogenerted ID of the 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 billing 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 Billing Model (USD, EUR, JPY oer GPB) (string)",
              "hdWalletIndex": "index of the wallet on the platform (integer)",
              "numberOfPayments": "number of recurring payment cycles of the Billing 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 billing model was updated in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "createdAt": "the date when the billing model was created in the following format: YYYY-MM-DDTH:m:s6z (string)",
              "deletedAt": "the date when the billing model was created 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),

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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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.

By provide your businessID and selecting between the Ethereum mainnet (1) for the history of the received payments or the testnet (3) used for the testing transactions.

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),

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 Billing 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" (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 unixtimestamp (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 unixtimestamp (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 Billing Model (USD, EUR, JPY oer 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 Single 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/{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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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": "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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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": "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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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)

Qeury 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,

All Transactions For the Business

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

Method:GET

Description

function transactionsByBusiness(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 transactionsByBusiness($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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 transactions for a business on a specified network.

Uses businessID to retrieve the transactions which were made on one of the given networks: Ethereum mainnet (1) or the Ropsten testnet (3)

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,

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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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

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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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 Billing Model (string)",
            "businessID": "unique autogenerted ID of the Merchant 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 Billing Model (string)",
            "numberOfPayments": "number of recurring payment cycles of the Billing 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 Billing Model (USD, EUR, JPY oer 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 Single 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

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 URL

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.

There are 5 CRUD coperations for the postback APIs.

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

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/postback

Header Parameters

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

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/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/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;
  }

Header Parameters

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

**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

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, $business_postback_ID, $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/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/{business_postback_id}/{business_id}

Header Parameters

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

Get Postback

Get the postback URL data

Method – GET

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

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/$postback_id/$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;
  }
**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

Get All Postbacks by Business

Get all of the postback URLs by business ID

Method – GET

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

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);
    promise = xmlhttp.send(ItemJSON);
}
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

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 billing 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 billing 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 billing 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"
   } 
}

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 retrieveFiatSettlement(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 retrieveFiatSettlement($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:

Retrieve all Fiat Settlement transactions by using your businessID.

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)" 
    },
    ... 
]

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 Billing Model ID (string)",  
            "billingName": "Billing 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 unixtimestamp in seconds (integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in unixtimestamp in seconds (integer)",   
            "paymentID": "unique payment ID (string)",  
            "paymentType": "Billing 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 Single 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 Billing Model ID (string)",  
            "billingName": "Billing 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 unixtimestamp in seconds (integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in unixtimestamp in seconds (integer)",   
            "paymentID": "unique payment ID (string)",  
            "paymentType": "Billing 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 Single 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 Billing Model ID (string)",  
            "billingName": "Billing 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 unixtimestamp in seconds (integer)",   
            "nextPaymentDate": "when the next PullPayment date Is due. Displayed in unixtimestamp in seconds (integer)",   
            "paymentID": "unique payment ID (string)",  
            "paymentType": "Billing 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 Single 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),

QR Code APIs

Generate QR Code

api/v2/api-key-auth/qrcode/{businessID}/{PaymentModelID}/{uniqueReferenceID}

Description

Method – GET

function generateQRCode(hostUrl, pmaApiKey, businessID, paymentModelID, uniqueReferenceID, title=null, description=null, amount=null, currency=null)
{
    URL = host_url + "/api/v2/open-auth/qr/settlement/" + businessID + "/" + paymentModelID + "/" + 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, $businessID, $paymentModelID, $uniqueReferenceID, $title=NULL, $description=NULL, $amount=NULL, $currency=NULL)
  {
      $url = "$host_url/api/v2/open-auth/qr/settlement/$businessID/$paymentModelID/$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 generate 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 generate 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 generate 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 billing 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 Billing Model (string),

description: (optional) description of the Billing Model (string),

amount: (optional, required for the dynamic billing model, described in the Dynamic Billing Model block below) the PullPayment amount in cents in base fiat currency (string),

currency: (optional) the base fiat currency of the Billing Model (USD, EUR, JPY oer GPB) (string)

Parameters for the Dynamic Billing Model

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

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

amount: required for the dynamic billing model,

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

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

Retrieve QR Code Response

api/v2/open-auth/pull-payment/{pullPaymentModelID}/{uniqueReferenceID}

Method – GET

Description:

function retrieveQRCodeResponse(hostUrl, pmaApiKey, pullPaymentModelID, uniqueReferenceID)
{
    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 retrieveQRCodeResponse($hostUrl, $pmaApiKey, $pullPaymentModelID, $uniqueReferenceID)
  {
      $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
Successful Response
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved QR code", 
    "data": {
              "pullPaymentModelID": "PullPayment 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": "payment amount in base fiat currency in cents (integer)",
              "currency": "base fiat currency (string)",
              "title": "title of the billing model (string)",
              "description": "description of the billing model (string)"
    }
}
Successful Response
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved QR code", 
    "data": {
              "pullPaymentModelID": "PullPayment 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": "payment amount in base fiat currency in cents (integer)",
              "currency": "base fiat currency (string)",
              "title": "title of the billing model (string)",
              "description": "description of the billing model (string)"
    }
}
Successful Response
{ 
    "success": true, 
    "status": 200, 
    "message": "Successfully retrieved QR code", 
    "data": {
              "pullPaymentModelID": "PullPayment 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": "payment amount in base fiat currency in cents (integer)",
              "currency": "base fiat currency (string)",
              "title": "title of the billing model (string)",
              "description": "description of the billing model (string)"
    }
}

This API call displays all the data retrieved from when a QR code is scanned by a customer.

Query Parameters

paymentID: unique PullPayment ID (string),

customerID: the unique reference ID of the customer (string),

Additional filter

amount: total amount of PullPayment in PMA (integer),

currency: base currency of the Billing Model (string)

title: name of the Billing Model (string)

description: description of the Billing Model (string)

Get Kemix Billing Model ID

api/v2/api-key-auth/kemix/pull-payment/{currency}

Retrieve the Kemix Billing Model ID QR for the payments processed through Kemix

Method – GET

function retrieveKemixBillingModelIDQR(hostUrl, pmaApiKey, currency)
{
    URL = host_url + "/api/v2/api-key-auth/kemix/pull-payment/" + 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 retrieveKemixBillingModelIDQR($hostUrl, $pmaApiKey, $currency)
  {
      $url = "$host_url/api/v2/api-key-auth/kemix/pull-payment/$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 Kemix Billing Model ID",
   "data": "autogenerated unique ID of the Billing Model"
}
Successful Response
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved Kemix Billing Model ID",
   "data": "autogenerated unique ID of the Billing Model"
}
Successful Response
{
   "success": true,
   "status": 200,
   "message": "Successfully retrieved Kemix Billing Model ID",
   "data": "autogenerated unique ID of the Billing 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)

Query Parameters

currency: base fiat currency chosen for the Billing Model (string)

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 Billing 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 Billing 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 Billing 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 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 Billing Model (string)