Skip to main content
GET
/
sessions
Get cart sessions
curl --request GET \
  --url {protocol}://{host}/wp-json/cocart/v2/sessions \
  --header 'Authorization: Basic <encoded-value>'
[
  {
    "session_key": "cb7a23af96a3f23af3c28a8b4b8c6d5e",
    "cart": {
      "d6b3e8e5a1b0c6e4f2a3b1d8c5e6f9a2": {
        "key": "d6b3e8e5a1b0c6e4f2a3b1d8c5e6f9a2",
        "product_id": 145,
        "variation_id": 0,
        "quantity": 2,
        "line_total": 36,
        "line_tax": 3.6
      }
    },
    "customer": {
      "billing_email": "john.doe@example.com",
      "billing_first_name": "John",
      "billing_last_name": "Doe"
    },
    "session_expiry": "2024-10-15T18:30:00"
  },
  {
    "session_key": "f8d9e1a2b3c4d5e6f7a8b9c0d1e2f3a4",
    "cart": {
      "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6": {
        "key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
        "product_id": 278,
        "variation_id": 289,
        "quantity": 1,
        "line_total": 80,
        "line_tax": 8
      }
    },
    "customer": {
      "billing_email": "jane.smith@example.com",
      "billing_first_name": "Jane",
      "billing_last_name": "Smith"
    },
    "session_expiry": "2024-10-16T12:15:00"
  }
]

Authorizations

Authorization
string
header
required

Basic authentication with username and password.

Query Parameters

page
integer
default:1

Current page of the collection.

per_page
integer
default:10

Maximum number of items to return per page.

Response

Cart sessions retrieved successfully.

session_key
string

Unique session key.

cart
object

Cart data for this session.

customer
object

Customer data for this session.

session_expiry
string<date-time>

Session expiry date.

I