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
active
boolean
query

Filter influencer codes based on the active field.

code
string
query

Filter influencer codes based on the code field.

name
string
query

Filter influencer codes based on the name field.

redeemable
boolean
query

Filter influencer codes based on the redeemable field.

vouchername
string
query

Filter influencer codes based on the vouchername field.

voucherpassword
string
query

Filter influencer codes based on the voucherpassword field.

datestart_from
integer
query

Filter influencer codes based on the datestart field. The value is greater or equal to datestart field on influencer code.

timestamp
datestart_to
integer
query

Filter influencer codes based on the datestart field. The value is less or equal to datestart field on influencer code.

timestamp
dateend_from
integer
query

Filter influencer codes based on the dateend field. The value is greater or equal to dateend field on influencer code.

timestamp
dateend_to
integer
query

Filter influencer codes based on the dateend field. The value is less or equal to dateend field on influencer code.

timestamp
datelastused_from
integer
query

Filter influencer codes based on the datelstused field. The value is greater or equal to datelastused field on influencer code.

timestamp
datelastused_to
integer
query

Filter influencer codes based on the datelstused field. The value is less or equal to datelastused field on influencer code.

timestamp
sort
string
query

Sort the result.

Available values:
  • code
  • -code
  • name
  • -name
  • vouchername
  • -vouchername
  • voucherpassword
  • -voucherpassword
  • datestart
  • -datestart
  • dateend
  • -dateend
  • datelastused
  • -datelastused
Default: "code"
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
string
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}$
Example: "123.00"

timestamp
integer

Number of seconds since the Unix Epoch.