Order API overview

How the Order API creates, updates and cancels protection plan contracts for an order.

The Order entity serves as the foundational record that captures detailed information about the line items purchased by a customer. Each line item within an order represents a product eligible for various warranty offerings, such as:

  • Product protection plans

  • Shipping warranties

The SureBright Order API is designed to transmit sold contract details to our system and to manage related operations such as order updates and cancellations. It acts as the primary interface for creating, updating, or canceling warranty contracts associated with your sales.


What the Order API does#

Create contracts#

When a new order is submitted:

  • The API checks if the order's orderId already exists in SureBright’s records.

  • If it does not exist, the API automatically generates warranty contracts for the order’s line items based on the provided details.

Update existing contracts#

When the orderId already exists:

  • Use the PUT method to update the existing order and its associated warranty contracts.

  • If a lower quantity is specified for any line item compared to the original order, the system will automatically cancel the corresponding number of warranty contracts to reflect the reduced coverage.

Cancel one line item#

To cancel warranty coverage on a particular product line:

  • Set quantity to 0 for that line item in orderLineItemList via the PUT method.

  • This action cancels only the warranty contracts for that specific line item, leaving the rest of the order unaffected.


Summary of operations#

OperationDescription
Create Order (POST)Generates new warranty contracts if the order is not yet recorded (orderId not found).
Update Order (PUT)Modifies existing warranty contracts and adjusts quantities. Cancels contracts if quantity decreases.
Cancel Line Item(PUT)To cancel a specific line item, use the PUT method and set quantity to 0 for that line item in orderLineItemList.

This API provides a robust way to keep your warranty contracts in sync with your order lifecycle, ensuring accurate coverage management across sales, returns, and cancellations.