Getting Started

Generating API Keys

Calling API Functions

JSON or XML

API Call Rate Limits

Affiliate Accounts

Functions

Types

Merchant Accounts

Functions

Types

GET Promotions Function

Retrieves an array of promotions, optionally filtered by one or more properties.


Syntax

GET https://api.commissionfactory.com/V1/Merchant/Promotions?apiKey=[apiKey]&affiliateId=[affiliateId]&affiliateContactName=[affiliateContactName]&affiliateBusinessName=[affiliateBusinessName]

Parameters

Name Type Description
apiKey
Required
String A valid API key that represents a merchant account.
affiliateId
Optional
Integer If specified, filters results by affiliate ID.
affiliateContactName
Optional
String If specified, filters results by affiliate contact name.
affiliateBusinessName
Optional
String If specified, filters results by affiliate business name.

Return Value

Type Description
PromotionArray Represents zero or more promotions.

Errors

Error Description
400 Bad Request One or more parameters could not be parsed correctly.
401 Unauthorised The API key is missing, invalid, or for a different account type; or the user account has been suspended or closed.
500 Internal Server Error An unexpected error occured while processing your request.
503 Service Unavailable The API call rate limit for the user account has been exceeded.
NOTE: As of 2019-02-01, the response from the server will change:
429 Too Many Requests

JSON XML

Example

Request

GET /V1/Merchant/Promotions?apiKey=ABC123 HTTP/1.1
Accept: application/json
Host: api.commissionfactory.com
GET /V1/Merchant/Promotions?apiKey=ABC123 HTTP/1.1
Accept: application/xml
Host: api.commissionfactory.com

Response

[
    {
        "Id": 1,
        "DateCreated": "2000-01-01T00:00:00.000",
        "DateModified": "2000-01-01T00:00:00.000",
        "Description": "10% off when you spend $100 or more",
        "TargetUrl": "https://www.example.com/",
        "TermsAndConditions": "Cannot be combined with any other offer.",
        "StartDate": null,
        "EndDate": null,
        "AffiliateId": 123,
        "AffiliateContactName": "John Smith",
        "AffiliateBusinessName": "Example Pty Ltd"
    },
    {
        "Id": 1,
        "DateCreated": "2000-01-01T00:00:00.000",
        "DateModified": "2000-01-01T00:00:00.000",
        "Description": "20% off when you spend $300 or more",
        "TargetUrl": "https://www.example.com/",
        "TermsAndConditions": "Cannot be combined with any other offer.",
        "StartDate": null,
        "EndDate": null,
        "AffiliateId": null,
        "AffiliateContactName": null,
        "AffiliateBusinessName": null
    },
    {
        "Id": 1,
        "DateCreated": "2000-01-01T00:00:00.000",
        "DateModified": "2000-01-01T00:00:00.000",
        "Description": "30% off when you spend $500 or more",
        "TargetUrl": "https://www.example.com/",
        "TermsAndConditions": "Cannot be combined with any other offer.",
        "StartDate": null,
        "EndDate": null,
        "AffiliateId": null,
        "AffiliateContactName": null,
        "AffiliateBusinessName": null
    }
]
<PromotionArray xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://api.commissionfactory.com/V1/Merchant">
    <Promotion>
        <Id>1</Id>
        <DateCreated>2000-01-01T00:00:00.000</DateCreated>
        <DateModified>2000-01-01T00:00:00.000</DateModified>
        <Description>10% off when you spend $100 or more</Description>
        <TargetUrl>https://www.example.com/</TargetUrl>
        <TermsAndConditions>Cannot be combined with any other offer.</TermsAndConditions>
        <StartDate i:nil="true" />
        <EndDate i:nil="true" />
        <AffiliateId>123</AffiliateId>
        <AffiliateContactName>John Smith</AffiliateContactName>
        <AffiliateBusinessName>Example Pty Ltd</AffiliateBusinessName>
    </Promotion>
    <Promotion>
        <Id>1</Id>
        <DateCreated>2000-01-01T00:00:00.000</DateCreated>
        <DateModified>2000-01-01T00:00:00.000</DateModified>
        <Description>20% off when you spend $300 or more</Description>
        <TargetUrl>https://www.example.com/</TargetUrl>
        <TermsAndConditions>Cannot be combined with any other offer.</TermsAndConditions>
        <StartDate i:nil="true" />
        <EndDate i:nil="true" />
        <AffiliateId i:nil="true" />
        <AffiliateContactName i:nil="true" />
        <AffiliateBusinessName i:nil="true" />
    </Promotion>
    <Promotion>
        <Id>1</Id>
        <DateCreated>2000-01-01T00:00:00.000</DateCreated>
        <DateModified>2000-01-01T00:00:00.000</DateModified>
        <Description>30% off when you spend $500 or more</Description>
        <TargetUrl>https://www.example.com/</TargetUrl>
        <TermsAndConditions>Cannot be combined with any other offer.</TermsAndConditions>
        <StartDate i:nil="true" />
        <EndDate i:nil="true" />
        <AffiliateId i:nil="true" />
        <AffiliateContactName i:nil="true" />
        <AffiliateBusinessName i:nil="true" />
    </Promotion>
</PromotionArray>

Related Links