Changelog

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

2025-04 (2025-04-10)

CHANGEBEFOREAFTER
Base URLhttps://api.aftership.com/commerce/2025-01https://api.aftership.com/commerce/2025-04
CHANGEBEFOREAFTER
as-store-id value format updatedThe UUID generated by AfterShip (The store.id for the version 2025-01 and earlier)Use store.source_id as the value, you can also retrieve the store.id from the Store resource with the latest 2025-04 API

In the version 2025-04, we introduced Customizable ID across all resources in Commerce API, when creating the resource, you can optionally provide your ID as the resource ID, instead of forcibly using our system-generated ID, and hence provide a much better experience for the case such as being unable to store AfterShip resource ID in your system.

Quick Overview

AspectBefore (2025-01)After (2025-04)
Create ResourcePOST /{resources}
Request:
{ "source_id": "custom-id-123" }
POST /{resources}
Request:
{ "id": "custom-id-123" }
Get ResourceGET /{resources}/ef123...789ef
(system-generated UUID)
GET /{resources}/custom-id-123
(value of the id field)
Update ResourcePATCH /{resources}/ef123...789ef
(system-generated UUID)
PATCH /{resources}/custom-id-123
(value of the id field)
System Generated IDAlways generates UUID as resource identifierGenerates UUID only if id not provided
  • Maximum length: 128 characters
  • Allowed pattern: ^[a-zA-Z0-9_-]+$
  • Immutable after creation
  • If not provided, a system-generated UUID will be assigned

In 2025-04, you can optionally provide your ID when creating the resource. Take creating an order as an example:

Request

preparing...

Response

preparing...

If you do not provide the id when creating the resource, AfterShip will generate an ID for you, similar to the earlier API versions:

Request

preparing...

Response

preparing...

Same as previous API version, you need to use the ID field returned by the API when creating the resource, to retrieve or update the resource by ID.

Example

preparing...

For all resources created in earlier API versions, you need to use the resource's original source_id value as the id in version 2025-04 to access the resource. You can no longer use the UUID style ID found in the previous API version to access the resource starting from 2025-04 API.

Example

For a resource created in 2025-01 API:

preparing...

In 2025-01 and earlier versions, the resource could be accessed with the id:

preparing...

From 2025-04 you can only access this resource with the source_id (now id from 2025-04):

preparing...
  1. The field has been renamed from source_id to id
  2. The id can no longer start with the reserved prefix app- when creating a new store
  3. The id must be unique within the organization

Affected Endpoints (Request and Response Body)

  • POST /stores

Affected Endpoints (Response Body)

  • GET /stores
  • GET /stores/{id}
  • PATCH /stores/{id}
ParameterBEFOREAFTER
Filter by IDssource_ids[]ids[]

Affected Endpoints

  • GET /stores

The field has been renamed:

BEFOREAFTER
source_idid
items.*.source_product_iditems.*.product_id
items.*.source_variant_iditems.*.product_variant_id
customer.source_idcustomer.id

Affected Endpoints (Request and Response Body)

  • POST /orders
  • POST /orders/{id}/items
  • PATCH /orders/{id}/items/{item_id}

Affected Endpoints (Response Body)

  • GET /orders
  • GET /orders/{id}
  • GET /orders/{id}/items/{item_id}
ParameterBEFOREAFTER
Filter by IDssource_ids[]ids[]

Affected Endpoints

  • GET /orders

Affected Endpoints

  • POST /orders/:id/items

When creating the order item with an ID which is already exist in any one of the existing item in the order, the API response error code has been updated, together with the response body meta.code:

CodeBEFOREAFTER
HTTP Status code422409
response_body.meta.code4220040900
BEFOREAFTER
source_idid
variants.*.source_idvariants.*.id

Affected Endpoints (Request and Response Body)

  • POST /products
  • PATCH /products/{id}

Affected Endpoints (Response Body)

  • GET /products
  • GET /products/{id}

New endpoints for managing product variants are added. For the detailed endpoint specification, please refer to the API endpoint reference.

  1. Product variant management endpoints:
    • POST /products/{id}/variants
    • GET /products/{id}/variants/{variant_id}
    • PATCH /products/{id}/variants/{variant_id}
    • DELETE /products/{id}/variants/{variant_id}
  2. Product listing endpoint with pagination support:
    • GET /products

The endpoint now supports updating all variants of a product in a single request:

  • Added variants array field in the request body

If variants are provided in the request body, this array will replace all existing variants. Also, variants could not be an empty array if provided in the request body.

BEFOREAFTER
source_idid
source_order_idorder_id
line_items.*.source_product_idline_items.*.product_id
line_items.*.source_product_variant_idline_items.*.product_variant_id

Affected Endpoints (Request and Response Body)

  • POST /fulfillments

Affected Endpoints (Response Body)

  • GET /fulfillments
  • GET /fulfillments/{id}
  • PATCH /fulfillments/{id}
ParameterChanges
source_idRemoved. Use ids[] parameter instead
ids[]Now accepts values that were previously used in source_id parameter
source_order_idRenamed to order_id

Affected Endpoints

  • GET /fulfillments

The field value limitation of some fields across multiple resources has been updated accordingly to provide a better using experience.

FieldTypeBeforeAfter
order_totalNumberNo specific limitationAccepting values >= 0 only.
shipping_totalNumberNo specific limitationAccepting values >= 0 only.
tax_totalNumberNo specific limitationAccepting values >= 0 only.
discount_totalNumberNo specific limitationAccepting values >= 0 only.
subtotalNumberNo specific limitationAccepting values >= 0 only.
items.*.quantityNumberAccepting values < 0 or > 0Accepting values > 0 only.
items.*.unit_weight.valueNumberNo specific limitationAccepting values >= 0 only.
items.*.unit_price.amountNumberNo specific limitationAccepting values >= 0 only.
items.*.discountNumberNo specific limitationAccepting values >= 0 only.
items.*.taxNumberNo specific limitationAccepting values >= 0 only.
items.*.returnable_quantityNumberNo specific limitationAccepting values >= 0 only.
customer.emails[].*StringNo specific limitationMax string length: 256
Must be a valid email address following RFC5322.
shipping_address.emailStringMax string length: 254Max string length: 256
Must be a valid email address following RFC5322.
billing_address.emailStringMax string length: 254Max string length: 256
Must be a valid email address following RFC5322.
FieldTypeBeforeAfter
variants.*.available_quantityNumberNo specific limitationAccepting values >= 0 only.
variants.*.priceNumberNo specific limitationAccepting values >= 0 only.
variants.*.compare_at_priceNumberNo specific limitationAccepting values >= 0 only.
variants.*.weight.valueNumberNo specific limitationAccepting values >= 0 only.
FieldTypeBeforeAfter
support_emailStringMax string length: 254Max string length: 256
Must be a valid email address following RFC5322.
owner_emailStringMax string length: 254Max string length: 256
Must be a valid email address following RFC5322.
FieldTypeBeforeAfter
ship_to_location.address.emailStringMax string length: 254Max string length: 256
Must be a valid email address following RFC5322.