Welcome to

The best way to monetize

your private server

API Docs

To get started using the API, ensure that you have created your store and received your API key via the dashboard. You'll need to send this key with every request in the headers as Authorization: Bearer your_code_here. This lets us know who is using the api and thus getting you the correct information.

Api URL: https://api.runepay.app

Endpoints
GET /cart/{username} Returns a user's cart.
PUT /cart/{product_id} Adds an item by product id to the user's cart.
DELETE /cart/{product_id} Removes an item from the user's cart.

GET /cart/{username}

Returns an array of items in the user's cart. IP Address must be provided to prevent users from seeing each others cart if using the same name.

Query String Params
Field Type Description Default
ip_address String The user's ip address. Required
discount String A discount code, if one is applied. Optional
Expected output:
                    
                        {
                            "items": [
                                {
                                    "id": 44,
                                    "username": "OGKingFox",
                                    "store_id": 1,
                                    "product_id": 2,
                                    "quantity": 1,
                                    "ip_address": "127.0.0.1",
                                    "stores_product": {
                                        "id": 1,
                                        "item_name": "A Test Product",
                                        "price": 10,
                                        "image_url": null
                                    }
                                }
                            ],
                            "total": 10,
                            "discount": {
                                "percentage": 0,
                                "error": "defined only if an invalid code is provided."
                            }
                        }
                    
                
Error output:
            
                { "error": "error message" }
            
        

PUT /cart/{product_id}

Adds an item to the users cart. The quantity can never exceed `max qty` set in the dashboard unless it's been set to -1.

Post Params
Field Type Description *
username String The user's name Optional
ip_address String The user's ip address. Required
quantity Integer The quantity of the product to add. Required
Expected output:
                    
                        { 
                            success: true,
                            message: "A test product has been added to your cart." 
                        }
                    
                
Error output:
            
                { "error": "error message" }
            
        

DELETE /cart/{product_id}

Removes the item from the users cart entirely.

Post Params
Field Type Description *
username String The user's name Optional
ip_address String The user's ip address. Required
Expected output:
                    
                        {
                            success: true, 
                            message: "Your cart has been updated."
                        }
                    
                
Error output:
            
                { "error": "error message" }