GET /api/rewards
Get the list of rewards

Get the list of all rewards accessible by the current user. Can be paginated and/or filtered by reward state

Params

Param name Description
archived_after
optional

Return only rewards accounted on and after the supplied date. Date format: YYYYMMDD (example: 20180702)

Validations:

  • Must be a String

page
optional

Return only one page of rewards. Default per-page is 10

Validations:

  • Must be a Integer

per_page
optional

Number of rewards returned per page. Works only in combination with “page” param. Default value is 10

Validations:

  • Must be a Integer

state
optional

Validations:

  • Must be one of: draft, reviewing, unapproved, queue, accounting.


POST /api/rewards
Create reward

Creates new reward

Params

Param name Description
draft
optional

Whether created reward should be in draft state. If the value of this param is 1, reward will be saved as draft and will not be validated; otherwise, it will be either in reviewing or queue state (depending on whether its user has approvers or not).

Validations:

  • Must be a Integer

user_id
optional

Reward’s user, optional, defaults to current user. Must be one of the current company users

Validations:

  • Must be a Integer

reward
required

Reward hash

Validations:

  • Must be a Hash

reward[description]
required

Reward description

Validations:

  • Must be a String

reward[date]
required

Reward date

Validations:

  • Must be a String

reward[cost_center_ids]
optional , nil allowed

Validations:

  • Must be an array of Integer

reward[reward_type_id]
required

Reward type ID, IDs can be fetched from GET /api/reward_types

Validations:

  • Must be a Integer

reward[tax_card_id]
optional , nil allowed

User’s tax card ID

Validations:

  • Must be a Integer

reward[cost]
required

Reward cost, can be either reward type cost or custom (for non-fixed price reward types)

Validations:

  • Must be a Float

reward[tax_percentage]
required

Tax percentage, should be less than 1, e.g. 0.35 for 35%

Validations:

  • Must be a Float