A PHP SDK for the Share-A-Sale Merchant API
ShareASale Merchant API Documentation: https://account.shareasale.com/m-apiips.cfm
(you must be logged into a valid Merchant Account to view)
NOTE: This is NOT the Affiliate API!
Install Composer and run the following command:
php composer require ooglek/shareasale-merchant-api-sdk
Calling from your code:
$sas = new ooglek\ShareASale\Client(
'12345', // MerchantId
'rAnDoMsTuFf', // Token
'sUpErRaNd0mStUfF' // Secret Key
);
// Returns an array with the Summary of your Merchant account Activity
$records = $sas->activitySummary(
[
'datestart' => '15/09/2021',
'dateend' => '15/08/2021'
]
);
You can magically get and set any properties in the class by calling their name prefixed with get
or set
.
$sas->setVersion('3.0');
$sas->getHttpResponse();
Any of the mentioned Actions are implemented magically and case insensitively.
$sas->void(['date' => '15/09/2021', 'ordernumber' => 12345]);
$sas->balance();
$sas->todayataglance();
You can use these properties to access the raw Guzzle request data, in case you are having issues.
$this->getHttpResponse()
// Guzzle Response Object$this->getQuery()
// Array of Query Parameters$this->getHeaders()
// Array of HTTP Headers$this->getSig()
// The string that is SHA256 encoded
ShareASale does not publish their error codes, so yeah, I don't know what your error code means either. Contact ShareASale.
Note: You may need to request special permission for some of these Transaction Actions
- void
- edit
- find
- new
- reference
- transactiondetail
- weeklyprogress
- affiliatetimespan
- activitysummary
- datafeeddownloads
- todayataglance
- staterevenue
- report-affiliate
- transactioneditreport
- transactionvoidreport
- apitokencount
- ledger
- affiliateTags
- balance
- bannerList
- bannerUpload
- bannerEdit
- dealList
- dealUpload
- dealEdit
- approveAffiliate
- declineAffiliate
- MassTagAffiliates