Documentation

Introduction

Base URL, required headers, and authentication overview for the Cartxis REST API

Last updated: Feb 09, 2026

Introduction

The Cartxis API provides a RESTful interface for mobile applications to interact with the e-commerce platform. It supports user authentication, product browsing, shopping cart management, checkout, order tracking, and more.

Base URL

Production: https://your-domain/api/v1
Development: http://localhost:8000/api/v1

Required Headers

All requests should include:

Accept: application/json
Content-Type: application/json

For authenticated requests, add:

Authorization: Bearer {token}

Authentication

Cartxis uses Laravel Sanctum for API authentication with bearer tokens.

Obtaining a Token

  1. Register a new user via POST /auth/register
  2. Login with credentials via POST /auth/login
  3. Use the returned token in the Authorization header

Token Lifecycle

  • Tokens expire after 24 hours (configurable)
  • Use POST /auth/refresh to get a new token
  • Use POST /auth/logout to revoke the current token

Token Usage

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...