OpenCart Orders API

Order creation, confirmation, and history

OpenAPI Specification

opencart-orders-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: OpenCart REST Affiliates Orders API
  description: 'The OpenCart REST API enables external applications to communicate with a self-hosted OpenCart store. It provides endpoints for managing the shopping cart, customers, orders, addresses, shipping methods, payment methods, subscriptions, and affiliates. Authentication is performed by submitting API credentials to receive a session token, which must accompany subsequent requests. IP-allowlist enforcement is applied at the store level.

    '
  version: '4.0'
  contact:
    name: OpenCart Developer Documentation
    url: https://docs.opencart.com/developer/
  license:
    name: GNU GPL v3
    url: https://github.com/opencart/opencart/blob/master/LICENSE.md
servers:
- url: https://yourstore.com/index.php?route=api
  description: OpenCart store API base URL (replace yourstore.com with your store domain)
security:
- apiToken: []
tags:
- name: Orders
  description: Order creation, confirmation, and history
paths:
  /order:
    post:
      operationId: manageOrder
      summary: Manage order operations via call parameter
      description: 'Dispatches order operations based on the `call` query parameter. Supports cart retrieval, product addition, address setting, shipping/payment method selection, order confirmation, and history updates.

        '
      tags:
      - Orders
      parameters:
      - name: call
        in: query
        required: true
        schema:
          type: string
          enum:
          - customer
          - cart
          - product_add
          - payment_address
          - shipping_address
          - shipping_method
          - shipping_methods
          - payment_method
          - payment_methods
          - affiliate
          - confirm
          - history_add
        description: The sub-operation to perform
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                api_token:
                  type: string
                order_id:
                  type: integer
                  description: Required for confirm and history_add calls
                order_status_id:
                  type: integer
                  description: Required for confirm and history_add calls
                comment:
                  type: string
                  description: Optional comment for confirm or history_add
                notify:
                  type: boolean
                  description: Whether to notify customer (history_add)
                override:
                  type: boolean
                  description: Override stock check (history_add)
                affiliate_id:
                  type: integer
                  description: Affiliate ID for confirm call
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
                description: Response varies by call parameter
                properties:
                  success:
                    type: string
                  error:
                    type: string
                  order_id:
                    type: integer
components:
  securitySchemes:
    apiToken:
      type: apiKey
      in: query
      name: api_token
      description: Session token obtained from the /login endpoint
externalDocs:
  description: OpenCart Admin API Documentation
  url: https://docs.opencart.com/admin-interface/system/users/api