Developer Docs
  • 👋Get Started
  • Add Payment Methods in Optty
  • Custom API | Headless
    • 🖥️Direct API Integration
      • Environments
      • Order Flow
      • 1️⃣Create Access Token
      • 2️⃣Get APM Options
      • 3️⃣Create Order
      • 4️⃣Handle Payment Response
      • 5️⃣Refund Order
      • 🔥Handling Exceptions
  • Platforms
    • ◾BigCommerce
      • 🚀Activate Optty
      • ⚡Add Optty Widgets
        • 1️⃣Install the App
        • 2️⃣Create Widget Token
        • 3️⃣Edit Your Template
        • 4️⃣Widget Configuration
      • 💳Refunds
    • Magento 2
      • Install Optty Module
      • Configure the Optty Extension
      • One Step Checkout
    • Salesforce Commerce Cloud
      • Component Overview
      • Implementation Guide
      • Operation and Management
      • User Guide
    • 🟪WooCommerce
      • 🚀Install Optty
      • ⚡Setup Widgets
      • 💳Refunds
  • Widget
    • Widget Setup and Integration
    • Create Order Widget Integration
    • Handle Order Payment Widget Integration
  • API References
    • Create Order
      • Create Order Response
    • Refund Order
    • Void Order
    • Capture Order
    • Transaction Details
    • Create Customer Session
    • Best Practice
  • Go Live
  • Universal Payment Platform
    • Support Articles
Powered by GitBook
On this page
  • Sandbox Testing Environment
  • Production Environment
  • Create Access Token
  1. Custom API | Headless
  2. Direct API Integration

Create Access Token

PreviousDirect API IntegrationNextGet APM Options

Last updated 8 months ago

Sandbox Testing Environment

Authentication

https://auth.qa.optty.com/token

Production Environment

Authentication

https://auth.optty.com/token

In order to access the API’s, first create an access token that will be used in the header of subsequent calls.

Access tokens expire in 24 hours from the time it was created but you are able to use this method to obtain a new token.

Create Access Token

POST /token?expires_in=1

Access tokens are only valid for 24 hours from its creation. Use this method if the current token is expiring soon or it may have been compromised to obtain a new Access Token. Client ID and secret credentials are provided by Optty.

Headers

Name
Type
Description

content-type*

application/x-www-form-urlencoded

Request Body

Name
Type
Description

client_id*

string

Client_ID credentials provided by Optty

client_secret*

string

Client secret credentials provided by Optty

grant_type*

string

Always “client_credentials”

scope*

string

The supported scope for machine-to-machine interaction for Optty’s APIs is “api-user”, this is needed to make API calls for placing an order

Content-type application/json:

{
"access_token": "<access token in JWT format>",
"expires_in": 86400,
"token_type": "Bearer",
"scope": "api-user"
}
🖥️
1️⃣