Getting Started

Generating API Keys

Calling API Functions

JSON or XML

API Call Rate Limits

Affiliate Accounts

Functions

Types

Merchant Accounts

Functions

Types

GET Payments Function

Retrieves an array of payments for a specified date range.


Syntax

GET https://api.commissionfactory.com/V1/Merchant/Payments?apiKey=[apiKey]&fromDate=[fromDate]&toDate=[toDate]

Parameters

Name Type Description
apiKey
Required
String A valid API key that represents a merchant account.
fromDate
Required
DateTime The start date of the date range to select.
toDate
Required
DateTime The end date of the date range to select.

Return Value

Type Description
PaymentArray Represents zero or more payments.

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

Remarks

The selected date range is inclusive of the fromDate and toDate parameters.

Both parameters are truncated so that only their date components are used, and their time components (if present) are ignored.

If fromDate is greater than toDate, then the parameters are swapped.

JSON XML

Example

Request

GET /V1/Merchant/Payments?apiKey=ABC123&fromDate=2000-01-01&toDate=2000-01-03 HTTP/1.1
Accept: application/json
Host: api.commissionfactory.com
GET /V1/Merchant/Payments?apiKey=ABC123&fromDate=2000-01-01&toDate=2000-01-03 HTTP/1.1
Accept: application/xml
Host: api.commissionfactory.com

Response

[
    {
        "Id": 1,
        "DateCreated": "2000-01-01T00:00:00.000",
        "Description": "Account Deposit",
        "Amount": 500.0000,
        "Balance": 500.0000
    },
    {
        "Id": 2,
        "DateCreated": "2000-01-02T00:00:00.000",
        "Description": "Payment to John Smith",
        "Amount": -10.0000,
        "Balance": 490.0000
    },
    {
        "Id": 3,
        "DateCreated": "2000-01-03T00:00:00.000",
        "Description": "Payment of Commission Factory Override",
        "Amount": -2.5000,
        "Balance": 487.5000
    }
]
<PaymentArray xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://api.commissionfactory.com/V1/Merchant">
    <Payment>
        <Id>1</Id>
        <DateCreated>2000-01-01T00:00:00.000</DateCreated>
        <Description>Account Deposit</Description>
        <Amount>500.0000</Amount>
        <Balance>500.0000</Balance>
    </Payment>
    <Payment>
        <Id>2</Id>
        <DateCreated>2000-01-02T00:00:00.000</DateCreated>
        <Description>Payment to John Smith</Description>
        <Amount>-10.0000</Amount>
        <Balance>490.0000</Balance>
    </Payment>
    <Payment>
        <Id>3</Id>
        <DateCreated>2000-01-03T00:00:00.000</DateCreated>
        <Description>Payment of Commission Factory Override</Description>
        <Amount>-2.5000</Amount>
        <Balance>487.5000</Balance>
    </Payment>
</PaymentArray>

Related Links