Skip to main content
Credential offers

Exchange authorisation code and receive credential

POST/v4/config/ows/holder/authorisation-code-exchanges

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

  • Authorizationstringheaderrequired

    Your API key with the prefix ApiKey: ApiKey <your-api-key>. Get an API key.

    Scope:credentials:receive

Body

application/json

The parameters of the redirect from the authorisation server of the issuer.

  • codestringrequired

    Required. The authorisation code of the redirect.

    At least 1 character.

    Example:"d7f1a2c4-9b83-4f0e-8c21-6a5e0d3b7f19"

  • credentialIdsstring[]

    The records to complete: the credentialId values from the answer of Receive credential. Each record must belong to state. Not sent: the wallet completes every record of state.

  • statestringrequired

    Required. The state of the redirect. It must be the state of the authorisation request of the records.

    Example:"b7c9e2f1-4a58-4d31-9f2c-0e6b8a1d5c73"

  • issstring

    The iss of the redirect (RFC 9207). Required when the metadata of the authorisation server sets authorization_response_iss_parameter_supported to true; it must then be the issuer of that server.

    Example:"https://demo-api.igrant.io/organisation/0f9b1c2d-3e4a-4b6c-8d8e-9f0a1b2c3d4e/service/version-01"

Response

application/json

The credential records that the wallet received.

  • credentialobject or any[] | null

    One credential record, an array when the flow gives more than one record, or null when it gives none.