API Documentation

zferral API


Introduction

Referral

Methods:

Examples:


All of the referral attribute fields are returned from GET (read) operations.

Parameters:

  • id INT (Read Only) The unique identifier for this referral
  • affiliate_id INT (Read Only) Affiliate id
  • campaign_id INT (Read Only) Campaign id
  • campaign_name VARCHAR(255) (Read Only) Campaign name
  • campaign_reward_type VARCHAR(40) (Read Only) Campaign reward type (monetary or non-monetary)
  • remote_customer_id VARCHAR(255) (Read Only) Customer id
  • remote_service_id VARCHAR(255) (Read Only) Service id
  • commission_amount DECIMAL(10,2) (Read Only) Commission amount
  • transaction_value DECIMAL(10,2) (Read Only) Transaction value
  • created_at TIMESTAMP (Read Only) The creation date for this referral


Methods

get – retrieve referral data

URL: "https://<subdomain>.zferral.com/api/<api_key>/referral/<id>.<format>"
Method: GET
Format: xml or json
Required Parameters: id
Response: An single referral
XML and JSON example


list – retrieve list of referrals

URL: "https://<subdomain>.zferral.com/api/<api_key>/referrals.<format>"
Method: GET
Format: xml or json
Optional Parameters: page, limit
Response: An array of Commissions, up to 50 per page
XML and JSON example

get – Usage Example

Scenarios [examples]:

Requirements:

  • Give correct <api_key>
  • Returned data format <format>
  • Give <id>


  1. Scenario: Retrieve referral data


    Request

    URL: "https://subdomain.zferral.com/api/<api_key>/referral/2.<format>"


    Response (return status code "200 OK"):

    a) XML

            <?xml version="1.0" encoding="UTF-8"?>
            <referral>
              <id>2</id>
              <affiliate_id>1</affiliate_id>
              <campaign_id>2</campaign_id>
              <remote_customer_id>customer@example.com</remote_customer_id>
              <remote_service_id>product</remote_service_id>
              <created_at>2010-10-21 14:44:50</created_at>
              <campaign_name>Campaign</campaign_name>
              <campaign_reward_type>non-monetary</campaign_reward_type>
              <commission_amount>1</commission_amount>
              <transaction_value>12</transaction_value>
            </referral>
          

    b) JSON

            {
              "referral": {
                "id"                    : 2,
                "affiliate_id"          : 1,
                "campaign_id"           : 2,
                "remote_customer_id"    : "customer@example.com",
                "remote_service_id"     : "product",
                "created_at"            : "2010-10-21 14:44:50",
                "campaign_name"         : "Campaign",
                "campaign_reward_type"  : "non-monetary",
                "commission_amount"     : 1
                "transaction_value"     : 12
            }}
          


list – Usage Example

Scenarios [examples]:

Requirements:

  • Give correct <api_key>
  • Returned data format <format>


  1. Scenario: Retrieve list of referrals


    Request

    URL: "https://subdomain.zferral.com/api/<api_key>referrals.<format>"


    Response (return status code "200 OK"):

    a) XML

            <?xml version="1.0" encoding="UTF-8"?>
            <referrals type="array">
              <referral>
                <id>2</id>
                <affiliate_id>1</affiliate_id>
                <campaign_id>2</campaign_id>
                <remote_customer_id>customer@example.com</remote_customer_id>
                <remote_service_id>product</remote_service_id>
                <created_at>2010-10-21 14:44:50</created_at>
                <campaign_name>Campaign</campaign_name>
                <campaign_reward_type>non-monetary</campaign_reward_type>
                <commission_amount>1</commission_amount>
                <transaction_value>12</transaction_value>
              </referral>
              <referral>
                <id>1</id>
                <affiliate_id>1</affiliate_id>
                <campaign_id>2</campaign_id>
                <remote_customer_id>customer1@example.com</remote_customer_id>
                <remote_service_id>product</remote_service_id>
                <created_at>2010-10-21 14:43:50</created_at>
                <campaign_name>Campaign</campaign_name>
                <campaign_reward_type>monetary</campaign_reward_type>
                <commission_amount>1</commission_amount>
                <transaction_value>12</transaction_value>
              </referral>
            </referrals>
          

    b) JSON

            {
             "referrals" : {
                "referral" : {
                  (...)
                },
                "referral" : {
                  (...)
                },
                "referral" : {
                  (...)
                }
            }}