For the complete documentation index, see llms.txt. This page is also available as Markdown.

Session Token

Access Token lets you transact and fetch details from a particular user account. To generate an Access token, you must pass the API Key, Request Token, and API secret. to create an Access token.

Endpoint

Base URL
https://connects.torusdigital.com/api/v1/session/generate

Header Parameters

Name
Value

Content-Type

application/json

Token

<Token>

Request Parameters

ATTRIBUTE
DESCRIPTION

API_SECRET

The apiSecret generated during Merchant Onboarding step for the specific merchant

API_KEY

The apiKey generated during Merchant Onboarding step for the specific merchant

Request

cURL
curl --location 'https://connects.torusdigital.com/api/v1/session/generate' \
--header 'Token: {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "API_KEY": "<API_KEY>",
    "API_SECRET": "<API_SECRET>"
}'
Java-Unirest
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://connects.torusdigital.com/api/v1/session/generate")
  .header("Token", "{{token}}")
  .header("Content-Type", "application/json")
  .body("{\n" +
        "    \"API_KEY\": \"<API_KEY>\",\n" +
        "    \"API_SECRET\": \"<API_SECRET>\"\n" +
        "}")
  .asString();
Go-Native
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://connects.torusdigital.com/api/v1/session/generate"
  method := "POST"

  payload := strings.NewReader(`{
    "API_KEY": "<API_KEY>",
    "API_SECRET": "<API_SECRET>"
  }`)

  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Token", "{{token}}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}

Response

Last updated