How to create and execute orders using Order API

Appxite

Introduction

This article guides you through creating and executing orders using the Order API version 3.1. You will learn how to add products to a cart, place orders, and manage order statuses through API calls. This guide is intended for developers integrating with the platform APIs.

In this article:

Prerequisites

Before using the Order API, ensure you have:

  • Access to the API documentation portal
  • A valid subscription key from the Portal
  • Client ID and Client Secret with appropriate permissions
  • Active reseller portal and user account
NOTE! The API client requires specific permissions to execute orders and create carts. Each API endpoint documentation specifies the required permissions.

API authentication and headers

All API calls require the following headers:

Required headers

Referer: The Platform URL where you are making the purchase (your portal URL)

Ocp-Apim-Subscription-Key: Your subscription key from the portal (click "Show" to reveal and copy)

api-version: Use "3.1" for the latest Order API version

X-On-Behalf-Of: The Organization ID where the order will be placed

Finding the organization ID

The Organization ID (X-On-Behalf-Of value) can be found by:

  1. Navigate to "Organization" in the portal
  2. Select "Select organization"
  3. Choose your target organization and click on "Profile" 
  4. Copy Organization ID from Basic Details section

  5. Use the Organization ID  as a X-On-Behalf-Of value
NOTE! The X-On-Behalf-Of header represents the organization where the order sits, not a generated token. Your user must be active and your reseller portal must be live.

Create an order (add to cart)

Creating an order adds products to a shopping cart without placing the order. This is the first step in the order process.

Endpoint

POST  https://api.appxite.com/orders/

Required information

Offer ID: The ID of the Product you want to order. This should be stored in your system when you retrieve available products.

Order Item ID: A unique identifier you generate for this order item. Generate a new ID for each cart addition.

Form Data: Configuration details for the product, including:

  • Billing Cycle (e.g., "annual", "monthly")
  • Quantity
  • Data center location (use location ID, not string)
  • Commitment Period
  • License tier (if applicable)

Obtaining form data keys

Form data keys are not visible in the user interface. To discover them:

  1. Add a product to cart through the portal interface
  2. Open browser developer tools (F12)
  3. Navigate to the Network tab
  4. Inspect the API call made when adding to cart
  5. Examine the "form_data" object in the request payload (copy OrderDetails and extract only "Form data")
  6. Use these exact key names in your API calls

Example form data structure

"FormData": { "quantityBox1": 1, "ChargePeriod": { "offerId": "3d800b57-0958-4d86-a6a6-144243908f4f", "offerRulePricingId": "57066ba2-04e7-4610-8517-cff8d1953104", "pricingFrequency": "Monthly", "offerRuleFrequency": "Monthly", "offerRuleCustomFrequencyMonths": 1 }

Response

The response contains:

  • Order ID (generated by the system)
  • Order Item ID (your generated ID)
  • Available operations you can perform (place_order, delete, update, schedule_order, create_quote)
  • Form data confirmation
IMPORTANT! Save the Order ID from the response - you will need it to execute the order.

Example API call and its response

Headers:

Body:

Response:

Execute an order (place order)

After adding products to the cart, you must execute the order to submit it for provisioning.

Endpoint

POST https://api.appxite.com/orders/operation

Required headers

Use the same headers as create/execute operations:

  • Referer
  • Ocp-Apim-Subscription-Key
  • api-version
  • X-On-Behalf-Of

Required information

Order ID: From the create order response

Offer ID: The same Offer ID used when creating the order

Order Item ID: The same Order Item ID used when creating the order

Form Data: The same form data used when creating the order

Set of Operations: Include the "place_order" operation from the create order response

 

Process flow

  1. Copy the Order ID from the create order response
  2. Use the same Offer ID and Order Item ID
  3. Include the place_order operation
  4. Submit the execute order request
  5. The order moves from cart to the orders page
  6. Provisioning begins automatically
NOTE! Executing an order is different from creating an order. Creating adds to cart; executing submits the order for processing.

Example API call and its response

Body

Response

Retrieve order information

To check order status and details, use the retrieve order endpoint.

Endpoint

GET https://api.appxite.com/orders/{orderId}

Required headers

Use the same headers as create/execute operations:

  • Referer
  • Ocp-Apim-Subscription-Key
  • api-version
  • X-On-Behalf-Of

Response information

The response includes:

  • Order Status (provision_started, provision_finished, provision_failed)
  • Order item details
  • Form data
  • Available operations

Use this endpoint to poll for order status updates after placing an order.

Example API call response

Understanding order provisioning

After executing an order, the Platform handles provisioning automatically.

Provisioning process

  1. Order is submitted via execute API call
  2. Platform initiates external communication with the Vendor (Microsoft, IBM, etc.)
  3. Order Status updates based on vendor response
  4. Final status: provision_finished (success) or provision_failed (failure)

Provisioning statuses

provision_started: Order submitted to vendor, processing in progress

provision_finished: Order successfully provisioned

provision_failed: Order failed during provisioning

Manual approval scenarios

Some offers require manual approval:

  • Custom integration offers without API automation
  • Offers configured for manual processing

For manually configured offers, a user must approve the order in the portal even when created via API.

NOTE! Automated offers do not require manual approval. The order provisions automatically after execution.

Cancel an order item

Cancellation disables a Subscription without deleting it from the system.

Prerequisites for cancellation

The order item must have status "provision_finished" before you can cancel it. Items that failed provisioning or are still processing cannot be cancelled.

Endpoint

POST https://api.appxite.com/orders/cancel?orderitemid={orderItemId}

Required information

Order Item ID: The ID of the order item to cancel

Include the same headers as other operations.

Cancellation limitations

You cannot cancel an order that:

  • Is still in cart (not executed)
  • Has status provision_started or provision_failed
  • Has already been cancelled

Summary

The Order API provides a two-step process for creating and executing orders. First, add products to a cart using the create order endpoint with proper form data. Then, execute the order using the place order operation. Monitor order status using the retrieve order endpoint. Remember that cancellation only disables subscriptions without deleting them, and some offers may require manual approval even when created via API.

For additional assistance, contact support at support@appxite.com

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.