---
title: "Creates a certificate for a product."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo merchant API › certificate

`POST /v1/stores/{store}/products/{product}/certificates`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `certificate:write`

## Path parameters

- `store` (`createCertificate.path.store`; string, required) — The store's id.
- `product` (`createCertificate.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1

## Header parameters

- `Idempotency-Key` (`createCertificate.header.Idempotency-Key`; string, optional) — Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.
  - minLength 1; maxLength 255; pattern `^[\x21-\x7E]+$`

## Request body

_Required._

- `headline_copy` (`createCertificate.headline_copy`; string, required)
  - minLength 1; maxLength 500
- `quiz` (`createCertificate.quiz`; any of, optional)
  - any of: `object`, `null`
- `title_copy` (`createCertificate.title_copy`; any of, optional)
  - any of: `string`, `null`
- `awarded_copy` (`createCertificate.awarded_copy`; any of, optional)
  - any of: `string`, `null`
- `reason_copy` (`createCertificate.reason_copy`; any of, optional)
  - any of: `string`, `null`
- `score_copy` (`createCertificate.score_copy`; any of, optional)
  - any of: `string`, `null`
- `out_of_score_copy` (`createCertificate.out_of_score_copy`; any of, optional)
  - any of: `string`, `null`
- `settings` (`createCertificate.settings`; object, optional)
  - `requires_passing` (`createCertificate.settings.requires_passing`; boolean, optional)
  - `earned_on` (`createCertificate.settings.earned_on`; any of, optional) — `completion` on a course, `attendance` (a check-in) on an event.
    - any of: `string`, `null`
  - `shows` (`createCertificate.settings.shows`; array<string>, optional)
    - one of `"date"`, `"score"`, `"qr_code"`
  - `template` (`createCertificate.settings.template`; string, optional)
    - one of `"classic"`, `"framed"`
  - `accent` (`createCertificate.settings.accent`; any of, optional) — Null clears it, so it prints in the store's color.
    - any of: `string`, `null`

## Example request

```json
{
  "quiz": {
    "id": "string"
  },
  "headline_copy": "string",
  "title_copy": "string",
  "awarded_copy": "string",
  "reason_copy": "string",
  "score_copy": "string",
  "out_of_score_copy": "string",
  "settings": {
    "requires_passing": true,
    "earned_on": "completion",
    "shows": [
      "date"
    ],
    "template": "classic",
    "accent": "emerald"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/certificates' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "quiz": {
    "id": "string"
  },
  "headline_copy": "string",
  "title_copy": "string",
  "awarded_copy": "string",
  "reason_copy": "string",
  "score_copy": "string",
  "out_of_score_copy": "string",
  "settings": {
    "requires_passing": true,
    "earned_on": "completion",
    "shows": [
      "date"
    ],
    "template": "classic",
    "accent": "emerald"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/certificates';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    quiz: {id: 'string'},
    headline_copy: 'string',
    title_copy: 'string',
    awarded_copy: 'string',
    reason_copy: 'string',
    score_copy: 'string',
    out_of_score_copy: 'string',
    settings: {
      requires_passing: true,
      earned_on: 'completion',
      shows: ['date'],
      template: 'classic',
      accent: 'emerald'
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/merchant/v1/stores/<store>/products/<product>/certificates"

payload = {
    "quiz": { "id": "string" },
    "headline_copy": "string",
    "title_copy": "string",
    "awarded_copy": "string",
    "reason_copy": "string",
    "score_copy": "string",
    "out_of_score_copy": "string",
    "settings": {
        "requires_passing": True,
        "earned_on": "completion",
        "shows": ["date"],
        "template": "classic",
        "accent": "emerald"
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 201

Creates a certificate for a product.

#### Example

```json
{
  "logo": {
    "attachment_id": "string",
    "asset_id": "string"
  },
  "issued": 0,
  "id": "string",
  "product_id": "string",
  "quiz_id": "string",
  "headline_copy": "string",
  "title_copy": "string",
  "awarded_copy": "string",
  "reason_copy": "string",
  "score_copy": "string",
  "out_of_score_copy": "string",
  "settings": {
    "template": "string",
    "accent": "string",
    "requires_passing": true,
    "earned_on": "string",
    "shows": [
      "string"
    ]
  },
  "created_at": "string"
}
```

- `logo` (`createCertificate.response.201.logo`; any of, required)
  - any of: `object`, `null`
- `issued` (`createCertificate.response.201.issued`; number, required)
- `id` (`createCertificate.response.201.id`; string, required)
- `product_id` (`createCertificate.response.201.product_id`; string, required)
- `quiz_id` (`createCertificate.response.201.quiz_id`; any of, required)
  - any of: `string`, `null`
- `headline_copy` (`createCertificate.response.201.headline_copy`; string, required)
- `title_copy` (`createCertificate.response.201.title_copy`; any of, required)
  - any of: `string`, `null`
- `awarded_copy` (`createCertificate.response.201.awarded_copy`; any of, required)
  - any of: `string`, `null`
- `reason_copy` (`createCertificate.response.201.reason_copy`; any of, required)
  - any of: `string`, `null`
- `score_copy` (`createCertificate.response.201.score_copy`; any of, required)
  - any of: `string`, `null`
- `out_of_score_copy` (`createCertificate.response.201.out_of_score_copy`; any of, required)
  - any of: `string`, `null`
- `settings` (`createCertificate.response.201.settings`; object, required)
  - `template` (`createCertificate.response.201.settings.template`; string, required)
  - `accent` (`createCertificate.response.201.settings.accent`; any of, required)
    - any of: `string`, `null`
  - `requires_passing` (`createCertificate.response.201.settings.requires_passing`; boolean, optional) — Earned by passing the quiz, not by merely finishing it.
  - `earned_on` (`createCertificate.response.201.settings.earned_on`; string, optional) — Set on a certificate no quiz awards: finishing every entry of a course, or a check-in at an event, earns it; losing its quiz never makes one.
  - `shows` (`createCertificate.response.201.settings.shows`; array<string>, optional)
- `created_at` (`createCertificate.response.201.created_at`; any of, required)
  - any of: `string`, `null`

### default

A problem; see https://api.sherpo.io/merchant/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`createCertificate.response.default.type`; string, required)
  - format `uri`
- `title` (`createCertificate.response.default.title`; string, required)
- `status` (`createCertificate.response.default.status`; integer, required)
- `detail` (`createCertificate.response.default.detail`; string, required)
- `code` (`createCertificate.response.default.code`; string, optional)
- `context` (`createCertificate.response.default.context`; object, optional)
- `reached_core` (`createCertificate.response.default.reached_core`; boolean, optional)
- `core_answer` (`createCertificate.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/merchant-api/reference/create-certificate/index.md
