Paytrie Developer Documentation
API ReferenceAuth

Exchange an OTP for an access token

POST
/auth/login-codes/verify

Verifies a login code emailed via POST /auth/login-codes and returns an access token for the user.

Authorization

ApiKeyAuth
x-api-key<token>

API key for integrator authentication

In: header

Header Parameters

x-api-key*string

API key for authentication

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

import { PaytrieAPI, configure } from '@paytrie/sdk'configure({ headers: { 'x-api-key': process.env.PAYTRIE_API_KEY! } })const { data } = await PaytrieAPI.verifyLoginCode({  email: "user@example.com",  code: "1234"})
{  "success": true,  "data": {    "accessToken": "eyJhbGciOi…",    "tokenType": "Bearer",    "expiresIn": 3600  }}
{  "success": false,  "errors": [    {      "field": "string",      "message": "string"    }  ]}
{  "success": false,  "errors": [    {      "field": "string",      "message": "string"    }  ]}
{  "success": false,  "errors": [    {      "field": "string",      "message": "string"    }  ]}