Orders

API endpoints for managing orders

Get all orders

GET https://wemx.app/api/v1/orders

Returns all orders on your application

{
    "status": true,
    "current_page": 1,
    "data": [
        {
            "id": 2,
            "user_id": 2388,
            "package_id": 1,
            "status": "active",
            "name": "Your personal server",
            "service": "universal",
            "domain": null,
            "price": {
                "id": 2,
                "package_id": 2,
                "type": "single",
                "period": 90,
                "price": 333,
                "renewal_price": 333,
                "setup_fee": 0,
                "cancellation_fee": 0,
                "data": null,
                "is_active": 1,
                "created_at": "2024-01-09T19:22:17.000000Z",
                "updated_at": "2024-01-09T19:22:26.000000Z"
            },
            "options": {
                "coupon": null
            },
            "data": {
                "example": true
            },
            "notes": null,
            "cancelled_at": null,
            "cancel_reason": null,
            "last_renewed_at": "2024-01-09T19:29:59.000000Z",
            "due_date": "2025-04-17T00:00:00.000000Z",
            "created_at": "2024-01-09T18:29:25.000000Z",
            "updated_at": "2024-01-09T19:29:59.000000Z"
        }
    ],
    "first_page_url": "http://wemx.app/api/v1/orders?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://wemx.app/api/v1/orders?page=1",
    "links": [
        {
            "url": null,
            "label": "Previous",
            "active": false
        },
        {
            "url": "http://wemx.app/api/v1/orders?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Next",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "http://wemx.app/api/v1/orders",
    "per_page": 15,
    "prev_page_url": null,
    "to": 2,
    "total": 2
}

Available Relationships (optional)

https://wemx.app/api/v1/orders?include=user,payments,package

Available relationships:

user, payments, package, members

Filters (optional)

https://wemx.app/api/v1/orders?filter[status]=suspended

Available Filters:

package_id, status, service, domain, data, options, price due_date

Tip: To filter JSON columns such as data and options, you can specify the key using ?filter[data->server_id]=12

Sorting (optional)

https://wemx.app/api/v1/orders?sort[created_at]=asc

Available Sorting Parameters:

first_name, last_name, username, email, balance, created_at

Sorting operators

asc, desc, random

Dates (optional)

https://wemx.app/api/v1/orders?date=30days
OperatorDescription

today

Get orders created today

yesterday

Get orders created yesterday

3days, 7days, 14days, 30days, 90days

Get orders created last x days

YYYY-MM-DD,YYY-MM-DD

Get orders created between a range of dates

Get an order

GET https://wemx.app/api/v1/orders/{order}

Retrieves a single order from the order id

Query Parameters

NameTypeDescription

package

String

Include package

members

String

Include members

payments

String

Include payments

user

String

Include user

{
    "status": true,
    "data": {
        "id": 2,
        "user_id": 2388,
        "package_id": 1,
        "status": "active",
        "name": "Your personal server",
        "service": "universal",
        "domain": null,
        "price": {
            "id": 2,
            "package_id": 2,
            "type": "single",
            "period": 90,
            "price": 333,
            "renewal_price": 333,
            "setup_fee": 0,
            "cancellation_fee": 0,
            "data": null,
            "is_active": 1,
            "created_at": "2024-01-09T19:22:17.000000Z",
            "updated_at": "2024-01-09T19:22:26.000000Z"
        },
        "options": {
            "coupon": null
        },
        "data": {
            "example": true
        },
        "notes": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "last_renewed_at": "2024-01-09T19:29:59.000000Z",
        "due_date": "2025-04-17T00:00:00.000000Z",
        "created_at": "2024-01-09T18:29:25.000000Z",
        "updated_at": "2024-01-09T19:29:59.000000Z"
    }
}

Update an order

PUT https://wemx.app/api/v1/orders/{order}

Update a specific order. All parameters are optional, only pass the parameters that you wish to update

Request Body

NameTypeDescription

name

String

Name of the order

user_id

Number

Change the user that owns the order

price_id

Number

Change the price of the order

data

JSON

Update the data parameters of an order

options

JSON

Update the options of an order

due_date

Date

Change the due date of an order, must be a date in the future

{
    "success": true,
    "data": {
        "id": 2,
        "user_id": 2388,
        "package_id": 1,
        "status": "active",
        "name": "Your personal server",
        "service": "universal",
        "domain": null,
        "price": {
            "id": 2,
            "package_id": 2,
            "type": "single",
            "period": 90,
            "price": 333,
            "renewal_price": 333,
            "setup_fee": 0,
            "cancellation_fee": 0,
            "data": null,
            "is_active": 1,
            "created_at": "2024-01-09T19:22:17.000000Z",
            "updated_at": "2024-01-09T19:22:26.000000Z"
        },
        "options": {
            "coupon": null
        },
        "data": {
            "example": true
        },
        "notes": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "last_renewed_at": "2024-01-09T19:29:59.000000Z",
        "due_date": "2025-04-17T00:00:00.000000Z",
        "created_at": "2024-01-09T18:29:25.000000Z",
        "updated_at": "2024-01-09T19:29:59.000000Z"
    }
}

Delete an order

DELETE https://wemx.app/api/v1/orders/{order}

Delete a order, the order must be terminated in order to delete it. Pass "force=1" to ignore this check

Request Body

NameTypeDescription

force

boolean

Delete order forcefully

Suspend an order

POST https://wemx.app/api/v1/orders/{order}/suspend

Suspend an order using from the order id

{
    "status": true,
    "data": {
        "id": 2,
        "user_id": 2388,
        "package_id": 1,
        "status": "suspended",
        "name": "Your personal server",
        "service": "universal",
        "domain": null,
        "price": {
            "id": 2,
            "package_id": 2,
            "type": "single",
            "period": 90,
            "price": 333,
            "renewal_price": 333,
            "setup_fee": 0,
            "cancellation_fee": 0,
            "data": null,
            "is_active": 1,
            "created_at": "2024-01-09T19:22:17.000000Z",
            "updated_at": "2024-01-09T19:22:26.000000Z"
        },
        "options": {
            "coupon": null
        },
        "data": {
            "test": true
        },
        "notes": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "last_renewed_at": "2024-01-09T19:29:59.000000Z",
        "due_date": "2025-04-17T00:00:00.000000Z",
        "created_at": "2024-01-09T18:29:25.000000Z",
        "updated_at": "2024-01-09T19:58:35.000000Z",
        "package": {
            "id": 1,
            "order": 0,
            "category_id": 1,
            "name": "Universal",
            "description": "",
            "icon": "universal.png",
            "service": "universal",
            "status": "restricted",
            "global_quantity": -1,
            "client_quantity": -1,
            "require_domain": 0,
            "allow_coupons": 1,
            "allow_notes": 1,
            "data": null,
            "setup_on": "payment_received",
            "created_at": "2024-01-09T18:28:54.000000Z",
            "updated_at": "2024-01-09T18:29:37.000000Z",
            "emails": [],
            "webhooks": []
        }
    }
}

Unsuspend an order

POST https://wemx.app/api/v1/orders/{order}/unsuspend

Unsuspend a order from the order id

{
    "status": true,
    "data": {
        "id": 2,
        "user_id": 2388,
        "package_id": 1,
        "status": "active",
        "name": "Your personal server",
        "service": "universal",
        "domain": null,
        "price": {
            "id": 2,
            "package_id": 2,
            "type": "single",
            "period": 90,
            "price": 333,
            "renewal_price": 333,
            "setup_fee": 0,
            "cancellation_fee": 0,
            "data": null,
            "is_active": 1,
            "created_at": "2024-01-09T19:22:17.000000Z",
            "updated_at": "2024-01-09T19:22:26.000000Z"
        },
        "options": {
            "coupon": null
        },
        "data": {
            "test": true
        },
        "notes": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "last_renewed_at": "2024-01-09T19:29:59.000000Z",
        "due_date": "2025-04-17T00:00:00.000000Z",
        "created_at": "2024-01-09T18:29:25.000000Z",
        "updated_at": "2024-01-09T19:59:58.000000Z",
        "package": {
            "id": 1,
            "order": 0,
            "category_id": 1,
            "name": "Universal",
            "description": "",
            "icon": "universal.png",
            "service": "universal",
            "status": "restricted",
            "global_quantity": -1,
            "client_quantity": -1,
            "require_domain": 0,
            "allow_coupons": 1,
            "allow_notes": 1,
            "data": null,
            "setup_on": "payment_received",
            "created_at": "2024-01-09T18:28:54.000000Z",
            "updated_at": "2024-01-09T18:29:37.000000Z",
            "emails": [],
            "webhooks": []
        }
    }
}

Terminate an order

POST https://wemx.app/api/v1/orders/{order}/terminate

Terminate an order from the order id

Request Body

NameTypeDescription

force

Boolean

Forcefully terminate the order

{
    "status": true,
    "data": {
        "id": 2,
        "user_id": 2388,
        "package_id": 1,
        "status": "terminated",
        "name": "Your personal server",
        "service": "universal",
        "domain": null,
        "price": {
            "id": 2,
            "package_id": 2,
            "type": "single",
            "period": 90,
            "price": 333,
            "renewal_price": 333,
            "setup_fee": 0,
            "cancellation_fee": 0,
            "data": null,
            "is_active": 1,
            "created_at": "2024-01-09T19:22:17.000000Z",
            "updated_at": "2024-01-09T19:22:26.000000Z"
        },
        "options": {
            "coupon": null
        },
        "data": {
            "test": true
        },
        "notes": null,
        "cancelled_at": null,
        "cancel_reason": null,
        "last_renewed_at": "2024-01-09T19:29:59.000000Z",
        "due_date": "2025-04-17T00:00:00.000000Z",
        "created_at": "2024-01-09T18:29:25.000000Z",
        "updated_at": "2024-01-09T20:01:30.000000Z",
        "package": {
            "id": 1,
            "order": 0,
            "category_id": 1,
            "name": "Universal",
            "description": "",
            "icon": "universal.png",
            "service": "universal",
            "status": "restricted",
            "global_quantity": -1,
            "client_quantity": -1,
            "require_domain": 0,
            "allow_coupons": 1,
            "allow_notes": 1,
            "data": null,
            "setup_on": "payment_received",
            "created_at": "2024-01-09T18:28:54.000000Z",
            "updated_at": "2024-01-09T18:29:37.000000Z",
            "emails": [],
            "webhooks": []
        }
    }
}

Last updated