ShopGo Orders API

Order, payment and shipment management

OpenAPI Specification

shopgo-orders-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: ShopGo Management Authentication Orders API
  version: 1.1.0
  description: 'The ShopGo Management API exposes store setup and administration capabilities equivalent to the functions available through the ShopGo (Makane) merchant dashboard: order, payment, shipment, user, tenant and store-settings management for the MENA eCommerce SaaS platform. All requests and responses use application/json and are wrapped in a result/payload envelope. Authentication is via a dashboard user API key (X-API-KEY header) or a platform master key. This OpenAPI was faithfully generated by the API Evangelist enrichment pipeline from the provider''s published documentation at https://docs.shopgo.me — ShopGo does not publish a machine-readable spec.'
  contact:
    name: ShopGo (Makane)
    url: https://docs.shopgo.me
  x-generated-by: api-evangelist-enrichment
  x-generated-method: generated
  x-source: https://docs.shopgo.me/llms.txt
servers:
- url: https://api.shopgo.me
  description: Production
security:
- UserApiKey: []
tags:
- name: Orders
  description: Order, payment and shipment management
paths:
  /v1/management/order/:
    get:
      operationId: listOrders
      tags:
      - Orders
      summary: Get all orders
      description: Get list of all orders for the authenticated tenant.
      responses:
        '200':
          description: Orders retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  payload:
                    type: object
                    properties:
                      orders:
                        type: array
                        items:
                          $ref: '#/components/schemas/Order'
        '403':
          $ref: '#/components/responses/Error'
  /v1/management/order/{number}:
    parameters:
    - name: number
      in: path
      required: true
      schema:
        type: string
      description: Order number
    get:
      operationId: getOrder
      tags:
      - Orders
      summary: Get order
      responses:
        '200':
          description: Order retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  payload:
                    type: object
                    properties:
                      orders:
                        $ref: '#/components/schemas/Order'
        '404':
          $ref: '#/components/responses/Error'
    patch:
      operationId: updateOrder
      tags:
      - Orders
      summary: Update order (authorize / cancel / visibility)
      description: Update order state. Set `authorized` to clear fulfillment, `cancelled` (optionally with `restock`) to cancel, or `visible` to show/hide the order across the dashboard and store fronts.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                authorized:
                  type: boolean
                  description: new state of order "authorized" field
                cancelled:
                  type: boolean
                  description: new value of "cancelled" field
                restock:
                  type: boolean
                  description: free reserved product stock
                visible:
                  type: boolean
                  description: new value of "visible" field
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/Error'
  /v1/management/order/{number}/payment/:
    parameters:
    - name: number
      in: path
      required: true
      schema:
        type: string
      description: Order number
    post:
      operationId: createOrderPayment
      tags:
      - Orders
      summary: Create payment (or refund)
      description: Create a new Payment for an order. All fields are optional; an empty body settles the order with a cash-on-delivery payment for the current balance. To create a refund, set `method` to `refund` with a negative `total`.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Payment'
      responses:
        '200':
          $ref: '#/components/responses/Success'
  /v1/management/order/{number}/shipment/{id}:
    parameters:
    - name: number
      in: path
      required: true
      schema:
        type: string
      description: Order number
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Shipment identifier
    patch:
      operationId: updateShipment
      tags:
      - Orders
      summary: Update shipment
      description: Update a shipment's state. The parent order must be authorized. `state` is one of ready, shipped or delivered.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                state:
                  type: string
                  enum:
                  - ready
                  - shipped
                  - delivered
                target_delivery:
                  type: string
                  description: DateTime
      responses:
        '200':
          $ref: '#/components/responses/Success'
components:
  schemas:
    Shipment:
      type: object
      properties:
        id:
          type: string
        state:
          type: string
          enum:
          - ready
          - shipped
          - delivered
        target_delivery:
          type: string
          description: DateTime
    Error:
      type: object
      description: Error envelope returned on non-2xx responses.
      properties:
        result:
          type: string
          example: error
        description:
          type: string
          description: explanation of what went wrong
    Buyer:
      type: object
      properties:
        ip:
          type: string
        name:
          type: string
        email:
          type: string
        phone:
          type: string
    Order:
      type: object
      description: Contract representing the exchange of goods or services.
      required:
      - number
      - buyer
      - billing_address
      - shipping_address
      - payment_method
      properties:
        number:
          type: string
          description: unique order identifier
        buyer:
          $ref: '#/components/schemas/Buyer'
        total:
          $ref: '#/components/schemas/Money'
        created:
          type: string
          description: order creation timestamp (DateTime)
        billing_address:
          type: object
          description: Address to send order invoice to
        shipping_address:
          type: object
          description: Address to ship order purchases to
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
        shipments:
          type: array
          items:
            $ref: '#/components/schemas/Shipment'
        purchases:
          type: array
          items:
            type: object
        adjustments:
          type: array
          items:
            type: object
        visible:
          type: boolean
        viewed:
          type: boolean
        cancelled:
          type: boolean
        confirmed:
          type: boolean
        authorized:
          type: boolean
        source:
          type: string
        payment_method:
          type: string
          enum:
          - cash
          - credit_card
          - bank_transfer
          - other
          description: payment method chosen by shopper
    Payment:
      type: object
      description: A payment made to settle an order. Refunds are Payments with method=refund and a negative total.
      properties:
        total:
          $ref: '#/components/schemas/Money'
        method:
          type: string
          example: cash_on_delivery
        created:
          type: string
          description: DateTime
        transaction_data:
          type: object
    Money:
      type: object
      properties:
        amount:
          type: string
          example: '25.00'
        currency:
          type: string
          example: JOD
  responses:
    Success:
      description: Successful operation
      content:
        application/json:
          schema:
            type: object
            properties:
              result:
                type: string
                example: success
              payload:
                type: object
    Error:
      description: Error (custom result/description envelope)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    UserApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Dashboard user API key (or platform master key)
    PlatformTenant:
      type: apiKey
      in: header
      name: X-TENANT-ID
      description: Target tenant identifier, required only when authenticating with a platform master key. X-TENANT-NAME may be used instead.