what i wanna do is make the order paid in my shopify store
i am going to explain what i am doing step by step
1- First i am creating a draft order using this payload
POST /admin/api/2023-10/draft_orders.json
and this is the payload
{
"draft_order": {
"created_at": "2024-03-14T09:08:10+03:00",
"currency": "IQD",
"financial_status": "pending",
"fulfillment_status": null,
"note": null,
"payment_gateway_names": ["Cash on Delivery (COD)"],
"phone": "+9647787654321",
"presentment_currency": "IQD",
"inventory_behaviour": "decrement_obeying_policy",
"total_shipping_price_set": {
"shop_money": { "amount": "7000", "currency_code": "IQD" },
"presentment_money": { "amount": "7000", "currency_code": "IQD" }
},
"tags": "",
"updated_at": "2024-03-14T09:08:10+03:00",
"billing_address": {
"first_name": "testOmar",
"address1": "test",
"phone": "+9647787654321",
"city": "\u0623\u0631\u0628\u064a\u0644",
"zip": null,
"province": null,
"country": "Iraq",
"last_name": null,
"address2": null,
"company": null,
"latitude": null,
"longitude": null,
"name": "testOmar",
"country_code": "IQ",
"province_code": null
},
"customer": {
"email": null,
"accepts_marketing": true,
"phone": "+9647787654321",
"created_at": "\u0623\u0631\u0628\u064a\u0644",
"updated_at": null,
"first_name": "testOmar",
"last_name": null,
"state": null,
"note": null,
"verified_email": null,
"multipass_identifier": null,
"tax_exempt": null,
"email_marketing_consent": null,
"tags": "IQ",
"id": "7960910299427"
},
"fulfillments": [],
"shipping_address": {
"first_name": "testOmar",
"address1": "test",
"phone": "+9647712345678",
"city": "\u0623\u0631\u0628\u064a\u0644",
"zip": null,
"province": null,
"country": "Iraq",
"last_name": null,
"address2": null,
"company": null,
"latitude": null,
"longitude": null,
"name": "testOmar",
"country_code": "IQ",
"province_code": null
},
"shipping_line": {
"carrier_identifier": "ff434226b7f91094b637c1285b845417",
"code": "\u062a\u0643\u0644\u0641\u0629 \u0627\u0644\u062a\u0648\u0635\u064a\u0644 \u0644\u0644\u0645\u062d\u0627\u0641\u0638\u0627\u062a_1",
"discounted_price": "7000",
"discounted_price_set": {
"shop_money": { "amount": "7000", "currency_code": "IQ" },
"presentment_money": { "amount": "7000", "currency_code": "IQ" }
},
"phone": "+9647712345678",
"price": "7000",
"source": "Shipping Rates - LogBase",
"title": "\u062a\u0643\u0644\u0641\u0629 \u0627\u0644\u062a\u0648\u0635\u064a\u0644 \u0644\u0644\u0645\u062d\u0627\u0641\u0638\u0627\u062a"
},
"applied_discount": {
"description": "omar",
"value_type": "fixed_amount",
"value": 0.01,
"amount": 0.01,
"title": "omar"
},
"line_items": [
{
"fulfillable_quantity": 1,
"fulfillment_service": "manual",
"fulfillment_status": null,
"gift_card": false,
"grams": 0,
"name": "Whitening Roll-on Men-Allure - 60ml | | \u062f\u064a\u0648\u062f\u0648\u0631\u0627\u0646 \u0631\u0648\u0644 \u0627\u0648\u0646 \u0644\u0644\u0631\u062c\u0627\u0644 - 60 \u0645\u0644",
"price": "12500.000",
"product_exists": true,
"product_id": "8839309492515",
"quantity": 1,
"requires_shipping": true,
"sku": "5287001018608",
"title": "Whitening Roll-on Men-Allure - 60ml | | \u062f\u064a\u0648\u062f\u0648\u0631\u0627\u0646 \u0631\u0648\u0644 \u0627\u0648\u0646 \u0644\u0644\u0631\u062c\u0627\u0644 - 60 \u0645\u0644",
"total_discount": 0,
"variant_id": "46994067063075",
"variant_inventory_management": "shopify",
"vendor": "Correction",
"applied_discount": {
"description": "omar",
"value_type": "percentage",
"value": 7,
"title": "omar"
}
}
],
"discount_codes": [
{ "code": "omar", "amount": 7.000000000000001, "type": "percentage" }
]
}
}
2- second i am completing the order using this api
PUT /admin/api/2023-04/draft_orders/DRAFT_ORDER_ID/complete.json
3- now i wanna make a transaction using this api
POST /admin/api/2023-04/orders/{order_id}/transactions.json
and the payload should be like this
{
"transaction": {
"kind": "sale",
"status": "success",
"amount": "IQD19,500.000",
"currency": "IQD",
"gateway": "manual"
}
}
what i need more is the parent_id based on the shopify docs
https://shopify.dev/docs/api/admin-rest/2023-04/resources/transaction#post-orders-order-id-transactions
how can i get it ?