Influencer Codes

Batch Add Influencer Codes

post /sites/{siteid}/influencercodes
PARAMETERS
siteid
integer
path
REQUIRED
REQUEST BODY
posthttps://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json
[
{
"code": "SCRAPBOOK101",
"name": "Emily Hadfield",
"active": false,
"voucherpassword": "RLFm3bef",
"vouchername": "All scrapbooks 10% off",
"maxuses": 1400
}
]
RESPONSE JSON
[
{
"statuscode": 200,
"return": "SCRAPBOOK101"
}
]
HTTP Status Code Summary
200Returns batch envelope with influencer codes.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Get Influencer Codes

get /sites/{siteid}/influencercodes
PARAMETERS
siteid
integer
path
REQUIRED
start
integer
query

The index of the item to start from

Default: 0
num
integer
query

The number of items returned

Default: 10
fields
array (string)
query

Comma separated list of fields to return. Use this to query only the fields you are using. See influencercode for all fields.

Example: /sites/{siteid}/influencercodes?fields=code,name,voucherpassword
RETURNS

Returns an envelope with items of type influencercode.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json?num=2
RESPONSE JSON
{
"totalcount": 2,
"items": [
{
"code": "PREPARE4SUMMER",
"name": "Taylor Smith",
"active": true,
"datestart": 1555711200,
"dateend": 1559339999,
"voucherpassword": "Lzs5MvMr",
"vouchercode": null,
"vouchername": null,
"vouchercomment": null,
"maxuses": 1000,
"numused": 2,
"datelastused": 1556466245,
"moneyordertotal": "174.00",
"moneyinfluencertotal": "97.00",
"moneyinfluencerdiscount": "38.00"
},
{
"code": "RUN-FASTER-2019",
"name": "Joe Mason",
"active": true,
"datestart": 1548975600,
"dateend": null,
"voucherpassword": "dJTv4gHE",
"vouchercode": null,
"vouchername": null,
"vouchercomment": "Discount on smartwatches.",
"maxuses": 600,
"numused": 1,
"datelastused": 1549985297,
"moneyordertotal": "1250.00",
"moneyinfluencertotal": "1000.00",
"moneyinfluencerdiscount": "250.00"
}
]
}
HTTP Status Code Summary
200Returns an envelope with items of type influencercode.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Batch Update Influencer Codes

put /sites/{siteid}/influencercodes
PARAMETERS
siteid
integer
path
REQUIRED
REQUEST BODY
puthttps://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json
[
{
"code": "SCRAPBOOK101",
"maxuses": 2000
}
]
RESPONSE JSON
[
{
"statuscode": 200,
"return": true
}
]
HTTP Status Code Summary
200Returns batch envelope with return value true on success.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Batch Delete Influencer Codes

delete /sites/{siteid}/influencercodes
PARAMETERS
siteid
integer
path
REQUIRED
REQUEST BODY
array
deletehttps://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes.json
[
{
"code": "SCRAPBOOK101"
}
]
RESPONSE JSON
[
{
"statuscode": 200,
"return": true
}
]
HTTP Status Code Summary
200Returns batch envelope with return value true on success.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Get Influencer Code

get /sites/{siteid}/influencercodes/{code}
PARAMETERS
siteid
integer
path
REQUIRED
code
integer
path
REQUIRED
fields
array (string)
query

Comma separated list of fields to return. Use this to query only the fields you are using. See influencercode for all fields.

Example: /sites/{siteid}/influencercodes/{code}?fields=code,name,voucherpassword
RETURNS

Returns an item of type influencercode.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/influencercodes/SCRAPBOOK101.json
RESPONSE JSON
{
"code": "SCRAPBOOK101",
"name": "Emily Hadfield",
"active": false,
"datestart": null,
"dateend": null,
"voucherpassword": "RLFm3bef",
"vouchercode": null,
"vouchername": "All scrapbooks 10% off",
"vouchercomment": null,
"maxuses": 1400,
"numused": 0,
"datelastused": null,
"moneyordertotal": "0.00",
"moneyinfluencertotal": "0.00",
"moneyinfluencerdiscount": "0.00"
}
HTTP Status Code Summary
200Returns an item of type influencercode.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Objects

influencercode
object

The object for influencer codes in Sitoo

PROPERTIES
code
string
REQUIRED

The unique influencer code. Can only contain [0-9a-zA-Z&_-.]

name
string
REQUIRED

The name of the influencer for this code.

active
boolean

If true, then this influencer code is active.

datestart

The date used for the activation of this influencer code. No activation date if value is null.

dateend

The date used for the expiration of this influencer code. No expiration date if value is null.

voucherpassword
string
REQUIRED

The password used for unlocking the voucher.

vouchercode
string

Value used to override vouchercode in the voucher applied for the purchase, or null to leave original value.

vouchername
string

Value used to override vouchername in the voucher applied for the purchase, or null to leave original value.

vouchercomment
string

Value used to override vouchercomment in voucher the voucher applied for the purchase, or null to leave original value.

maxuses
integer

The maximum times the influencer code can be used or null for unlimited use.

numused
integer
READ ONLY

The number of times the influencer code has been used.

datelastused
READ ONLY

The date for latest redeem of the influencer code.

moneyordertotal
READ ONLY

The total amount of sales for purchases where the influencer code was applied.

moneyinfluencertotal
READ ONLY

The total amount of sales for items affected by the influencer code.

moneyinfluencerdiscount
READ ONLY

The total amount of discounts given for the influencer code.

money
string

Pattern: ^[-+]?[0-9]+\.[0-9]{2}$

timestamp
integer

Number of seconds since the Unix Epoch.