Learn how to authenticate and use the Marketplace API to set up your integration server for the base URL.
When a customer uses your integration, the following two APIs are used for interaction and communication between the user, Vercel and the provider integration:
- Vercel calls the provider API
- The provider calls the Vercel API
Review Native Integration Concepts and Native Integration Flows to learn more.
This authentication uses the OpenID Connect Protocol (OIDC). Vercel sends a JSON web token (JWT) signed with Vercel’s private key and verifiable using Vercel’s public JSON Web Key Sets (JWKS) available here.
User Auth OIDC token claims schema:
account_idstringRequired audstringRequired The ID of the target integration. Example: "oac_9f4YG9JFjgKkRlxoaaGG0y05" installation_idstringRequired The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" issstringRequired One of: https://marketplace.vercel.com
substringRequired Denotes the User who is making the change (matches /^account:[0-9a-fA-F]+:user:[0-9a-fA-F]+$/
)user_avatar_urlstring The user's public avatar URL user_emailstring The user's email address. For this property to have a value, your Marketplace integration must be opted in. Please reach out to Vercel Support to request access. Without access, this property will be undefined. user_idstringRequired user_namestring The user's real name user_rolestringRequired One of: ADMIN
|USER
This authentication uses the OpenID Connect Protocol (OIDC). Vercel sends a JSON web token (JWT) signed with Vercel’s private key and verifiable using Vercel’s public JSON Web Key Sets (JWKS) available here.
System Auth OIDC token claims schema:
account_idstringRequired audstringRequired The ID of the target integration. Example: "oac_9f4YG9JFjgKkRlxoaaGG0y05" installation_idstring or nullRequired The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" issstringRequired One of: https://marketplace.vercel.com
substringRequired Denotes the Account (or Team) who is making the change (matches /^account:[0-9a-fA-F]+$/
), possibly null
- Authorization URL:
https://api.vercel.com/oauth/authorize
- Token URL:
https://api.vercel.com/oauth/access_token
The integration provider can initiate the SSO process from their side. This helps to streamline the authentication process for users coming from the provider's platform and provides security when a user attempts to access a resource managed by a Vercel Marketplace integration.
To initiate SSO, an integration provider needs to construct a URL using the following format:
https://vercel.com/sso/integrations/{URLSlug}/{installationId}?{query}
Where:
URLSlug
: The unique identifier for your integration in the Vercel Integrations MarketplaceinstallationId
: The ID of the specific installation for the userquery
: Optional query parameters to include additional information
Example
Let's say you have an AWS integration with the following details:
URLSlug
:aws-marketplace-integration-demo
installationId
:icfg_PSFtkFqr5djKRtOkNtOHIfSd
- Additional parameter:
resource_id=123456
The constructed URL would look like this:
https://vercel.com/sso/integrations/aws-marketplace-integration-demo/icfg_PSFtkFqr5djKRtOkNtOHIfSd?resource_id=123456
Flow
- The provider constructs and redirects the user to the SSO URL
- Vercel validates the SSO request and confirms user access
- Upon successful validation, Vercel initiates an SSO redirect back to the provider
- The user gains authenticated access to the requested resource
/v1/integrations/sso/token
code
parameter. The provider then calls the SSO Token Exchange endpoint with the sent code and receives the OIDC token. They log the user in based on this token and redirects the user back to the Vercel account using deep-link parameters included the redirectLoginUrl. This is used to verify the identity of the user during the Open in Provider flow. Providers should not persist the returned id_token
in a database since the token will expire.access_tokenRequired id_tokenstringRequired token_typeRequired
/v1/installations/{installationId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
The installation was created successfully
billingPlanobject The billing plan for the installation. If not set, the installation is billed on resource level.
/v1/installations/{installationId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
The installation
billingPlanobject The billing plan for the installation. If not set, the installation is billed on resource level.
/v1/installations/{installationId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
The installation was updated successfully
billingPlanobject The billing plan for the installation. If not set, the installation is billed on resource level.
/v1/installations/{installationId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
Installation deleted successfully
finalizedboolean If true, the installation will be removed immediately. Otherwise, the installation will stay in the "delete pending" state for 12 hours awaiting for finalizing invoice(s).
/v1/installations/{installationId}/resources
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
Return the newly provisioned resource
billingPlanobject The billing plan for the resource. If not set, the resource is billed on installation level. idstringRequired The partner-specific ID of the resource metadataobjectRequired User-inputted metadata based on the registered metadata schema. namestringRequired User-inputted name for the resource. notificationobject Resource's active notification. Example: { "level": "warn", "title": "Database is nearing maximum planned size" } productIdstringRequired The partner-specific ID/slug of the product. Example: "redis" secretsarrayRequired statusstringRequired One of: ready
|pending
|suspended
|resumed
|uninstalled
|error
/v1/installations/{installationId}/resources
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
Return a list of Resources for a given Installation
resourcesarrayRequired
/v1/installations/{installationId}/resources/{resourceId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
resourceId | Partner-provided resource ID | string |
Return the resource
billingPlanobject The billing plan for the resource. If not set, the resource is billed on installation level. idstringRequired The partner-specific ID of the resource metadataobjectRequired User-inputted metadata based on the registered metadata schema. namestringRequired User-inputted name for the resource. notificationobject Resource's active notification. Example: { "level": "warn", "title": "Database is nearing maximum planned size" } productIdstringRequired The partner-specific ID/slug of the product. Example: "redis" statusstringRequired One of: ready
|pending
|suspended
|resumed
|uninstalled
|error
/v1/installations/{installationId}/resources/{resourceId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
resourceId | Partner-provided resource ID | string |
Return the updated resource
billingPlanobject The billing plan for the resource. If not set, the resource is billed on installation level. idstringRequired The partner-specific ID of the resource metadataobjectRequired User-inputted metadata based on the registered metadata schema. namestringRequired User-inputted name for the resource. notificationobject Resource's active notification. Example: { "level": "warn", "title": "Database is nearing maximum planned size" } productIdstringRequired The partner-specific ID/slug of the product. Example: "redis" statusstringRequired One of: ready
|pending
|suspended
|resumed
|uninstalled
|error
/v1/installations/{installationId}/resources/{resourceId}
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
resourceId | Partner-provided resource ID | string |
Resource deleted successfully
No content
/v1/installations/{installationId}/resources/{resourceId}/repl
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
resourceId | Partner-provided resource ID | string |
Return result of running REPL command
array
/v1/products/{productSlug}/plans
Vercel sends a request to the partner to return quotes for different billing plans for a specific Product.
Note: You can have this request triggered by Vercel before the integration is installed when the Product is created for the first time. In this case, OIDC will be incomplete and will not contain an account ID.
Name | Description | Type |
---|---|---|
productSlug | The partner-specific ID/slug of the product. Example: "redis" | string |
Return a list of billing plans
plansarrayRequired
/v1/installations/{installationId}/resources/{resourceId}/plans
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
resourceId | Partner-provided resource ID | string |
Return a list of billing plans for a resource
plansarrayRequired
/v1/installations/{installationId}/plans
Name | Description | Type |
---|---|---|
installationId | The ID of target installation. Example: "icfg_9bceb8ccT32d3U417ezb5c8p" | string |
Return a list of billing plans for an installation
plansarrayRequired
/v1/installations/{integrationConfigurationId}/account
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
contactobject or nullRequired namestring urlstringRequired
/v1/installations/{integrationConfigurationId}/member/{memberId}
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
memberId | None | string |
idstringRequired rolestringRequired One of: ADMIN
|USER
/v1/installations/{integrationConfigurationId}/events
list-resources
and other read APIs to get the new state. resource.updated
event should be dispatched when any state of a resource linked to Vercel is modified by the partner. Use cases:
- The user renames a database in the partner’s application. The partner should dispatch a
resource.updated
event to notify Vercel to update the resource in Vercel’s datastores. Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
No content
/v1/installations/{integrationConfigurationId}/billing
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
No content
/v1/installations/{integrationConfigurationId}/billing/invoices
There are several limitations to the invoice submission:
1. A resource can only be billed once per the billing period and the billing plan.
2. The billing plan used to bill the resource must have been active for this resource during the billing period.
3. The billing plan used must be a subscription plan.
4. The interim usage data must be sent hourly for all types of subscriptions. See Send subscription billing and usage data API on how to send interim billing and usage data.
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
invoiceIdstring testboolean validationErrorsarray
/v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}
See Billing Events with Webhooks documentation on how to receive invoice events. This endpoint is used to retrieve the invoice details.
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
invoiceId | None | string |
createdstringRequired discountsarray externalIdstring invoiceDatestringRequired invoiceIdstringRequired itemsarrayRequired memostring periodobjectRequired refundReasonstring refundTotalstring statestringRequired One of: pending
|scheduled
|invoiced
|paid
|notpaid
|refund_requested
|refunded
testbooleanRequired totalstringRequired updatedstringRequired
/v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}/actions
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
invoiceId | None | string |
No content
/v1/installations/{integrationConfigurationId}/products/{integrationProductIdOrSlug}/resources/{resourceId}/secrets
Use cases for this endpoint:
- Resetting the credentials of a database in the partner. If the user requests the credentials to be updated in the partner’s application, the partner post the new set of secrets to Vercel, the user should redeploy their application and the expire the old credentials.
Name | Description | Type |
---|---|---|
integrationConfigurationId | None | string |
integrationProductIdOrSlug | None | string |
resourceId | None | string |
No content
- Receive billing events with webhooks
You can receive the following events:
marketplace.invoice.created
: the invoice was created and sent to the customermarketplace.invoice.paid
: the invoice was paidmarketplace.invoice.notpaid
: the invoice was not paid after a grace period- You can then take the appropriate action, such as suspending the resource
- 2024-10-08: "Provision Resource" now passes through the
externalId
property from theexternal-id
query parameter in the Deploy Button flow. - 2024-10-04: "Upsert Installation" and "Update Installation" APIs now allow returning
{billingPlan: BillingPlan}
in the response. This is useful for installation level billing. - 2024-09-06: "Delete Installation" API can optionally return
{finalized: true}
to signal that the installation can be removed immediately. Otherwise, the installation will wait for up to 12hr for any pending billing data to be submitted. - 2024-08-27: Removed
BillingPlan.maxResources
field. - 2024-08-20: Added
AccountInfo.url
field to the "Get Account Information" API. - 2024-08-16: "Get Member Information" API.
- 2024-08-16: Documentation for API error responses (e.g. 400, 403) added.
- 2024-08-15: Added "Get Installation" and "List Billing Plans for Installation" API for installation-level billing. Added
BillingPlan.scope
attribute that determines installation or resource level billing for a billing plan. - 2024-08-14: "Submit Invoice" and "Submit Billing Data" APIs no longer require
resourceId
for each item. - 2024-08-14: "Submit Invoice" and "Submit Billing Data" APIs accept
discounts
fields. - 2024-08-13:
Resource.billingPlan
is no longer required when the integration has installation-level billing enabled. If installation-level billing is not enabled in the Integration Console and this property is missing, the response will be treated as an error. - 2024-08-09: Added the
user_email
to the User Authentication JWT claims. - 2024-07-24: Added
REPL
endpoint. - 2024-07-09: Removed
BillingPlan.requiredPolicies?
andProvisionResourceRequest.acceptedPolicies
fields until further notice. The only policies required/accepted for now are for theInstallIntegrationRequest
. - 2024-07-01:
Resource.notification
field for an optional active resource notification. - 2024-07-01:
BillingPlan.quote
field is replaced with more genericBillingPlan.details
andBillingPlan.cost
fields. - 2024-07-01:
BillingPlan.paymentMethodRequired
field as added to indicate free plans. - 2024-06-16: The "Refund Invoice" API.
- 2024-06-03: The "Submit Invoice" and "Get Invoice" APIs.
- 2024-06-03: The negative amount statement for the
BillingItem
in the "Send invoice billing and usage data" endpoint is removed as not correct. - 2024-05-30: The Vercel API routes using the
/v1/integrations/marketplace/installations
namespace were shortened to/v1/installations
. The old, longer namespaced routes will continue to work as expected. - 2024-05-23:
BillingPlan.type
value of "invoice" has been changed to "subscription". - 2024-05-21:
Resource.billingPlan
type has been changed from string (for a plan ID) to aBillingPlan
structure with the complete plan information.billingPlan: string
for a plan ID has been changed tobillingPlanId: string
for consistency. - 2024-05-21:
BillingPlan.maxProducts
has been renamed tomaxResources
.
Was this helpful?