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
  • Akifast User Authentication​
  • 1. Redirecting User to the Login Page​
  • 2. Getting an Access Token​
  • 3. Refreshing the Access Token​

Was this helpful?

  1. Akifast
  2. HPP

Authorization

Akifast User Authentication​

The Akifast application performs the necessary authorization for users to log in to merchant sites and freely navigate and shop on the site within the OAuth2 framework. The merchant must implement the authorization_code flow in the OAuth2 framework for the Akifast (Akinon) user to enter the merchant's website.

The following steps needs to be completed in this flow:

1. Redirecting User to the Login Page​

The merchant initiates the flow with the Login with Akifast button placed on the login page. Clicking this button redirects the user to the Login page on the Akifast OAuth2 Server. When clicking the button, the merchant should redirect to the following address by appending the parameters in the table to the URI. This redirection occurs in a new tab.

Method: GET

Path: /oauth/authorize

Query Parameters​

The parameters to be added to the authorization URL are provided in the table below.

Parameter
Description

grant_type

This value must be assigned as authorization_code.

response_type

This value must be assigned as code.

client_id

The client_id value of the merchant using Akifast.

state

A boomerang value to be used by the merchant to match the response to the request. It is not a mandatory parameter.

redirect_uri

The URI to which the logged-in user will be redirected.

Example Request​

https://oauth.sandbox.akifast.com/oauth/authorize?grant_type=authorization_code&response_type=code&client_id={{client_id}}&state=HLa754Dj&redirect_uri=https%3A%2F%2Ftest-merchant.com%2Foauth-code-handler

The user redirected to the above URL reaches the Akifast OAuth2 Server's Login page. The user performs authentication on this page and grants permission to the merchant.

2. Getting an Access Token​

To obtain an access token on behalf of the authenticated user who has granted permission to the merchant, the user is redirected to a URL that accepts the following parameters provided by the merchant.

Parameter
Description

code

The code value to be sent to obtain the access token in the next step.

state

The boomerang value sent when the user was initially redirected.

The merchant will send the above parameters to the URL provided by the merchant via URI Query.

The URL will be as follows:

https://test-merchant.com/oauth-code-handler?code=yCcm1Z&state=HLa754Dj

The merchant, upon receiving the request with the code parameter in the URL, should make a request to the following URL with the parameters below to obtain an access token on behalf of the user.

Method: POST

Path: ${oauth_server_url}/oauth/token

Content Type: application/x-www-form-urlencoded

The Authorization header of the request must include the Basic Authentication method with the merchant ID and password.

Example Request​

curl --location 'http://oauth.sandbox.akifast.com/oauth/token' \
--header 'Accept-Language: tr' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic OWQzNmVjMDQtZGUyZi0xMWVhLTg3ZDAtMDI0MmFjMTMwMDAzOllvdXJTZWN1cmVQYXNzd29yZCE=' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=EYDCPY' \
--data-urlencode 'redirect_uri=https://test-merchant.com/oauth-code-handler'

Query Parameters​

Parameter
Example Value
Description

grant_type

authorization_code

The value of grant_type in the request sent to the OAuth2 Server must be sent as authorization_code.

code

yCcm1Z

The code value received in the redirect URL must be sent.

redirect_uri

The URI to which the logged-in user will be redirected. This redirect URI sent in the “Redirecting User to the Login Page” request must be the same.

Example Response​

{
  "access_token": "{{jwt_formatted_access_token}}",
  "token_type": "bearer",
  "refresh_token": "{{jwt_formatted_refresh_token}}",
  "expires_in": 3599999,
  "scope": "read write update delete",
  "user": {
      "akinon_user_id": "{{akinon_user_id}}",
      "phone_number": "+900000000000",
      "email": "john.doe@example.com"
  },
  "jti": "2qMQ4eZD2Ce_s1L77S_JygcrYew"
}

Response Parameters​

Return Value
Description
Example Value

access_token

Token information used for making requests on behalf of the user. Returned as a JWT.

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsmtpZCI6ImQ3OTdmZDA2LTQ2NmQtNGM1MS05N2RmLWZlYzdmZjAwMjlmOCJ9 ExUDO2FqkoTevLcpIstyXvNd1HejhxDq3t3uC5modp9mGdRZgmYH2zWMtAVVkEd

token_type

The type of the returned token.

bearer

refresh_token

Token used to refresh the user's access_token when it expires. It has a longer validity period than the access_token.

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtZCI6ImQ3OTdmZDA2LTQ2NmQtNGM1MS05N2RmLWZlYzdmZjAwMjlmOCJ9 oKSLZFeEOjxax7cCzZ3RrYVGdRzUHfhU5koWsRhRnxXYIOI6KXLj__X3BXAav64psg45VlWMBipbjFmgk0o_1knTXCaglg4j3kk3xtwfmEVOkzqkj0dvJ2hYF61AvilSPcQV0lM1oUk

expires_in

The expiration time of the Access Token in seconds.

3599999

scope

The scopes for which the Access Token is valid.

read/write/update/delete user

user.akinon_user_id

The Akinon User ID of the user who owns the token.

F61C8BF00BFD4C7AFE459F24A358F2B

user.phone_number

The phone number of the user who owns the token.

+900000000000

user.email

The email address of the user who owns the token.

jti

A unique value generated for the request.

2qMQ4eZD2Ce_s1L77S_JygcrYew

With this response, the access_token obtained will be sent to the Akifast API with the Akinon-User-Access-Token header for all requests made on behalf of the Akinon user. The access_token can be stored by the merchant on the user's session and can be refreshed once with the refresh_token when the access_token expires.

3. Refreshing the Access Token​

This method is used to refresh the access token when it expires.

Method: POST

Path: ${oauth_server_url}/oauth/token

Content Type: application/x-www-form-urlencoded

The Authorization header of the request must include the Basic Authentication method with the merchant ID and password.

Example Request​

curl --location 'http://oauth.sandbox.akifast.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic OWQzNmVjMDQtZGUyZi0xMWVhLTg3ZDAtMDI0MmFjMTMwMDAzOllvdXJTZWN1cmVQYXNzd29yZCE=' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token={{jwt_formatted_refresh_token}}'

Query Parameters​

Parameter
Example Value
Description

grant_type

authorization_code

The value of grant_type in the request sent to the OAuth2 Server must be sent as authorization_code. This identifies the flow.

refresh_token

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCI...

Token used to refresh the user's access_token when it expires. It has a longer validity period than the access_token.

Example Response​

{
  "access_token": "{{jwt_formatted_access_token}}",
  "token_type": "bearer",
  "refresh_token": "{{jwt_formatted_refresh_token}}",
  "expires_in": 3599999,
  "scope": "read write update delete",
  "user": {
      "akinon_user_id": "{{akinon_user_id}}",
      "phone_number": "+900000000000",
      "email": "john.doe@example.com"
  },
  "jti": "2qMQ4eZD2Ce_s1L77S_JygcrYew"
}

Response Parameters​

Return Value
Description
Example Value

access_token

Token information used for making requests on behalf of the user. Returned as a JWT.

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6mQ3OTdmZDA2LTQ2NmQtNGM1MS05N2RmLWZlYzdmZjAwMjlmOCJ9 ExUDO2FqkoTevLcpIstyXvNd1HejhxDq3t3uC5modp9mGdRZgmYH2zWMtAVVkEd

token_type

The type of the returned token.

bearer

refresh_token

Token used to refresh the user's access_token when it expires. It has a longer validity period than the access_token.

eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVIsImtpZCI6ImQ3OTdmZDA2LTQ2NmQtNGM1MS05N2RmLWZlYzdmZjAwMjlmOCJ9 oKSLZFeEOjxax7cCzZ3RrYVGdRzUHfhU5koWsRhRnxXYIOI6KXLj__X3BXAav64psg45VlWMBipbjFmgk0o_1knTXCaglg4j3kk3xtwfmEVOkzqkj0dvJ2hYF61AvilSPcQV0lM1oUk

expires_in

The expiration time of the Access Token in seconds.

3599999

scope

The scopes for which the Access Token is valid.

read/write/update/delete user

user.akinon_user_id

The Akinon User ID of the user who owns the token.

F61C8BF00BFD4C7AFE459F24A358F2B

user.phone_number

The phone number of the user who owns the token.

+900000000000

user.email

The email address of the user who owns the token.

jti

A unique value generated for the request.

2qMQ4eZD2Ce_s1L77S_JygcrYew

PreviousGetting StartedNextPayment Session Creation

Last updated 24 days ago

Was this helpful?

https://test-merchant.com/oauth-code-handler
john.doe@example.com
john.doe@example.com