# A blank draft's template

Source: https://amanucci.com/docs/developers/api/documents/getDocumentTemplate

## GET /v1/entities/{entityId}/document-template

A blank draft's template

A blank draft of `kind`, painted: today's issue date, a due date the customer's payment term away (else the entity's), a quote's validity, the customer's name as the reference, the entity's first language and the customer's own as the second when it differs, the entity's terms sentence, and the paper the draft would print. With `from`, the source's party, currency, reference, languages, lines and discounts, each line under a fresh id. Writes nothing. A `from` or `partyId` of another entity is the 404 one that does not exist is.

Operation ID: `getDocumentTemplate`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid",
      "description": "The document the new one derives from: a credit note's invoice, an invoice's quote."
    },
    "required": false,
    "description": "The document the new one derives from: a credit note's invoice, an invoice's quote.",
    "name": "from",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "enum": [
        "quote",
        "invoice",
        "credit_note"
      ]
    },
    "required": true,
    "name": "kind",
    "in": "query"
  },
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": false,
    "name": "partyId",
    "in": "query"
  }
]
```

### Responses

#### 200 The blank draft and its paper.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/DocumentTemplate"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
