Skip to main content

Format a Compact Credential as a Google digital Pass

This guide will show you how to format your Compact or Semantic Compact Credentials as a Google digital pass.

Prerequisites

You need the following in order to proceed with this tutorial:

  • Access to Sovrin APIs. If you’re experiencing any difficulties, contact us.

  • The payload of a signed Compact or Semantic Compact Credential.

  • Google digital pass template: This is used by Sovrin to format the different information from the credential into a digital pass.

tip

Customers who choose to use their own certificates to manage these digital passes (Google/Apple) will need to ensure that these certificates do not expire. If you’re experiencing any difficulties, contact us.

Request

Make the following request to format a Compact Credential as a Google digital pass:

POST https://api.sovrin.one/v2/credentials/compact/digitalpass/google
{
"templateId": "1b04f0ee-8e3e-4153-a0e0-8603a10e7f0a",
"payload": "CSC:/1/2KCE3IQEJB5DCMSMGZITM5QBE2QFSALWVQAXQI3ENFSDU53FMI5GYZLBOJXC45TJNEXGC5JQGEXG2YLUORZC4Z3MN5RGC3AFDJSZE7YQHIAACAACOFBW65LSONSSAQ3SMVSGK3TUNFQWYBA2NFLDPEDENZQW2ZLPIVWW2YJAJJQW4ZJAKRQXG3LBMRRW6ZDFMZEFGLRSG44HCY3FOJ2GSZTJMNQXI2LPNZHGC3LFOJLW64TLNFXGOIDBOQQEQZLJM5UHI43SMNSXE5DJMZUWGYLUNFXW4TDFOZSWYZ2MMV3GK3BAGRVGS43TOVSXETTBNVSXQGCBMR3GC3TDMVSCAU3BMZSXI6JAKRZGC2LONFXGOZTFPBYGS4TZNIZDAMRWFUYDCLJQGE5AAAIAACRAEAYDPB2WQ5DUOBZTULZPNRSWC4TOFZ3GS2JOMF2TAMJONVQXI5DSFZTWY33CMFWC6Y3POJSS65RSF5RXEZLEMVXHI2LBNRZS6Y3PNVYGCY3UF5ZGK5TPMNQXI2LPNYWWY2LTORZS6OBYG5RWIMJUGAWWKNDEG4WTINJRHAWWENZQMYWTGMBVMIZDGNZXHA4DIOAH3BAFA3FHFPDIRRKK4SM3ZDTKQSRCPRCYIA7RFUZYQI3RIGDHIGLAODJ6K2F245DTLIIKXAD35TORFQ7MVRJCIEPH6SC6NGA4HRMK76H5V6GXP66FFNX7MNYC6MYVU7ZLLXYVLXBU"
}
  • templateId: Use the id of the Google digital pass template you wish to use to format this credential.

  • payload: Use the encoded element from the response obtained when creating the Compact Credential.

You can make a similar request to a different endpoint to format a Semantic Compact Credential as a Google digital pass:

POST https://api.sovrin.one/v2/credentials/compact-semantic/digitalpass/google
{
"templateId": "6f1e20c2-f74b-4608-8dd3-3fa61d5defb6",
"payload": "CSS:/1/2KCE3IQEJB5DCMSMGZITM5QBE2QFSAOZUYAXQI3ENFSDU53FMI5GYZLBOJXC45TJNEXGC5JQGEXG2YLUORZC4Z3MN5RGC3AFDJSZE7YQMJ3GHI3IIBRW63TUMV4HJALYEZUHI5DQOM5C6L3XO53S45ZTFZXXEZZPGIYDCOBPMNZGKZDFNZ2GSYLMOMXXMMLEOR4XAZMCORLGK4TJMZUWCYTMMVBXEZLEMVXHI2LBNRYUG33VOJZWKICDOJSWIZLOORUWC3DRMNZGKZDFNZ2GSYLMKN2WE2TFMN2KMZDOMFWWK2SFNVWWCICUMFZW2YLEMNXWIZLGJBJS4MRXHBYWGZLSORUWM2LDMF2GS33OJZQW2ZLSK5XXE23JNZTSAYLUEBEGK2LHNB2HG4TDMVZHI2LGNFRWC5DJN5XEYZLWMVWGOTDFOZSWYIBUNJUXG43VMVZE4YLNMV4BQQLEOZQW4Y3FMQQFGYLGMV2HSICUOJQWS3TJNZTWMZLYOBUXE6LKGIYDENRNGAYS2MBRAQNGSVRXSA5AAAIAACRAEAADPB7GQ5DUOBZTULZPNRSWC4TOFZ3GS2JOMF2TAMJONVQXI5DSFZTWY33CMFWC6Y3POJSS65RSF5RXEZLEMVXHI2LBNRZS6Y3PNVYGCY3UFVZWK3LBNZ2GSYZPOJSXM33DMF2GS33OFVWGS43UOMXTCZTFGAYGINTDFU4TANDGFU2DSN3FFVRGEZJRFVQTGY3GMRRTAYRYGM3DQB6YIBIHRYMUS2CSCQSLQMKTL6Y6ZL3ICWCAUPGIGEOOWODF77V7ZJPVLGAQC2ZUP7MASXIRTIRRPOIIBKNHKZ4LHROPWBPBCYTKA3GXWIRD736HIJNQENTSFUYIPQ77BG4ZPCTXYIY"
}

Response

{
"redirectTo": "https://pay.google.com/gp/v/save/ejqEeFUtiFRF2t_0hXelmd1TDaeoPES091NT7LBiDvrmKpYPrOlhBfeSKOaA"
}
  • redirectTo: This is the URL where the digital pass is available to download.

Bad request (400) Errors may occur in the following scenarios:

  • Payload is not a string.

  • Payload does not match a Compact Credential profile.

  • Unable to validate or decode the payload.

  • Google account credentials are missing or incorrect

  • The template does not exist or is incorrectly defined.

  • The decoded payload doesn't include a required field in template.json.

What's next?

Now that you have the Compact or Semantic Credential formatted as a Google pass, you can share it with its intended holder. It can be downloaded and saved into a Google wallet, and presented digitally to a verifier.