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)

Available relationships:

user, payments, package, members

Filters (optional)

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)

Available Sorting Parameters:

first_name, last_name, username, email, balance, created_at

Sorting operators

asc, desc, random

Dates (optional)

Operator
Description

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

Name
Type
Description

package

String

Include package

members

String

Include members

payments

String

Include payments

user

String

Include user

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

Name
Type
Description

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

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

Name
Type
Description

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

Unsuspend an order

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

Unsuspend a order from the order id

Terminate an order

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

Terminate an order from the order id

Request Body

Name
Type
Description

force

Boolean

Forcefully terminate the order

Last updated

Was this helpful?