---
title: "\u062f\u0631\u062c \u0633\u0646\u062f \u0627\u0632 \u0637\u0631\u06cc\u0642 API"
space: "\u0645\u0633\u062a\u0646\u062f\u0627\u062a \u0641\u0627\u0631\u0633\u06cc Frappe"
url: "https://docs.didegan.cloud/fa/framework/user/en/guides/app-development/insert-a-document-via-api"
updated: "2026-11-28"
---


می‌توانید با استفاده از متد `frappe.get_doc`، از طریق اسکریپت سند درج کنید.

### نمونه‌ها

#### 1. درج یک لیست انجام کار

```python
todo = frappe.get_doc({"doctype": "ToDo", "description": "test"})
todo.insert()
```

---

#### 2. درج بدون بررسی مجوزهای کاربر

```python
todo = frappe.get_doc({"doctype": "ToDo", "description": "test"})
todo.insert(ignore_permissions = True)
```

---

#### 3. ارسال سند پس از درج

```python
todo = frappe.get_doc({"doctype": "ToDo", "description": "test"})
todo.insert(ignore_permissions = True)
todo.submit()
```

---

#### 4. درج سند هنگام ذخیرهٔ سند دیگر

```python
class MyType(Document):
    def on_update(self):
        todo = frappe.get_doc({"doctype": "ToDo", "description": "test"})
        todo.insert()
```

---

#### 5. درج سند دارای جدول‌های فرزند

```python
sales_order = frappe.get_doc({
    "doctype": "Sales Order",
    "company": "_Test Company",
    "customer": "_Test Customer",
    "delivery_date": "2013-02-23",
    "sales_order_details": [
        {
            "item_code": "_Test Item Home Desktop 100",
            "qty": 10.0,
            "rate": 100.0,
            "warehouse": "_Test Warehouse - _TC"
        }
    ]
})
sales_order.insert()
```

---

**منبع:** [درج سند از طریق API](https://docs.frappe.io/framework/user/en/guides/app-development/insert-a-document-via-api). این صفحه ترجمهٔ غیررسمی است. محتوای نوشتاری تحت شرایط CC BY-SA منتشر شده و این ترجمه نیز با انتساب به منبع بازنشر می‌شود.


