Initial commit
This commit is contained in:
31
testing.py
Normal file
31
testing.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import requests
|
||||
|
||||
SHOP = "cx0du9-sq.myshopify.com"
|
||||
TOKEN = "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" # sizda bor token
|
||||
VERSION = "2026-01"
|
||||
|
||||
|
||||
def mark_order_paid(order_id, amount):
|
||||
url = f"https://{SHOP}/admin/api/{VERSION}/orders/{order_id}/transactions.json"
|
||||
|
||||
payload = {
|
||||
"transaction": {
|
||||
"kind": "sale",
|
||||
"source": "external",
|
||||
"amount": amount
|
||||
}
|
||||
}
|
||||
|
||||
r = requests.post(
|
||||
url,
|
||||
headers={
|
||||
"X-Shopify-Access-Token": TOKEN,
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
json=payload
|
||||
)
|
||||
|
||||
print(r.status_code, r.text)
|
||||
|
||||
|
||||
mark_order_paid("1254611222844", 600000)
|
||||
Reference in New Issue
Block a user