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

# Create Fulfillment

> Creates a fulfillment with a shipment tracker for provided order items. When trackers change their state, order.status will change to IN_PRODUCTION, PARTIALLY_IN_PRODUCTION, PARTIALLY_SHIPPED, SHIPPED depending on the shipping tracker info. Order updated webhooks will be triggered.

<Note>
  **OAuth scope:** `fulfillment_write`

  API keys have full access to this endpoint.
</Note>


## OpenAPI

````yaml POST /open-api/v1.0/fulfillments
openapi: 3.1.0
info:
  title: Fourthwall APIs
  description: Service used for management of orders, carts, and payments.
  termsOfService: https://fourthwall.com/terms-of-service
  contact:
    name: Backend team
    url: https://fourthwall.com
    email: backend@fourthwall.com
  version: unspecified
servers:
  - url: https://api.fourthwall.com
    description: Production server
security: []
externalDocs:
  description: OpenAPI documentation
  url: https://docs.fourthwall.com
paths:
  /open-api/v1.0/fulfillments:
    post:
      tags:
        - Fulfillment
      summary: Create a fulfillment for an order
      description: >-
        Creates a fulfillment with a shipment tracker for provided order items.
        When trackers change their state, order.status will change to
        IN_PRODUCTION, PARTIALLY_IN_PRODUCTION, PARTIALLY_SHIPPED, SHIPPED
        depending on the shipping tracker info. Order updated webhooks will be
        triggered.
      operationId: create-fulfillment
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/com.fourthwall.app.openapi.endpoint.FulfillmentRequest
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/com.fourthwall.app.openapi.endpoint.FulfillmentResponse
        '400':
          description: >-
            Possible errors: `FULFILLMENT_ALREADY_EXISTS`,
            `FULFILLMENT_ORDER_INVALID_VARIANT`,
            `FULFILLMENT_VARIANT_QUANTITY_TO_HIGH`
          content:
            application/json:
              examples:
                fulfillment-already-exists:
                  value:
                    code: FULFILLMENT_ALREADY_EXISTS
                    fulfillmentId: <fulfillmentid>
                    orderId: <orderid>
                fulfillment-order-invalid-variant:
                  value:
                    code: FULFILLMENT_ORDER_INVALID_VARIANT
                    orderId: <orderid>
                    variantId: <offervariantid>
                    groupedId: <cartitemgroupedid?>
                fulfillment-variant-quantity-to-high:
                  value:
                    code: FULFILLMENT_VARIANT_QUANTITY_TO_HIGH
                    orderId: <orderid>
                    variantId: <offervariantid>
                    fulfillable: <int>
                    quantity: <int>
        '404':
          description: >-
            Possible errors: `FULFILLMENT_INVALID_SHOP_ORDER`,
            `FULFILLMENT_ORDER_NOT_FOUND`, `OFFER_VARIANT_NOT_FOUND_ERROR`,
            `ORDER_ID_NOT_FOUND`
          content:
            application/json:
              examples:
                fulfillment-invalid-shop-order:
                  value:
                    code: FULFILLMENT_INVALID_SHOP_ORDER
                    shopId: <shopid?>
                    orderId: <orderid>
                fulfillment-order-not-found:
                  value:
                    code: FULFILLMENT_ORDER_NOT_FOUND
                    orderId: <orderid>
                offer-variant-not-found-error:
                  value:
                    code: OFFER_VARIANT_NOT_FOUND_ERROR
                    offerVariantId: <offervariantid>
                order-id-not-found:
                  value:
                    code: ORDER_ID_NOT_FOUND
                    id: <orderid>
      security:
        - oauth:
            - fulfillment_write
        - basicAuth: []
      externalDocs:
        url: >-
          https://docs.fourthwall.com/api-reference/platform/fulfillment/create-fulfillment
components:
  schemas:
    com.fourthwall.app.openapi.endpoint.FulfillmentRequest:
      type: object
      properties:
        orderId:
          type: string
          format: uuid
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/com.fourthwall.app.openapi.endpoint.FulfillmentItem
          minItems: 1
        shippingLabel:
          $ref: >-
            #/components/schemas/com.fourthwall.app.openapi.endpoint.ShippingLabel
      required:
        - items
        - orderId
        - shippingLabel
      title: Fulfillment Request
    com.fourthwall.app.openapi.endpoint.FulfillmentResponse:
      type: object
      properties:
        fulfillmentId:
          type: string
      required:
        - fulfillmentId
      title: Fulfillment Response
    com.fourthwall.app.openapi.endpoint.FulfillmentItem:
      type: object
      properties:
        variantId:
          type: string
          format: uuid
        quantity:
          type: integer
          format: int32
          minimum: 1
      required:
        - quantity
        - variantId
      title: Fulfillment Item
    com.fourthwall.app.openapi.endpoint.ShippingLabel:
      type: object
      properties:
        trackingNumber:
          type: string
          minLength: 1
        trackingCompany:
          type: string
          example: USPS
          examples:
            - DHL
            - UPS
            - USPS
            - Canada Post
          minLength: 1
      required:
        - trackingCompany
        - trackingNumber
      title: Shipping Label
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: >-
            https://auth.staging.fourthwall.com/auth/realms/Fourthwall/protocol/openid-connect/auth
          scopes:
            donation_read: donation_read
            order_read: order_read
            order_write: order_write
            fulfillment_write: fulfillment_write
            giveaway_read: giveaway_read
            giveaway_write: giveaway_write
            memberships_read: memberships_read
            memberships_write: memberships_write
            promotions_write: promotions_write
            promotions_read: promotions_read
            offer_read: offer_read
            offer_write: offer_write
            shop_read: shop_read
            thankyou_read: thankyou_read
            thankyou_write: thankyou_write
            webhook_read: webhook_read
            webhook_write: webhook_write
            media_read: media_read
            media_write: media_write
            analytics_read: analytics_read
            samples_read: samples_read
            samples_write: samples_write
            dns_read: dns_read
            dns_write: dns_write
            settings_read: settings_read
            payout_read: payout_read
            integrations_read: integrations_read
    basicAuth:
      type: http
      scheme: basic

````