31 lines
673 B
Python
31 lines
673 B
Python
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) |