Set up your PostGrid API Keys

PostGrid - Configuration

PostGrid provides address autocomplete and address verification for the United States, Canada and international addresses. This article explains which PostGrid keys you need and how to enter them in Address Validation for Dataverse.

Before you start

  • A PostGrid account with address verification enabled.
  • An Address Validation license that includes the PostGrid add-on. Without it, PostGrid is not offered as a Validation Service Type.

You need two keys

PostGrid issues two kinds of API keys, and Address Validation uses both:

KeyStarts withUsed byWhy
Public keylive_pk_ (or test_pk_)The PostGrid autocomplete control on your formsThe control runs in the user's browser, so it must use a public key. Public keys only work from web addresses (origins) you register in PostGrid.
Secret keylive_sk_ (or test_sk_)Workflows and Power Automate actionsVerification runs on the server, where a public key is rejected. A secret key must never be used in the browser.

Each API Configuration record holds one key, so you create two API Configuration records if you use both autocomplete and verification.

Test keys (test_) do not use any lookups but return sample data. Use them to build and test your configuration, and switch to live keys to check real results.

Step 1: Get your keys from PostGrid

  1. Sign in to your PostGrid dashboard and open the API keys page for address verification.
  2. Copy your public key and your secret key.
  3. For the public key, add your Dataverse environment URL to its allowed origins, for example https://contoso.crm.dynamics.com. PostGrid also accepts a wildcard for one level, such as https://*.crm.dynamics.com, which covers every environment in that region.

Step 2: Create the API Configuration records

  1. In the Address Validation for Power Apps app, go to Settings > API Configuration.
  2. Create a record for the autocomplete control:
    • API Configuration Name: a unique name, for example PostGrid Autocomplete.
    • Validation Service Type: PostGrid API.
    • Service License Key: your public key.
  3. Create a second record for verification:
    • API Configuration Name: for example PostGrid Verify.
    • Validation Service Type: PostGrid API.
    • Service License Key: your secret key.
  4. Save each record. To log each PostGrid call, set Save Transaction Logs to Yes; the details appear in Logs, under the Resources area.

Costs and limits

  • PostGrid bills per lookup. In the autocomplete control, suggestions shown while typing are free; one lookup is used when the user selects an address.
  • Each verification uses one lookup, plus one more when geocoding (latitude and longitude) is requested. Geocoding is off by default and must also be enabled on your PostGrid account by PostGrid support.
  • PostGrid limits address requests to 5 per second for your whole organization. Large numbers of concurrent workflows or flows can reach this limit.

Troubleshooting

SymptomWhat to check
The autocomplete control shows an origin or access errorThe control's API Configuration must hold the public key, and your environment URL must be in the key's allowed origins.
A workflow or flow reports that PostGrid rejected the key because of its allowed-origins restrictionThe verification API Configuration holds a public key. Use the secret key.
HTTP 403 with no origin messageYour PostGrid lookups are used up. Check your remaining balance in the PostGrid dashboard.
PostGrid API is not offered as a Validation Service TypeYour Address Validation license does not include the PostGrid add-on. Update your license or contact support@sharpxrm.com.

Next steps

Was this article helpful?