# Order Validation

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

## Validate an order model and return if the order is possible or not.

<mark style="color:green;">`POST`</mark> `https://api.hypeproxy.io/v2/Orders/Validate`

#### Request Body

| Name                                            | Type    | Description                                               |
| ----------------------------------------------- | ------- | --------------------------------------------------------- |
| productId<mark style="color:red;">\*</mark>     | Guid    | Product Id                                                |
| locationId<mark style="color:red;">\*</mark>    | Guid    | Location Id                                               |
| billingPeriod<mark style="color:red;">\*</mark> | Enum    | `Daily`, `Weekly`, `Monthly` or `Yearly`                  |
| paymentMethod<mark style="color:red;">\*</mark> | Enum    | `CreditCard` or `Cryptos`                                 |
| quantity<mark style="color:red;">\*</mark>      | Integer | Quantity, like 1, 2, 3, 10 etc                            |
| isAutoRenewed<mark style="color:red;">\*</mark> | Boolean | If payment should be renewed every end of billing period. |
| couponCode                                      | String  | If you have a coupon code you can put it there.           |

{% tabs %}
{% tab title="200: OK Validation passed response" %}

```javascript
{
    "message": "Validation Passed. You can now use /v2/Orders endpoint to create an order.",
    "statusCode": "OK",
    "requestDetails": {
        "userId": "00000000-0000-0000-0000-000000000000",
        "endpoint": "/v2/Orders/Validate",
        "date": "2021-11-07T15:01:06.776251Z",
        "timestamp": 1636297266,
        "userAgent": "PostmanRuntime/7.28.4",
        "clientIp": "::1"
    },
    "data": {
        "price": {
            "unitPrice": 55,
            "totalPrice": 55
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Insufficient quantity available for this kind of products/locations." %}

```javascript
{
    "errors": [
        {
            "code": "InsufficientQuantityAvailable",
            "message": "Insufficient quantity available for this kind of products/locations."
        }
    ],
    "message": "Request failed.",
    "statusCode": "BadRequest",
    "requestDetails": {
        "userId": "00000000-0000-0000-0000-000000000000",
        "endpoint": "/v2/Orders/Validate",
        "date": "2021-11-07T15:02:02.753931Z",
        "timestamp": 1636297322,
        "userAgent": "PostmanRuntime/7.28.4",
        "clientIp": "::1"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Payment autorenew not possible with this payment method." %}

```javascript
{
    "errors": [
        {
            "code": "UnavailableAutomaticRenew",
            "message": "With this payment method it's not possible to enable autorenew."
        }
    ],
    "message": "Request failed.",
    "statusCode": "BadRequest",
    "requestDetails": {
        "userId": "00000000-0000-0000-0000-000000000000",
        "endpoint": "/v2/Orders/Validate",
        "date": "2021-11-07T15:04:15.939415Z",
        "timestamp": 1636297455,
        "userAgent": "PostmanRuntime/7.28.4",
        "clientIp": "::1"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hypeproxy.io/api/order-process-1/order-validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
