{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-create-order-fulfillment-response-schema.json",
  "title": "CreateOrderFulfillmentResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-orders-api-openapi.yml#/components/schemas/CreateOrderFulfillmentResponse",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "fulfillment": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The Rutter generated unique ID of the fulfillment."
            },
            "order_id": {
              "type": "string",
              "description": "The Rutter ID of the [Order](/rest/version/orders) linked to the fulfillment."
            },
            "carrier": {
              "type": [
                "string",
                "null"
              ],
              "description": "The carrier of the fulfillment, ex \"USPS\", \"Fedex\", \"UPS\", \"Canada Post\", etc."
            },
            "service": {
              "type": [
                "string",
                "null"
              ],
              "description": "The carrier shipping service of the fulfillment, ex \"Priority Mail\", \"2 Day Delivery\", etc."
            },
            "tracking_number": {
              "type": [
                "string",
                "null"
              ],
              "description": "The tracking number of the fulfillment. Buyers can track tracking info using this number at the carrier's website."
            },
            "tracking_url": {
              "type": [
                "string",
                "null"
              ],
              "description": "The tracking URL of the fulfillment. Buyers can open this URL to look up tracking information."
            },
            "type": {
              "type": [
                "string",
                "null"
              ],
              "description": "The fulfillment method, when the platform distinguishes one. For Square: 'shipment' | 'pickup' | 'delivery' | 'digital'."
            },
            "line_items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The Rutter generated unique ID of the fulfillment line item."
                  },
                  "product_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The Rutter ID of the [Product](/rest/version/products) linked to the fulfillment line item. `null` if the product has been deleted from the connection."
                  },
                  "variant_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "The Rutter ID of the [Product](/rest/version/products) linked to the order. `null` if the product has been deleted from the connection. The `variant_id` and `product_id` are equal if the variant is the default variant or the product contains no variants."
                  },
                  "price": {
                    "type": "number",
                    "description": "The total cost of all of the variants associated with this line item. This is before applying any taxes or discounts, and is typically calculated by multiplying the single unit cost by the quantity purchased. For WooCommerce, this value does include discounts."
                  },
                  "quantity": {
                    "type": "number",
                    "description": "The quantity of the linked [Variant](/rest/version/variants) fulfilled with this line item."
                  },
                  "sku": {
                    "type": "string",
                    "description": "The stock keeping unit (SKU) of the linked [Variant](/rest/version/variants)."
                  },
                  "title": {
                    "type": "string",
                    "description": "The `title` of the linked [Variant](/rest/version/variants)"
                  },
                  "additional_fields": {
                    "type": "object",
                    "properties": {
                      "platform_product_id": {
                        "type": "string",
                        "description": "The platform ID of the product. Supported for Walmart, eBay."
                      },
                      "product_type": {
                        "type": "string",
                        "description": "The product type. Supported for Walmart, eBay."
                      },
                      "total_amount": {
                        "type": "number",
                        "description": "The total amount of the line item (including all taxes, discounts, promotions, and delivery costs). Supported for Walmart, eBay."
                      }
                    },
                    "additionalProperties": false,
                    "description": "Additional fields required only for a narrow set of use cases."
                  }
                },
                "required": [
                  "id",
                  "product_id",
                  "variant_id",
                  "price",
                  "quantity",
                  "sku",
                  "title"
                ],
                "additionalProperties": false
              },
              "description": "The linked [Variants](/rest/version/variants) and quantities associated with this fulfillment."
            }
          },
          "required": [
            "id",
            "order_id",
            "carrier",
            "service",
            "tracking_number",
            "tracking_url",
            "line_items"
          ],
          "additionalProperties": false
        },
        "connection": {
          "$ref": "#/$defs/Connection"
        }
      },
      "required": [
        "fulfillment",
        "connection"
      ],
      "additionalProperties": false
    },
    {
      "$ref": "#/$defs/AsyncResponsePayload"
    }
  ],
  "$defs": {
    "AsyncResponsePayload": {
      "type": "object",
      "properties": {
        "async_response": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "response_url": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "prequeued",
                "pending",
                "success",
                "failure"
              ]
            },
            "platform_rate_limit_details": {
              "type": "object",
              "properties": {
                "lookback_window_seconds": {
                  "type": "number"
                },
                "platform_rate_limited_basis": {
                  "type": "string",
                  "enum": [
                    "platform",
                    "connection",
                    "hybrid"
                  ]
                },
                "recent_connection_rate_limited_job_count": {
                  "type": "number"
                },
                "recent_platform_rate_limited_job_count": {
                  "type": "number"
                },
                "recent_rate_limited_job_count": {
                  "type": "number"
                }
              },
              "required": [
                "lookback_window_seconds",
                "platform_rate_limited_basis",
                "recent_connection_rate_limited_job_count",
                "recent_platform_rate_limited_job_count",
                "recent_rate_limited_job_count"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "response_url",
            "status"
          ],
          "additionalProperties": false
        }
      }
    },
    "Connection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The UUID of the connection. Generated by Rutter."
        },
        "orgId": {
          "type": "string",
          "format": "uuid",
          "description": "Your organization id."
        },
        "platform": {
          "$ref": "#/$defs/Platform"
        }
      },
      "required": [
        "id",
        "orgId",
        "platform"
      ]
    },
    "Platform": {
      "type": "string",
      "enum": [
        "AMAZON",
        "EBAY",
        "ETSY",
        "FNAC",
        "WALMART",
        "SHOPEE",
        "LAZADA",
        "MERCADOLIBRE",
        "ALIBABA",
        "WAYFAIR",
        "SHEIN",
        "NOON",
        "SHOPLINE",
        "PRESTASHOP",
        "SHOPIFY",
        "MAGENTO",
        "WOO_COMMERCE",
        "SQUARESPACE",
        "WIX",
        "SHOPER",
        "SHOPLAZZA",
        "BIG_COMMERCE",
        "SALLA",
        "ZID",
        "TIKTOKSHOP",
        "COMMERCELAYER",
        "WEBFLOW",
        "GUMROAD",
        "ECWID",
        "PAYPAL",
        "SQUARE",
        "STRIPE",
        "CLOVER",
        "MOLLIE",
        "PAYNL",
        "AUTHORIZENET",
        "RECHARGE",
        "CHARGIFY",
        "CHARGEBEE",
        "RECURLY",
        "KASHFLOW",
        "SAGE_INTACCT",
        "SAGE_INTACCT_V2",
        "DYNAMICS365",
        "DYNAMICS365FO",
        "ZOHOBOOKS",
        "EXACTONLINE",
        "FREEAGENT",
        "QUICKBOOKS",
        "QUICKBOOKS_DESKTOP",
        "FRESHBOOKS",
        "XERO",
        "SAGE_BUSINESS_CLOUD",
        "SAGE_50",
        "VISTA",
        "NETSUITE",
        "WAVE",
        "DUALENTRY",
        "CAMPFIRE",
        "RILLET",
        "SOFTLEDGER",
        "VISMA",
        "SPIRIS",
        "LEXWARE",
        "MONEYBIRD",
        "SAGE200CLOUD",
        "MX",
        "PLAID",
        "TELLER",
        "RAMP",
        "ODOO",
        "ACUMATICA",
        "FULFIL",
        "TALLY",
        "SAPBUSINESSONE",
        "SAPS4HANA",
        "WORKDAY",
        "ANFIX",
        "ORACLEFUSION",
        "HOLDED",
        "MYOBBUSINESS",
        "FORTNOX",
        "GOOGLE",
        "FACEBOOK",
        "TIKTOK",
        "INTUIT_BANK_FEEDS",
        "PLAID_BANK_FEEDS",
        "SAGE",
        "SAGE_BANK_FEEDS",
        "YODLEE_BANK_FEEDS",
        "QUICKBOOKS_HRIS",
        "BAMBOO_HR",
        "GUSTO",
        "DEEL",
        "RIPPLING"
      ],
      "description": "The underlying platform."
    }
  }
}