Get a session token

get/session_tokens/{id}

Lookup a specific API or Mobile Card Reader session token.

SecurityappIdAuth and appTokenAuth
Request
path Parameters
id
required
string [ 1 .. 255 ] characters

ID of the session token, generated by WePay when the session token is created.

header Parameters
Api-Version
required
string
Example: 3.0
Unique-Key
string
WePay-Risk-Token
string

This header is required when tokenizing Payment Methods, Legal Entities, and Payout Methods when the tokenization JS library is not being used.

Client-IP
string

This header is required when tokenizing Payment Methods, Legal Entities, and Payout Methods when the tokenization JS library is not being used.

Responses
200
Response Schema: application/json
id
required
string [ 1 .. 255 ] characters

ID of the object or resource.

session_token
required
string

When using mobile card readers, a string that should be passed to the WePay Card Present SDK during initialization and when refreshing a session.

expire_time
required
integer <int64> >= 0

The UNIX timestamp in seconds that indicates when the session token will expire.

path
required
string or null

The HTTP path of the resource. The path can be used to retrieve details about the resource and perform actions on it.

required
object

Details the owner resource and owner path associated with the document.

resource
required
string

Helps organize information by identifying the resource type of the object data.

Value: Description
session_tokens
create_time
required
integer <int64> >= 0

The UNIX timestamp for when the object was created.

api_version
required
string
state
required
string

Describes the state of session token. Can be either active or deleted.

Enum: Description
active

The token was successfully generated and has not yet been deleted by your app with a DELETE request.

deleted

The session token was deleted by your app with a DELETE request.

type
required
string

Describes the type of session token. Can be either api_session or mobile_session.

Enum: Description
mobile_session

Session token which associates a mobile card reader with a merchant account.

api_session

A session token created for the API use case (as opposed to Card Present use case).

object
400

INVALID_PARAMS

403

NOT_AUTHORIZED

500

UNEXPECTED_ERROR

Request samples
Response samples
application/json
{
  • "id": "c0e72785-195f-4a96-86b1-171a7a60da13",
  • "path": "/session_tokens/c0e72785-195f-4a96-86b1-171a7a60da13",
  • "resource": "session_tokens",
  • "type": "mobile_session",
  • "owner": {
    • "id": "4cf8bab9-271f-4008-8a3d-aeccc127ad67",
    • "resource": "accounts",
    • "path": "/accounts/4cf8bab9-271f-4008-8a3d-aeccc127ad67"
    },
  • "state": "active",
  • "api_version": "3.0",
  • "create_time": 1619042611,
  • "expire_time": 1619129011,
  • "session_token": "prod_NTFfOTFmMDY3ZjctYmFjOC00NDA4LThhNGItNzMyNjk3NzRmMWJl",
  • "mobile_session": {
    • "time_to_live": 86400,
    • "account_id": "4cf8bab9-271f-4008-8a3d-aeccc127ad67"
    }
}