New cart

POST /carts/{platform}/{merchantId}

New cart

Path parameters

  • platform string Required

    Source platform

    Values are shopify, commerce, woocommerce, magento, bigcommerce, or squarespace.

  • merchantId string Required

    Globally unique id for merchant

application/json

Body

Create new cart details

Responses

  • 200

    Cart created successfully

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
  • 400

    Invalid message

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
  • 500

    Cart creation failed

    Hide response attributes Show response attributes object
    • code integer(int32)

      HTTP status code

    • message string

      Message

    • data object

      API response data

      Hide data attributes Show data attributes
POST /carts/{platform}/{merchantId}
curl \
 -X POST https://nomad.samarkand-global.cn/checkout/carts/{platform}/SMK474 \
 -H "x-ca-key: $API_KEY" \
 -H "Content-Type: application/json" \
 -d '{"merchantSiteUrl":"https://smktestpartner.myshopify.com/cart","cart":{"currency":"GBP","item_count":5,"items":[{"id":36801771733142,"quantity":2,"variant_id":14808998805549,"key":"14808998805549:7d7c76c0a1dd684c158ea58cf28a5062","title":"Probio7 50 Plus","price":2349,"sku":"PB50","grams":27,"product_title":"Probio7 50 Plus","properties":{"shipping_interval_unit_type":"Months","shipping_interval_frequency":"1"},"image":"https://cdn.shopify.com/s/files/1/0024/2240/7213/products/ORIG_plain_73cf94a5-7732-4457-a32a-449b537c4598.png?v=1587802551","vendor":"Probio7"}],"total_price":6355,"total_weight":99.2155},"subdomain":false}'
Request example
{
  "merchantSiteUrl": "https://smktestpartner.myshopify.com/cart",
  "cart": {
    "currency": "GBP",
    "item_count": 5,
    "items": [
      {
        "id": 36801771733142,
        "quantity": 2,
        "variant_id": 14808998805549,
        "key": "14808998805549:7d7c76c0a1dd684c158ea58cf28a5062",
        "title": "Probio7 50 Plus",
        "price": 2349,
        "sku": "PB50",
        "grams": 27,
        "product_title": "Probio7 50 Plus",
        "properties": {
          "shipping_interval_unit_type": "Months",
          "shipping_interval_frequency": "1"
        },
        "image": "https://cdn.shopify.com/s/files/1/0024/2240/7213/products/ORIG_plain_73cf94a5-7732-4457-a32a-449b537c4598.png?v=1587802551",
        "vendor": "Probio7"
      }
    ],
    "total_price": 6355,
    "total_weight": 99.2155
  },
  "subdomain": false
}
Response examples (200)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}
Response examples (400)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}
Response examples (500)
{
  "code": 42,
  "message": "Status of operation",
  "data": {
    "cartId": "SMK474-1Vzff80HMU0FqdotSN8T0mGjK",
    "exchangeRate": 9.1
  }
}