Template Docs Commerce APIs Tools
Get Started
Get Started

Fulfilling an Order

POST https://api.squarespace.com/1.0/commerce/orders/{orderId}/fulfillments

You can post a fulfillment of an order, which will change its fulfillment state to FULFILLED and optionally trigger an email notification to the customer. It will update the order summary with the shipments sent during the fulfillment.

Parameters

  • orderId
    • Type: A string.
    • Specifies the order to update.

Request Format & Example

curl "https://api.squarespace.com/1.0/commerce/orders/585d498fdee9f31a60284a37/fulfillments" \
  -H "Authorization: Bearer YOUR_SECRET_API_KEY" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{
    "shouldSendNotification": true,
    "shipments": [
      {
        "shipDate": "2017-01-28T22:19:26.980Z",
        "carrierName": "USPS",
        "service": "Priority Mail",
        "trackingNumber": "9400109699939624119857",
        "trackingUrl": "https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1=9400109699939624119857"
      }, {
        "shipDate": "2017-01-29T22:19:26.980Z",
        "carrierName": "FedEx",
        "service": "Same-Day Delivery",
        "trackingNumber": "103932814692659",
        "trackingUrl": "https://www.fedex.com/apps/fedextrack/?tracknumbers=103932814692659"
      }
    ]
  }'
  • shouldSendNotification: Indicates whether the customer should receive an email notification about the added shipments.
  • shipments: An array of objects containing shipment data.
    • shipDate: The ISO 8601 date and time representing the moment the shipment occurred.
    • carrierName: A string representing the parcel service transporting the shipment.
    • service: A string representing the level of service, as offered by the carrier, used for this shipment.
    • trackingNumber: A string representing the carrier-generated tracking number.
    • trackingUrl optional: A tracking URL, ideally supplied by the carrier. If this value is provided, it must represent a valid URL.

Response Format

A response to a successful request will not contain any data.

Status Codes & Error Conditions

  • 204 OK
    • The request was successful. The message body does not contain any data.
  • 400 BAD REQUEST
    • Type: INVALID_REQUEST_ERROR
    • Subtype: INVALID_ARGUMENT
      1. One or more of the provided tracking URLs are invalid.
  • 404 NOT FOUND
    • Type: INVALID_REQUEST_ERROR
    • Subtype: INVALID_ARGUMENT
      1. The requested order could not be found.