SAP Commerce Cloud Orders API

Order management and history

OpenAPI Specification

sap-commerce-cloud-orders-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: SAP Commerce Cloud Admin Addresses Orders API
  description: Administrative API for SAP Commerce Cloud providing system configuration, maintenance, monitoring, and health check capabilities. Enables programmatic access to system administration functions including cache management, CronJob execution, and system health monitoring.
  version: '1.0'
  contact:
    name: SAP Support
    url: https://support.sap.com/
  termsOfService: https://www.sap.com/about/legal/terms-of-use.html
servers:
- url: https://{tenant}.{region}.commercecloud.sap
  description: SAP Commerce Cloud Production
  variables:
    tenant:
      description: Tenant identifier
      default: my-tenant
    region:
      description: Deployment region
      default: us
security:
- oauth2: []
tags:
- name: Orders
  description: Order management and history
paths:
  /users/{userId}/orders:
    get:
      operationId: getUserOrders
      summary: SAP Commerce Cloud List user orders
      description: Retrieve order history for a specific user with pagination.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/userId'
      - $ref: '#/components/parameters/currentPage'
      - $ref: '#/components/parameters/pageSize'
      - $ref: '#/components/parameters/sort'
      - $ref: '#/components/parameters/fields'
      responses:
        '200':
          description: Order history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderHistoryList'
        '401':
          description: Unauthorized
    post:
      operationId: placeOrder
      summary: SAP Commerce Cloud Place an order
      description: Authorize the cart and place the order. The cart must have a delivery address, delivery mode, and payment details set.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/userId'
      - name: cartId
        in: query
        required: true
        description: Cart identifier to convert to order
        schema:
          type: string
      - name: termsChecked
        in: query
        required: true
        description: Whether terms and conditions have been accepted
        schema:
          type: boolean
      responses:
        '201':
          description: Order placed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          description: Cart not ready for checkout
        '401':
          description: Unauthorized
  /users/{userId}/orders/{orderCode}:
    get:
      operationId: getOrder
      summary: SAP Commerce Cloud Get order details
      description: Retrieve details of a specific order.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/userId'
      - name: orderCode
        in: path
        required: true
        description: Order code
        schema:
          type: string
      - $ref: '#/components/parameters/fields'
      responses:
        '200':
          description: Order details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '404':
          description: Order not found
  /InboundOrder/Orders:
    get:
      operationId: listOrders
      summary: SAP Commerce Cloud List orders
      description: Retrieve order data through the inbound order integration object.
      tags:
      - Orders
      parameters:
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/select'
      - $ref: '#/components/parameters/expand'
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/orderby'
      responses:
        '200':
          description: Order list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ODataOrderCollection'
    post:
      operationId: createOrder
      summary: SAP Commerce Cloud Create or update an order
      description: Create or update order data through the inbound integration layer.
      tags:
      - Orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntegrationOrder'
      responses:
        '201':
          description: Order created
        '400':
          description: Invalid order data
components:
  schemas:
    Category:
      type: object
      properties:
        code:
          type: string
          description: Category code
        name:
          type: string
          description: Category name
        url:
          type: string
          description: Category URL
        image:
          $ref: '#/components/schemas/Image'
        subcategories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
    Consignment:
      type: object
      properties:
        code:
          type: string
          description: Consignment code
        status:
          type: string
          description: Consignment status
        statusDisplay:
          type: string
          description: Display-friendly status
        trackingID:
          type: string
          description: Shipment tracking ID
        entries:
          type: array
          items:
            $ref: '#/components/schemas/ConsignmentEntry'
        deliveryPointOfService:
          $ref: '#/components/schemas/PointOfService'
    PointOfService:
      type: object
      properties:
        name:
          type: string
          description: Store name
        displayName:
          type: string
          description: Display name
        description:
          type: string
          description: Store description
        address:
          $ref: '#/components/schemas/Address'
        geoPoint:
          $ref: '#/components/schemas/GeoPoint'
        openingHours:
          $ref: '#/components/schemas/OpeningSchedule'
        storeImages:
          type: array
          items:
            $ref: '#/components/schemas/Image'
        features:
          type: object
          additionalProperties:
            type: string
          description: Store features
    Region:
      type: object
      properties:
        isocode:
          type: string
          description: Region ISO code
        name:
          type: string
          description: Region name
    Review:
      type: object
      properties:
        id:
          type: string
          description: Review identifier
        headline:
          type: string
          description: Review headline
        comment:
          type: string
          description: Review text
        rating:
          type: number
          format: double
          description: Rating value
        date:
          type: string
          format: date-time
          description: Review date
        alias:
          type: string
          description: Reviewer alias
        principal:
          $ref: '#/components/schemas/Principal'
    OrderEntry:
      type: object
      properties:
        entryNumber:
          type: integer
          description: Entry number (zero-based)
        product:
          $ref: '#/components/schemas/Product'
        quantity:
          type: integer
          description: Quantity
        basePrice:
          $ref: '#/components/schemas/Price'
        totalPrice:
          $ref: '#/components/schemas/Price'
        updateable:
          type: boolean
          description: Whether the entry can be updated
    Classification:
      type: object
      properties:
        code:
          type: string
          description: Classification code
        name:
          type: string
          description: Classification name
        features:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              name:
                type: string
              featureValues:
                type: array
                items:
                  type: object
                  properties:
                    value:
                      type: string
    Product:
      type: object
      properties:
        code:
          type: string
          description: Product code
        name:
          type: string
          description: Product name
        description:
          type: string
          description: Product description
        summary:
          type: string
          description: Short product summary
        price:
          $ref: '#/components/schemas/Price'
        images:
          type: array
          items:
            $ref: '#/components/schemas/Image'
          description: Product images
        categories:
          type: array
          items:
            $ref: '#/components/schemas/Category'
          description: Product categories
        reviews:
          type: array
          items:
            $ref: '#/components/schemas/Review'
          description: Customer reviews
        averageRating:
          type: number
          format: double
          description: Average customer rating
        stock:
          $ref: '#/components/schemas/Stock'
        classifications:
          type: array
          items:
            $ref: '#/components/schemas/Classification'
          description: Product classification attributes
        purchasable:
          type: boolean
          description: Whether the product can be purchased
        url:
          type: string
          description: Product URL
    ODataOrderCollection:
      type: object
      properties:
        d:
          type: object
          properties:
            results:
              type: array
              items:
                $ref: '#/components/schemas/IntegrationOrder'
    Country:
      type: object
      properties:
        isocode:
          type: string
          description: ISO 3166-1 alpha-2 country code
        name:
          type: string
          description: Country name
    Sort:
      type: object
      properties:
        code:
          type: string
          description: Sort code
        name:
          type: string
          description: Sort display name
        selected:
          type: boolean
          description: Whether this sort is selected
    Principal:
      type: object
      properties:
        uid:
          type: string
          description: User unique identifier
        name:
          type: string
          description: Display name
    Address:
      type: object
      properties:
        id:
          type: string
          description: Address identifier
        firstName:
          type: string
          description: First name
        lastName:
          type: string
          description: Last name
        titleCode:
          type: string
          description: Title code
        line1:
          type: string
          description: Address line 1
        line2:
          type: string
          description: Address line 2
        town:
          type: string
          description: City or town
        region:
          $ref: '#/components/schemas/Region'
        district:
          type: string
          description: District
        postalCode:
          type: string
          description: Postal or ZIP code
        country:
          $ref: '#/components/schemas/Country'
        phone:
          type: string
          description: Phone number
        email:
          type: string
          description: Email address
        defaultAddress:
          type: boolean
          description: Whether this is the default address
    Price:
      type: object
      properties:
        currencyIso:
          type: string
          description: ISO 4217 currency code
        value:
          type: number
          format: double
          description: Price value
        formattedValue:
          type: string
          description: Formatted price string
        priceType:
          type: string
          enum:
          - BUY
          - FROM
          description: Price type
    Image:
      type: object
      properties:
        url:
          type: string
          description: Image URL
        altText:
          type: string
          description: Alternative text
        format:
          type: string
          description: Image format (e.g., thumbnail, product, zoom)
        imageType:
          type: string
          enum:
          - PRIMARY
          - GALLERY
          description: Image type
    Order:
      type: object
      properties:
        code:
          type: string
          description: Order code
        status:
          type: string
          description: Order status
        statusDisplay:
          type: string
          description: Display-friendly order status
        created:
          type: string
          format: date-time
          description: Order creation timestamp
        totalPrice:
          $ref: '#/components/schemas/Price'
        totalPriceWithTax:
          $ref: '#/components/schemas/Price'
        subTotal:
          $ref: '#/components/schemas/Price'
        deliveryCost:
          $ref: '#/components/schemas/Price'
        totalTax:
          $ref: '#/components/schemas/Price'
        totalItems:
          type: integer
          description: Total number of items
        entries:
          type: array
          items:
            $ref: '#/components/schemas/OrderEntry'
        deliveryAddress:
          $ref: '#/components/schemas/Address'
        deliveryMode:
          $ref: '#/components/schemas/DeliveryMode'
        paymentInfo:
          $ref: '#/components/schemas/PaymentDetails'
        consignments:
          type: array
          items:
            $ref: '#/components/schemas/Consignment'
        user:
          $ref: '#/components/schemas/Principal'
    GeoPoint:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Latitude
        longitude:
          type: number
          format: double
          description: Longitude
    Stock:
      type: object
      properties:
        stockLevelStatus:
          type: string
          enum:
          - inStock
          - lowStock
          - outOfStock
          description: Stock level status
        stockLevel:
          type: integer
          description: Actual stock level quantity
    IntegrationOrder:
      type: object
      properties:
        code:
          type: string
          description: Order code
        date:
          type: string
          format: date-time
          description: Order date
        status:
          type: string
          description: Order status
        currency:
          type: string
          description: Order currency ISO code
        totalPrice:
          type: number
          format: double
          description: Total price
        user:
          type: object
          properties:
            uid:
              type: string
          description: Customer reference
        entries:
          type: array
          items:
            type: object
            properties:
              entryNumber:
                type: integer
              productCode:
                type: string
              quantity:
                type: integer
              totalPrice:
                type: number
                format: double
          description: Order entries
        integrationKey:
          type: string
          description: Unique integration key
    OpeningSchedule:
      type: object
      properties:
        weekDayOpeningList:
          type: array
          items:
            type: object
            properties:
              weekDay:
                type: string
              openingTime:
                type: object
                properties:
                  formattedHour:
                    type: string
              closingTime:
                type: object
                properties:
                  formattedHour:
                    type: string
              closed:
                type: boolean
    PaymentDetails:
      type: object
      properties:
        id:
          type: string
          description: Payment details identifier
        accountHolderName:
          type: string
          description: Card holder name
        cardNumber:
          type: string
          description: Masked card number
        cardType:
          type: object
          properties:
            code:
              type: string
              description: Card type code
            name:
              type: string
              description: Card type name
        expiryMonth:
          type: string
          description: Card expiry month
        expiryYear:
          type: string
          description: Card expiry year
        billingAddress:
          $ref: '#/components/schemas/Address'
        defaultPayment:
          type: boolean
          description: Whether this is the default payment method
        saved:
          type: boolean
          description: Whether the payment details are saved
    Pagination:
      type: object
      properties:
        currentPage:
          type: integer
          description: Current page number
        pageSize:
          type: integer
          description: Number of results per page
        totalPages:
          type: integer
          description: Total number of pages
        totalResults:
          type: integer
          description: Total number of results
    OrderHistoryList:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/Order'
        pagination:
          $ref: '#/components/schemas/Pagination'
        sorts:
          type: array
          items:
            $ref: '#/components/schemas/Sort'
    DeliveryMode:
      type: object
      properties:
        code:
          type: string
          description: Delivery mode code
        name:
          type: string
          description: Delivery mode name
        description:
          type: string
          description: Delivery mode description
        deliveryCost:
          $ref: '#/components/schemas/Price'
    ConsignmentEntry:
      type: object
      properties:
        orderEntry:
          $ref: '#/components/schemas/OrderEntry'
        quantity:
          type: integer
          description: Shipped quantity
        shippedQuantity:
          type: integer
          description: Actual shipped quantity
  parameters:
    pageSize:
      name: pageSize
      in: query
      description: Number of results per page
      schema:
        type: integer
        default: 20
    skip:
      name: $skip
      in: query
      description: Number of results to skip
      schema:
        type: integer
    orderby:
      name: $orderby
      in: query
      description: Property name and direction for sorting
      schema:
        type: string
    userId:
      name: userId
      in: path
      required: true
      description: User identifier. Use 'current' for the authenticated user or 'anonymous' for guest users.
      schema:
        type: string
    expand:
      name: $expand
      in: query
      description: Comma-separated list of navigation properties to expand
      schema:
        type: string
    fields:
      name: fields
      in: query
      description: Response field configuration level. Use BASIC, DEFAULT, or FULL to control the amount of data returned.
      schema:
        type: string
        enum:
        - BASIC
        - DEFAULT
        - FULL
        default: DEFAULT
    select:
      name: $select
      in: query
      description: Comma-separated list of properties to return
      schema:
        type: string
    currentPage:
      name: currentPage
      in: query
      description: Current page number (zero-based)
      schema:
        type: integer
        default: 0
    filter:
      name: $filter
      in: query
      description: OData filter expression
      schema:
        type: string
    top:
      name: $top
      in: query
      description: Maximum number of results to return
      schema:
        type: integer
    sort:
      name: sort
      in: query
      description: Sort criteria (e.g., relevance, topRated, name-asc, price-asc)
      schema:
        type: string
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authentication for SAP Commerce Cloud Admin API
      flows:
        clientCredentials:
          tokenUrl: https://{tenant}.{region}.commercecloud.sap/authorizationserver/oauth/token
          scopes:
            admin: Administrative access
externalDocs:
  description: SAP Commerce Cloud Administration Documentation
  url: https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/