Versions Compared
Version | Old Version 1 | New Version 2 |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Promo Code Lists
Method Objective
The method allows getting all existing lists of promo codes.
Request
Endpoint | Request Type |
---|---|
https://api.personaclick.com/promo_codes | GET |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
shop_secret | string | required | Store Secret Key in PersonaClick. Located there: Account > Settings > Store Settings |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
403 Forbidden | The request was unsuccessful. |
404 Not Found | There are no mandatory parameters in the query. |
API Response Data
The API returns an array of category objects. Below are the properties of a single object.
Name | Type | Description |
---|---|---|
id | number | The ID of the Promo Code list |
name | string | The name of the Promo Code list |
available | number | Available number of promo codes. |
Request Example
Code Block | ||||
---|---|---|---|---|
| ||||
curl 'https://api.personaclick.com/promo_codes?shop_id=0d42fd8b713d0752776ca589cc0056&shop_secret=0123456789abcdef0123456789abcdef' |
Method Objective
The method gives the next promo code from the requested list of promo codes.
Syntax and parameters
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("get_promo_code", params, success, error); |
Name | Type | Requirement | Description |
---|---|---|---|
params | object | required | Object with request parameters. See below. |
success | function | required | A callback function, to which the API response will be passed. Response type: string. |
error | function | optionally | A callback function that will be called when an error occurs (any HTTP status code other than 200), including when the list of promo codes is empty. |
Request parameters
Name | Type | Requirement | Description |
---|---|---|---|
id | number/string | required | Unique ID of the promo code list. |
API response
Type | Description |
---|---|
string | Next promo code from the requested list |
Note |
---|
The received promo code is cached for 2 hours for the current user's device. The end of the caching period is shifted by 2 hours each time if the user opens pages of the site during the caching period. |
Example of use
Code Block | ||||
---|---|---|---|---|
| ||||
personaclick("get_promo_code", {id: 100500}, function(code) { // the functionality of using promo code }, function(error) { // when something went wrong }); |
Table of Contents | ||
---|---|---|
|