> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fusioncore.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Order

> Creates a new Salesforce Order via the fusionCore Commerce service layer. Returns the created Order's Salesforce Id and the fusionCore Order UUID.



## OpenAPI

````yaml POST /v1/order
openapi: 3.0.3
info:
  title: fusionCore REST API
  version: 1.0.0
  description: >-
    External integration endpoints for the fusionCore unmanaged REST API
    package. Provides HTTP access to order creation, order item management,
    renewal generation, and subscription cancellation, all running as Salesforce
    Apex REST resources.
servers:
  - url: https://{instance}.my.salesforce.com/services/apexrest
    description: Salesforce org Apex REST endpoint
    variables:
      instance:
        default: your-instance
        description: >-
          Your Salesforce org's My Domain prefix (for example, acme-dev or
          acme.sandbox).
security:
  - bearerAuth: []
tags:
  - name: Order
    description: Order creation.
  - name: Order Item
    description: Order item creation and deletion.
  - name: Order Renewal
    description: Generate renewal orders from existing purchase activities.
  - name: Subscription Cancellation
    description: Cancel subscription renewals.
paths:
  /v1/order:
    post:
      tags:
        - Order
      summary: Create an order
      description: >-
        Creates a new Salesforce Order via the fusionCore Commerce service
        layer. Returns the created Order's Salesforce Id and the fusionCore
        Order UUID.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateRequest'
            example:
              businessUnitId: a0X5g000000abcDEAA
              customerType: ORGANIZATION
              accountId: 0015g00000XyZabAAB
              billToContactId: 0035g00000PqRstAAA
              currencyIsoCode: USD
      responses:
        '201':
          description: Order created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreateResponse'
              example:
                id: 8015g00000AbCdEAAQ
                uuid: f6c1c6a9-1b3e-4a2f-9a55-2c1d0e8f3a11
                success: true
        '400':
          description: >-
            Validation error (missing or invalid request fields, malformed
            JSON).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    OrderCreateRequest:
      type: object
      required:
        - businessUnitId
        - customerType
        - accountId
      properties:
        businessUnitId:
          type: string
          description: >-
            Salesforce Id of the Business Unit (`FCORE_PAY__Business_Unit__c`)
            the order is being placed under.
        customerType:
          type: string
          description: >-
            Customer type for the order. Typical values include `ORGANIZATION`
            and `INDIVIDUAL`; consult your fusionCore Commerce configuration for
            the full list.
        accountId:
          type: string
          description: Salesforce Id of the Account that owns the order.
        billToContactId:
          type: string
          description: Salesforce Id of the bill-to Contact (optional).
        currencyIsoCode:
          type: string
          description: >-
            ISO 4217 currency code (for example `USD`). Required when the org is
            multi-currency.
    OrderCreateResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            id:
              type: string
              description: Salesforce Id of the created Order.
            uuid:
              type: string
              description: >-
                fusionCore Order UUID (`FCORE_PAY__Order_UUID__c`) of the
                created Order.
    ErrorResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
      example:
        success: false
        errors:
          - businessUnitId is required
    BaseResponse:
      type: object
      description: >-
        Common envelope returned by every endpoint. Concrete responses extend
        this shape with operation-specific fields.
      properties:
        success:
          type: boolean
          description: '`true` when the request completed without errors.'
        errors:
          type: array
          description: Populated with one or more error messages when `success` is `false`.
          items:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Salesforce Session ID
      description: >-
        Salesforce session ID (or OAuth 2.0 access token issued by the
        Salesforce org) supplied as `Authorization: Bearer <token>`. Obtain via
        the Salesforce OAuth 2.0 flows or the SOAP login API.

````