1. Authentication
WPay
  • Introduction
  • Signature
  • API Keys
  • Get Started
  • Webhook Service
  • Api Reference
    • Authentication
      • Get Access Token
        POST
      • Refresh Access Token
        POST
    • WPay
      • Hosted Payment Page
      • List Payment History
      • Get Payment Detail
      • Refund
      • List Subscriptions
      • Get Subscription Detail
      • Cancel Subscription
      • Get Subscription Bills
    • Webhook
      • Simulate a Event Call
  • Schemas
    • Schemas
      • RefundOrderDTO
      • RefundPageReq
      • ApiPageApiPageRefundOrderDTO
      • ApiResponseApiPageRefundOrderDTO
      • CancelReq
  1. Authentication

Get Access Token

POST
/user/auth/oauth2/token
To use OAuth 2.0, please use Fetch Access Token first.
Add Authorization: Bearer {access_token} in the other API requests.
ParamDescriptionFixed Value
Content-TypeThe Content-Type should be multipart/form-data.multipart/form-data
api_keyThe API Key value fetched from Before Integration.
api_secretThe API Secret value fetched from Before Integration.
grant_typeFixed value client_credentials.client_credentials

Request

Query Params

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff --request POST '/user/auth/oauth2/token?grant_type=client_credentials&api_key={{api_key}}&api_secret={{api_secret}}'

Responses

🟢200成功
application/json
Bodyapplication/json

Example
{
    "retcode": 200,
    "retdata": {
        "access_token": "Cji8NYO32ugrFJJkG7uCYiX2",
        "token_type": "bearer",
        "expires_in": 21600,
        "refresh_token": "C6k8Vqytb4S8x41RUdMNqzG1",
        "rt_expires_in": 43200
    },
    "success": true
}
Modified at 2026-05-13 02:44:08
Previous
Webhook Service
Next
Refresh Access Token
Built with