{
  "openapi": "3.0.4",
  "info": {
    "title": "The Flower Factory Partner API",
    "description": "Send orders to The Flower Factory and follow them through to delivery.\n\n## Authentication\n\nEvery request needs an OAuth 2.0 access token, sent as `Authorization: Bearer <token>`. Get one with the\nclient credentials flow, using the client ID and secret we gave you: the token URL and scope are in the\nsecurity scheme below. Tokens last about an hour; get a new one when yours expires.\n\nA missing, invalid or expired token gets 401. A token for an application we haven't set up as a partner\ngets 403.\n\n## Errors\n\nErrors are [problem details](https://www.rfc-editor.org/rfc/rfc9457) (`application/problem+json`), with a\n`title` saying what went wrong and a `detail` saying what to do about it. An invalid request gets 400 with\neach problem listed under `errors`.",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.theflowerfactory.ie",
      "description": "Production"
    },
    {
      "url": "https://api.sandbox.theflowerfactory.ie",
      "description": "Sandbox"
    }
  ],
  "paths": {
    "/partner/v1/orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Create an order",
        "description": "Each order needs a reference of your own that you haven't used before. If you send a reference again,\r\nfor example retrying after a timeout, you get 409 and the order isn't created twice: get the order by\r\nits reference to see it.",
        "requestBody": {
          "description": "The order.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The order was created. The `Location` header is its URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "The order isn't valid: each problem is listed under `errors`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "The token isn't for a partner application we've set up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "You've already sent an order with this reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "List orders",
        "description": "Your orders, newest first. Pages are cursor-based: pass the previous page's `nextCursor` as `cursor` to\r\nget the next page; `nextCursor` is null on the last page.",
        "parameters": [
          {
            "name": "deliveryDateFrom",
            "in": "query",
            "description": "Only orders for delivery on or after this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "deliveryDateTo",
            "in": "query",
            "description": "Only orders for delivery on or before this date.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The previous page's `nextCursor`. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Orders per page, 1 to 100.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of orders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPage"
                }
              }
            }
          },
          "400": {
            "description": "A filter isn't valid, such as delivery dates the wrong way round.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "The token isn't for a partner application we've set up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/orders/{reference}": {
      "put": {
        "tags": [
          "Orders"
        ],
        "summary": "Update an order",
        "description": "Replaces the order's purchaser, recipient, delivery, message and items with the request: send every field,\r\nnot only the ones that changed. The reference can't be changed.\r\n            \r\nYou can change an order until we start making it, while its status is `Received`. After that you get 409:\r\ncontact us to change it.",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "description": "Your reference for the order.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The order's new details.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "The order isn't valid: each problem is listed under `errors`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "The token isn't for a partner application we've set up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You haven't sent an order with this reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "We've started the order, so it can't be changed; or it changed while you were updating it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Get an order",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "description": "Your reference for the order.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The order and where it's got to.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "description": "The access token is missing, invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "The token isn't for a partner application we've set up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You haven't sent an order with this reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "responses": {
          "200": {
            "description": "Your webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "description": "The response has the webhook's signing secret: keep it, as it isn't shown again. You can have up to five\r\nwebhooks.",
        "requestBody": {
          "description": "The webhook.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The webhook was created, with its signing secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "400": {
            "description": "The URL or events aren't valid, or you already have five webhooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Get a webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have a webhook with this ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "description": "Replaces the webhook's URL, events and whether it's on. Turn it back on here after we've turned it off.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "The webhook's new settings.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The webhook as it is now.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "description": "The URL or events aren't valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have a webhook with this ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "description": "Stops its events at once, including any still being retried.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The webhook was deleted."
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have a webhook with this ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/{id}/secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Replace a webhook's secret",
        "description": "Events are signed with the new secret from now on, so update your endpoint straight away. The response has the\r\nnew secret, which isn't shown again.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The webhook, with its new signing secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookWithSecret"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have a webhook with this ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List a webhook's deliveries",
        "description": "Each event sent to the webhook and how sending it went, newest first. Pages are cursor-based: pass the previous\r\npage's `nextCursor` as `cursor`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The previous page's `nextCursor`. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Deliveries per page, 1 to 100.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryPage"
                }
              }
            }
          },
          "400": {
            "description": "The cursor or page size isn't valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have a webhook with this ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/partner/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send an event again",
        "description": "Sends a delivery's event to the webhook again, with the same `webhook-id`, as a new delivery. Use it after\r\nfixing your endpoint, or to test it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The webhook's ID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "description": "The delivery's ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The event will be sent again shortly: this is the new delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "403": {
            "description": "Managing your own webhooks isn't turned on for you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "You don't have this webhook, or it has no such delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "The webhook is turned off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Address": {
        "required": [
          "country",
          "line1"
        ],
        "type": "object",
        "properties": {
          "line1": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string",
            "description": "The first line: house number or name, and street.",
            "example": "12 Main Street"
          },
          "line2": {
            "maxLength": 100,
            "type": "string",
            "description": "The second line, if there is one.",
            "nullable": true,
            "example": "Rathmines"
          },
          "city": {
            "maxLength": 60,
            "type": "string",
            "description": "The town or city.",
            "nullable": true,
            "example": "Dublin 6"
          },
          "county": {
            "maxLength": 60,
            "type": "string",
            "description": "The county.",
            "nullable": true,
            "example": "Dublin"
          },
          "postcode": {
            "maxLength": 20,
            "type": "string",
            "description": "The postcode (Eircode in Ireland).",
            "nullable": true,
            "example": "D06 A1B2"
          },
          "country": {
            "maxLength": 60,
            "minLength": 1,
            "type": "string",
            "description": "The country.",
            "example": "Ireland"
          }
        },
        "additionalProperties": false,
        "description": "A postal address."
      },
      "CreateOrderRequest": {
        "required": [
          "delivery",
          "items",
          "purchaser",
          "recipient",
          "reference"
        ],
        "type": "object",
        "properties": {
          "purchaser": {
            "$ref": "#/components/schemas/Purchaser"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "message": {
            "maxLength": 1000,
            "type": "string",
            "description": "The message for the card. Leave it out for no card message.",
            "nullable": true,
            "example": "Happy birthday Mam! Love, Siobhán"
          },
          "items": {
            "maxItems": 50,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            },
            "description": "What's in the order: 1 to 50 lines."
          },
          "reference": {
            "maxLength": 64,
            "minLength": 1,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$",
            "type": "string",
            "description": "Your reference for the order, unique among your orders: letters, digits, `.`, `_` and `-`, up to 64\r\ncharacters. You use it to look the order up.",
            "example": "WEB-100234"
          }
        },
        "additionalProperties": false,
        "description": "A new order."
      },
      "CreateWebhookRequest": {
        "required": [
          "events",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string",
            "description": "Where to send events: an HTTPS URL on the internet.",
            "example": "https://example.com/hooks/the-flower-factory"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The events to send: `order.status_changed`, `order.shipment_added`, or both."
          }
        },
        "additionalProperties": false,
        "description": "A new webhook."
      },
      "Delivery": {
        "required": [
          "date"
        ],
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The delivery date: today or later.",
            "format": "date",
            "example": "2026-11-14"
          },
          "earliestTime": {
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "type": "string",
            "description": "The start of the delivery window, in 24-hour time (Irish time). Leave it out for any time.",
            "nullable": true,
            "example": "09:00"
          },
          "latestTime": {
            "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
            "type": "string",
            "description": "The end of the delivery window, in 24-hour time (Irish time). Leave it out for any time.",
            "nullable": true,
            "example": "13:00"
          }
        },
        "additionalProperties": false,
        "description": "When the order is to be delivered."
      },
      "Order": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "Your reference for the order.",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "receivedAt": {
            "type": "string",
            "description": "When we received the order (UTC).",
            "format": "date-time",
            "nullable": true
          },
          "purchaser": {
            "$ref": "#/components/schemas/Purchaser"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "message": {
            "type": "string",
            "description": "The message for the card.",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            },
            "description": "What's in the order.",
            "nullable": true
          },
          "shipments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Shipment"
            },
            "description": "The order's parcels with the courier, once it's dispatched: empty until then.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An order, and where it's got to."
      },
      "OrderItem": {
        "required": [
          "name",
          "sku",
          "unitPrice"
        ],
        "type": "object",
        "properties": {
          "sku": {
            "maxLength": 64,
            "minLength": 1,
            "type": "string",
            "description": "Your product code.",
            "example": "BQT-ROSE-12"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string",
            "description": "The product's name.",
            "example": "A dozen red roses"
          },
          "quantity": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "description": "How many: 1 to 100.",
            "format": "int32",
            "example": 1
          },
          "unitPrice": {
            "maximum": 100000,
            "minimum": 0,
            "type": "number",
            "description": "The price of one, in euro.",
            "format": "double",
            "example": 49.99
          }
        },
        "additionalProperties": false,
        "description": "A line of an order."
      },
      "OrderPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            },
            "description": "This page's orders, newest first.",
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as `cursor` to get the next page; null on the last page.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of orders."
      },
      "OrderStatus": {
        "enum": [
          "Received",
          "InProgress",
          "Packed",
          "Dispatched",
          "Delivered",
          "DeliveryFailed",
          "Returned",
          "OnHold",
          "Cancelled"
        ],
        "type": "string",
        "description": "Where an order has got to. `Received`: we have the order and haven't started it. `InProgress`: it's being\r\nmade. `Packed`: it's made and waiting for the courier. `Dispatched`: it's with the courier. `Delivered`.\r\n`DeliveryFailed`: the courier couldn't deliver it, and will usually try again. `Returned`: it came back to us.\r\n`OnHold`: we've paused it, and will be in touch. `Cancelled`."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "Purchaser": {
        "required": [
          "email",
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string",
            "description": "Their full name.",
            "example": "Siobhán Murphy"
          },
          "email": {
            "maxLength": 254,
            "minLength": 1,
            "type": "string",
            "description": "Their email address.",
            "format": "email",
            "example": "siobhan@example.com"
          }
        },
        "additionalProperties": false,
        "description": "The person who placed the order."
      },
      "Recipient": {
        "required": [
          "address",
          "name",
          "telephone"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 100,
            "minLength": 1,
            "type": "string",
            "description": "Their full name.",
            "example": "Mary Murphy"
          },
          "telephone": {
            "maxLength": 30,
            "minLength": 1,
            "type": "string",
            "description": "A telephone number the courier can call them on.",
            "example": "+353 87 123 4567"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "additionalProperties": false,
        "description": "The person the order is for, and where it's going."
      },
      "Shipment": {
        "type": "object",
        "properties": {
          "carrier": {
            "type": "string",
            "description": "The courier, if known, such as `DPD`.",
            "nullable": true
          },
          "trackingNumber": {
            "type": "string",
            "description": "The courier's tracking number.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A consignment with a courier."
      },
      "UpdateOrderRequest": {
        "required": [
          "delivery",
          "items",
          "purchaser",
          "recipient"
        ],
        "type": "object",
        "properties": {
          "purchaser": {
            "$ref": "#/components/schemas/Purchaser"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "message": {
            "maxLength": 1000,
            "type": "string",
            "description": "The message for the card. Leave it out for no card message.",
            "nullable": true,
            "example": "Happy birthday Mam! Love, Siobhán"
          },
          "items": {
            "maxItems": 50,
            "minItems": 1,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            },
            "description": "What's in the order: 1 to 50 lines."
          }
        },
        "additionalProperties": false,
        "description": "An order's new details. They replace all of its current ones, so send every field, not only the ones that changed."
      },
      "UpdateWebhookRequest": {
        "required": [
          "enabled",
          "events",
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string",
            "description": "Where to send events: an HTTPS URL on the internet.",
            "example": "https://example.com/hooks/the-flower-factory"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The events to send: `order.status_changed`, `order.shipment_added`, or both."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether to send events. Turning a webhook back on after we turned it off (see `disabledReason`) sends events\r\nfrom then on."
          }
        },
        "additionalProperties": false,
        "description": "A webhook's new settings. They replace its current ones."
      },
      "ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The webhook's ID.",
            "nullable": true
          },
          "url": {
            "type": "string",
            "description": "Where events are sent.",
            "nullable": true
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The events it gets.",
            "nullable": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether events are being sent."
          },
          "disabledReason": {
            "type": "string",
            "description": "Why we turned it off, if we did: for example, after a day of failed deliveries.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "When it was created (UTC).",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "When it was last changed (UTC).",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "A webhook."
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The delivery's ID.",
            "format": "int64"
          },
          "eventId": {
            "type": "string",
            "description": "The event's ID: the `webhook-id` header, the same for every delivery of the event.",
            "nullable": true
          },
          "eventType": {
            "type": "string",
            "description": "The event's type.",
            "nullable": true
          },
          "orderReference": {
            "type": "string",
            "description": "Your reference for the event's order.",
            "nullable": true
          },
          "status": {
            "type": "string",
            "description": "`Pending` (still trying), `Delivered`, or `Failed` (we've stopped trying).",
            "nullable": true
          },
          "attempts": {
            "type": "integer",
            "description": "How many times we've tried.",
            "format": "int32"
          },
          "lastAttemptAt": {
            "type": "string",
            "description": "When we last tried (UTC).",
            "format": "date-time",
            "nullable": true
          },
          "nextAttemptAt": {
            "type": "string",
            "description": "When we'll try next (UTC), while it's pending.",
            "format": "date-time",
            "nullable": true
          },
          "lastResponseStatus": {
            "type": "integer",
            "description": "The HTTP status your endpoint last answered with, if it answered.",
            "format": "int32",
            "nullable": true
          },
          "lastError": {
            "type": "string",
            "description": "Why the last attempt failed.",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "When the event happened (UTC).",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "An attempt, or attempts, to send an event to a webhook."
      },
      "WebhookDeliveryPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "description": "This page's deliveries, newest first.",
            "nullable": true
          },
          "nextCursor": {
            "type": "string",
            "description": "Pass as `cursor` to get the next page; null on the last page.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A page of deliveries."
      },
      "WebhookWithSecret": {
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/Webhook"
          },
          "secret": {
            "type": "string",
            "description": "The secret to check event signatures with, in the Standard Webhooks format. Keep it safe: it's only shown when\r\nthe webhook is created and when the secret is replaced.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A webhook and its signing secret, which is only ever shown here."
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "description": "An OAuth 2.0 access token from the client credentials flow, with the client ID and secret we gave you.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://login.microsoftonline.com/b66ad013-3458-4610-a433-7bdd1264b5b4/oauth2/v2.0/token",
            "scopes": {
              "api://24579c38-caed-4940-a35f-8fc7763b718c/.default": "The partner API"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "OAuth2": [
        "api://24579c38-caed-4940-a35f-8fc7763b718c/.default"
      ]
    }
  ],
  "tags": [
    {
      "name": "Orders",
      "description": "Send us orders and follow them through to delivery. You only ever see your own orders."
    },
    {
      "name": "Webhooks",
      "description": "Get events about your orders sent to your own endpoint, instead of checking for changes. We may set up your\r\nwebhooks for you; you can manage them yourself here if we've turned that on for you."
    }
  ]
}
