Account

productSold

Post a sell of product


/productSold

Usage and API Samples

Name Value Description
authID Authentication credentials Provided by us
data Array of products See product attributes below
- product[‘product_link’] To identify the product
- product[‘product_price’] The of the product
- product[‘time’] Timestamp when sale happened
- product[‘qty’] Quantity sold
- product[‘order_id’] Your order identifier
signature Signature to validate the request See explanation at the “Signature” section
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AccountApi;

import java.io.File;
import java.util.*;

public class AccountApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: SecureAuthorization
        OAuth SecureAuthorization = (OAuth) defaultClient.getAuthentication("SecureAuthorization");
        SecureAuthorization.setAccessToken("YOUR ACCESS TOKEN");

        AccountApi apiInstance = new AccountApi();
        try {
            array[Balance] result = apiInstance.productSold();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#productSold");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AccountApi;

public class AccountApiExample {

    public static void main(String[] args) {
        AccountApi apiInstance = new AccountApi();
        try {
            array[Balance] result = apiInstance.productSold();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AccountApi#productSold");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: SecureAuthorization)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


AccountApi *apiInstance = [[AccountApi alloc] init];

// Reterive Balance of Ceevo Account
[apiInstance productSoldWithCompletionHandler: 
              ^(array[Balance] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var request = require("request");

var options = { method: 'POST',
  url: 'https://adsstate.com/api/productSold',
  headers:
   {
     referer: 'https://adsstate.com/api/productSold',
     'accept-encoding': 'gzip, deflate',

     'Content-Type': 'application/x-www-form-urlencoded', },
  formData:
   { authID: 'Your authID here',
     data: '[{"product_price":"PRODUCT_PRICE",
     "time":"UNIX Timestamp",
     "qty":"QUANTITY",
     "order_id":"ORDER_ID",
     "product_link":"PRODUCT_LINK"}]',
     signature: 'Your signature here' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class productSoldExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: SecureAuthorization
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AccountApi();

            try
            {
                // Reterive Balance of Ceevo Account
                array[Balance] result = apiInstance.productSold();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AccountApi.productSold: " + e.Message );
            }
        }
    }
}
<?php
                        $data = array(
                            array(
                                'product_price' => 'PRODUCT_PRICE',
                                'time'          => 'UNIX Timestamp',
                                'qty'           => 'QUANTITY',
                                'order_id'      => 'ORDER_ID',
                                'product_link'  => 'PRODUCT_LINK',
                            ),
                            array(
                                'product_price' => 'PRODUCT_PRICE',
                                'time'          => 'UNIX Timestamp',
                                'qty'           => 'QUANTITY',
                                'order_id'      => 'ORDER_ID',
                                'product_link'  => 'PRODUCT_LINK',
                            )
                        );
                        
                        $authID        = "myAuthID";
                        $authSignature = "myAuthSignature";
                        
                        $curl = curl_init();
                        curl_setopt_array( $curl, array(
                            CURLOPT_URL            => 'https://adsstate.com/api/productSold',
                            CURLOPT_RETURNTRANSFER => true,
                            CURLOPT_ENCODING       => "",
                            CURLOPT_MAXREDIRS      => 10,
                            CURLOPT_TIMEOUT        => 30,
                            CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
                            CURLOPT_FOLLOWLOCATION => true,
                            CURLOPT_MAXREDIRS      => 2,
                            CURLOPT_CUSTOMREQUEST  => "POST",
                            CURLOPT_POSTFIELDS     => http_build_query( [
                                'authID'    => $authID,
                                'data'      => $data,
                                'signature' => base64_encode( hash( "sha256", json_encode( $data, JSON_NUMERIC_CHECK ) . $authSignature, true ) )
                            ] ),
                            CURLOPT_HTTPHEADER     => array( "content-type: application/x-www-form-urlencoded" )
                        ) );
                        
                        $response2 = curl_exec( $curl );
                        
                        $err = curl_error( $curl );
                        
                        curl_close( $curl );
                        
                        if ( $err ) {
                            echo "cURL Error #:" . $err . ' (2)';
                            die();
                        }
import requests
import hashlib

authID = "Your authID here"
authSignature = "You authSignature here"
data = """[{"product_price":"PRODUCT_PRICE",
        "time":"UNIX Timestamp",
        "qty":"QUANTITY",
        "order_id":"ORDER_ID",
        "product_link":"PRODUCT_LINK"}]"""

headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "referer": "https://adsstate.com/api/productSold",
}
signature = data + authSignature
signature = hashlib.sha256(signature.encode()).hexdigest()
signature = hashlib.base64(signature.encode()).hexdigest()

files = {"authID": (None, authID), "data": (None, data), "signature": (None, signature)}

response = requests.post(
    "https://adsstate.com/api/productSold", headers=headers, files=files
)

getProductData

Get Product Data


/getProductData

Usage and API Samples

Name Value Description
authID Authentication credentials Provided by us
reflink Product link To identify the product
signature Signature to validate the request See explanation at the “Signature” section
curl -X POST "https://api.ceevo.com/v1/getProductData"
import io.swagger.client.*;
  import io.swagger.client.auth.*;
  import io.swagger.client.model.*;
  import io.swagger.client.api.AccountApi;
  
  import java.io.File;
  import java.util.*;
  
  public class AccountApiExample {
  
      public static void main(String[] args) {
          ApiClient defaultClient = Configuration.getDefaultApiClient();
          
          // Configure OAuth2 access token for authorization: SecureAuthorization
          OAuth SecureAuthorization = (OAuth) defaultClient.getAuthentication("SecureAuthorization");
          SecureAuthorization.setAccessToken("YOUR ACCESS TOKEN");
  
          AccountApi apiInstance = new AccountApi();
          getProductData customer = ; // getProductData | customer
          try {
              apiInstance.getProductData(customer);
          } catch (ApiException e) {
              System.err.println("Exception when calling AccountApi#getProductData");
              e.printStackTrace();
          }
      }
  }
import io.swagger.client.api.AccountApi;
  
  public class AccountApiExample {
  
      public static void main(String[] args) {
          AccountApi apiInstance = new AccountApi();
          getProductData customer = ; // getProductData | customer
          try {
              apiInstance.getProductData(customer);
          } catch (ApiException e) {
              System.err.println("Exception when calling AccountApi#getProductData");
              e.printStackTrace();
          }
      }
  }
Configuration *apiConfig = [Configuration sharedConfig];
  
  // Configure OAuth2 access token for authorization: (authentication scheme: SecureAuthorization)
  [apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
  
  getProductData *customer = ; // customer (optional)
  
  AccountApi *apiInstance = [[AccountApi alloc] init];
  
  // Register Bank Account with your Ceevo Account
  [apiInstance getProductDataWith:customer
                completionHandler: ^(NSError* error) {
                              if (error) {
                                  NSLog(@"Error: %@", error);
                              }
                          }];
  
var CeevoPayment = require('ceevo_payment');
  var defaultClient = CeevoPayment.ApiClient.instance;
  
  // Configure OAuth2 access token for authorization: SecureAuthorization
  var SecureAuthorization = defaultClient.authentications['SecureAuthorization'];
  SecureAuthorization.accessToken = "YOUR ACCESS TOKEN"
  
  var api = new CeevoPayment.AccountApi()
  
  var opts = { 
    'customer':  // {getProductData} customer
  };
  
  var callback = function(error, data, response) {
    if (error) {
      console.error(error);
    } else {
      console.log('API called successfully.');
    }
  };
  api.getProductData(opts, callback);
  
using System;
  using System.Diagnostics;
  using IO.Swagger.Api;
  using IO.Swagger.Client;
  using IO.Swagger.Model;
  
  namespace Example
  {
      public class getProductDataExample
      {
          public void main()
          {
              
              // Configure OAuth2 access token for authorization: SecureAuthorization
              Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
  
              var apiInstance = new AccountApi();
              var customer = new getProductData(); // getProductData | customer (optional) 
  
              try
              {
                  // Register Bank Account with your Ceevo Account
                  apiInstance.getProductData(customer);
              }
              catch (Exception e)
              {
                  Debug.Print("Exception when calling AccountApi.getProductData: " + e.Message );
              }
          }
      }
  }
  
<?php
                            $reflink = "REFERAL_LINK";
                          
                          $authID        = "myAuthID";
                          $authSignature = "myAuthSignature";
                          
                          $curl = curl_init();
                          curl_setopt_array( $curl, array(
                            CURLOPT_URL            => 'https://adsstate.com/api/getProductData',
                            CURLOPT_RETURNTRANSFER => true,
                            CURLOPT_ENCODING       => "",
                            CURLOPT_MAXREDIRS      => 10,
                            CURLOPT_TIMEOUT        => 30,
                            CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
                            CURLOPT_FOLLOWLOCATION => true,
                            CURLOPT_MAXREDIRS      => 2,
                            CURLOPT_CUSTOMREQUEST  => "POST",
                            CURLOPT_POSTFIELDS     => http_build_query( [
                              'authID'    => $authID,
                              'reflink'      => $reflink,
                              'signature' => base64_encode( hash( "sha256", $reflink . $authSignature, true ) )
                            ] ),
                            CURLOPT_HTTPHEADER     => array( "content-type: application/x-www-form-urlencoded" )
                          ) );
                          
                          $response2 = curl_exec( $curl );
                          
                          $err = curl_error( $curl );
                          
                          curl_close( $curl );
                          
                          if ( $err ) {
                            echo "cURL Error #:" . $err . ' (2)';
                            die();
                          }
import requests
                                  import hashlib
                                  
                                  authID = "Your authID here"
                                  authSignature = "You authSignature here"
                                  data = """[{"reflink":"REFERAL_LINK"}]"""
                                  
                                  headers = {
                                      "Content-Type": "application/x-www-form-urlencoded",
                                      "referer": "https://adsstate.com/api/getProductData",
                                  }
                                  signature = data + authSignature
                                  signature = hashlib.sha256(signature.encode()).hexdigest()
                                  signature = hashlib.base64(signature.encode()).hexdigest()
                                  
                                  files = {"authID": (None, authID), "data": (None, data), "signature": (None, signature)}
                                  
                                  response = requests.post(
                                      "https://adsstate.com/api/getProductData", headers=headers, files=files
                                  )

Balance

getBalance

Get account balance


/getBalance

Usage and API Samples

Name Value Description
authID Authentication credentials Provided by us
email Client's email
signature Signature to validate the request See explanation at the “Signature” section
curl -X POST "https://api.ceevo.com/v1/Balance/{BalanceId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.BalanceApi;

import java.io.File;
import java.util.*;

public class BalanceApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure OAuth2 access token for authorization: SecureAuthorization
        OAuth SecureAuthorization = (OAuth) defaultClient.getAuthentication("SecureAuthorization");
        SecureAuthorization.setAccessToken("YOUR ACCESS TOKEN");

        BalanceApi apiInstance = new BalanceApi();
        String BalanceId = BalanceId_example; // String | Register Account Token with Balance
        getBalance tokenDetail = ; // getBalance | tokenDetail
        try {
            apiInstance.getBalance(BalanceId, tokenDetail);
        } catch (ApiException e) {
            System.err.println("Exception when calling BalanceApi#getBalance");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.BalanceApi;

public class BalanceApiExample {

    public static void main(String[] args) {
        BalanceApi apiInstance = new BalanceApi();
        String BalanceId = BalanceId_example; // String | Register Account Token with Balance
        getBalance tokenDetail = ; // getBalance | tokenDetail
        try {
            apiInstance.getBalance(BalanceId, tokenDetail);
        } catch (ApiException e) {
            System.err.println("Exception when calling BalanceApi#getBalance");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: SecureAuthorization)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];

String *BalanceId = BalanceId_example; // Register Account Token with Balance
getBalance *tokenDetail = ; // tokenDetail

BalanceApi *apiInstance = [[BalanceApi alloc] init];

// Register Account Token with Balance
[apiInstance getBalanceWith:BalanceId
    tokenDetail:tokenDetail
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CeevoPayment = require('ceevo_payment');
var defaultClient = CeevoPayment.ApiClient.instance;

// Configure OAuth2 access token for authorization: SecureAuthorization
var SecureAuthorization = defaultClient.authentications['SecureAuthorization'];
SecureAuthorization.accessToken = "YOUR ACCESS TOKEN"

var api = new CeevoPayment.BalanceApi()

var BalanceId = BalanceId_example; // {String} Register Account Token with Balance

var tokenDetail = ; // {getBalance} tokenDetail


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getBalance(BalanceId, tokenDetail, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getBalanceExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: SecureAuthorization
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new BalanceApi();
            var BalanceId = BalanceId_example;  // String | Register Account Token with Balance
            var tokenDetail = new getBalance(); // getBalance | tokenDetail

            try
            {
                // Register Account Token with Balance
                apiInstance.getBalance(BalanceId, tokenDetail);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling BalanceApi.getBalance: " + e.Message );
            }
        }
    }
}
<?php
                            $email = "EMAIL"
                              
                              $authID        = "myAuthID";
                              $authSignature = "myAuthSignature";
                              
                              $curl = curl_init();
                              curl_setopt_array( $curl, array(
                                CURLOPT_URL            => 'https://adsstate.com/api/getBalance',
                                CURLOPT_RETURNTRANSFER => true,
                                CURLOPT_ENCODING       => "",
                                CURLOPT_MAXREDIRS      => 10,
                                CURLOPT_TIMEOUT        => 30,
                                CURLOPT_HTTP_VERSION   => CURL_HTTP_VERSION_1_1,
                                CURLOPT_FOLLOWLOCATION => true,
                                CURLOPT_MAXREDIRS      => 2,
                                CURLOPT_CUSTOMREQUEST  => "POST",
                                CURLOPT_POSTFIELDS     => http_build_query( [
                                  'authID'    => $authID,
                                  'email'      => $email,
                                  'signature' => base64_encode( hash( "sha256", $email . $authSignature, true ) )
                                ] ),
                                CURLOPT_HTTPHEADER     => array( "content-type: application/x-www-form-urlencoded" )
                              ) );
                              
                              $response2 = curl_exec( $curl );
                              
                              $err = curl_error( $curl );
                              
                              curl_close( $curl );
                              
                              if ( $err ) {
                                echo "cURL Error #:" . $err . ' (2)';
                                die();
                              }
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::BalanceApi;

# Configure OAuth2 access token for authorization: SecureAuthorization
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

my $api_instance = WWW::SwaggerClient::BalanceApi->new();
my $BalanceId = BalanceId_example; # String | Register Account Token with Balance
my $tokenDetail = WWW::SwaggerClient::Object::getBalance->new(); # getBalance | tokenDetail

eval { 
    $api_instance->getBalance(BalanceId => $BalanceId, tokenDetail => $tokenDetail);
};
if ($@) {
    warn "Exception when calling BalanceApi->getBalance: $@\n";
}
import requests
                                import hashlib
                                
                                authID = "Your authID here"
                                authSignature = "You authSignature here"
                                data = """[{"email":"EMAIL"}]"""
                                
                                headers = {
                                    "Content-Type": "application/x-www-form-urlencoded",
                                    "referer": "https://adsstate.com/api/getBalance",
                                }
                                signature = data + authSignature
                                signature = hashlib.sha256(signature.encode()).hexdigest()
                                signature = hashlib.base64(signature.encode()).hexdigest()
                                
                                files = {"authID": (None, authID), "data": (None, data), "signature": (None, signature)}
                                
                                response = requests.post(
                                    "https://adsstate.com/api/getBalance", headers=headers, files=files
                                )

Signature

SIGNATURE: To make sure that the received data is the exact data sent by the api caller, signature validation is required. See how to generate a signature below:

a. Concatenate all the endpoint parameters (except for ‘authID’) + authSignature.

● If the param is an array, then concat the json_encoded value of it.

b. Encrypt the concatenated string using SHA-256 Cryptographic Hash Algorithm.

c. Encode the result using Base64.

The parameters must be concatenated in the order they appear in the doc.

Responses

Success output example:


                                array (
                                    'status' => 'success',
                                    'message' => 'Success',
                                    'dataSet' => 'response data',
                                  )
                                  

Failure output example:


                                    array (
                                        'status' => 'error',
                                        'errors' => 
                                        array (
                                            0 =>
                                            array (
                                                'errCode' => '100.1',
                                                'errMessage' => 'API authentication error',
                                            ),
                                            1 =>
                                            array (
                                                'errCode' => '200.1.1',
                                                'errMessage' => 'Signature is required'
                                            ),
                                        ),
                                    )
                                      

Error codes:

Status: 100.1 - API authentication error

Status: 100.X - Internal errors (contact support)

Status: 200.X.X - parameters validation error

Status: 300.X.X - Internal errors (contact support)