EntityUser

Generate JWT Token

POST
https://api.mercoa.com/entity/:entityId/user/:userId/token

Generate a JWT token for an entity user with the given options. This token can be used to authenticate the entity and entity user in the Mercoa API and iFrame.

Path parameters

entityId
string
userId
string

Request

This endpoint expects an object.
expiresIn
optional string

Expressed in seconds or a string describing a time span. The default is 1h.

invoice
optional object
pages
optional object
style
optional object
vendors
optional object
entity
optional object

Response

This endpoint return a string.
POST
/entity/:entityId/user/:userId/token
curl -X POST https://api.mercoa.com/entity/ent_a0f6ea94-0761-4a5e-a416-3c453cb7eced/user/user_a0f6ea94-0761-4a5e-a416-3c453cb7eced/token \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"expiresIn": "1h"
}'
Response
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTIzNDU2Nzg5LCJuYW1lIjoiSm9zZXBoIn0.OpOSSw7e485LOP5PrzScxHb7SR6sAOMRckfFwi4rp7o"