Akinon Release Notes (06/09/2025) are now live! Click here to learn what's new.
LogoLogo
API Reference
  • Home
  • Quick Start
  • Tutorials
  • Technical Guides
  • Release Notes
  • Glossary
  • Welcome to Akinon Technical Guides
  • ACC
    • ACC CLI
    • Create Application via CLI
    • Deploy Environment Variables
    • App Store for Developers
  • Omnitron
    • Product Types
    • Product Categorization
    • Splitting a Merged Order Item
  • Commerce
    • Shipping Rules Calculator
    • Data Source Shipping Options
    • Attribute Based Shipping Options
    • Filtering Products
    • Conversation & Messages
    • Sitemap Configuration
    • Weight-Based Product Sales
    • Group Attribute Sets
    • Contract Management
    • Find in Store for Whippy Ware
    • Plugins
    • Remote Price
    • E-mail Templates
    • Loyalty Accounts
    • Search Structure
    • User Segmentation & Rules
    • Configuring User Segmentation
    • Promotions
    • Email Redirection in Multi-Frontend Structure
  • OMS
    • Getting Started with OMS
    • Basic Setup
    • Scenarios
    • Capacity Feature
    • Package Management
      • Packages
      • Transfer
      • States
    • Commands
      • Packages
        • Package Command Parameters
        • DeAllocate Package Reservations Command
        • Channel Based Complete Packaging without Shipment Command
        • Complete Packaging with Shipment Command
        • Complete Packaging without Shipment Command
        • Package Refuse with Denial Reason Command
        • Product Not Found & Wrong Product Command
        • Product Not Found & Wrong Product Command Advanced
        • Package Packed for Refund Command
        • Block The Package For Action Command
        • Unblock the Package For Action Command
        • Update The Package’s Invoice
        • Manual Planning Command
      • Transfer
        • Transfer Order Advanced Command
        • Product for Transfer Not Found & Wrong Product Command
        • Transfer Delivered Command
        • Transfer Dispatch Command
        • Transfer Ready for Dispatch Command
        • Transfer Out Of Stock
      • Shipment
        • Shipment Order Command
        • Package Advanced Shipment Command
        • Ship The Package Command
        • Ship The Package without Shipment Integration Command
        • Update The Package’s Shipment Status Command
        • Update Shipment Info of Package Command
    • Inventory Locations & Engine
      • Properties & Domain Relation
      • Customization
      • Inventory Engine
    • Fulfillment
      • Shipments
      • Invoice Integration
    • Webhooks
      • Webhook Examples
        • Order Webhook
        • Package Webhook
        • Shipment Webhook
        • Stock Location Webhook
        • Transfer Webhook
    • Integrating OMS with Seller Center
  • Instore
    • Getting Started
    • Cash Register Integration
    • OTP (One Time Password) Process
    • Services
      • Password Reset Services
  • Marketplace Dashboard
    • N11 Marketplace Setup Configurations
    • Trendyol Marketplace Setup Configurations
    • Walmart Marketplace Setup Configurations
    • Amazon Marketplace Setup Configurations
    • Hepsiburada Marketplace Setup Configurations
    • Fashfed Marketplace Setup Configurations
    • Mono Marketplace Setup Configurations
    • Passo Marketplace Setup Configurations
    • Package Splitting Flow
    • Marketplace Dashboard Flow Trigger
  • Project Zero
    • Django
      • Basic Setup
      • Project Structure
        • Templates & Components
        • Private Dependencies
        • Omnife Project Submodule
        • Webpack
        • ESLint Rules
        • Bundles
        • Multilanguage & Translation
        • Environmental File
        • Custom Error Pages
        • Icon Font
      • Page Types
        • Static Pages & Flatpages
        • Account Page
          • Template Rendering in Account Pages
          • Forms & Validation
        • Basket Page
          • Redux Basket State
          • Basket Page - View
        • Checkout
          • Redux Checkout State
          • View & Template Rendering
          • Masking & Validation
      • Theming & Styling
      • Widgets
      • SEO Management
      • Extending Project Zero
    • Next.js
      • Basic Setup
      • Deployment
      • Static Assets
      • Icons
      • SEO Management
      • Advanced Usage
      • Plugins
        • Akinon Next
          • Data Fetching
            • Client
              • Account
              • Address
              • Basket
              • Checkout
              • Misc
              • Product
              • User
              • Wishlist
            • Server
              • Category
              • Flat Page
              • Landing Page
              • List
              • Menu
              • Product
              • SEO
              • Special Page
              • Widget
          • Localization
          • Widgets
        • Akifast
        • B2B
        • Basket Gift Package
        • BKM Express
        • Checkout Gift Package
        • Click&Collect
        • Credit Payment
        • GarantiPay
        • Hepsipay
        • Masterpass
        • Multi Basket
        • One Click Checkout
        • OTP
        • Pay on Delivery
        • Saved Card
        • Tabby Payment Gateway
        • Tamara Payment Gateway
  • App Maker
    • Setup Your Environment
    • Plugin Quickstart
    • Create Project
    • Setup Existing Project
    • Deploy Project
    • Users and Roles
    • Add Public Key
    • App Maker CLI
    • Create App on Stores
      • Creating App on Apple App Store
      • Creating App on Google Play Store
    • Mobile App Framework
      • Configuration
      • Framework
      • Project Structure
        • Structure
        • Data Containers
        • Pages
      • Dependency Integration
        • Plugins
        • Akinon Plugin Adapter
  • Akifast
    • HPP
      • Getting Started
      • Authorization
      • Payment Session Creation
        • Key Points Before Creating a Payment Session
        • Creating Payment Session
        • Redirecting to the Payment Page
        • Errors Encountered During Payment Session Creation
      • Merchant Services
        • Shipping Query URL
        • Agreement Query URL
        • Other URLs
  • B2B
    • Getting Started
    • B2B Setup
  • Adds-on
    • Invoicer
      • Introduction
      • Invoice & Pay On Delivery Service
  • Channel App Template
    • Introduction
    • Installation and Usage
    • Development Steps
      • Folder Structure
      • Starting Step
      • Encoding the Sales Channel
        • Introduction
        • Setup
        • Products
        • Product Price
        • Product Stock
        • Product Image
        • Orders
        • Product Data
      • Adding a New Command to Akinon
      • Listening for External Requests
    • Architecture
      • Introduction
      • Integration
      • Services (Flows)
        • Introduction
        • Product Service
        • Price Service
        • Stock Service
        • Image Service
        • Order Service
  • Multi Regional Settings
    • Multi Regional Settings
  • 3rd Party Integration
    • NKolay POS Payment Integration
    • ShipX (Inpost) Shipment Extension
    • Checkout Flow Integration
    • Ngenius Payment Integration
    • ShypV Shipment Extension
    • Masterpass via Craftgate POS
    • Benefit via Tap
    • Tap Credit Card
    • PayU Payment Extension
    • Pay with Iyzico Payment Extension
    • Multisafepay Payment Extension
    • Masterpass Installment Integration
    • Masterpass Iframe Extension
    • Mollie Payment Extension
    • Masterpass REST POS
    • Masterpass Rest Payment Option
    • YooMoney Payment Extension
    • MyFatoorah Payment Installation
    • Checkout Payment Extension
    • CyberSource Credit Card Integration
    • QNBPay Integration
    • KNET Payment Integration
    • MNG Seller Pays Shipment Extension
    • Porter Express Shipment Extension
    • Akbank Installation
    • Fero AI Shipment Extension
    • Horoz Lojistik Satıcı Öder Shipment Extension
    • Kolay Gelsin Shipment Extension
    • Falcon Flex Shipment Extension
    • Tap Saved Card Installation
    • NAPS QPay via Tap Installation
    • Tamara Payment Extension
    • Paywall Payment Integration
    • Horoz Lojistik Shipment Extension
    • Monist Shipment Extension
    • Sipay Integration
    • Nestpay Integration
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • useGetBasketQuery
  • useGetMiniBasketQuery
  • useGetMiniBasketDetailQuery

Was this helpful?

  1. Project Zero
  2. Next.js
  3. Plugins
  4. Akinon Next
  5. Data Fetching
  6. Client

Basket

useGetBasketQuery

This function is used to fetch a list of products in the shopping basket.

The useGetBasketQuery function is imported from '@akinon/next/data/client/basket'.

import { useGetBasketQuery } from '@akinon/next/data/client/basket';

To use the function, create a variable and call the function:

const { data } = useGetBasketQuery();

Data returned from the function:

{
  "basketitem_set": [{
    "quantity": 1,
    "product": {
      "pk": 37,
      "name": "Product Name",
      "sku": "AKN12345",
      "base_code": "AKN12345",
      "attributes": {
        ...
      },
      "attribute_set": 1,
      "attributes_kwargs": {
        ...
      },
      "extra_attributes": {},
      "productimage_set": [{
        "pk": 378,
        "status": "active",
        "image": "https://image-url.jpg",
        "order": 0,
        "created_date": "2023-04-18T09:52:58.863335Z",
        "specialimage_set": []
      }],
      "price": "59",
      "in_stock": true,
      "currency_type": "aed",
      "retail_price": "85",
      "unit_type": "qty",
      "absolute_url": "/product/37/",
      "productvideo_set": [],
      "product_type": "0",
      "price_type": "default",
      "form_schema": null,
      "is_ready_to_basket": false,
      "stock": 230,
      "data_source": null
    },
    "unit_price": "59.00",
    "currency_type": "aed",
    "tax_rate": "5.00",
    "total_amount": "59.00",
    "shipping_discount": null,
    "attributes": {},
    "id": 95,
    "attributes_kwargs": {},
    "image": null,
    "parent": null,
    "offer_badges": [{
      "description": "This is a test coupon.",
      "discount": "58.99"
    }],
    "price": "59.00",
    "retail_price": "85.00",
    "stock": 230,
    "discount_amount": "100.00",
    "datasource": null,
    "extra_product_stock_detailed": null,
    "extra_product_price_detailed": null
  }],
  "total_amount": "0.01",
  "total_quantity": 1,
  "unavailable_basket_products": [],
  "upsell_details": [],
  "discounts": [{
    "description": "This is a test coupon.",
    "discount": "58.99"
  }],
  "total_discount_amount": "58.99",
  "total_product_amount": "59.00",
  "voucher_code": null,
  "pk": 55,
  "created_date": "2023-04-27T12:12:28.890431Z",
  "modified_date": "2023-04-27T12:12:28.890452Z",
  "segment": {
    "pk": 2,
    "stock_list": null,
    "price_list": null
  }
}

useGetMiniBasketQuery

Returns the number of products in the cart.

The useGetMiniBasketQuery function is imported from '@akinon/next/data/client/basket'.

import { useGetMiniBasketQuery } from '@akinon/next/data/client/basket';

This function can be used like this:

const { data: miniBasket } = useGetMiniBasketQuery();

const totalQuantity = useMemo(
   () => miniBasket?.total_quantity ?? 0,
   [miniBasket]
);

useGetMiniBasketDetailQuery

Those using namespaces in their baskets should useGetMiniBasketDetailQuery to see the total quantity.

The useGetMiniBasketDetailQuery function is imported from '@akinon/next/data/client/basket'.

import { useGetMiniBasketDetailQuery } from '@akinon/next/data/client/basket';

This function can be used like this:

const {
   data: miniBasketDetail,
   isLoading,
   error
} = useGetMiniBasketDetailQuery({
   namespace: 'test'
});

const totalQuantity = useMemo(
   () => miniBasketDetail?.total_quantity ?? 0,
   [miniBasketDetail]
);
PreviousAddressNextCheckout

Last updated 5 hours ago

Was this helpful?