Akinon Release Notes (05/12/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
    • Promotions
  • 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
  • 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
      • Plugins
      • Widgets
      • Icons
      • Localization
      • SEO Management
      • Advanced Usage
      • Data Fetching
        • Client
          • Account
          • Address
          • Basket
          • Checkout
          • Misc
          • Product
          • User
          • Wishlist
        • Server
          • Category
          • Flat Page
          • List
          • Menu
          • Product
          • SEO
          • Special Page
          • Widget
  • 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
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • useGetProductByPkQuery
  • useGetInstallmentsQuery
  • useGetProductByParamsQuery

Was this helpful?

  1. Project Zero
  2. Next.js
  3. Data Fetching
  4. Client

Product

useGetProductByPkQuery

This function is used to fetch product data.

The useGetProductByPkQuery function is imported from '@akinon/next/data/client/product'.

import { useGetProductByPkQuery } from '@akinon/next/data/client/product';

To use this function, the product's primary key (pk) needs to be provided as an argument:

const { data, isLoading, isSuccess } = useGetProductByPkQuery(
    item.product.pk
  );

The returned data can be used as data.product.in_stock.

Data returned from the function:

{
  "in_stock": true,
  "product": {
    "pk": 154,
    "name": "Product Name",
    "sku": "AKN-002-starprint001-XS",
    "base_code": "AKN-002",
    "attributes": {
      ...
    },
    "attribute_set": 6,
    "attributes_kwargs": {
      ...
    },
    "extra_attributes": {},
    "productimage_set": [{
      "pk": 201,
      "status": "active",
      "image": "https://img-url.jpg",
      "order": 0,
      "created_date": "2022-12-30T07:43:17.590001Z",
      "specialimage_set": []
    }],
    "price": "29.99",
    "in_stock": true,
    "currency_type": "eur",
    "retail_price": "29.99",
    "unit_type": "qty",
    "absolute_url": "/product-url/",
    "productvideo_set": [],
    "product_type": "0",
    "price_type": "default",
    "form_schema": null,
    "is_ready_to_basket": false,
    "stock": 968,
    "data_source": null,
    "basket_offers": []
  },
  "variants": [{
    ...
  }],
  "selected_variant": null
}

useGetInstallmentsQuery

This function is used to fetch installment payment information available in banks for a product's purchase.

The useGetInstallmentsQuery function is imported from '@akinon/next/data/client/product'.

import { useGetInstallmentsQuery } from '@akinon/next/data/client/product';

To use this function, the productPk needs to be provided as an argument:

const { data, isLoading, isSuccess } = useGetInstallmentsQuery(productPk);

Data returned from the function:

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [{
    "pk": 1,
    "name": "Other",
    "bank": {
      "pk": 1,
      "name": "Other",
      "slug": "other",
      "logo": "https://0fb534.cdn.akinoncloud.com/banks/2023/01/17/be59a98c-00f6-486d-be4e-e3451ea3e970.jpg"
    },
    "card_type": {
      "pk": 1,
      "name": "Other",
      "slug": "other",
      "logo": "https://0fb534.cdn.akinoncloud.com/card_types/2021/12/17/4c22a73e-cd2a-423a-af7f-9078690ada89.jpg"
    },
    "card_payment_type": "credit",
    "cash_payment": 1,
    "installment_payment": 1,
    "slug": "other",
    "three_d_payment": 1,
    "is_commerce_card": false,
    "installments": [{
        "pk": 1,
        "card": 1,
        "installment_count": 1,
        "label": "1",
        "interest_rate": "0.000000",
        "is_active": true,
        "config": {},
        "translations": null,
        "amount": 19.49,
        "interest_amount": 0,
        "single_installment_amount": 19.49,
        "total_amount": 19.49
      },
      {
        "pk": 2,
        "card": 1,
        "installment_count": 2,
        "label": "2",
        "interest_rate": "0.010000",
        "is_active": true,
        "config": {},
        "translations": null,
        "amount": 19.49,
        "interest_amount": 0.2,
        "single_installment_amount": 9.85,
        "total_amount": 19.69
      },
      {
        "pk": 3,
        "card": 1,
        "installment_count": 3,
        "label": "3",
        "interest_rate": "0.050000",
        "is_active": true,
        "config": {},
        "translations": null,
        "amount": 19.49,
        "interest_amount": 0.98,
        "single_installment_amount": 6.83,
        "total_amount": 20.47
      }
    ]
  }]
}

useGetProductByParamsQuery

This function is used to fetch product and variants information, selected_variant, and in_stock status without navigating to the product details page.

The useGetProductByParamsQuery function is imported from '@akinon/next/data/client/product'.

import { useGetProductByParamsQuery } from '@akinon/next/data/client/product';

To use this function, the productPk needs to be provided as an argument:

const { data, isFetching, isSuccess } = useGetProductByParamsQuery({ pk });

Data returned from the function:

{
	"in_stock": true,
	"product": {
		"pk": 123456,
		"name": "Product Name",
		"sku": "123456",
		"base_code": "123456",
		"attributes": {
			...
		},
		"attribute_set": 12,
		"attributes_kwargs": {
			...
		},
		"extra_attributes": {},
		"productimage_set": [{
			...
		}],
		"price": "15",
		"in_stock": true,
		"currency_type": "aed",
		"retail_price": "15",
		"unit_type": "qty",
		"absolute_url": "/product-url/",
		"productvideo_set": [],
		"product_type": "0",
		"price_type": "default",
		"form_schema": null,
		"is_ready_to_basket": false,
		"stock": 319,
		"data_source": null,
		"basket_offers": []
	},
	"variants": [{
			"attribute_key": "color",
			"attribute_name": "Color",
			"options": [{
				"is_selected": true,
				"is_selectable": true,
				"is_selectable_without_stock": true,
				"in_stock": true,
				"order": "0",
				"label": "Pink",
				"value": "Pink",
				"product": {
					...
				}
			}]
		},
		{
			"attribute_key": "size",
			"attribute_name": "Size",
			"options": [{
				"is_selected": true,
				"is_selectable": true,
				"is_selectable_without_stock": true,
				"in_stock": true,
				"order": "5020",
				"label": "236ML",
				"value": "236ML",
				"product": {
					...
				}
			}]
		}
	],
	"selected_variant": {
		"pk": 123456,
		"name": "Product name",
		"sku": "123456",
		"base_code": "123456",
		"attributes": {
			...
		},
		"attribute_set": 12,
		"attributes_kwargs": {
			...
		},
		"extra_attributes": {},
		"productimage_set": [{
			...
		}],
		"price": "15",
		"in_stock": true,
		"currency_type": "usd",
		"retail_price": "15",
		"unit_type": "qty",
		"absolute_url": "/product-url",
		"productvideo_set": [],
		"product_type": "0",
		"price_type": "default",
		"form_schema": null,
		"is_ready_to_basket": false,
		"stock": 319,
		"data_source": null
	}

}
PreviousMiscNextUser

Was this helpful?