> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/api/send-orders.md).

# Send Orders

## Preview Order as Admin

> Preview an order in Limio using management credentials. This is the server-to-server equivalent of \`POST /order/preview\` and accepts the same request payload and returns the same response, including changes to future charges, the effective date of the change, and any other details.\
> \
> For an order discount, the preview reads only \`orderDiscount.name\`, the name of a promo code, and builds the discount from the promo code record, as \`POST /admin/order\` does. If the order has a \`checkoutId\`, the promo code name comes from that checkout. An unknown, expired or disabled promo code, or an \`orderDiscount\` with no name, gives the same 400 error as \`POST /admin/order\`.

```json
{"openapi":"3.1.0","info":{"title":"Limio Commerce API","version":"1.0.0"},"tags":[],"servers":[{"url":"https://{tenant}/api","description":"Limio environment API","variables":{"tenant":{"default":"your-environment.prod.limio.com","description":"Your Limio environment hostname, e.g. `acme.prod.limio.com` or `acme-sandbox.prod.limio.com`."}}}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2.0 Bearer token for authenticated API access. Required for order submission, object management, and administrative operations.\n\nObtain a token via the OAuth flow described in [Authentication](https://docs.limio.com/api/authentication).\n\nPass the token in the `Authorization` header: `Bearer <token>`"}},"schemas":{"ChangeOffer":{"type":"object","title":"Change Offer","description":"Change the offer that is attached to a subscription.","allOf":[{"$ref":"#/components/schemas/Order"},{"type":"object","properties":{"order_type":{"type":"string","enum":["change_offer"]},"forSubscription":{"description":"Subscription to update","oneOf":[{"$ref":"#/components/schemas/SubscriptionByName"},{"$ref":"#/components/schemas/SubscriptionById"}]},"offer":{"$ref":"#/components/schemas/OfferPayload"},"effectiveDate":{"description":"The date on which the Offer change will be effective. If not provided, the change will be effective at the end of the current term.","type":"string","format":"date-time"},"payment":{"description":"Payment","oneOf":[{"$ref":"#/components/schemas/ZuoraPayment"}]},"billingDetails":{"$ref":"#/components/schemas/Address"},"deliveryDetails":{"$ref":"#/components/schemas/Address"}},"required":["order_type","forSubscription","offer"]}]},"Order":{"type":"object","description":"Common order properties shared across all order types. These fields can be included alongside the order-type-specific payload (e.g. CreateSubscription, ChangeOffer).","properties":{"external_id":{"description":"Your own external order reference. Useful for correlating Limio orders with records in upstream systems.\n\nFor a `new` order, Limio uses this value to find an earlier submission. If an order with the same `external_id` exists and its status is not `error`, Limio returns that order and does not create a second one. Thus, send a `new` order again with the same `external_id` when you do not know if the first request created the order.","type":"string"},"initiated_source":{"description":"Indicates where the order originated. Limio uses `shop` for storefront orders and `salesforce` for CRM-initiated orders. Custom values are supported for other integrations.","type":"string","enum":["shop","salesforce"]},"source":{"description":"The system that submitted the order. Limio uses `shop` for storefront submissions and `salesforce` for CRM submissions.","type":"string"},"process_immediately":{"description":"When `true`, the order is processed synchronously and the response includes the final processing result. When `false` (default), the order is queued for asynchronous processing.","type":"boolean","default":false}}},"SubscriptionByName":{"description":"Update subscription by name","properties":{"name":{"type":"string"}}},"SubscriptionById":{"description":"Update subscription by id","properties":{"id":{"type":"string"}}},"OfferPayload":{"description":"Reference to a published Limio offer.\nRetrieve `id` and `version` from `GET /offers/v2`.\n","required":["id","version"],"properties":{"id":{"type":"string","description":"The unique content hash of the offer. Retrieve from `GET /offers/v2`."},"version":{"type":"string","description":"The version hash of the offer. Use the latest version from the same API response."}}},"ZuoraPayment":{"type":"object","description":"Zuora Payment Method","properties":{"type":{"type":"string","enum":["zuora"]},"zuora":{"type":"object","properties":{"refId":{"type":"string","description":"The Zuora ID of the payment method to use for the payment"},"paymentGateway":{"type":"string","description":"The Zuora payment gateway to use for processing the payment"}}}}},"Address":{"description":"Address","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"workEmail":{"type":"string"},"phone":{"type":"string"},"workPhone":{"type":"string"},"otherPhone":{"type":"string"},"company":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"UpdateSubscription":{"type":"object","title":"Update Subscription","description":"Update an existing subscription — upgrade or downgrade the primary offer, add or remove add-ons, or change quantities on existing items.","allOf":[{"$ref":"#/components/schemas/Order"},{"type":"object","properties":{"order_type":{"type":"string","enum":["update_subscription"]},"owner":{"type":"string","description":"The identity ID of the subscription owner."},"forSubscription":{"description":"The subscription to update. Must include `id` and/or `name`.","oneOf":[{"$ref":"#/components/schemas/SubscriptionByName"},{"$ref":"#/components/schemas/SubscriptionById"}]},"forSubscriptionOffer":{"description":"The subscription offer being changed. Used by the checkout flow to resolve the current active offer when multiple offers exist on the subscription. Optional when the subscription has only one active offer.","type":"object","properties":{"offerId":{"type":"string","description":"The ID of the subscription_offer object."}}},"orderItems":{"type":"array","description":"The list of changes to apply. Each item specifies an action (add, remove, or update) targeting an offer, add-on, or existing subscription item.","items":{"$ref":"#/components/schemas/UpdateSubscriptionOrderItem"}},"effectiveDate":{"type":"string","format":"date-time","description":"ISO 8601 date when the changes take effect. If omitted, the system calculates it automatically based on the direction of change — upgrades and additions are effective immediately, downgrades and removals are effective at the end of the current term."}},"required":["order_type","forSubscription","orderItems"]}]},"UpdateSubscriptionOrderItem":{"description":"A single action within an update_subscription order. Each item adds, removes, or updates an offer or add-on on the subscription.","type":"object","required":["id","orderItemActionType","offer"],"properties":{"id":{"type":"string","description":"Unique identifier for this order item (typically a UUID)."},"orderItemActionType":{"type":"string","enum":["add","remove","update"],"description":"The action to perform.\n- `add` — Add a new offer or add-on to the subscription.\n- `remove` — Remove an existing subscription offer or add-on.\n- `update` — Change the quantity of an existing subscription item."},"type":{"type":"string","enum":["offer","add_on","subscription_offer","subscription_add_on"],"description":"The record type of the target item.\n- `offer` / `add_on` — Used with `add` actions. References a catalog offer or add-on.\n- `subscription_offer` / `subscription_add_on` — Used with `remove` and `update` actions. References an existing item on the subscription."},"offer":{"type":"object","description":"Reference to the catalog item (for add) or subscription item (for remove/update).","required":["id","version"],"properties":{"id":{"type":"string","description":"For `add` actions: the catalog offer or add-on ID. For `remove`/`update` actions: the subscription_offer or subscription_add_on ID."},"version":{"type":"string","description":"The version of the referenced object."}}},"quantity":{"type":"integer","minimum":1,"description":"The target quantity. Only applicable for `update` actions on items that support quantity changes (offers with `allow_multibuy` or `recurringVolume` pricing). Must be a positive integer within the offer's configured bounds."}}},"SwitchPreviewResponse":{"type":"object","description":"Preview response returned by the order preview endpoint. Contains the raw billing provider result and a normalised payment schedule that front-end consumers use to display pricing summaries.","properties":{"preview":{"type":"object","properties":{"success":{"type":"boolean"},"orderNumber":{"type":"string"},"orderId":{"type":"string"},"accountNumber":{"type":"string"},"status":{"type":"string"},"subscriptions":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"subscriptionId":{"type":"string"},"subscriptionNumber":{"type":"string"}}}},"paymentNumber":{"type":"string"},"paymentId":{"type":"string"},"paidAmount":{"type":"string"},"previewResult":{"type":"object","properties":{"invoices":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"amountWithoutTax":{"type":"number"},"targetDate":{"type":"string","format":"date-time"},"taxAmount":{"type":"number"},"invoiceItems":{"type":"array","$ref":"#/components/schemas/ZuoraLineItem"}}}},"creditMemos":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"amountWithoutTax":{"type":"number"},"targetDate":{"type":"string","format":"date-time"},"taxAmount":{"type":"number"},"creditMemoItems":{"type":"array","items":{"$ref":"#/components/schemas/ZuoraLineItem"}}}}}}}}},"schedule":{"type":"array","description":"Normalised payment schedule derived from the billing provider preview. For `update_subscription` orders, the first schedule entry is filtered to show only charges related to the update (new charges, proration credits, and quantity amendment pairs). Subsequent entries show all charges since the customer pays the full amount on renewal. Entries before the order's effective date are excluded.","items":{"type":"object","properties":{"date":{"type":"string","format":"date-time","description":"Invoice date (ISO datetime without offset)."},"schedule_date":{"type":"string","format":"date-time","description":"Same as `date`. Included for backwards compatibility."},"type":{"type":"string","description":"Schedule entry type."},"amount":{"type":"string","description":"Total amount including tax."},"taxAmount":{"type":"number","description":"Tax portion of the total amount."},"amountWithoutTax":{"type":"string","description":"Subtotal excluding tax."},"currency":{"type":"string","description":"ISO 4217 currency code from the subscription."},"unit_amount":{"type":"string","description":"Total amount (same as `amount`)."},"quantity":{"type":"number"},"hasDiscount":{"type":"boolean","description":"Whether any charge in this schedule entry has `processingType: \"Discount\"`."},"amountExcludingDiscount":{"type":"string","description":"Subtotal of non-discount charges only (excludes tax). Same as `amountWithoutTax` when no discounts are present."},"discountUnitValue":{"type":"string","description":"Sum of `unitPrice` values from discount charges. `\"0.00\"` when no discounts are present."},"lineItems":{"type":"array","description":"Breakdown of individual charges within this schedule entry.","items":{"type":"object","properties":{"amountWithoutTax":{"type":"string","description":"Charge amount excluding tax."},"taxAmount":{"type":"string","description":"Tax amount for this charge."},"limioCatalogObjectId":{"type":"string","description":"Maps back to the Limio catalog record. Set via the `chargeDescription` field in Zuora charge overrides, formatted as `{record_type}-{id}`."},"processingType":{"type":"string","description":"Zuora processing type.","enum":["Charge","Discount"]},"chargeName":{"type":"string","description":"Name of the charge from the billing provider."},"productName":{"type":"string","description":"Name of the product from the billing provider."},"quantity":{"type":"number","description":"Quantity for this charge."}}}},"taxSummary":{"type":"array","description":"Tax amounts aggregated by tax code.","items":{"type":"object","properties":{"taxCode":{"type":"string","description":"Tax code identifier."},"taxRate":{"type":"number","description":"Tax rate as a decimal (e.g. 0.2 for 20%)."},"taxAmount":{"type":"number","description":"Total tax amount for this tax code."}}}},"reference":{"type":"string"}}}}}},"ZuoraLineItem":{"type":"object","properties":{"additionalInfo":{"type":"object","properties":{"quantity":{"type":"number"},"unitOfMeasure":{"type":"string"}}},"amountWithoutTax":{"type":"number"},"chargeDescription":{"type":"string"},"chargeName":{"type":"string"},"chargeNumber":{"type":"string"},"processingType":{"type":"string"},"productName":{"type":"string"},"productRatePlanChargeId":{"type":"string"},"serviceEndDate":{"type":"string","format":"date-time"},"serviceStartDate":{"type":"string","format":"date-time"},"subscriptionNumber":{"type":"string"},"taxAmount":{"type":"number"},"unitPrice":{"type":"number"}}}},"responses":{"401Response":{"description":"Unauthorized: the request lacks valid authentication credentials. This response is returned by the API gateway before the request reaches the application. Verify your Bearer token is correct and has not expired.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"502Response":{"description":"Bad Gateway — an upstream service returned an unexpected response. This typically indicates an issue with the request payload (e.g. invalid field values, missing required fields) or a transient infrastructure error. Retry the request, and if the issue persists, verify the request body matches the expected schema.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error description."}}}}}}}},"paths":{"/admin/order/preview":{"post":{"operationId":"previewAdminOrder","summary":"Preview Order as Admin","description":"Preview an order in Limio using management credentials. This is the server-to-server equivalent of `POST /order/preview` and accepts the same request payload and returns the same response, including changes to future charges, the effective date of the change, and any other details.\n\nFor an order discount, the preview reads only `orderDiscount.name`, the name of a promo code, and builds the discount from the promo code record, as `POST /admin/order` does. If the order has a `checkoutId`, the promo code name comes from that checkout. An unknown, expired or disabled promo code, or an `orderDiscount` with no name, gives the same 400 error as `POST /admin/order`.","tags":["Send Orders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"discriminator":{"propertyName":"order_type","mapping":{"change_offer":"#/components/schemas/ChangeOffer","update_subscription":"#/components/schemas/UpdateSubscription"}},"oneOf":[{"$ref":"#/components/schemas/ChangeOffer"},{"$ref":"#/components/schemas/UpdateSubscription"}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchPreviewResponse"}}}},"400":{"description":"The promo code cannot be applied, or the order discount has no promo code name. The `code` field gives the reason: for example `PROMO_NOT_FOUND`, `PROMO_INVALID_DISCOUNT`, `PROMO_NO_MATCHING_ITEMS` or `PROMO_CURRENCY_MISMATCH`."},"401":{"$ref":"#/components/responses/401Response"},"404":{"description":"Not found"},"502":{"$ref":"#/components/responses/502Response"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.limio.com/api/send-orders.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
