merchOne Documentation
  • Overview
  • REST API
  • API reference
    • Catalog
    • Orders
    • Shipping
  • Webhooks
  • Print files
Powered by GitBook
On this page
  1. API reference

Shipping

PreviousOrdersNextWebhooks

Last updated 2 years ago

Introduction

Through the endpoints included in the Shipping section, you will be able to:

  • Calculate shipping rate for a given country and variant with specified quantity

  • Retrieve information about the shipping types

  • Retrieve information about the shipping methods

  • Retrieve a list of countries in our system

  • Retrieve a list of regions in a specific country

Endpoints

Shipping rates

Shipping types

Shipping methods

Countries

Regions

Parameters

Key
Description

shipping

An object that contains the country property.

shipping.country

The ID of the country from our system, check /api/beta/countries for more information about the countries.

items

An array of objects that contains information about the quantity and variant.

items.*.quantity

Quantity of a variant.

items.*.variant_id

The ID of the variant, please check /api/beta/products/{product_id} for more details about the variants.

Show shipping types

get

This API endpoint retrieves a list of all available shipping types

Authorizations
Responses
200
Request completed successfully.
application/json
401
Unauthorized
get
GET /api/beta/shipping/types HTTP/1.1
Host: api.merchone.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "priority": 1,
      "code": "UNTRACKED"
    },
    {
      "priority": 2,
      "code": "TRACKED"
    }
  ]
}

Show shipping methods

get

This API endpoint retrieves a list of all available shipping methods

Authorizations
Responses
200
Request completed successfully.
application/json
401
Unauthorized
get
GET /api/beta/shipping/methods HTTP/1.1
Host: api.merchone.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "code": "GEL",
      "name": "GEL"
    },
    {
      "code": "UPS",
      "name": "UPS"
    }
  ]
}

Show countries

get

This endpoint retrieves a list of countries with IDs and their corresponding codes.

Authorizations
Responses
200
Request completed successfully.
application/json
401
Unauthorized
get
GET /api/beta/countries HTTP/1.1
Host: api.merchone.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "name": "Germany",
      "country_id": 276,
      "country_code": "DE"
    },
    {
      "name": "Latvia",
      "country_id": 428,
      "country_code": "LV"
    }
  ]
}

Show regions

get

This API endpoint retrieves the list of regions within a specific country by providing its ID.

Authorizations
Path parameters
country_idintegerRequired

ID of country from our system

Responses
200
Request completed successfully.
application/json
400
Wrong argument
401
Unauthorized
get
GET /api/beta/regions/{country_id} HTTP/1.1
Host: api.merchone.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "id": 52,
      "code": "AB",
      "name": "Alberta"
    },
    {
      "id": 53,
      "code": "LB",
      "name": "Labrador"
    }
  ]
}
  • Introduction
  • Endpoints
  • Shipping rates
  • POSTCalculate shipping rates
  • Shipping types
  • GETShow shipping types
  • Shipping methods
  • GETShow shipping methods
  • Countries
  • GETShow countries
  • Regions
  • GETShow regions
  • Parameters

Calculate shipping rates

post

This API endpoint retrieves a list of calculated shipping rates for the given items and shipping info

Authorizations
Body
Responses
200
Request completed successfully.
application/json
401
Unauthorized
422
Unprocessable entity
application/json
post
POST /api/beta/shipping/rates HTTP/1.1
Host: api.merchone.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "shipping": {
    "country": 276
  },
  "items": [
    {
      "quantity": 5,
      "variant_id": 4
    }
  ]
}
{
  "data": [
    {
      "code": "DHL",
      "name": "DHL",
      "price": 6.02,
      "price_details": {
        "currency": "EUR",
        "formatted": "6.02 €",
        "in_subunit": 602
      }
    },
    {
      "code": "DHL",
      "name": "DHL",
      "price": 6.02,
      "price_details": {
        "currency": "EUR",
        "formatted": "6.02 €",
        "in_subunit": 602
      }
    }
  ]
}