Exchange authorisation code and receive credential
Completes the Authorization Code Flow of a credential offer or of a wallet-initiated issuance: the wallet exchanges the authorisation code for an access token at the issuer and receives the credentials. Call it after the authorisation server of the issuer redirects the user back with code and state, for the records in credential_pending that have an authorisationRequest. The wallet refuses a redirect whose state does not match the records, before any token request (RFC 6749 section 10.12).
Authorizations
AuthorizationstringheaderrequiredYour API key with the prefix
ApiKey:ApiKey <your-api-key>. Get an API key.Scope:
credentials:receive
Body
The parameters of the redirect from the authorisation server of the issuer.
codestringrequiredRequired. The authorisation code of the redirect.
At least 1 character.
Example:
"d7f1a2c4-9b83-4f0e-8c21-6a5e0d3b7f19"credentialIds string[]The records to complete: the
credentialIdvalues from the answer of Receive credential. Each record must belong tostate. Not sent: the wallet completes every record ofstate.statestringrequiredRequired. The
stateof the redirect. It must be the state of the authorisation request of the records.Example:
"b7c9e2f1-4a58-4d31-9f2c-0e6b8a1d5c73"issstringThe
issof the redirect (RFC 9207). Required when the metadata of the authorisation server setsauthorization_response_iss_parameter_supportedtotrue; it must then be theissuerof that server.Example:
"https://demo-api.igrant.io/organisation/0f9b1c2d-3e4a-4b6c-8d8e-9f0a1b2c3d4e/service/version-01"
Response
The credential records that the wallet received.
credentialobject or any[] | nullOne credential record, an array when the flow gives more than one record, or
nullwhen it gives none.