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

# Fulfil an order

> Mark an order fulfilled (status completed). Requires the WRITE_ORDERS scope.



## OpenAPI

````yaml apps-api/specs/orders.json POST /orders/{id}/fulfill
openapi: 3.1.0
info:
  title: Salesive Apps API — Orders
  version: 1.0.0
  description: >-
    Read and manage the store's orders from an installed third-party app. Every
    endpoint authenticates with an installed-app access token (prefix `app_`)
    and requires a specific OAuth scope. The target store is bound to the token
    server-side from the installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /orders/{id}/fulfill:
    post:
      tags:
        - Orders
      summary: Fulfil an order
      description: >-
        Marks the order fulfilled: its status becomes `completed`, the
        dashboard's final state. Allowed from `paid` and `processing`; calling
        it on a completed order changes nothing and returns the order. Nothing
        is shipped by Salesive (use the shipping endpoints for shipments). Fires
        `orders/fulfilled`. Requires the `WRITE_ORDERS` scope.
      operationId: fulfillOrder
      parameters:
        - $ref: '#/components/parameters/OrderId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                notes:
                  type: string
                  maxLength: 2000
                  description: Replaces the order's notes, as the cancel endpoint does.
            example:
              notes: Handed to the courier
      responses:
        '200':
          description: The updated, fully populated order.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/OrderDetail'
              example:
                status: 200
                success: true
                message: Order fulfilled
                data:
                  _id: 66b1f0a3c2d4e5f6a7b8c9d0
                  orderId: 1042
                  user:
                    _id: 66a0c1d2e3f4a5b6c7d8e9f0
                    name: Ada Lovelace
                    email: ada@example.com
                    phone: '+2348012345678'
                    customerId: 66a0d0e1f2a3b4c5d6e7f8a9
                  items:
                    - _id: 66b1f0a3c2d4e5f6a7b8c9d1
                      product:
                        _id: 6699aabbccddeeff00112233
                        name: Wireless Earbuds
                        images:
                          - https://cdn.salesive.com/p/earbuds.jpg
                      name: Wireless Earbuds
                      sku: WE-BLK-01
                      price: 24990
                      quantity: 2
                      variantAttributes: {}
                      imageUrl: https://cdn.salesive.com/p/earbuds.jpg
                  status: processing
                  notes: Packed and awaiting pickup
                  additionalInfo:
                    - label: Gift message
                      value: Happy birthday!
                  payment:
                    _id: 66b1f0a3c2d4e5f6a7b8c9e0
                    status: completed
                    amount: 49980
                    method: card
                    transactionId: txn_9f8e7d6c
                  coupon: null
                  shipment: null
                  discount: 500
                  subtotal: 49980
                  shippingCost: 1500
                  tax: 0
                  source: online
                  paymentMethod: card
                  total: 50980
                  createdAt: '2026-06-21T10:30:00.000Z'
                  updatedAt: '2026-06-21T11:20:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >-
            The order's current status cannot move to this one (for example a
            pending or cancelled order).
components:
  parameters:
    OrderId:
      name: id
      in: path
      required: true
      description: The order's id (Mongo ObjectId).
      schema:
        type: string
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    OrderDetail:
      type: object
      description: >-
        A fully populated order as returned by the get-by-id and update
        endpoints.
      properties:
        _id:
          type: string
        orderId:
          type: integer
        user:
          $ref: '#/components/schemas/CustomerProfile'
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItemPopulated'
        status:
          type: string
        notes:
          type: string
        additionalInfo:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalInfoItem'
          description: Custom labelled key/value info attached to the order.
        payment:
          oneOf:
            - $ref: '#/components/schemas/PaymentDetail'
            - type: 'null'
        coupon:
          oneOf:
            - $ref: '#/components/schemas/Coupon'
            - type: 'null'
        shipment:
          oneOf:
            - $ref: '#/components/schemas/ShipmentDetail'
            - type: 'null'
        discount:
          type: number
        subtotal:
          type: number
        shippingCost:
          type: number
        tax:
          type: number
        source:
          type: string
        paymentMethod:
          type: string
        total:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CustomerProfile:
      type: object
      description: Summary of the customer (user) attached to the order.
      properties:
        _id:
          type: string
        name:
          type: string
        email:
          type: string
        phone:
          type: string
        customerId:
          type: string
          description: The store-scoped customer record id.
        lastActive:
          type: string
          format: date-time
        customerSince:
          type: string
          format: date-time
    OrderItemPopulated:
      type: object
      description: A line item where the product is populated with name and images.
      properties:
        _id:
          type: string
        product:
          type:
            - object
            - 'null'
          properties:
            _id:
              type: string
            name:
              type: string
            images:
              type: array
              items:
                type: string
        variant:
          type:
            - string
            - 'null'
        name:
          type: string
        sku:
          type: string
        price:
          type: number
        quantity:
          type: integer
        variantAttributes:
          type: object
          additionalProperties: true
        imageUrl:
          type:
            - string
            - 'null'
    AdditionalInfoItem:
      type: object
      description: A labelled key/value entry of order additional info.
      required:
        - label
      properties:
        label:
          type: string
          maxLength: 100
          description: The field name.
        value:
          type: string
          maxLength: 2000
          description: The field value.
    PaymentDetail:
      type: object
      description: Full payment detail, including the transaction id.
      properties:
        _id:
          type: string
        status:
          type: string
        amount:
          type: number
        method:
          type: string
        transactionId:
          type: string
    Coupon:
      type: object
      description: Coupon applied to the order.
      properties:
        _id:
          type: string
        code:
          type: string
        discountType:
          type: string
        discountValue:
          type: number
    ShipmentDetail:
      type: object
      description: Full shipment detail with tracking, address and shipping option.
      properties:
        _id:
          type: string
        status:
          type: string
        carrier:
          type:
            - string
            - 'null'
        trackingNumber:
          type:
            - string
            - 'null'
        trackingUrl:
          type:
            - string
            - 'null'
        trackingHistory:
          type: array
          items:
            type: object
            additionalProperties: true
        estimatedDelivery:
          type:
            - string
            - 'null'
          format: date-time
        shippingAddress:
          type: object
          properties:
            name:
              type: string
            address:
              type: string
            city:
              type: string
            state:
              type: string
            zipCode:
              type: string
            country:
              type: string
            email:
              type: string
            phone:
              type: string
        shippingOption:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
            type:
              type: string
            price:
              type: number
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    NotFound:
      description: The order does not exist or does not belong to the installation's store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Order not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.