Changelog

This page contains the changelog of the current API version. For the past changelog, please refer to this page.

CHANGEBEFOREAFTER
Base URLhttps://api.aftership.com/commerce/2026-01https://api.aftership.com/commerce/2026-07

The new Location resource represents an organization-level warehouse, store, or other physical place used for fulfillment, order processing, and pickup settings.

New Endpoints

  • POST /locations
  • GET /locations
  • GET /locations/{id}
  • PATCH /locations/{id}

Notes

  • Location resources are organization-level resources and do not require the as-store-id header.
  • source indicates whether a location was created manually through Commerce API (manual) or imported from an ecommerce platform (platform).
  • POST /locations creates manual locations only. The required request fields are name and address.
  • Custom IDs for manual locations must be unique within the organization and cannot start with the reserved prefix app-.
  • Platform-sourced location IDs are returned in the format app-<platform>-<app_key>-<external_id>.
  • Platform-sourced locations can only patch address.email, address.phone, timezone_identifier, opening_hours, and order_processing.
  • The id returned by every Location endpoint is the canonical identifier to use elsewhere in Commerce API — for example as the location_id inside order.pickup_location and fulfillment.ship_from_location / fulfillment.pickup_location. See §3.
  • address.first_name and address.last_name are joined into one contact name on write; on read, the full contact name is returned as address.first_name and address.last_name is empty.
  • address.type is accepted by the schema for compatibility with the standard address shape but is not used for Location resources — omit it on write; on read it is always empty.
  • When pickup_setting.enabled = true, omitted address.coordinate values are auto-filled from the postal address (geocoded by AfterShip). Coordinates explicitly provided by the caller are preserved as-is.

Response Example

{ "id": "warehouse_1", "name": "SF Warehouse", "source": "manual", "address": { "company": "AfterShip", "first_name": "John", "last_name": "Doe", "phone": "+14155551234", "email": "[email protected]", "street_1": "123 Main St", "street_2": "Suite 100", "street_3": "", "city": "San Francisco", "state": "CA", "country_region": "USA", "postal_code": "94105", "coordinate": { "latitude": 37.7749, "longitude": -122.4194 } }, "timezone_identifier": "America/New_York", "opening_hours": { "sunday": { "open": false, "from": null, "to": null }, "monday": { "open": true, "from": "09:00", "to": "18:00" }, "tuesday": { "open": true, "from": "09:00", "to": "18:00" }, "wednesday": { "open": true, "from": "09:00", "to": "18:00" }, "thursday": { "open": true, "from": "09:00", "to": "18:00" }, "friday": { "open": true, "from": "09:00", "to": "18:00" }, "saturday": { "open": false, "from": null, "to": null } }, "order_processing": { "enabled": true, "order_cutoff_time": "14:00", "order_processing_duration_days": 0 }, "pickup_setting": { "enabled": true, "instructions": "Please pick up at the front desk.", "order_processing_duration_seconds_min": 3600, "order_processing_duration_seconds_max": 7200 }, "created_at": "2026-01-01T00:00:00Z", "updated_at": "2026-04-24T00:00:00Z" }

From 2026-07, the location_id field on order.pickup_location, fulfillment.pickup_location, and fulfillment.ship_from_location would only accept the public Location ID returned by the new Location Resource (§2), in either form:

  • A merchant-defined custom ID (e.g. "warehouse_1") for source = manual locations.
  • A platform composite ID app-<platform>-<app_key>-<external_id> for source = platform locations.

Affected Endpoints (Request Body)

  • POST /orders (request_body.pickup_location.location_id)
  • POST /fulfillments (request_body.pickup_location.location_id, request_body.ship_from_location.location_id)
  • PATCH /fulfillments/{id} (request_body.pickup_location.location_id, request_body.ship_from_location.location_id)
BEFORE (2026-01)AFTER (2026-07)
location_id required the ID from admin.aftership.com/organization/warehouses, which was not exposed by any Commerce API endpoint.location_id accepts the Location resource's public id (GET /locations) only, previous ID would be rejected.

Recommended Flow

  1. Call GET /locations (or remember the id returned by POST /locations).
  2. Pass that id as the location_id on order/fulfillment requests.

If the supplied location_id does not match any Location under the organization, the endpoint returns 422 Unprocessable Entity with info: "The location does not exist." on the corresponding request_body.*.location_id path.

The product variant now supports two customs-related fields. This is a backward-compatible addition made after the initial release of this version: existing requests keep working without changes.

FieldTypeDescription
hs_codestring (max 256)Harmonized System (HS) code of the variant.
origin_country_regionstringOrigin country of the variant, in ISO 3166-1 alpha-3 format, for example AUS.

Affected Endpoints (Request Body and Response Body)

  • POST /products
  • PATCH /products/{id}
  • POST /products/{id}/variants
  • PATCH /products/{id}/variants/{variant_id}
  • GET /products, GET /products/{id}, GET /products/{id}/variants/{variant_id} (response only)

Request Example

{ "variants": [ { "id": "5634477687", "sku": "SKU001", "price": "10", "hs_code": "6403911600", "origin_country_region": "AUS" } ] }

If origin_country_region is not a valid ISO 3166-1 alpha-3 code (for example AU or Australia), the endpoint returns 422 Unprocessable Entity. On PATCH, omitting a field keeps its current value.