-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproducts_create_monthly_fixed_fee.py
More file actions
46 lines (36 loc) · 1.16 KB
/
Copy pathproducts_create_monthly_fixed_fee.py
File metadata and controls
46 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# coding=utf-8
import os
from corehttp.credentials import ServiceKeyCredential
from credytapi import CredytApiClient
"""
# PREREQUISITES
pip install credyt-api
# USAGE
python products_create_monthly_fixed_fee.py
Before run the sample, please set environment variables AZURE_KEY with real value
which can access your service
"""
def main():
client = CredytApiClient(
credential=ServiceKeyCredential(key=os.getenv("CREDYT_API_KEY")),
)
response = client.products.create(
body={
"code": "glitch_pro",
"name": "Glitch Pro Subscription",
"prices": [
{
"billing_model": {"recurring": {"interval": "month"}, "type": "recurring"},
"id": "prc_4asvwjbgbypk6d9z3xp95ttrc8",
"name": "Monthly Subscription",
"pricing": [{"asset": "USD", "values": [{"unit_price": 20}]}],
"type": "fixed",
}
],
"publish": True,
},
)
print(response)
# x-ms-original-file: next/Products_create_Monthly_Fixed_Fee.json
if __name__ == "__main__":
main()