
# Order Fulfillment

Contains details about how to fulfill this order.
Orders can only be created with at most one fulfillment using the API.
However, orders returned by the Orders API might contain multiple fulfillments because sellers can create multiple fulfillments using Square products such as Square Online.

## Structure

`OrderFulfillment`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
|  --- | --- | --- | --- | --- | --- |
| `uid` | `?string` | Optional | A unique ID that identifies the fulfillment only within this order.<br>**Constraints**: *Maximum Length*: `60` | getUid(): ?string | setUid(?string uid): void |
| `type` | [`?string(OrderFulfillmentType)`](../../doc/models/order-fulfillment-type.md) | Optional | The type of fulfillment. | getType(): ?string | setType(?string type): void |
| `state` | [`?string(OrderFulfillmentState)`](../../doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | getState(): ?string | setState(?string state): void |
| `lineItemApplication` | [`?string(OrderFulfillmentFulfillmentLineItemApplication)`](../../doc/models/order-fulfillment-fulfillment-line-item-application.md) | Optional | The `line_item_application` describes what order line items this fulfillment applies<br>to. It can be `ALL` or `ENTRY_LIST` with a supplied list of fulfillment entries. | getLineItemApplication(): ?string | setLineItemApplication(?string lineItemApplication): void |
| `entries` | [`?(OrderFulfillmentFulfillmentEntry[])`](../../doc/models/order-fulfillment-fulfillment-entry.md) | Optional | A list of entries pertaining to the fulfillment of an order. Each entry must reference<br>a valid `uid` for an order line item in the `line_item_uid` field, as well as a `quantity` to<br>fulfill.<br>Multiple entries can reference the same line item `uid`, as long as the total quantity among<br>all fulfillment entries referencing a single line item does not exceed the quantity of the<br>order's line item itself.<br>An order cannot be marked as `COMPLETED` before all fulfillments are `COMPLETED`,<br>`CANCELED`, or `FAILED`. Fulfillments can be created and completed independently<br>before order completion. | getEntries(): ?array | setEntries(?array entries): void |
| `metadata` | `?array<string,string>` | Optional | Application-defined data attached to this fulfillment. Metadata fields are intended<br>to store descriptive references or associations with an entity in another system or store brief<br>information about the object. Square does not process this field; it only stores and returns it<br>in relevant API calls. Do not use metadata to store any sensitive information (such as personally<br>identifiable information or card details).<br>Keys written by applications must be 60 characters or less and must be in the character set<br>`[a-zA-Z0-9_-]`. Entries can also include metadata generated by Square. These keys are prefixed<br>with a namespace, separated from the key with a ':' character.<br>Values have a maximum length of 255 characters.<br>An application can have up to 10 entries per metadata field.<br>Entries written by applications are private and can only be read or modified by the same<br>application.<br>For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). | getMetadata(): ?array | setMetadata(?array metadata): void |
| `pickupDetails` | [`?OrderFulfillmentPickupDetails`](../../doc/models/order-fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | getPickupDetails(): ?OrderFulfillmentPickupDetails | setPickupDetails(?OrderFulfillmentPickupDetails pickupDetails): void |
| `shipmentDetails` | [`?OrderFulfillmentShipmentDetails`](../../doc/models/order-fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | getShipmentDetails(): ?OrderFulfillmentShipmentDetails | setShipmentDetails(?OrderFulfillmentShipmentDetails shipmentDetails): void |
| `deliveryDetails` | [`?OrderFulfillmentDeliveryDetails`](../../doc/models/order-fulfillment-delivery-details.md) | Optional | Describes delivery details of an order fulfillment. | getDeliveryDetails(): ?OrderFulfillmentDeliveryDetails | setDeliveryDetails(?OrderFulfillmentDeliveryDetails deliveryDetails): void |

## Example (as JSON)

```json
{
  "uid": "uid8",
  "type": "PICKUP",
  "state": "PROPOSED",
  "line_item_application": "ALL",
  "entries": [
    {
      "uid": "uid0",
      "line_item_uid": "line_item_uid0",
      "quantity": "quantity6",
      "metadata": {
        "key0": "metadata3",
        "key1": "metadata4",
        "key2": "metadata5"
      }
    },
    {
      "uid": "uid0",
      "line_item_uid": "line_item_uid0",
      "quantity": "quantity6",
      "metadata": {
        "key0": "metadata3",
        "key1": "metadata4",
        "key2": "metadata5"
      }
    },
    {
      "uid": "uid0",
      "line_item_uid": "line_item_uid0",
      "quantity": "quantity6",
      "metadata": {
        "key0": "metadata3",
        "key1": "metadata4",
        "key2": "metadata5"
      }
    }
  ]
}
```

