Omniplex Docs

Payments

These API endpoints are related to payments on Omniplex

Get Paypal

GET
/payments/paypal

Gets the required info needed for paypal payments.

Response Body

Success

application/json
  1. response
paypal_client_id?string
Example Request
curl -X GET 'https://spider.omniplex.gg/payments/paypal'
Example Response
{  "paypal_client_id": "string"}

Create Paypal Order

POST
/users/{id}/paypal

Creates a paypal order returning the URL. Use this to initiate a new paypal order in your client.

Authorization

User
headerUser-Auth<token>

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

Path Parameters

id*string

User ID

Request Body

application/json
  1. body
credits?integer
for?string
for_type?string
Value in"bot""server"
gift?boolean

Whether this is a gift for a listing the buyer doesn't own

gift_anonymous?boolean

Hide the buyer's name from the listing's owners

gift_message?string
id?string
name?string
promo_code?string

Response Body

Success

application/json
  1. response
url?string
Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/paypal' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "url": "string"}

Capture Paypal Order

GET
/payments/paypal/capture/{ref_id}

Captures a paypal order, giving any needed perks. This is an internal endpoint.

Path Parameters

ref_id*string

The reference ID of the order returned during paypals redirect back to us

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 GET 'https://spider.omniplex.gg/payments/paypal/capture/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Stripe

GET
/payments/stripe

Gets the required info needed for stripe payments.

Response Body

Success

application/json
  1. response
stripe_public_key?string
Example Request
curl -X GET 'https://spider.omniplex.gg/payments/stripe'
Example Response
{  "stripe_public_key": "string"}

Create Stripe Checkout

POST
/users/{id}/stripe

Creates a stripe checkout session returning the URL. Use this to initiate a new stripe order in your client.

Authorization

User
headerUser-Auth<token>

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

Path Parameters

id*string

User ID

Request Body

application/json
  1. body
credits?integer
for?string
for_type?string
Value in"bot""server"
gift?boolean

Whether this is a gift for a listing the buyer doesn't own

gift_anonymous?boolean

Hide the buyer's name from the listing's owners

gift_message?string
id?string
name?string
promo_code?string

Response Body

Success

application/json
  1. response
url?string
Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/stripe' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "url": "string"}

Check Promo Code

POST
/users/{id}/promo-codes/check

Checks whether a promo code can be used for premium or Auto-vote and previews the discount. For premium, credits are applied before the code.

Authorization

User
headerUser-Auth<token>

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

Path Parameters

id*string

User ID

Request Body

application/json
  1. body
code?string
credits?integer
plan?string
product?string
Value in"premium""autovote"

Response Body

Success

application/json
  1. response
amount_off_cents?integer

Fixed amount taken off in US cents, if this is a fixed amount code

code?string

The normalised promo code

description?string

Staff-written description of the offer

discount_cents?integer

Amount the code takes off the first payment, in US cents

duration?string

How long the discount lasts on Auto-vote: once, repeating or forever

duration_months?integer

Number of months the discount repeats for, when duration is repeating

percent_off?integer

Percentage taken off, if this is a percentage code

product?string

The product the code was checked against: premium or autovote

subtotal_cents?integer

Price in US cents before the code, after any credits

total_cents?integer

First payment in US cents after the code

Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/promo-codes/check' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "amount_off_cents": 0,  "code": "string",  "description": "string",  "discount_cents": 0,  "duration": "string",  "duration_months": 0,  "percent_off": 0,  "product": "string",  "subtotal_cents": 0,  "total_cents": 0}

Handle Stripe Webhook

POST
/payments/stripe/webhook

Handles stripe payment webhooks. Not intended for public use and firewalled to only stripe IPs.

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/payments/stripe/webhook'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Handle PayPal Webhook

POST
/payments/paypal/webhook

Handles PayPal refund and dispute webhooks. Not intended for public use; every event is verified with PayPal before it is acted on.

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/payments/paypal/webhook'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Premium Plans

GET
/payments/premium/plans

Gets the current set of premium plans available.

Response Body

Success

application/json
  1. response
auto_vote?

Auto-vote subscription prices

credits_per_cent?integer

How many vote credits take one cent off a plan

max_credit_share?number

The largest share of a plan's price credits can cover, from 0 to 1

Formatdouble
plans?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/payments/premium/plans'
Example Response
{  "auto_vote": {    "included_slots": 0,    "max_extra_slots": 0,    "price_cents": 0,    "slot_price_cents": 0,    "yearly_price_cents": 0,    "yearly_slot_price_cents": 0  },  "credits_per_cent": 0,  "max_credit_share": 0.1,  "plans": [    {      "benefit": "string",      "id": "string",      "name": "string",      "price": 0.1,      "time_period": 0    }  ]}

Redeem Payment Offer

POST
/users/{id}/redeem-payment-offer

Redeems a payment offer for a user given a redeem code

Authorization

User
headerUser-Auth<token>

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

Path Parameters

id*string

User ID

Query Parameters

code*string

Redeem Code. Default codes: BOOSTPREMIUM -> special booster offer

Request Body

application/json
  1. body
credits?integer
for?string
for_type?string
Value in"bot""server"
gift?boolean

Whether this is a gift for a listing the buyer doesn't own

gift_anonymous?boolean

Hide the buyer's name from the listing's owners

gift_message?string
id?string
name?string
promo_code?string

Response Body

Success

application/json
  1. response
url?string
Example Request
curl -X POST 'https://spider.omniplex.gg/users/string/redeem-payment-offer?code=string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "url": "string"}