Merchant Services
Use the merchant services to search, view details and get links for merchants in our system.
GetClosestMerchants
Description
The GetClosestMerchants method returns a list of the closest merchants to the specified location.
Request Parameters
| Field | Field Type | Data Type | Description |
|---|---|---|---|
| Authorization | Header | String | This is the authorization token you'll get from the site administrator console. You must send this string with every api request. |
| Method | URL | String | To use this method you must use the string: GetClosestMerchants |
| Latitude | URL | Double | The latitude corresponding to your current location |
| Longitude | URL | Double | The longitude corresponding to your current location |
| Radius | URL | Integer | A number representing the search radius in miles. |
| CategoryID | URL | Integer | This is the CategoryID of the iRebates category whose results you want returned. |
| Page | URL | Integer | This is the page or records you want. |
| Count | URL | Integer | The is the number of records per page you want returned. The maximum number of results the system will return is 100 at a time. The default value for this field is 50. |
| ReturnType | URL | String | This is the type of response you're looking for. Valid values are json and xml. This defaults to xml. |
Example:
If you only wanted to get the closest 50 merchants in a 25 mile radius that are mexican food restaurants then you would use the following url along with the authorization string in your header:
http://yoursite.com/webservices/merchant?method=GetClosestMerchants&Latitude=40&Longitude=-111&Radius=25&Category=Mexican+Food&Page=1&Count=50
Response
Below are the fields it returns.
| Field | Type | Description |
|---|---|---|
| Columns | Array | An array containing the column names of the data |
| Data | Array | An array of the merchants meeting the criteria. |
Data Array
| Field | Type | Description |
|---|---|---|
| MerchantName | String | The name of the Merchant. |
| MerchantID | Integer | The ID of the Merchant. |
| Address | String | The address of the Merchant. |
| Address2 | String | Address line 2 |
| City | String | |
| State | String | |
| Zip | String | |
| Country | String | |
| Phone | String | |
| Latitude | String | |
| Longitude | String | |
| BaseOfferTitle | String | |
| BaseOfferDetails | String | |
| Reviews | Integer | The number of reviews the merchant has. |
| Rating | Double | The average rating of the merchant. |
| CategoryID | Integer | The CategoryID associated with the merchant. |
| Website | String | If the merchant has a website this will provide the link to it. |
Example
Here is an example of a JSON response.
{"Merchants":[{"Zip":"84057","Reviews":0,"Phone":"8013732600","State":"UT","Address2":"","MerchantID":4951,
"City":"Orem","Country":"","CategoryID":0,"Address":"504 W 800 N",
"BaseOfferDetails":"Get a free entree with a purchase of any entree",
"BaseOfferTitle":"Buy one get one free","Longitude":-111.709335327148,"Rating":0,"Latitude":40.31326675415,
"MerchantName":"Test Merchant","Website":"http:\/\/www.test.com\/"}]}
GetReviews
Description
The GetReviews method returns a list of reviews for the selected merchant.
Request Parameters
| Field | Field Type | Data Type | Description |
|---|---|---|---|
| Authorization | Header | String | This is the authorization token you'll get from the site administrator console. You must send this string with every api request. |
| Method | URL | String | To use this method you must use the string: GetReviews |
| MerchantID | URL | Integer | The ID of the merchant in the iRebates system |
| Page | URL | Integer | This is the page or records you want. |
| Count | URL | Integer | The is the number of records per page you want returned. The maximum number of results the system will return is 100 at a time. The default value for this field is 50. |
| ReturnType | URL | String | This is the type of response you're looking for. Valid values are json and xml. This defaults to xml. |
Example:
To get the most recent 10 reviews for a merchant use the following url:
http://yoursite.com/webservices/merchant?method=GetReviews&MerchantID=160&Page=1&Count=50
Response
Below are the fields it returns.
Data Array
| Field | Type | Description |
|---|---|---|
| Name | String | The name of the person who provided the review. |
| ReviewID | Integer | The ID of the Review. |
| Date | DateTime | The date and time the review was written. |
| UserID | Integer | The ID of the User that left the review. |
| Title | String | The title of the review. |
| Comments | String | The content of the review. |
| Rating | Integer | A rating based on a 1 to 5 scale |
Example
Here is an example of a JSON response.
{"Reviews":[{"Title":"Good Merchant","Name":"John Doe","UserID":685948,"Rating":4,"ReviewID":2,
"Date":"December, 28 2011 17:08:22-0700","Comments":"They're ok"},{"Title":"Awesome Merchant","Name":"Mike Jones",
"UserID":685948,"Rating":5,"ReviewID":1,"Date":"December, 28 2011 17:07:53-0700",
"Comments":"I love this place. They serve the best food."}]}
CreateReview
Description
The CreateReview allows you to create a review for a user.
Request Parameters
| Field | Field Type | Data Type | Description |
|---|---|---|---|
| Authorization | Header | String | This is the authorization token you'll get from the site administrator console. You must send this string with every api request. |
| Method | URL | String | To use this method you must use the string: CreateReview |
| MerchantID | URL | Integer | The ID of the merchant in the iRebates system |
| UserID | URL | Integer | The ID of the user in the iRebates system |
| Title | URL | String | The title of the review |
| Comments | URL | String | The content of the review |
| Rating | URL | Integer | The rating of the merchant based on a 1 to 5 scale. |
| ReturnType | URL | String | This is the type of response you're looking for. Valid values are json and xml. This defaults to xml. |
Example:
To create a review for a user use the following url:
http://yoursite.com/webservices/merchant?method=CreateReview&MerchantID=160&UserID=685948&Title=Excellent+Merchant&Comments=I+love+coming+to+this+place&Rating=5
Response
Below are the fields it returns.
| Field | Type | Description |
|---|---|---|
| Success | Boolean | Returns true if the review was created successfully. |
| ID | Integer | The ID of the Review created. |
Example
Here is an example of a JSON response.
{"ID":"3","Success":true}
CreateReviewComplaint
Description
The CreateReviewComplaint allows you to create a complaint for a review.
Request Parameters
| Field | Field Type | Data Type | Description |
|---|---|---|---|
| Authorization | Header | String | This is the authorization token you'll get from the site administrator console. You must send this string with every api request. |
| Method | URL | String | To use this method you must use the string: CreateReviewComplaint |
| ReviewID | URL | Integer | The ID of the review the complaint is about. |
| UserID | URL | Integer | The ID of the user in the iRebates system |
| Title | URL | String | The title of the complaint |
| Comments | URL | String | The content of the complaint |
| ReturnType | URL | String | This is the type of response you're looking for. Valid values are json and xml. This defaults to xml. |
Example:
To create a review for a user use the following url:
http://yoursite.com/webservices/merchant?method=CreateReviewComplaint&ReviewID=4&UserID=685948&Title=Profanity&Comments=There+was+offensive+language+in+the+review&
Response
Below are the fields it returns.
| Field | Type | Description |
|---|---|---|
| Success | Boolean | Returns true if the review was created successfully. |
| ID | Integer | The ID of the Review created. |
Example
Here is an example of a JSON response.
{"ID":"3","Success":true}
GetMerchantDetails
Description
The GetMerchantDetails allows you to get details for a specific merchant.
Request Parameters
| Field | Field Type | Data Type | Description |
|---|---|---|---|
| Authorization | Header | String | This is the authorization token you'll get from the site administrator console. You must send this string with every api request. |
| Method | URL | String | To use this method you must use the string: GetMerchantDetails |
| MerchantID | URL | Integer | The ID of the merchant in the iRebates system. |
| ReturnType | URL | String | This is the type of response you're looking for. Valid values are json and xml. This defaults to xml. |
Example:
To get details for a merchant with an iRebates ID of 1234 use the following url:
http://yoursite.com/webservices/merchant?method=GetMerchantDetails&MerchantID=1234
Response
Below are the fields it returns.
| Field | Type | Description |
|---|---|---|
| MerchantID | Integer | The ID of the Merchant in the iRebates system. |
| Name | String | The name of the Merchant. |
| Description | String | The description of the merchant. |
| Website | String | The website of the merchant. |
| Phone | String | The primary phone number of the merchant. |
| String | The contact email address of the merchant. | |
| BaseOfferTitle | String | The title of the Merchant's base offer. |
| BaseOfferDetails | String | The details of the Merchant's base offer. |
| DealCount | Integer | The number of deals associated with the merchant. |
| LocationCount | Integer | The number of locations associated with the merchant. |
| Deals | Array | An array containing Deal objects. |
| Locations | Array | An array containing Location objects. |
Deals Object
| Field | Type | Description |
|---|---|---|
| Title | String | The title of the deal. |
| Details | String | The details of the deal. |
| Code | String | The coupon code associated with the deal. |
| StartDate | Datetime | The datetime that the deal became active. |
| EndDate | Datetime | The datetime that the deal becomes inactive. |
| Image | String | The URL of the deal image. |
Locations Object
| Field | Type | Description |
|---|---|---|
| LocationID | Integer | The ID of the location. |
| Latitude | String | The longitude of the location. Calculated using the google geocode service. |
| Longitude | String | The longitude of the location. Calculated using the google geocode service. |
| Address | String | The address of the location. |
| Address2 | String | An additional address field for the location. |
| City | String | The city the location is in. |
| State | String | The state the location is in. |
| Zip | String | The postal code of the location. |
| Country | String | The country the location is located in. |
| Phone | String | The phone number for this location. |
Example
Here is an example of a JSON response.
{"Phone":"","Website":"","Label":"","Deals":[],"MerchantID":"5346","Locations":[{"Zip":"84062","Phone":"(801) 796- 6166",
"LocationID":11,"Address":"793 South Main Street","State":"Utah","Address2":"","Longitude":-111.740676879883,
"Latitude":40.354232788086,"Country":"United States","City":"Pleasant Grove"}],
"BaseOfferDetails":"10% off any head in the store ","Email":"","Description":"","Name":"",
"BaseOfferTitle":"10% off any lacrosse head","LocationCount":1,"DealCount":0}
