Versions Compared
Version | Old Version 1 | New Version Current |
---|---|---|
Changes made by | ||
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Get Promo Code Lists
Method Objective
The method
gives the next promo code from the requested listallows getting all existing lists of promo codes.
Syntax and parametersRequest
codepersonaclick("get_promo_code", params, success, error);Endpoint |
---|
language | js |
---|---|
theme | FadeToGrey |
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 request. |
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 |
Upload Promo Codes
Method Objective
The method allows uploading promo codes to the specified list.
Request
Endpoint | Request Type | Content-Type |
---|---|---|
https://api.personaclick.com/promo_codes | POST | application/json |
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 |
id | string | required | Promo code list ID |
API response
codes | Array | required | The array of promo codes. |
API Response Code
HTTP status code | Description |
---|---|
200 OK | The request was successful. |
400 Bad Request | See the "message" property of the API response for details. |
403 Forbidden | See the "message" property of the API response for details. |
404 Not Found | Required query parameters are missed or undefined. |
API Response Data
The response is JSON type with the following properties:
Name | Type | Description |
---|---|---|
status | string | Current status. Can have one of two values:
|
message | string | The text of the error if it occurred |
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
}); |
curl 'https://api.personaclick.com/promo_codes' \
-X 'POST' \
-H 'content-type: application/json' \
-d '{"shop_id":"0d42fd8b713d0752776ca589cc0056","shop_secret":"0123456789abcdef0123456789abcdef","id":100500,"codes":["code1","code2","codeN"]}' |
Get Next Promo Code
Method Objective
The method gives the next promo code from the requested list of promo codes.
Request
Endpoint | Request Type |
---|---|
https://api.personaclick.com/promo_codes/fetch | GET |
Parameters
Name | Type | Requirement | Description |
---|---|---|---|
shop_id | string | required | Unique Store Key in PersonaClick. Located there: Account > Settings > Store Settings |
id | number | required | Promo code list ID. |
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 request. |
API Response Data
Name | Type | Description |
---|---|---|
code | string | The next promo code on the list. |
Request Example
Code Block | ||||
---|---|---|---|---|
| ||||
curl https://api.personaclick.com/promo_codes/fetch?shop_id=0d42fd8b713d0752776ca589cc0056&id=100500 |
Column | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Page Navigation
Related Pages
|