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

Refresh Access Token

POST
/user/auth/oauth2/token
API to Refresh Token for Authentication.
If the access token expired, you can re-fetch it or use the Fetch Access Token by Refresh Token API. Or you can get a new access token before it expired.
Only one access token can be exists in the same time per client-id, we suggest cache the access token in your caching system, for example, Redis.
ParamDescriptionFixed Value
Content-TypeThe Content-Type should be multipart/form-data.multipart/form-data
refresh_tokenFrome the Get Access Token Api
grant_typeFixed value refresh_token.refresh_token

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 --request POST '/user/auth/oauth2/token?refresh_token=CpCAhcCRtLU4kPjs54omWW3A&grant_type=refresh_token'

Responses

🟢200成功
application/json
Bodyapplication/json

Example
{
    "access_token": "CkppLkyiqEUKITGdtCZRUZBl",
    "expires_in": 21600,
    "refresh_token": "CpCAhcCRtLU4kPjs54omWW3A",
    "rt_expires_in": 43200,
    "token_type": "bearer"
}
Modified at 2026-05-13 02:44:08
Previous
Get Access Token
Next
Hosted Payment Page
Built with