Skip to content

Instantly share code, notes, and snippets.

@Snakeyyy
Created September 25, 2023 11:32
Show Gist options
  • Save Snakeyyy/915f99c6a2a357081b1dbea6f20a303c to your computer and use it in GitHub Desktop.
Save Snakeyyy/915f99c6a2a357081b1dbea6f20a303c to your computer and use it in GitHub Desktop.
PartnerJam - example of notifying PartnerJam about successfull installation of the app - Python/Django
def install_app_view(request):
# do your logic
shop = store_shop_data(request)
app_secret = '<secret>' # obtain this secret in the code example in PartnerJam dashboard
token = request.COOKIES.get("partner_jam_token")
requests.post(
"https://be-app.partnerjam.com/webhooks/installation-confirm/",
json={
"token": token,
"shopify_id": shop.shopify_id,
"shop_name": shop.shop_name,
"myshopify_domain": shop.myshopify_domain,
"pricing_plan": shop.plan,
"secret": app_secret,
"test": False, # set True for dry run (only for testing purposes)
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment