ItsfoundPostage.Api.Http (itsfound_postage v0.1.0) View Source

Link to this section Summary

Link to this section Functions

Link to this function

add_credit(params \\ %{}, options \\ [])

View Source

Add Credit

ENDPOINT:

POST https://api.easyship.com/company/v1/credits

Example request body:

%{

"amount"=> 1000

}

API REFERENCE:

https://developers.easyship.com/reference#add-credit

Link to this function

confirm_and_buy_labels(params \\ %{}, options \\ [])

View Source

Confirm and buy labels

ENDPOINT:

POST https://api.easyship.com/label/v1/labels

Example request body: [

%{
  easyship_shipment_id: "ESUS3171766",
  courier_id: "b4552ed2-ae95-4647-9746-5790bf252c7f"
}

]

API REFERENCE:

https://developers.easyship.com/reference#confirm-and-buy-labels

Link to this function

create_shipment(params \\ %{}, options \\ [])

View Source

Create a shipment

ENDPOINT:

POST https://api.easyship.com/shipment/v1/shipments

Example request body:

%{

"platform_name"=> "Amazon",
"platform_order_number"=> "#1234",
"selected_courier_id"=> "b8d528a7-a2d4-4510-a7ac-11cbbb6542cd",
"destination_country_alpha2"=> "US", # required
"destination_city"=> "New York", # required
"destination_postal_code"=> "10022", # required
"destination_state"=> "NY",
"destination_name"=> "Aloha Chen", # required
"destination_address_line_1"=> "300 Park Avenue", # required
"destination_address_line_2"=> null,
"destination_phone_number"=> "+1 234-567-890", # required
"destination_email_address"=> "api-support@easyship.com",
"items"=> [ # required
  %{
    "description"=> "Silk dress",
    "sku"=> "test",
    "actual_weight"=> 1.2,
    "height"=> 10,
    "width"=> 15,
    "length"=> 20,
    "category"=> "fashion",
    "declared_currency"=> "SGD",
    "declared_customs_value"=> 100
  }
]

}

API REFERENCE:

https://developers.easyship.com/reference#create-a-shipment

Link to this function

delete_shipment(easyship_shipment_id, options \\ [])

View Source

Delete a shipment

ENDPOINT:

DELETE https://api.easyship.com/shipment/v1/shipments/easyship_shipment_id

API REFERENCE:

https://developers.easyship.com/reference#delete-a-shipment

Link to this function

get_shipment(easyship_shipment_id, params \\ %{}, options \\ [])

View Source

Get a shipment

ENDPOINT:

GET https://api.easyship.com/shipment/v1/shipments/easyship_shipment_id

API REFERENCE:

https://developers.easyship.com/reference#get-a-shipment

Link to this function

get_shipment_checkpoints(easyship_shipment_id, platform_order_number, options \\ [])

View Source

Checkpoints

ENDPOINT:

GET https://api.easyship.com/track/v1/checkpoints

API REFERENCE

https://developers.easyship.com/reference#checkpoints

Link to this function

get_shipment_status(easyship_shipment_id, platform_order_number, options \\ [])

View Source

Status

ENDPOINT:

GET https://api.easyship.com/track/v1/status

API REFERENCE:

https://developers.easyship.com/reference#status

Link to this function

list_courier_pick_up_slots(courier_id, options \\ [])

View Source

Retrieve Available Pick Up Slots

ENDPOINT:

GET https://api.easyship.com/pickup/v1/pickup_slots/courier_id

API REFERENCE:

https://developers.easyship.com/reference#retrieve-available-pick-up-slots

Link to this function

list_item_categories(options \\ [])

View Source

Item Categories

ENDPOINT:

GET https://api.easyship.com/reference/v1/categories

API REFERENCE:

https://developers.easyship.com/reference#item-categories

Link to this function

list_rates_and_taxes(params \\ %{}, options \\ [])

View Source

Request rates and taxes

ENDPOINT:

POST https://api.easyship.com/rate/v1/rates

Example request body:

%{

  "origin_country_alpha2"=> "SG",
  "origin_postal_code"=> "WC2N",
  "destination_country_alpha2"=> "US", # required
  "destination_postal_code"=> "10030",
  "taxes_duties_paid_by"=> "Sender",
  "is_insured"=> false,
  "items"=> [ # required
    %{
      "actual_weight"=> 1.2,
      "height"=> 10,
      "width"=> 15,
      "length"=> 20,
      "category"=> "mobiles",
      "declared_currency"=> "SGD",
      "declared_customs_value"=> 100
    }
  ]
}

API REFERENCE:

https://developers.easyship.com/reference#request-rates-and-taxes

Link to this function

list_shipments(params \\ %{}, options \\ [])

View Source

List Shipments

ENDPOINT:

GET https://api.easyship.com/shipment/v1/shipments

API REFERENCE:

https://developers.easyship.com/reference#get-shipments

Link to this function

mark_as_handed_over(params \\ %{}, options \\ [])

View Source

Mark as directly handed over

ENDPOINT:

POST https://api.easyship.com/pickup/v1/direct_handover

Example request body:

%{

"easyship_shipment_ids": ["ESUS3171766", "ESUS3171767", "ESUS3171764"]

}

API REFERENCE:

https://developers.easyship.com/reference#mark-as-handed-over

Link to this function

request_a_pick_up(params \\ %{}, options \\ [])

View Source

Request a pickup

ENDPOINT:

POST https://api.easyship.com/pickup/v1/pickups

Example request body:

%{

"courier_id"=> "b4552ed2-ae95-4647-9746-5790bf252c7f",
"preferred_date"=> "2016-12-08", # required
"preferred_max_time"=> "2016-12-08T18:00", # required
"preferred_min_time"=> "2016-12-08T09:00", # required
"easyship_shipment_ids"=> "ESUS3171766"

}

API REFERENCE:

https://developers.easyship.com/reference#request-a-pickup

Link to this function

update_shipment(easyship_shipment_id, params \\ %{}, options \\ [])

View Source

Update a shipment

ENDPOINT:

PATCH https://api.easyship.com/shipment/v1/shipments/easyship_shipment_id

Example request body:

%{

"platform_name"=> "Amazon",
"platform_order_number"=> "#1234",
"selected_courier_id"=> "b8d528a7-a2d4-4510-a7ac-11cbbb6542cd",
"destination_country_alpha2"=> "US",
"destination_city"=> "New York",
"destination_postal_code"=> "10022",
"destination_state"=> "NY",
"destination_name"=> "Aloha Chen",
"destination_address_line_1"=> "300 Park Avenue",
"destination_address_line_2"=> null,
"destination_phone_number"=> "+1 234-567-890",
"destination_email_address"=> "api-support@easyship.com",
"items"=> [
  %{
    "description"=> "Silk dress",
    "sku"=> "test",
    "actual_weight"=> 1.2,
    "height"=> 10,
    "width"=> 15,
    "length"=> 20,
    "category"=> "fashion",
    "declared_currency"=> "SGD",
    "declared_customs_value"=> 100
  }
]

}

API REFERENCE:

https://developers.easyship.com/reference#update-a-shipment

Link to this function

update_shipment_warehouse_status(params \\ %{}, options \\ [])

View Source

Update a Shipment's Warehouse Status

ENDPOINT:

PATCH https://api.easyship.com/shipment/v1/shipments/update_warehouse_state

Example request body:

%{

"easyship_shipment_ids": [
  "ESUS3171766"
],
"warehouse_state": "created"

}

API REFERENCE:

https://developers.easyship.com/reference#update-shipment-warehouse-status