How To Place An Order Using The API?
Publisher: Psychz Networks, October 13,2022The following instructions describe how to place orders using Psychz Order API calls. Suppose you are a customer of Psychz Networks and are using your application to manage your clients or your services/infrastructure. In that case, you can use our API as a messenger to process requests and ensure the seamless functioning of new order placements.
You can fetch order-related APIs from the following link https://www.psychz.net/api/doc/dist/#/SERVICES - CREATE ORDER.
Note: Please whitelist your IP address if you plan to use the "Try It Out feature". To add the IP address to the list, read the "IP Address" section below.
To perform a test, you will need a Token and a Username. To fetch these details, follow the steps given in the article here Setup API Access
Now that you have the token and the username, you can try the APIs related to Create Order. The fields other than the Token and the username are not mandatory.
Order Process
Order creation is a three-step process that involves getting order plans, order creation, and order submission. We also offer order express API if you don't wish to customize the order.
Order Plans - Get Request (Document)
This will show you all the available plans in the system. You can import several parameters like Category, Plan name, Plan ID, location, price, etc.
Sample code
"dedicated_servers": {
"138": {
"category_name": "Dedicated Servers,"
"category_id": 2,
"billing_type": "1",
"plan_name": "Los Angeles :: E3-1230 v2",
"plan_id": "138",
"base_price": "319.00",
"reseller_price": ", "
"location_name": "Los Angeles, USA",
"configuration_items": {
"2055": {
"item_id": "2055",
"item_name": "Support Type",
"options": {
"6459": {
"option_id": "6459",
"description": "Basic (Ping Monitor)",
"option_price": "0.00",
"option_setup_price": "0.00",
"default": 0
},
NOTE: The above is only a piece of code for your reference. You can download the entire JSON file at your end to view the parameters in detail.
Order Create - Post Request (Document)
You can create an order by passing the Plan ID, order quantity, and configuration options. Once the order is made, it waits in your cart for you to proceed with the payment.
Sample code
{
"access_token": "string",
"access_username": "string",
"plan_id": 0,
"order_quantity": 1,
"config_option": {}
}
Order Submit (Document)
Order submission is the last stage of order placement. The available payment options are "Credit only" and "Credit Card". You must have a default credit card added to the system when using the payment through a credit card. The order ID generated while creating the order needs to be passed along with the payment mode.
Sample code
{
"access_token": "string",
"access_username": "string",
"payment_mode": 0,
"order_id": 0,
"partner_id": 0
}
Payment mode options
1 = 'credit apply'
2 = 'credit card'
Order Express (Document)
Using the express order, you can place multiple orders in one go. The following is the piece of code, along with the parameters that are passed
Sample code
{
"access_token": "string",
"access_username": "string",
"plan_id": 0,
"order_quantity": 1,
"payment_mode": 0,
"os_cat": 0,
"os_id": 0,
"disk_partition_id": 0,
"software_raid": 0,
"hostname": "string",
"password": "string",
"partner_id": 0,
"enforce_password_change": 0
}
For more functionality-related information, kindly refer to the following page https://www.psychz.net/api/doc/dist/.