---
updatedAt: 2025-10-24T16:40:18.000Z
---

# Create OAuth Token

To create a client assertion using privatekey, refer to https://datatracker.ietf.org/doc/html/rfc7523. This returns a Token that can be valid for 30 minutes.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Paze Checkout API",
    "description": "Paze Checkout API for Merchants",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.paze.com"
    }
  ],
  "security": [
    {
      "OAuth2": []
    }
  ],
  "paths": {
    "/token": {
      "post": {
        "summary": "Create OAuth Token",
        "tags": [
          "Identity"
        ],
        "servers": [
          {
            "url": "https://auth.paze.com"
          }
        ],
        "description": "To create a client assertion using privatekey, refer to https://datatracker.ietf.org/doc/html/rfc7523. This returns a Token that can be valid for 30 minutes.\"",
        "requestBody": {
          "description": "Request Body",
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "properties": {
                  "client_assertion": {
                    "$ref": "#/components/schemas/client_assertion"
                  },
                  "grant_type": {
                    "$ref": "#/components/schemas/grant_type"
                  },
                  "client_assertion_type": {
                    "$ref": "#/components/schemas/client_assertion_type"
                  }
                }
              },
              "examples": {
                "TokenRequestExample": {
                  "$ref": "#/components/examples/TokenRequestExample"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created a token valid for 30 minutes",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "access_token": {
                      "$ref": "#/components/schemas/access_token"
                    },
                    "expires_in": {
                      "$ref": "#/components/schemas/expires_in"
                    },
                    "token_type": {
                      "$ref": "#/components/schemas/token_type"
                    }
                  }
                },
                "examples": {
                  "TokenResponseExample": {
                    "$ref": "#/components/examples/TokenResponseExample"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "examples": {
                  "TokenResponse400InvalidGrantExample": {
                    "$ref": "#/components/examples/TokenResponse400InvalidGrantExample"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized. clientAssertion not valid any more.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                },
                "examples": {
                  "TokenResponse401InvalidClientExample": {
                    "$ref": "#/components/examples/TokenResponse401InvalidClientExample"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "grant_type": {
        "type": "string",
        "enum": [
          "client_credentials"
        ]
      },
      "client_assertion": {
        "type": "string"
      },
      "client_assertion_type": {
        "type": "string",
        "enum": [
          "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
        ]
      },
      "access_token": {
        "type": "string"
      },
      "error": {
        "type": "object",
        "description": "A provided error",
        "properties": {
          "error": {
            "type": "string",
            "maxLength": 24
          }
        },
        "required": [
          "error"
        ]
      },
      "expires_in": {
        "type": "string",
        "enum": [
          "1800"
        ]
      },
      "token_type": {
        "type": "string",
        "enum": [
          "bearer"
        ]
      }
    },
    "examples": {
      "TokenRequestExample": {
        "summary": "Token request to server",
        "description": "Request can be sent json format too. This is just an example with 'Content-Type' as 'application/x-www-form-urlencoded'. merchantSessionId is the sessionId will require to send in API payload.",
        "value": {
          "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
          "grant_type": "client_credentials",
          "session_id": "5df9983c-bfa1-49ab-ad52-eaab72b6c7c2",
          "client_assertion": "eyJ0eXAiOiJKV1QiLCJraWQiOiJwYXplLW1vYmlsZS1xYS1zaWduaW5nIiwiYWxnIjoiUlMyNTYifQ.eyJuYmYiOjE3Mzk0OTMwNzYsImlzcyI6IjM2OWM3ODFiLTUxNjEtNGFhMC1hYTc4LWFiNmVlYTdjOGZjOCIsImV4cCI6MTczOTQ5NDg3NiwianRpIjoiNWNkNWYwZjgtMjFhNi00OGY4LTkxYTEtZjUzMmM1NzRjZTVlIiwiaWF0IjoxNzM5NDkzMDc2LCJzdWIiOiIzNjljNzgxYi01MTYxLTRhYTAtYWE3OC1hYjZlZWE3YzhmYzgiLCJhdWQiOiJodHRwczpcL1wvYXV0aC53YWxsZXQucWEuZWFybHl3YXJuaW5nLmlvXC90b2tlbiJ9.HcYZ_CxY-cZTf8WUecSMRBhvJBIfGALkI1ejgxzLUXKRtkjsLCIfNK0FEWkfHJhcuATjg7faBtXfVrg5yb-iHgqR3N65soHtXYEhAGJmyVPP1OvYpTetTfAPY385DA-y6UWYKXc2szAPe6hFRWgSIIwPypcqaIUWP11fGNXN2MFQWJXNrl0k9iYw9oTNO8E84sI_Gip2RBa4kREKRYV3ZZ_T641gHGJJMi_8kWBFHGaqNCM0WwHJzepvmZRrj68q8MQi6QwbA-R2T7GTWjdwBqaf92vu4LXBxtleQ9ZKkGW5MoFEXs7PxQS-mBuQfnd78PGiCh_eMCnGDxVV_ezdag"
        }
      },
      "TokenResponseExample": {
        "summary": "Token response from server",
        "value": {
          "access_token": "eyJraWQiOiI3Rjg2OEEwNDc2MTQ4Mzg3NDMzRTk5RjFDODlDODgwQjJEODBBMDYzIiwiYWxnIjoiUFMyNTYifQ.eyJpc3MiOiJodHRwczovL3BsYXRmb3JtLXBhemUtY2F0LWVhc3QuZXd0LmxvY2FsLyIsInN1YiI6IjM2OWM3ODFiLTUxNjEtNGFhMC1hYTc4LWFiNmVlYTdjOGZjOCIsImF1ZCI6Imh0dHBzOi8vYXV0aC53YWxsZXQucWEuZWFybHl3YXJuaW5nLmlvIiwiZXhwIjoxNzM5NDk0ODc2LCJuYmYiOjE3Mzk0OTMwNjYsImlhdCI6MTczOTQ5MzA2NiwianRpIjoiMTlBRkEyMUZGOUNGNEJEN0RCODhGNjE3MTM0RjIwM0VCQjgzODQ1MDo5MEM3MERDMC05REY2LTQyNEItODk3QS1CQzBCMEY1ODA3NzgifQ.VrgFR-4xa30fmThXI-VaXgpQgR1dEkdqzjbJyFkY0Fo76zhnr6tsLAVQis_Cr_McGDv_y_nhhbRxJIjQyohAuVGGtmZKAzsXKlkCjKKwqwX0UqOIrWanNmA4yvNzCcCCydkGZgrJ8APSwj0yqp0488s8YMdwTfHXpYkawouK30qahln3E99CugDSDM6rOsLE5UzmNcozcPsz0gTZbcyaS9Ih3I0ML5KZ5e-8ILAsejTIKW2-I_PXm8NfZ9mp-V63sbcHY4fyggJQjoF5rYlZcFLwGo8st15RM2ld7ASbGvYSf3vOAt1cxOy0c0m8FGrYiqz1jhzlzuLduPCm3wrl0A",
          "expires_in": "1800",
          "token_type": "bearer"
        }
      },
      "TokenResponse401InvalidClientExample": {
        "summary": "401 Unauthorized",
        "value": {
          "error": "invalid_client"
        }
      },
      "TokenResponse400InvalidGrantExample": {
        "summary": "400 Bad Request",
        "value": {
          "error": "invalid_grant"
        }
      }
    },
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth.paze.com/token/",
            "scopes": {
              "sessionId": "Merchant sessionId should be passed for create, review and complete"
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```