Get customer data
Exchange Authorization Code for a Token
In your callback endpoint, verify the state
parameter and exchange the authorization code for an access token. This step is crucial for ensuring the security of the OAuth 2.0 flow.
Access customer data
With the access token, you can now retrieve customer data. If the scope
was set to openid onboarding
, additional company information will be included in the response. The structure of the response adheres to the OpenID Connect (OIDC) standard.
Example response
- Example Request
- Example Response
curl -X GET \
-H 'authorization: Bearer xyz' \
https://access.ledyer.com/userinfo \
{
"company": {
"addresses": [
{
"care_of": "",
"city": "Stockholm",
"company_name": "TestBolaget AB",
"country": "SE",
"postal": true,
"postal_code": "111 33",
"street_address": "Testgatan 1",
"type": "hq"
}
],
"company_id": "5555555555",
"company_name": "Testbolaget AB",
"company_vatid": "SE555555555501"
},
"country": "SE",
"name": "Per Persson",
"sub": "f27a2559-9e7a-41dc-a218-4796fe180943"
}