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

Payment Session

Create temporary payment sessions for onboarded users. The session token is used to authenticate the user in the Payr payment interface (iframe or SDK).

Create Payment Session

post
/user-login/

Create a temporary payment session token for an onboarded user.

This token is valid for 15 minutes and is used for client-side payment operations. Pass the token to the Payr payment interface (iframe or SDK) to enable the user to make rent payments.

Note: The user must have been onboarded via /onboarding/ first, otherwise a 400 error is returned.

Example cURL Request

curl -X POST https://api.mypayr.co.uk/thirdparty/user-login/ \
  -H "Authorization: Token your_server_token" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "john.smith@university.edu"
  }'

Example Response

{
  "token": "x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0f9e8d7c6b5a4",
  "session_id": "01KH1FZ0N0..."
}
Authorizations
AuthorizationstringRequired

Server-to-server authentication token obtained via the rotate-token endpoint. Include in the Authorization header as: Authorization: Token <your_token>

Body
emailstring · emailRequired

Email address of the user to create a payment session for

Example: tenant@example.com
Responses
200

Payment session token created successfully

application/json
tokenstringOptional

Temporary payment session token (valid for 15 minutes)

Example: session_token_abc123...
session_idstringOptional

Session identifier (valid for 30 minutes)

Example: 01KH1FZ0N0...
post/user-login/
POST /thirdparty/user-login/ HTTP/1.1
Host: sandbox-api.mypayr.co.uk
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 37

{
  "email": "john.smith@university.edu"
}
{
  "token": "x9y8z7w6v5u4t3s2r1q0p9o8n7m6l5k4j3i2h1g0f9e8d7c6b5a4",
  "session_id": "01KH1FZ0N0..."
}

Last updated