> ## Documentation Index
> Fetch the complete documentation index at: https://docs.edisglobal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order VPS

> Place a new VPS order by authenticating with your WHMCS credentials and specifying the order details in JSON format.

### JSON Parameters:
- **billingcycle**: Specifies the billing cycle, e.g., 'monthly' or 'yearly'.
- **paymentmethod**: Specifies the payment method, e.g., 'paypal'.
- **applycredit**: Specifies whether to apply available account credit for the order. Accepts `true` or `false`.
- **item**: An array of product configurations:
  - **pid**: Product ID.
  - **os**: Operating System ID.
  - **hostname**: Hostname for the VPS.
  - **additional_ram**: Additional RAM requested (optional).
  - **additional_vcpu**: Additional vCPU requested (optional).
  - **additional_ip**: Additional IPs requested (optional).
  - **additional_diskboost**: Additional disk boost requested (optional).
  - **ssh_pubkey**: Public SSH key for access.

### **Response Behavior:**
- If `applycredit` is set to `true` and there is sufficient credit in the account, the response will return:
  ```json
  { "invoicepaid": true }
  ```
- If there is insufficient credit or the request is incorrect, the response will return:
  ```json
  { "invoicepaid": false }
  ```

**Example JSON:**
```json
{
  "billingcycle": "monthly",
  "paymentmethod": "paypal",
  "applycredit": true,
  "item": [
    {
      "pid": 1814,
      "os": 92,
      "hostname": "kvmtest",
      "additional_ram": 467,
      "additional_vcpu": 467,
      "additional_ip": 467,
      "additional_diskboost": 615,
      "ssh_pubkey": "ssh-rsa. ..."
    },
    {
      "pid": 1814,
      "os": 88,
      "hostname": "kvmtest2",
      "additional_ram": "",
      "additional_vcpu": "",
      "additional_ip": "",
      "additional_driveboost": "",
      "ssh_pubkey": "ssh-rsa. ..."
    }
  ]
}
```

⚠️ **Note:**
If you receive a response like `"status": "failed"` along with an `orderid`, it may indicate that the VPS could not be provisioned due to the product being **out of stock** in the selected location.

**Example Failed Response:**
```json
{
  "status": "failed",
  "orderid": 241158
}
```



## OpenAPI

````yaml post /kvm/v2/add/order
openapi: 3.0.0
info:
  title: EDIS Global ORDER API
  description: >
    Welcome to EDIS Global ORDER API 🚀

    The EDIS Global ORDER API allows seamless integration with our
    infrastructure to automate the entire product lifecycle (ordering and
    cancellations).


    Whether you’re integrating into your billing system or automating your
    service orders, our ORDER API makes managing the product lifecycle of EDIS
    Global services simple and effective. Below is a quick overview to help you
    get started.


    🚀 **Get Started Here**

    Follow these steps to begin using the EDIS Global ORDER API:


    - **Authentication:** Ensure you are authenticated (WHMCS username and
    password)

    - **Explore the Endpoints:** Use the endpoints below to order and cancel VPS
    services in any of our worldwide server locations.


    Available API Endpoints:


    **Payment Methods**

    - POST `get payment methods`
      Retrieve the available payment methods for your order.

    **Billing Cycles**

    - POST `get billingcycles`
      Get available billing cycles for different products.

    **Locations**

    - POST `get locations`
      Fetch all available VPS locations across the globe.

    **Products**

    - POST `get products`
      List the available VPS products and configurations.

    **Place an Order**

    - POST `add order`
      Add a new VPS order to the EDIS Global infrastructure.

    **Cancel a Product**

    - POST `cancel product`
      Cancel a specific product or VPS service.

    For more details on the EDIS Global ORDER API, please refer to the full
    documentation, and feel free to reach out if you have any questions or need
    assistance.


    Happy Coding!

    The EDIS Global Team
  version: 1.0.0
servers:
  - url: https://order.edisglobal.com
    description: Sandbox Server
security: []
paths:
  /kvm/v2/add/order:
    post:
      summary: Order-VPS.
      description: >-
        Place a new VPS order by authenticating with your WHMCS credentials and
        specifying the order details in JSON format.


        ### JSON Parameters:

        - **billingcycle**: Specifies the billing cycle, e.g., 'monthly' or
        'yearly'.

        - **paymentmethod**: Specifies the payment method, e.g., 'paypal'.

        - **applycredit**: Specifies whether to apply available account credit
        for the order. Accepts `true` or `false`.

        - **item**: An array of product configurations:
          - **pid**: Product ID.
          - **os**: Operating System ID.
          - **hostname**: Hostname for the VPS.
          - **additional_ram**: Additional RAM requested (optional).
          - **additional_vcpu**: Additional vCPU requested (optional).
          - **additional_ip**: Additional IPs requested (optional).
          - **additional_diskboost**: Additional disk boost requested (optional).
          - **ssh_pubkey**: Public SSH key for access.

        ### **Response Behavior:**

        - If `applycredit` is set to `true` and there is sufficient credit in
        the account, the response will return:
          ```json
          { "invoicepaid": true }
          ```
        - If there is insufficient credit or the request is incorrect, the
        response will return:
          ```json
          { "invoicepaid": false }
          ```

        **Example JSON:**

        ```json

        {
          "billingcycle": "monthly",
          "paymentmethod": "paypal",
          "applycredit": true,
          "item": [
            {
              "pid": 1814,
              "os": 92,
              "hostname": "kvmtest",
              "additional_ram": 467,
              "additional_vcpu": 467,
              "additional_ip": 467,
              "additional_diskboost": 615,
              "ssh_pubkey": "ssh-rsa. ..."
            },
            {
              "pid": 1814,
              "os": 88,
              "hostname": "kvmtest2",
              "additional_ram": "",
              "additional_vcpu": "",
              "additional_ip": "",
              "additional_driveboost": "",
              "ssh_pubkey": "ssh-rsa. ..."
            }
          ]
        }

        ```


        ⚠️ **Note:**

        If you receive a response like `"status": "failed"` along with an
        `orderid`, it may indicate that the VPS could not be provisioned due to
        the product being **out of stock** in the selected location.


        **Example Failed Response:**

        ```json

        {
          "status": "failed",
          "orderid": 241158
        }

        ```
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/add_order_body'
        required: true
      responses:
        '200':
          description: Successfully added a new VPS order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_200_6'
        '400':
          description: Bad Request - Invalid parameters or JSON format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_400_5'
        '401':
          description: Unauthorized - Invalid WHMCS credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_401_5'
        '500':
          description: Internal Server Error - Unable to process the order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/inline_response_500'
      servers:
        - url: https://order.edisglobal.com
          description: Specific endpoint for retrieving new VPS order
components:
  schemas:
    add_order_body:
      type: object
      properties:
        email:
          type: string
          description: Your WHMCS email address.
          example: yourwhmc_email
        pw:
          type: string
          description: Your WHMCS password.
          example: yourwhmcs_password
        order:
          type: string
          description: >-
            JSON-encoded string that includes order details such as billing
            cycle, payment method, apply credit, and VPS item configurations.
            Each item specifies properties like product ID (pid), operating
            system (os), hostname, additional resources (RAM, vCPU, IP), and an
            optional SSH public key.
          example: |
            {
              "billingcycle": "monthly",
              "paymentmethod": "paypal",
              "applycredit": true,
              "item": [
                {
                  "pid": 1814,
                  "os": 92,
                  "hostname": "kvmtest",
                  "additional_ram": 467,
                  "additional_vcpu": 467,
                  "additional_ip": 467,
                  "additional_diskboost": 615,
                  "ssh_pubkey": "ssh-rsa. ..."
                },
                {
                  "pid": 1814,
                  "os": 88,
                  "hostname": "kvmtest2",
                  "additional_ram": "",
                  "additional_vcpu": "",
                  "additional_ip": "",
                  "additional_driveboost": "",
                  "ssh_pubkey": "ssh-rsa. ..."
                }
              ]
            }
    inline_response_200_6:
      type: object
      properties:
        status:
          type: string
          example: success
        orderid:
          type: integer
          example: 123456
        serviceids:
          type: string
          example: 123456,123457
        invoiceid:
          type: integer
          example: 654321
        invoicepaid:
          type: boolean
          description: >-
            Indicates whether the invoice was paid successfully using available
            credit or another payment method.
          example: true
    inline_response_400_5:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Invalid parameters or incorrect JSON format.
        errors:
          type: array
          example:
            - billingcycle is required
            - invalid JSON structure
          items:
            type: string
    inline_response_401_5:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Invalid WHMCS credentials provided.
        suggestion:
          type: string
          example: Please verify your username and password and try again.
    inline_response_500:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: An unexpected error occurred while processing the order.
        support:
          type: string
          example: Please contact support with the order details for assistance.

````