curl --request POST \
--url https://api.example.com/connect/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirectUri": "<string>"
}
'import requests
url = "https://api.example.com/connect/sessions"
payload = { "redirectUri": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirectUri: '<string>'})
};
fetch('https://api.example.com/connect/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"url": "<string>",
"state": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Create a sign-in window session
Issue a short-lived URL for the HEVN sign-in window. Open it in a popup from your page: link lets the account holder connect their account and returns a code for POST /clients/link, sign lets the holder of a connected account approve one payout that waits for their signature. The result comes back on redirectUri with state.
curl --request POST \
--url https://api.example.com/connect/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redirectUri": "<string>"
}
'import requests
url = "https://api.example.com/connect/sessions"
payload = { "redirectUri": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({redirectUri: '<string>'})
};
fetch('https://api.example.com/connect/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"url": "<string>",
"state": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The client account to act for, as a cl_… id. Omit it to act as yourself.
"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Body
link asks the account holder to connect their account, sign to approve one payout.
link, sign Page the sign-in window returns to with the result and state. Its origin must be one of the allowed origins in the sign-in window settings.
1 - 2048The payout the account holder approves. Required for sign, not accepted for link.
^(?:po_)?[A-Za-z0-9._:\-]{1,216}$"po_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"
Was this page helpful?