Last updated Jun 7, 2024

Quote order preview api

The Quote order preview api is designed to surface the following details to the consumers before the actual order is placed:

  1. Sales transition type for the order. It can be found in the processingInfo object for each item.
    Possible values are NEW, UPGRADE, DOWNGRADE, RENEW, NA.
  2. Promotion eligibility, applicability, and sequence in which they will be applied.

Endpoint

1
2
POST /api/v2/order-intent/preview
Request HeadersTypeDescription
X-transaction-accountString REQUIREDTransaction account ID to use for the quote.

Request

1
2
{
  "source": "QUOTE",
  "quote": {
    "id": "<string>",
    "version": 2154
  }
}

Response

1
2
{
    "orderId": "<string>",
    "slug": "<string>",
    "transactionAccountId": "<string>",
    "invoiceGroupId": "<string>",
    "items": [
        {
            "offeringId": "<string>",
            "orderItemId": "<string>",
            "optedUsageOptions": {
                "chargingDetails": {},
                "trial": {},
                "billingBehaviour": {
                    "type": "PAUSE_BILLING"
                },
                "effectiveTime": {
                    "endsAt": {
                        "type": "TIMESTAMP"
                    }
                }
            },
            "type": "CREATION_ORDER",
            "processingInfo": {
                "status": "PROCESSING",
                "entitlement": {
                    "id": "<string>",
                    "version": "<string>"
                },
                "transitionTimestamp": 2154,
                "transitionTime": "IMMEDIATE",
                "saleTransitionDetails": {},
                "saleTransitionType": "NEW",
                "computedDetails": {},
                "accountModification": {},
                "additionalTriggeredOrderItems": [
                    {}
                ],
                "prorationBehaviour": "NONE",
                "impactedEntitlements": [
                    {
                        "entitlementId": "<string>"
                    }
                ]
            },
            "billingOptions": {
                "preBill": {}
            },
            "reasonCode": "<string>",
            "metadata": {},
            "triggeredByOrderItem": {
                "orderId": "<string>",
                "orderItemId": "<string>"
            },
            "promotions": [
                {
                    "promotionInstanceId": "<string>",
                    "promotionDefinition": {}
                }
            ],
            "isImmediate": true,
            "originalOrderItemId": "<string>",
            "quoteLineItemDetailsReference": {
                "quoteId": "<string>",
                "version": 2154,
                "quoteLineItemId": "<string>"
            },
            "subscriptionStartTime": 2154,
            "transition": {
                "offering": {},
                "pricingPlan": {},
                "applyAfterTimestamp": 2154
            },
            "rewindToOrderItemId": "<string>",
            "billingAnchorTime": 2154,
            "nextBillingAnchorTimestamp": 2154,
            "backdateTimestamp": 2154,
            "rebillOptions": {
                "billFromTimestamp": 2154
            },
            "relatesFromEntitlements": [
                {}
            ]
        }
    ],
    "additionalTriggeredOrders": [],
    "createdDate": 2154
}

Error response and error codes

Error response for order failures

1
2
{
   "title":"Not found.",
   "code":"E1001",
   "detail":"Promotion not found",
   "status":"404 NOT_FOUND",
   "id":"",
   "items":[
      {
         "itemId":"2345",
         "errors":[
            {
               "errorCode":"W2002",
               "errorName":"INVALID_ORDER_REQUEST_DATA",
               "message":"",
               "field":""
            }
         ]
      }
   ]
}
Response ArgumentsDescription
codeError code for validation errors at the order level. If the code is populated and errors array size is 0, then the failure is caused by an invalid order.
detailError message describing the error.
idTrace ID for the error.
itemsErroneous items received in the request.
itemIdItem identifier itemId.
errorsContains an array of errors for the item it is listed under.
errorCodeError code.
errorNameError name.
messageDetailed description of the error.
fieldIf error is due to a specific parameter, JSON path to the field. Optional field.

Expected validation failures

Stale quotes

Order preview for quote will give 2xx response for DRAFT and OPEN quotes. For the stale quotes order preview will return the validation errors regarding what needs to be updated in the quote to move it back to DRAFT/OPEN.

Rate this page: