Omniplex Docs

Shop

These API endpoints are related to the Omniplex shop.

Get Shop Coupons

GET
/shop/public-coupons

Gets the publicly viewable shop coupons on the list

Response Body

Success

application/json
  1. response
items?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/shop/public-coupons'
Example Response
{  "items": [    {      "allowed_users": [        "string"      ],      "applicable_items": [        "string"      ],      "cents": 0.1,      "code": "string",      "created_at": "2019-08-24T14:15:22Z",      "created_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "expiry": 0,      "id": "string",      "last_updated": "2019-08-24T14:15:22Z",      "max_uses": 0,      "public": true,      "requirements": [        "string"      ],      "reuse_wait_duration": 0,      "target_types": [        "string"      ],      "updated_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "usable": true    }  ]}

Get Shop Items

GET
/shop/items

Gets the publicly viewable shop items on the list

Response Body

Success

application/json
  1. response
items?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/shop/items'
Example Response
{  "items": [    {      "benefits": [        "string"      ],      "cents": 0.1,      "created_at": "2019-08-24T14:15:22Z",      "created_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "description": "string",      "duration": 0,      "id": "string",      "last_updated": "2019-08-24T14:15:22Z",      "name": "string",      "target_types": [        "string"      ],      "updated_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      }    }  ]}

Get Shop Items

GET
/shop/item-benefits

Gets the publicly viewable shop items on the list

Response Body

Success

application/json
  1. response
items?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/shop/item-benefits'
Example Response
{  "items": [    {      "created_at": "2019-08-24T14:15:22Z",      "created_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "description": "string",      "id": "string",      "last_updated": "2019-08-24T14:15:22Z",      "name": "string",      "target_types": [        "string"      ],      "updated_by": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      }    }  ]}

Get Shop Purchases

GET
/{target_type}/{target_id}/shop/purchases

Returns the purchase history for an entity.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Response Body

Success

application/json
  1. response
items?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/shop/purchases'
Example Response
{  "items": [    {      "cents": 0.1,      "created_at": "2019-08-24T14:15:22Z",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "item_id": "string",      "target_id": "string",      "target_type": "string"    }  ]}

Purchase Shop Item

POST
/{target_type}/{target_id}/shop/purchase

Spends an entity's earned vote credits on a shop item, optionally discounted by a coupon code. Returns a 204 on success.

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Request Body

application/json
  1. body
coupon_code?string

An optional coupon code to apply to this purchase

item_id?string

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/shop/purchase' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}