# Orders Welcome to the Orders API documentation for Annex Cloud, where loyalty and seamless customer experiences converge. This API empowers developers, partners, and integrators to tap into the core of our loyalty-based ecosystem, enabling the creation of innovative and personalized solutions that enhance customer engagement and drive business growth. In this comprehensive guide, you will find all the essential information needed to integrate with our Orders API seamlessly. Whether you're a seasoned developer seeking to leverage the power of loyalty data or a business owner aiming to enhance customer satisfaction, this documentation will serve as your compass to navigate the world of loyalty-driven transactions. From placing orders and tracking purchases to utilizing loyalty rewards within the checkout process, the Orders API opens a realm of possibilities. By harnessing this interface, you can craft applications that bridge the gap between exceptional user experiences and business success. We've designed this documentation to provide clear insights into the capabilities, endpoints, authentication, and best practices for utilizing the Orders API effectively. As you embark on this integration journey, we encourage you to explore the diverse use cases, reference implementations, and code snippets that will help you hit the ground running. Thank you for choosing Annex Cloud as your partner in delivering unparalleled loyalty experiences. Let's dive into the intricacies of the Orders API and pave the way for loyalty-driven innovation that transforms the way customers interact with your brand. ## Create a New Order - [POST /orders](https://annexcloud.redocly.app/loyalty/loyalty/orders/createorder.md): Use the POST method in the Orders API to create a new order made by a member in the loyalty program. Each order has a unique ID and contains all the relevant order data such as the member placing the order, the order total, when the order is placed, discounts applied to the order or when the order ships. All other fields in the request body are listed below. Please note that you must enter required fields such as the ID and user ID parameters. The orderDate parameter is required to make the POST request if the backdated order functionality is enabled for the client via the "Enable Customize Orderdate In Order API " flag in the super admin. ## Create New Orders in Bulk - [POST /bulkpostorder](https://annexcloud.redocly.app/loyalty/loyalty/orders/createbulkorder.md): To create new orders in bulk, use this POST method in the Orders API. When uploading bulk orders, you will input the relevant order information such as the parameters for userId, orderID and orderDetails, for each order being passed. This is very helpful when you need to upload the order information for multiple orders instead of doing it as a single order like you would in the POST /orders method. You must specify the order id, user Id, product id, quantity, and unit price parameters for each order included in the bulk request, as they are mandatory fields. ## Update an existing order in bulk - [POST /bulkpatchorder](https://annexcloud.redocly.app/loyalty/loyalty/orders/bulkpatchorder.md): Use this endpoint in the Bulk Patch Order API to update details of an already created order in the loyalty program. This method allows updating order level information such as status, product details, quantity, and pricing. It is used when an order has already been created but values such as product quantity, unit price, or order status need correction or updates. ## This API is used to get the details of all the secondary member orders - [GET /secondaryuserorders](https://annexcloud.redocly.app/loyalty/loyalty/orders/secondaryuserorders.md): This field will only retrieve the information specific to that member for that order. Otherwise, it will return all secondary member's data. ## Get order details - [POST /orderdetails](https://annexcloud.redocly.app/loyalty/loyalty/orders/postorderdetails.md): This API is used to retrieve all of the details of an order based on either the user ID parameter, the order ID parameter, or both. Please note that if only the userId is entered, all orders placed by that member are returned. ## Calculate the potential points of the products which are in the member's cart - [POST /cart](https://annexcloud.redocly.app/loyalty/loyalty/orders/postcart.md): The potential points a member can earn off of the products in their cart are calculated by using the POST cart API. The Purchase Action must be properly configured before the API can function correctly. ## Manually adjust (credit or debit) the spend amount for an order - [POST /manualspend](https://annexcloud.redocly.app/loyalty/loyalty/orders/postmanuaspend.md): To manually adjust the spend amount of an order, use this POST method. When adjusting the spend amount, locate the specific order using the orderId field and then enter when the adjustment is a credit or debit, the amount credited or debited, which administrator performed the adjustment, and the reason why the manual spend is being adjusted. ## Update the order - [PATCH /orders/orderid](https://annexcloud.redocly.app/loyalty/loyalty/orders/updateorder.md): Use the PATCH method in the Orders API to update the order status of a shipment to the ship, return, or cancel status in the input parameter. Orders can also be updated depending on their status as partial or full ship, partial or full return, and partial or full cancellation of the order. All other fields in the request body are listed below. If you are cancelling, returning, or shipping an order, use the first request/response body schema set. If you are adding a new product or changing the quantity of an existing order, use the second request/response body schema set. ## Add to an exisiting order - [PATCH /orders/orderid - Add to an existing order](https://annexcloud.redocly.app/loyalty/loyalty/orders/updateaddexistingorder.md): Use the following request body schema to add new quantities or an additional product(s) to an existing order by entering add as the Status parameter value.