Orders

Get Orders

GET /residential/orders

Query Parameters

Name
Type
Description

page

Integer

Number of page

per_page

Integer

Number of orders to get per page

Example request:

curl -X GET "https://resi-api.iproyal.com/v1/residential/orders?page=1&per_page=10" \
     -H "Authorization: Bearer <your_api_token>"

Example response:

{
  "data": [
    {
      "id": 4,
      "note": null,
      "product_name": "Residential",
      "status": "confirmed",
      "amount": 50,
      "quantity": 10,
      "order_billing_type": "subscription",
      "created_at": "2025-06-26 10:01:50"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 20,
    "total": 1
  }
}

Create Order

POST /residential/orders

Body Parameters:

Name
Type
Description

quantity

Integer

GB quantity

coupon_code

String

A discount code to apply to the order, if available.

card_id

Integer

If supplied - card will be billed for this order, if not - we will try to deduct the amount from balance

order_billing_type

String

subscription or regular default - subscription

Example request:

curl -X POST https://resi-api.iproyal.com/v1/residential/orders \
     -H "Authorization: Bearer <your_api_token>" \
     -H "Content-Type: application/json" \
     -d '{"quantity": 10}'

Response:

{
    "id": 4,
    "note": null,
    "product_name": "Residential",
    "status": "confirmed",
    "amount": 50,
    "quantity": 10,
    "order_billing_type": "subscription",
    "created_at": "2025-06-26 10:01:50"
}

Calculate Pricing

GET /residential/orders/calculate-pricing

Query Parameters:

Name
Type
Description

quantity

Integer

Required. The amount of the product to order.

coupon_code

String

Optional. Discount code for the order.

order_billing_type

String

subscription or regular default - subscription

Example request:

curl -X GET https://resi-api.iproyal.com/v1/residential/orders/calculate-pricing \
     -H "Authorization: Bearer <your_api_token>" \
     -H "Content-Type: application/json" \
     -d '{"quantity": 10}'

Example response:

{
  "total": 50
}

Last updated