-
Notifications
You must be signed in to change notification settings - Fork 7
API v1: Store and Purchase
iDigitalFlame edited this page Apr 6, 2021
·
8 revisions
- Token with "__SYS_STORE" permissions
- Teams must have their "Store ID" set
Accepts: GET, POST
| 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. |
- 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
}
| 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. |
- Team ID
Examples:
POST /api/v1/purchase/10
POST /api/v1/purchase/5
POST /api/v1/purchase/100
POST /api/v1/purchase/9999
- 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>
}
]
}