ClassCharts API Docs

Purchase Reward

Purchase a reward item from the student's rewards shop.

POST
/purchase/{itemId}
/purchase/{itemId}

The Authorization access token

Authorization

Authorization
Required
Basic <token>

This is the session_id returned when logging in. e.g. Basic eW91IHNob3VsZCBzdGFyIHRoaXMgcmVwbyE=

In: header

Request Body

application/x-www-form-urlencodedRequired

pupil_idinteger

Path Parameters

itemId
Required
integer

curl -X POST "https://www.classcharts.com/apiv2student/purchase/0" \
  -H "Authorization: Basic <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "pupil_id": 0
  }'

Reward purchased

{
  "data": {
    "single_purchase": "yes",
    "order_id": 0,
    "balance": 0
  },
  "success": 0
}