Skip to main content

User sync between Zuora Billing and Zephr

Zuora

User sync between Zuora Billing and Zephr

With the Zuora Billing extension enabled, you can synchronize Zuora users and Zephr user subscriptions to give Zephr users the appropriate grants. 

One Zephr User can contain multiple Zuora customer accounts, which helps with the situation where an end user has more than one account. 

Note: This functionality is intended for users who only use the user and subscription management module in Zephr, but don't use Zephr's payment forms.

To enable user sync, you need to use the Zephr Admin API to link a Zephr user with one or more Zuora customer accounts. Then, use the Zephr User Sync API to trigger the sync between Zuora and Zephr for a user.
You can also automate the user sync process for certain events by setting up callouts on the Zuora Billing side.

Link a Zephr account to a Zuora account

To link a Zephr user to a Zuora account, you need to use the Zuora customer account ID as the foreign key. One Zephr user can be linked to many Zuora accounts,  which means a Zephr user can have multiple Zuora accounts with multiple subscriptions. 

After an account is created in Zuora, you can use the Upsert Foreign Key Zephr Admin API to link it to a Zephr user by upserting a foreign key in the Zephr user foreign key table. 

The following is an example request: 

PUT REQUEST https://{tenantId}.api.zephr.com/v3/users/{zephr_user_id}/foreign-key/update/zuora_account_id

This request will create a new record in the `blaize_user_foreign_keys` data table with a provided foreign key as follows:
image1.png

  • user_id: This is a Zephr user ID.
  • foreign_key_system: This should always be `zuora_account_id`.
  • foreign_key: This is a Zuora account ID.

Trigger user sync

You can trigger the user sync by calling the following API:

POST REQUESThttps://{site}/zephr/subscriber/access/sync
{
 "external-customer-account" : {{zuora_account_id}}
}

external-customer-account: This accepts one of the Zephr user foreign keys (Zuora account ID), and the endpoint will look up a Zephr account with that foreign key and use that account to fetch all the foreign keys related to it. Then, the foreign keys (Zuora account IDs) found will be used to fetch all the Zuora subscriptions, subscription rate plans and subscription rate plan charges related to those account IDs and will be synched and used to issue the appropriate grants. 

Note: The sync endpoint requires a basic auth and can be configured in Zuora billing extension under Webhook Security Configuration. These configurations will also be used in Zuora Billing callout configuration.

image2.png

The response of the User Sync API will include a message and a status code. For example:

Synced successfully
Code: 200
Message: Synced successfully