POST /v1/carts

Service: commerce · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "customer_id": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "customer_id"
  ]
}

Responses

201 Cart created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "customer_id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "total_cents": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cart_id": {
            "type": "string"
          },
          "product_id": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_price_cents": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "cart_id",
          "product_id",
          "quantity",
          "unit_price_cents",
          "created_at",
          "updated_at"
        ]
      }
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "customer_id",
    "status",
    "total_cents",
    "currency",
    "items",
    "created_at",
    "updated_at"
  ]
}

400 Validation error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://commerce.platform.loop.health/v1/carts \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'