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

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",
		"company_nr_employees": 10,
		"company_sni_code": "56110"
	},
	"country": "SE",
	"name": "Per Persson",
	"sub": "f27a2559-9e7a-41dc-a218-4796fe180943"
}
type string
Type of location. Possible values are hq or location.
company_nr_employees number
Number of employees in the company. This number is not exact but can be used as an indicator of the company's size. In case data is not avialable this value will be 0.
company_sni_code string
Only for Swedish companies. The SNI code is a standard classification of economic activities in Sweden, similar to the NACE code used in the EU. It provides insight into the industry or sector in which the company operates.