Skip to content

API v1: Store and Purchase

iDigitalFlame edited this page Apr 6, 2021 · 8 revisions

Endpoint /v1/purchase/(?P<team_id>[0-9]+)

Requirements

  • Token with "__SYS_STORE" permissions
  • Teams must have their "Store ID" set

Accepts: GET, POST

GET /v1/purchase/(?P<team_id>[0-9]+)

Status Response Meaning
200 OK. (Sends the conversion rate.)
401 Missing token.
403 Missing or invalid permissions.
404 Team ID is invalid.
500 Internal server error.

Parameters

  • Team ID

Examples:

GET /api/v1/purchase/10
GET /api/v1/purchase/5
GET /api/v1/purchase/100
GET /api/v1/purchase/9999

Example 200 output:

{
    "rate": 1.0
}

POST /v1/purchase/(?P<team_id>[0-9]+)

Status Response Meaning
200 Purchase processed.
400 Order data is invalid.
401 Missing token.
403 Missing or invalid permissions.
404 Team ID is invalid.
500 Internal server error.

Parameters

  • Team ID

Examples:

POST /api/v1/purchase/10
POST /api/v1/purchase/5
POST /api/v1/purchase/100
POST /api/v1/purchase/9999

Notes

  • JSON "team" attribute will be omitted in newer releases.
  • JSON "order[].item" is recommended to be under 150 characters long.
    • If longer than 150 characters, the API will truncate it before committing.

Example Submission:

{
    "team": <store_id>,
    "order": [
        {
            "item": "PaloAlto Firewall"
            "price": 9001
        },
        {
            "item": "Item Name or Description",
            "price": <int score value>
        }
    ]
}

Clone this wiki locally