QUICKSTART
API Quick Start
Authentication
SignString
OAuth
Overview
Getting Started
Scope List
Rate Limit
Body Envelope
Request Errors
CHANGELOG
Changelog
REFERENCE
API Overview
v3
Rates
Get rates
get
Calculate rates
post
Get a rate
get
Labels
Get labels
get
Create a label
post
Get a label
get
Manifests
Get manifests
get
Create a manifest
post
Get a manifest
get
Couriers
Get all couriers
get
Cancel Labels
Get the cancelled labels
get
Cancel a label
post
Get a cancelled label
get
Pickups
Get pickups
get
Create a pickup
post
Get a pickup
get
Cancel Pickups
Get the cancelled pickups
get
Cancel a pickup
post
Get a cancelled pickup
get
Shipper Accounts
Get shipper accounts
get
Create a shipper account
post
Get a shipper account
get
Delete a shipper account
delete
Update a shipper account's information
put
Update a shipper account's credentials
patch
Update a shipper account's settings
patch
Specific Shipper Accounts
Create a FedEx shipper account
post
Update a FedEx shipper account
post
Address Validations (Beta)
Create an address validation
post
Locations
Get locations
get
MODEL
Envelope
Meta
v3
Error
v3
Primitive
Billing
v3
Customs
v3
Shipment
v3
Address
v3
Parcel
v3
Item
v3
Courier
v3
Reference
v3
Money
v3
PaymentMethodAccount
v3
Dimension
v3
Weight
v3
Volume
v3
Aes
v3
NoEei
v3
Resource
Rate
v3
RateRecord
v3
Label
v3
Manifest
v3
ShipperAccount
v3
CancelLabel
v3
AddressValidation (Beta)
v3
Location
v3
Pickup
v3
CancelPickup
v3
Carrier Guide
Supported Carriers
ENUM
Shipper Accounts Credentials
Service Types and Service Options List
All Service Options
Webhook
Webhook Overview
Webhook Specifications
Webhook Signature
Webhook Outgoing IPs
SDK
Java SDK
Node.js SDK
Open Source
phone
email-verifier
Support
Contact Support

SignString

The SignString is generated by Method, Uri, Headers, Body from a HTTP(s) request.


KeyDescriptionExample
methodHTTP methodPUT GET POST
content_md5Computed MD5 hash of the request body in uppercase hex format.

If the request body is empty, set content_md5 to an empty string.
875264590688CA6171F6228AF5BBB3D2
content_typeContent type string.

If the request body is empty, set content_type to an empty string.
application/json
dateUTC time in RFC 1123 format.

Kindly note that the calculated signature is only valid for 3 minutes before or after the datetime indicated in this key.
Sun, 06 Nov 1994 08:49:37 GMT
canonicalized_headersSee below for the specification.

If no customized header is provided, set canonicalized_headers to an empty string
as-api-key:c25b1e6fee2348b3a8bd21599b6ac2de
canonicalized_resourceResource Uri, See below for the specification./commerce/v1/products

To generate the canonicalized_headers:

  1. Extract all request headers with the as- prefix key. Kindly note that the headers with the as- prefix are not limited to as-api-key, but also include other as- prefixed key such as as-store-id.

  2. Convert all the request header key to lowercase (except the header values case), and sort the headers in ASCII code order.

  3. Remove leading spaces and trailing spaces from the header key and value.

  4. Concatenate each of the header key and value with :, to form a header pair

    preparing...
  5. Concatenate all header pairs with the new line character (ASCII code 10).

Original Headercanonicalized_headers
AS-header2: ThisIsHeader2\nAS-Header1: this-is-header-1as-header1:this-is-header-1\nas-header2:ThisIsHeader2

canonicalized_resource is the path of the URL, including the query parameters.

Example
https://api.aftership.com/admin/2022-01/some-resources

canonicalized_resource
/admin/2022-01/some-resources

If there is any parameter, it should be appended to the path.

The parameters should be sorted by the ASCII code of the key in ascending order, and parameters with duplicate names should be sorted by the value.

Example
https://api.aftership.com/admin/2022-01/some-resources?key2=value2&key1=value1

canonicalized_resource
/admin/2022-01/some-resources?key1=value1&key2=value2

The SignString is constructed by concatenating all the required keys with the new line character (ASCII code 10).

preparing...

Make sure the string encoding is in UTF-8.