openapi: 3.2.0 info: title: Aftership Locations API contact: name: AfterShip Support url: https://www.aftership.com/contact-us email: support@aftership.com termsOfService: https://www.aftership.com/legal/terms-of-service version: '1.0' description: 'Operations tagged Locations across 2 of this provider''s published API definitions: aftership-commerce-api-openapi.yml, aftership-shipping-api-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - url: https://api.aftership.com/commerce/2026-07 description: API Endpoint - description: Sandbox url: https://sandbox-api.aftership.com/postmen/v3 - url: https://api.aftership.com/postmen/v3 description: Production security: - as-api-key: [] tags: - name: Locations paths: /locations: post: summary: Create a location responses: '201': description: '' content: application/json: schema: type: object properties: meta: $ref: '#/components/schemas/Meta.v1' data: $ref: '#/components/schemas/Location.v1' examples: Example 1: value: meta: code: 20100 type: Created message: The request was successful, we created a new resource and the response body contains the representation. data: id: warehouse_1 name: SF Warehouse source: manual address: company: AfterShip first_name: John Doe last_name: '' phone: '+14155551234' email: john@example.com 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' operationId: create-location description: Create a manual location. Locations created through Commerce API are organization-level resources and are not bound to a store. A custom `id` can be provided, but it cannot start with the reserved prefix `app-`. parameters: [] requestBody: content: application/json: schema: type: object additionalProperties: false required: - name - address properties: id: type: string description: A custom identifier for the location. If not provided, the system will generate a UUID. Must be unique within the organization and immutable. Cannot start with the reserved prefix `app-`. maxLength: 128 pattern: ^[a-zA-Z0-9_-]+$ example: warehouse_1 name: type: string description: The location name. maxLength: 256 example: SF Warehouse address: $ref: '#/components/schemas/Address_with_coordinate.v1' description: The physical address and contact information of the location. For Location resources, `first_name` and `last_name` are joined into one contact name on write; on read, the full contact name is returned as `first_name` and `last_name` is empty. The `type` field is accepted by the schema but not used for Location resources — omit it on write; on read it is always empty. timezone_identifier: type: string description: The name of the timezone where the location is located, as defined by the [IANA timezone database standard](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). maxLength: 256 example: America/New_York opening_hours: $ref: '#/components/schemas/Opening_hours.v1' description: The regular opening hours of the location. order_processing: type: object additionalProperties: false description: The order processing setting for this location. When `enabled` is `true`, `order_cutoff_time` and `order_processing_duration_days` are required. properties: enabled: type: boolean description: Whether order processing is enabled for this location. example: true order_cutoff_time: type: string description: The daily cutoff time for processing orders in `HH:mm` format. example: '14:00' order_processing_duration_days: type: integer description: The number of business days needed to process an order. Use `0` when fulfillment can be completed within 1 business day. minimum: 0 example: 0 pickup_setting: type: object additionalProperties: false description: The pickup setting for this location. When `enabled` is `true`, `order_processing_duration_seconds_min` and `order_processing_duration_seconds_max` are required. properties: enabled: type: boolean description: Whether pickup is enabled for this location. example: true instructions: type: string description: Pickup instructions shown to the customer. maxLength: 2048 example: Please pick up at the front desk. order_processing_duration_seconds_min: type: integer description: The minimum number of seconds needed before the order is ready for pickup. minimum: 0 example: 3600 order_processing_duration_seconds_max: type: integer description: The maximum number of seconds needed before the order is ready for pickup. minimum: 0 example: 7200 examples: Example 1: value: id: warehouse_1 name: SF Warehouse address: company: AfterShip first_name: John last_name: Doe phone: '+14155551234' email: john@example.com 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 description: '' tags: - Locations x-stoplight: id: create-location get: summary: Get locations operationId: get-locations responses: '200': description: '' content: application/json: schema: type: object properties: meta: $ref: '#/components/schemas/Meta.v1' data: type: object properties: locations: type: array items: $ref: '#/components/schemas/Location.v1' pagination: $ref: '#/components/schemas/Pagination.v2' parameter_string: type: string description: A string that includes the request parameters. example: source=manual&page=1&limit=10 examples: Example 1: value: meta: code: 20000 type: OK message: The request was successfully processed by AfterShip. data: locations: - id: warehouse_1 name: SF Warehouse source: manual address: company: AfterShip first_name: John Doe last_name: '' phone: '+14155551234' email: john@example.com 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' pagination: page: 1 limit: 10 has_next_page: false parameter_string: source=manual&page=1&limit=10 description: Get location results with multiple locations. parameters: - schema: type: string enum: - manual - platform in: query name: source description: Filter locations by source. `manual` means locations created through Commerce API. `platform` means locations imported from ecommerce platforms. - schema: type: integer default: 1 minimum: 1 maximum: 200 in: query name: page description: Current page of the collection. Default is 1. - schema: type: integer default: 10 minimum: 1 maximum: 50 in: query name: limit description: The maximum number of results to show on a page. Default is 10, maximum is 50. tags: - Locations x-stoplight: id: get-locations parameters: [] servers: - url: https://api.aftership.com/commerce/2026-07 description: API Endpoint /locations/{id}: parameters: - schema: type: string name: id in: path required: true description: Location ID. Use the `id` value returned in a `Location` resource response, such as from `GET /locations`, as this path parameter. get: summary: Get location by ID responses: '200': description: '' content: application/json: schema: type: object properties: meta: $ref: '#/components/schemas/Meta.v1' data: $ref: '#/components/schemas/Location.v1' examples: Example 1: value: meta: code: 20000 type: OK message: The request was successfully processed by AfterShip. data: id: warehouse_1 name: SF Warehouse source: manual address: company: AfterShip first_name: John Doe last_name: '' phone: '+14155551234' email: john@example.com 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' operationId: get-location-by-id description: Get a location by ID. Use the `id` value returned in a `Location` resource response, such as from `GET /locations`, as this path parameter. parameters: [] tags: - Locations x-stoplight: id: get-location-by-id patch: summary: Update location by ID operationId: update-location-by-id responses: '200': description: '' content: application/json: schema: type: object properties: meta: $ref: '#/components/schemas/Meta.v1' data: $ref: '#/components/schemas/Location.v1' examples: Example 1: value: meta: code: 20000 type: OK message: The request was successfully processed by AfterShip. data: id: warehouse_1 name: SF Warehouse source: manual address: company: AfterShip first_name: John Doe last_name: '' phone: '+14155551234' email: john@example.com 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' requestBody: content: application/json: schema: type: object additionalProperties: false properties: name: type: string description: The location name. This field cannot be patched for platform-sourced locations. maxLength: 256 example: SF Warehouse address: type: object additionalProperties: false description: Patch the address and contact information of the location. The `address` object itself cannot be `null`; omit a field to keep its current value. For platform-sourced locations, only `email` and `phone` can be patched. For Location resources, `first_name` and `last_name` are joined into one contact name on write; on read, the full contact name is returned as `first_name` and `last_name` is empty. The `type` field is accepted by the schema but not used for Location resources — omit it on write; on read it is always empty. properties: company: type: string description: The name of the company associated to the address. maxLength: 256 example: AfterShip first_name: type: string description: The first name of the person associated to the address. maxLength: 256 example: John last_name: type: string description: The last name of the person associated to the address. maxLength: 256 example: Doe phone: type: string description: The phone number of the person associated to the address. maxLength: 256 example: '+14155551234' email: type: string description: The email address of the person associated to the address. maxLength: 256 example: john@example.com street_1: type: string description: First line of the street address. maxLength: 256 example: 123 Main St street_2: type: string description: Second line of the street address. maxLength: 256 example: Suite 100 street_3: type: string description: Third line of the street address. maxLength: 256 example: '' city: type: string description: The location's city, town, or village. maxLength: 256 example: San Francisco state: type: string description: The state or region of the location, such as a province, state, or prefecture. maxLength: 256 example: CA country_region: type: string description: The address country/region in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. pattern: ^[A-Z]{3}$ example: USA postal_code: type: string description: The postal code of the location. maxLength: 256 example: '94105' coordinate: type: object additionalProperties: false description: The coordinate of the address. If `coordinate` is provided, both `latitude` and `longitude` are required. required: - latitude - longitude properties: latitude: type: number description: The latitude of the address. example: 37.7749 longitude: type: number description: The longitude of the address. example: -122.4194 timezone_identifier: type: string description: The name of the timezone where the location is located, as defined by the [IANA timezone database standard](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). maxLength: 256 example: America/New_York opening_hours: $ref: '#/components/schemas/Opening_hours.v1' description: Patch the regular opening hours of the location. The `opening_hours` object itself cannot be `null`. You may provide only the weekdays to update, but each provided weekday object is replaced atomically and must include `open`. When `open` is `false`, `from` and `to` must be `null` or omitted. When `open` is `true`, `from` and `to` must both be provided in `HH:mm` format or both be `null` for 24-hour operation. order_processing: type: object additionalProperties: false description: Patch the order processing setting for this location. The `order_processing` object itself cannot be `null`. Omitted fields keep their current values. Sending only `enabled` toggles the setting without clearing `order_cutoff_time` or `order_processing_duration_days`; when enabling order processing, the final setting must include a valid cutoff time and processing duration. properties: enabled: type: boolean description: Whether order processing is enabled for this location. example: true order_cutoff_time: type: string description: The daily cutoff time for processing orders in `HH:mm` format. example: '14:00' order_processing_duration_days: type: integer description: The number of business days needed to process an order. Use `0` when fulfillment can be completed within 1 business day. minimum: 0 example: 0 pickup_setting: type: object additionalProperties: false description: Patch the pickup setting for this location. The `pickup_setting` object itself cannot be `null`. Omitted fields keep their current values. Sending only `enabled` toggles the setting without clearing existing pickup fields; when enabling pickup, the final setting must include valid minimum and maximum processing durations. This field cannot be patched for platform-sourced locations. properties: enabled: type: boolean description: Whether pickup is enabled for this location. example: true instructions: type: string description: Pickup instructions shown to the customer. maxLength: 2048 example: Please pick up at the front desk. order_processing_duration_seconds_min: type: integer description: The minimum number of seconds needed before the order is ready for pickup. minimum: 0 example: 3600 order_processing_duration_seconds_max: type: integer description: The maximum number of seconds needed before the order is ready for pickup. minimum: 0 example: 7200 examples: Example 1: value: address: city: San Francisco timezone_identifier: America/New_York opening_hours: monday: open: true from: 09:00 to: '18:00' order_processing: enabled: true order_cutoff_time: '14:00' order_processing_duration_days: 0 description: Update a location by ID. Use the `id` value returned in a `Location` resource response, such as from `GET /locations`, as this path parameter. Omit a field to keep its current value. Top-level objects and scalar fields cannot be set to `null`. For platform-sourced locations, only `address.email`, `address.phone`, `timezone_identifier`, `opening_hours`, and `order_processing` can be patched; other fields are managed by the ecommerce platform. parameters: [] tags: - Locations x-stoplight: id: update-location-by-id servers: - url: https://api.aftership.com/commerce/2026-07 description: API Endpoint components: schemas: Opening_hours.v1: description: The regular opening hours of the location. title: OpeningHours x-stoplight: id: n7s4wz0dwk5ai type: object properties: sunday: $ref: '#/components/schemas/Opening_hour_period.v1' monday: $ref: '#/components/schemas/Opening_hour_period.v1' tuesday: $ref: '#/components/schemas/Opening_hour_period.v1' wednesday: $ref: '#/components/schemas/Opening_hour_period.v1' thursday: $ref: '#/components/schemas/Opening_hour_period.v1' friday: $ref: '#/components/schemas/Opening_hour_period.v1' saturday: $ref: '#/components/schemas/Opening_hour_period.v1' x-tags: - Primitive Opening_hour_period.v1: title: OpeningHourPeriod x-stoplight: id: 2g4w1syylsphw type: object additionalProperties: false description: The `OpeningHourPeriod` model provides detailed information about a location's operating hours for a specific day. It includes the start and end times, and indicates whether the location is open on that particular day. x-tags: - Primitive properties: open: type: boolean default: false x-stoplight: id: qbb3rmmdfdhxy description: Indicate whether the store is open on this day. For locations that operate 24 hours, please set the value to `true`. from: type: - string - 'null' x-stoplight: id: fvyfkui68t3gt description: The start time of the opening hour period in YY:MM format. For locations that operate 24 hours, please set the value to `null`. example: '10:30' to: type: - string - 'null' x-stoplight: id: sk5yjthy1achl description: The end time of the opening hour period in YY:MM format. For locations that operate 24 hours, please set the value to `null`. example: '20:30' examples: - open: true from: '10:30' to: '20:30' Meta.v1: description: 'The `Meta` model holds the metadata of the API response, including relevant error details for debugging purposes.
' type: object x-examples: {} title: Meta x-tags: - Envelope examples: - code: 20000 type: OK message: The request was successfully processed by AfterShip. additionalProperties: false required: - code - type - message properties: code: type: number default: 20000 example: 20000 description: Error code in integer format. For detailed information, please refer to the [Request Error](../../docs/quickstart/request_errors.md) introduction page. type: type: string minLength: 1 example: OK description: Response type string for the reference. For detailed information, please refer to the [Request Error](../../docs/quickstart/request_errors.md) introduction page. message: type: string minLength: 1 example: The request was successfully processed by AfterShip. description: Human-readable response message. For detailed information, please refer to the [Request Error](../../docs/quickstart/request_errors.md) introduction page. errors: type: array description: 'Error detail object. Each error object contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error. ' items: $ref: '#/components/schemas/Error.v1' Error.v1: type: object title: Error description: The `Error` model contains a "path" key and an "info" key. The "path" is the JSON path of the request object to indicate the error location. The "info" is a human-readable description of the error. examples: - path: data.policy_id info: data.policy_id must not be 32 characters additionalProperties: false x-tags: - Envelope properties: path: type: string description: The JSON path of the request object to indicate the error location. example: data.product.title info: type: string description: A human-readable description of the error. example: Title is invalid Pagination.v2: title: Pagination x-stoplight: id: 6twr4wc3wp9lu type: object examples: - page: 1 limit: 10 has_next_page: false description: The `Pagination` holds the information for the pagination when the response contains multiple objects. x-tags: - Envelope properties: page: type: integer x-stoplight: id: 5ld3b35057z8s description: Page number. limit: type: integer x-stoplight: id: qmvbmlfjchyh5 description: Maximum object count per page. has_next_page: type: boolean x-stoplight: id: qtm2ifhlv0r4i description: To indicate if next page is available. Location.v1: x-stoplight: id: location-resource-v1 type: object x-tags: - Resource title: Location description: A `Location` represents a warehouse, store, or other physical place used for fulfillment, order processing, and pickup settings. Location resources are scoped to the organization and are not bound to a store. additionalProperties: false examples: - id: warehouse_1 name: SF Warehouse source: manual address: company: AfterShip first_name: John Doe last_name: '' phone: '+14155551234' email: john@example.com 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' required: - id - name - source - address - created_at - updated_at properties: id: type: string description: The unique identifier of the location. For locations created through Commerce API, this is the custom ID supplied when creating the location, or a system-generated UUID if no custom ID was provided. For ecommerce platform-sourced locations, the ID is returned in the format `app-