Snipcart Orders API

Manage orders and order lifecycle

OpenAPI Specification

snipcart-orders-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Snipcart REST AbandonedCarts Orders API
  description: 'The Snipcart REST API provides programmatic access to your store''s data including orders, customers, products, discounts, notifications, abandoned carts, domains, refunds, user sessions, and custom shipping methods. Authentication uses HTTP Basic Auth with a secret API key generated from the merchant dashboard. All requests must include an Accept: application/json header.

    '
  version: '3.0'
  contact:
    name: Snipcart Support
    url: https://snipcart.com
  license:
    name: Proprietary
    url: https://snipcart.com/terms-of-service
servers:
- url: https://app.snipcart.com/api
  description: Snipcart API
security:
- basicAuth: []
tags:
- name: Orders
  description: Manage orders and order lifecycle
paths:
  /orders:
    get:
      summary: List all orders
      operationId: listOrders
      description: Retrieve all completed orders with optional filtering.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - Processed
          - Disputed
          - Shipped
          - Delivered
          - Pending
          - Cancelled
      - name: from
        in: query
        schema:
          type: string
          format: date-time
        description: Filter orders created on or after this date
      - name: to
        in: query
        schema:
          type: string
          format: date-time
        description: Filter orders created on or before this date
      responses:
        '200':
          description: Paginated list of orders
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/PaginatedResponse'
                - type: object
                  properties:
                    items:
                      type: array
                      items:
                        $ref: '#/components/schemas/Order'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /orders/{token}:
    get:
      summary: Get order
      operationId: getOrder
      description: Retrieve a single order including all items, promo codes, and applied taxes.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/orderToken'
      responses:
        '200':
          description: Order details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    put:
      summary: Update order
      operationId: updateOrder
      description: Update the status, payment status, tracking information, or metadata of a specific order.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/orderToken'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                  - Processed
                  - Disputed
                  - Shipped
                  - Delivered
                  - Pending
                  - Cancelled
                paymentStatus:
                  type: string
                  enum:
                  - Paid
                  - Deferred
                  - PaidDeferred
                  - ChargedBack
                  - Refunded
                  - Paidout
                  - Failed
                  - Pending
                  - Cancelled
                  - Open
                trackingNumber:
                  type: string
                trackingUrl:
                  type: string
                  format: uri
                metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Updated order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /orders/{token}/digital:
    get:
      summary: Get digital goods for order
      operationId: getOrderDigitalGoods
      description: Return the list of digital goods attached to an order with download details and validity status.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/orderToken'
      responses:
        '200':
          description: List of digital goods
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    fileName:
                      type: string
                    url:
                      type: string
                      format: uri
                    expirationDate:
                      type: string
                      format: date-time
components:
  schemas:
    OrderItem:
      type: object
      properties:
        uniqueId:
          type: string
        id:
          type: string
        name:
          type: string
        price:
          type: number
          format: float
        quantity:
          type: integer
        url:
          type: string
          format: uri
    Order:
      type: object
      properties:
        token:
          type: string
          description: Unique order token
        status:
          type: string
          description: Order status
          enum:
          - Processed
          - Disputed
          - Shipped
          - Delivered
          - Pending
          - Cancelled
        paymentStatus:
          type: string
          description: Payment status
          enum:
          - Paid
          - Deferred
          - PaidDeferred
          - ChargedBack
          - Refunded
          - Paidout
          - Failed
          - Pending
          - Cancelled
          - Open
        email:
          type: string
          format: email
          description: Customer email address
        total:
          type: number
          format: float
          description: Order total
        currency:
          type: string
          description: Currency code (ISO 4217)
        completionDate:
          type: string
          format: date-time
          description: Date and time the order was completed
        trackingNumber:
          type: string
          description: Shipment tracking number
        trackingUrl:
          type: string
          format: uri
          description: Shipment tracking URL
        items:
          type: array
          description: Items in the order
          items:
            $ref: '#/components/schemas/OrderItem'
    PaginatedResponse:
      type: object
      properties:
        totalItems:
          type: integer
        offset:
          type: integer
        limit:
          type: integer
        items:
          type: array
          items:
            type: object
    Error:
      type: object
      properties:
        message:
          type: string
        details:
          type: array
          items:
            type: string
  parameters:
    orderToken:
      name: token
      in: path
      required: true
      description: Unique order token
      schema:
        type: string
    limit:
      name: limit
      in: query
      required: false
      description: Number of results to return per page
      schema:
        type: integer
        default: 25
    offset:
      name: offset
      in: query
      required: false
      description: Zero-based offset for pagination
      schema:
        type: integer
        default: 0
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: 'Use your secret API key as the username with an empty password. Base64-encode as {API_KEY}: and pass as Authorization: Basic {encoded}.

        '