File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
official/guides/embeddables-guide Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import os
22import requests
33from flask import Flask , jsonify
4-
54app = Flask (__name__ )
6-
75EASYPOST_API_KEY = os .environ .get ("EASYPOST_API_KEY" , "" )
86
97
108@app .route ("/api/easypost-embeddables/session" , methods = ["GET" ])
119def create_embeddable_session ():
12- payload = {"user_id" : "SUB_ACCOUNT_USER_ID" , "origin_host" : "ORIGIN_HOST" }
10+ payload = {
11+ "user_id" : "SUB_ACCOUNT_USER_ID" , # Replace with sub-account user ID
12+ "origin_host" : "ORIGIN_HOST" , # Replace with integrator's domain
13+ }
1314
1415 response = requests .post (
1516 "https://api.easypost.com/v2/embeddables/session" ,
@@ -18,7 +19,6 @@ def create_embeddable_session():
1819 headers = {"Content-Type" : "application/json" },
1920 timeout = 10 ,
2021 )
21-
2222 response .raise_for_status ()
2323 return jsonify (response .json ())
2424
You can’t perform that action at this time.
0 commit comments