Skip to content

preorders.php

Preorder management module for handling customer orders, including adding new preorders, checking status, and managing notifications.

API Methods

Method Action Description
add add preorder Creates a new preorder for the authenticated customer.
check check preorder status Checks the current status of preorders.
count_customer get customer preorder count Returns the total number of preorders for the authenticated customer.
delete delete preorder Deletes a specific preorder.
list_customer get customer preorders list Returns a list of preorders belonging to the authenticated customer.
notify send notification Sends a notification to the customer regarding preorders.

preorders/add

Creates a new preorder for the authenticated customer.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: add
token ✅ string Authentication token.

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X POST \
--data "action=add" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "add",
"data": {
"id": 12345,
"status": "pending",
"total": {
"EUR": 49.99,
"USD": 54.0
},
"created_at": "2024-05-20T12:00:00Z"
}
}
Error examples
{
"code": -1,
"message": "Error description"
}

preorders/check

Checks the current status of preorders.

HTTP method: GET

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: check

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X GET \
--data "action=check"
Success response example
{
"result": "OK",
"action": "check",
"data": {
"status": "active",
"last_update": "2024-05-20T12:00:00Z"
}
}
Error examples
{
"code": -1,
"message": "Error description"
}

preorders/count_customer

Returns the total number of preorders for the authenticated customer.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: count_customer
token ✅ string Authentication token.

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X POST \
--data "action=count_customer" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "count_customer",
"data": {
"count": 5
}
}
Error examples
{
"code": -1,
"message": "Error description"
}

preorders/delete

Deletes a specific preorder.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: delete
token ✅ string Authentication token.
cancel_token ❌ string Cancellation token for the preorder.

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X POST \
--data "action=delete" \
--data "token=HOSTKEY_TOKEN" \
--data "cancel_token=VALUE"
Success response example
{
"result": "OK",
"action": "delete",
"data": null
}
Error examples
{
"code": -1,
"message": "Error description"
}

preorders/list_customer

Returns a list of preorders belonging to the authenticated customer.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: list_customer
token ✅ string Authentication token.

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X POST \
--data "action=list_customer" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "list_customer",
"data": [
{
"id": 101,
"status": "active",
"amount": 25.0
},
{
"id": 102,
"status": "pending",
"amount": 10.0
}
]
}
Error examples
{
"code": -1,
"message": "Error description"
}

preorders/notify

Sends a notification to the customer regarding preorders.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: notify
token ✅ string Authentication token.

Request example

curl -s "https://invapi.hostkey.com/preorders.php" -X POST \
--data "action=notify" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "notify",
"data": {
"status": "sent"
}
}
Error examples
{
"code": -1,
"message": "Error description"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×