UniLink API: Orders Endpoint (Access and Manage Customer Orders)

By UniLink May 02, 2026 9 min read
UniLink API: Orders Endpoint (Access and Manage Customer Orders)


UniLink API: Orders Endpoint (Access and Manage Customer Orders)

The /orders endpoint lets you read every customer order and update fulfilment status programmatically — the foundation for order management integrations and accounting exports.

  • Use GET /orders with filters for status, date range, or product ID to pull exactly the orders you need.
  • Each order object includes customer details, line items with product snapshots, and totals in the account's currency.
  • Update order status to fulfilled or refunded with a single PUT /orders/{id} call.

Whether you are building an order fulfilment dashboard, pushing UniLink sales into your accounting software, or triggering a shipping label workflow after each purchase, the /orders endpoint gives you the structured access you need. Every sale made through your UniLink storefront creates an order record the moment payment is confirmed — accessible via API within seconds. The endpoint is read-heavy by design; you pull order data frequently and update status sparingly, which keeps the integration simple and the API calls predictable.

What the Orders Endpoint Does

The GET /orders endpoint returns a paginated list of all orders on your account, sorted by creation date descending by default. Each order object in the list response contains the complete transaction record: the order id, status, total (in cents), currency (ISO 4217 code), a customer object with name and email, an array of line_items, and a created_at timestamp in ISO 8601 format. The list endpoint supports multiple filters so you can slice the dataset to match exactly what your integration needs.

A single order fetch with GET /orders/{id} returns the same fields as the list but adds expanded line item detail. Each entry in line_items contains the product_id, a snapshot of the product_name and unit_price at the time of purchase, the quantity, and the subtotal. Product snapshots mean that even if you later change a product's price or name, the historical order record reflects the exact terms the customer agreed to — which is essential for accounting accuracy and dispute resolution.

Status updates via PUT /orders/{id} accept a status field with three possible values: pending (default after payment), fulfilled (order shipped or digital access granted), and refunded (payment reversed). Marking an order refunded via the API does not automatically trigger a payment reversal with your payment processor — the refund must be initiated separately in Stripe or your gateway. The API status field reflects the state you record, not a payment processor event. UniLink webhook events fire on status transitions, so downstream systems subscribed to order webhooks will receive the update.

How to Get Started

  1. Log in to app.unilink.us and navigate to Settings → API. Generate an API key with write scope (needed to update order status) or read scope if you only need to pull data.
  2. Fetch your first page of orders: curl -H "Authorization: Bearer YOUR_KEY" "https://unilink.us/api/v1/orders?per_page=10". Review the response structure to understand the field names and types.
  3. Try a filtered request to confirm the filter parameters work with your data: GET /orders?status=pending&start_date=2026-01-01&end_date=2026-01-31.
  4. Fetch a single order to inspect the full line items array: GET /orders/{id} using an ID from the list response. Confirm the line_items structure matches what your integration expects.
  5. Test a status update on a test order: PUT /orders/{id} with body {"status": "fulfilled"}. Confirm the response returns the updated order object with the new status value.

How to Use the Orders Endpoint

  1. List all orders: GET /orders?page=1&per_page=50 — page through results using page and per_page (max 100). The response includes a total count and has_more boolean for pagination logic.
  2. Filter by status: GET /orders?status=pending — returns only orders awaiting fulfilment. Use fulfilled or refunded to pull completed or reversed orders.
  3. Filter by date range: GET /orders?start_date=2026-01-01&end_date=2026-01-31 — both parameters accept ISO 8601 dates. Combine with the status filter for targeted reporting queries.
  4. Filter by product: GET /orders?product_id={id} — returns all orders that include a specific product, useful for per-product sales reports.
  5. Update order status: PUT /orders/{id} with JSON body {"status": "fulfilled"} or {"status": "refunded"}. The response is the full updated order object.

Key Settings

SettingWhat It DoesRecommended
status filterLimits list results to orders in a specific fulfilment statePoll ?status=pending on a schedule to find orders that need fulfilment action
start_date / end_dateISO 8601 date range filter on created_atUse monthly ranges for accounting exports to keep response size manageable
product_idFilters to orders containing a specific productUseful for per-product commission reporting or fulfilment queues segmented by product
per_pageNumber of orders per response page (max 100)Use 100 for bulk exports; use 10–20 for dashboard display queries
PUT statusUpdates order fulfilment state: pending, fulfilled, refundedSet to fulfilled after confirming delivery; set to refunded after payment reversal is processed
Tip: For accounting integrations, export orders using monthly date range filters rather than attempting to pull all orders at once. Store the last-processed order's created_at timestamp in your system and use it as start_date on the next run to fetch only new orders. This incremental approach is more reliable than offset-based pagination for large order histories.

Get the Most Out Of the Orders Endpoint

Pair the orders endpoint with UniLink's order webhooks to build near-real-time fulfilment systems. Configure a webhook on the order.created event and your endpoint receives a POST within seconds of each purchase. Use the webhook payload to trigger your fulfilment logic immediately, then confirm completion by calling PUT /orders/{id} with status: "fulfilled". The API poll can then serve as a reconciliation check rather than the primary trigger, reducing latency and catch-up load.

When pushing orders into accounting software like QuickBooks or Xero, map UniLink's total (cents) to your accounting system's amount field after dividing by 100. Map currency directly — it is already ISO 4217. Store the UniLink id as an external reference in the accounting record so you can look up the original order quickly during audits or when a customer disputes a charge.

The customer object in each order contains name and email. If your CRM or email platform already has a record for this customer, use the email as the matching key to attach the order as a purchase event in the customer timeline. This creates a full purchase history in your CRM without manual data entry, and it enables post-purchase email sequences triggered by specific product purchases.

For refund workflows, the recommended sequence is: initiate the payment reversal in Stripe first, confirm the reversal succeeded, then call PUT /orders/{id} with status: "refunded" to update the UniLink record. Doing it in this order ensures your UniLink order status is only marked refunded when the actual money movement has occurred — preventing situations where the status says refunded but the customer has not received their money.

Troubleshooting

ProblemCauseFix
GET /orders returns empty array despite known ordersDate range or status filter excludes all matching ordersRemove filters and fetch without parameters first to confirm orders exist, then add filters one at a time
PUT /orders/{id} returns 422Invalid status value (e.g., "complete" instead of "fulfilled")Accepted values are exactly pending, fulfilled, and refunded — check spelling and case
Order totals do not match payment processor amountstotal is in cents but being treated as dollarsDivide total by 100 before displaying or recording in your system
Cannot find orders from a specific productproduct_id filter requires the UniLink product ID, not an external SKUFetch GET /products to find the UniLink id for the product, then use that ID in the filter
  • Line item snapshots preserve the exact price and product name at purchase time, ensuring accurate historical records
  • Multiple filter parameters let you pull precisely the orders you need without post-processing on your end
  • Status update endpoint is simple — one field, three values, minimal integration surface
  • Webhook integration reduces the need for polling, enabling near-real-time fulfilment workflows
  • Marking an order refunded via API does not trigger a payment reversal — that must be done separately in your payment processor
  • No bulk status update endpoint — each order must be updated individually via its ID
  • Order records cannot be deleted via API — all historical orders are permanently retained
Does the API include orders from all payment methods?

Yes — GET /orders returns orders regardless of which payment method was used (Stripe card, Apple Pay, etc.). The payment method detail is not currently exposed in the order object but the order record is created for all successful payments.

How far back does the order history go?

The API returns all orders since your account was created, subject to your plan's data retention policy. Pro and Business plans retain full order history indefinitely. Use date range filters to query specific periods efficiently.

Can I create orders via API (not just read them)?

No — orders are created automatically by the UniLink checkout flow when a customer completes a purchase. There is no endpoint to create orders programmatically. This protects payment integrity and ensures every order corresponds to an actual payment.

What happens to an order's status if I initiate a refund through Stripe directly?

UniLink listens for Stripe refund events and automatically updates the order status to refunded when a full refund is processed through Stripe's dashboard. For partial refunds, the status remains fulfilled and you should update it manually via the API if needed.

Is the customer email always present in the order object?

Yes — UniLink requires an email address at checkout for order confirmation delivery. The customer.email field is always populated on every order record returned by the API.

  • Every completed purchase creates an order record accessible at https://unilink.us/api/v1/orders within seconds.
  • Filter by status, start_date/end_date, and product_id to pull exactly the orders your integration needs.
  • Order totals are in cents — divide by 100 before displaying or recording in external systems.
  • Line items contain product snapshots that reflect purchase-time details, preserving accurate historical records even if products are later modified.
  • Updating status to refunded records the state in UniLink but does not trigger a payment reversal — process the refund in your payment gateway first.

Connect your fulfilment or accounting system to UniLink orders today — generate an API key at app.unilink.us under Settings → API and start with GET /orders?status=pending.

Create Your Free Link-in-Bio Page

Join thousands of creators using UniLink. 40+ blocks, analytics, e-commerce, and AI tools — all free.

Get Started Free