CredentialOrderV1
Issues a new Credential for a person based on a Credential Template.
When to use
Call this after fetching your Template ID and required fields from CredentialTemplatesV2. On success the Credential is created and follows the Tenant's configured production flow — no further call is needed. See status for what happens next.
Required roles
user
All requests must be authenticated — see Authentication.
Operation
mutation OrderCredential($credential: CredentialOrderInput!, $tenantId: ID, $userId: ID) {
CredentialOrderV1(
credential: $credential
tenantId: $tenantId
userId: $userId
) {
_id
credential_number
status
created
}
}
Arguments
Top-level
| Name | Type | Required | Description |
|---|---|---|---|
credential | CredentialOrderInput! | Yes | The Credential data. See CredentialOrderInput below. |
tenantId | ID | No | Issue the Credential under a specific Tenant. Defaults to the API user's primary Tenant. The API user must have access to that Tenant. |
userId | ID | No | Issue the Credential on behalf of another user. That user must have allow_api enabled in Breeze. |
CredentialOrderInput
| Name | Type | Required | Description |
|---|---|---|---|
template_id | ID! | Yes | ID of the Credential Template to use. Get this from CredentialTemplatesV2. |
data | [CredentialOrderDataFieldInput]! | Yes | Array of field values. One entry per field. See CredentialOrderDataFieldInput below. |
external_id | String | No | Your system's identifier for this Credential. Stored on the Credential and available in lookups. |
order_reference | String | No | Reference string added to the invoice for this order. |
object_id | ID | No | Links the Credential to an existing object in Breeze. |
quantity | Int | No | Number of Credentials to order. Only valid for batch-type Templates. Defaults to 1. |
CredentialOrderDataFieldInput
Each entry in data provides a value for one field. Use exactly one value key matching the field's field_type.
| Name | Type | Required | Description |
|---|---|---|---|
data_field | String! | Yes | Field name. Must match a name from all_used_fields on the Template. |
string_value | String | No | Use when field_type is string. |
number_value | Int | No | Use when field_type is number. |
bool_value | Boolean | No | Use when field_type is boolean. |
date_value | Date | No | Use when field_type is date. ISO 8601 format: 2035-12-31T12:00:00.000Z. |
base64_value | String | No | Use when field_type is buffer. Base64-encoded image string. Max 5 MB. |
url_value | String | No | Use when field_type is buffer. Publicly accessible image URL. The server downloads and stores the image. Max 5 MB. |
Only fields where manual_input: true need to be included. Fields where manual_input: false are populated automatically by the system — values you provide for them are ignored, with one exception: image fields such as personPhoto1 accept base64_value or url_value even though they are not manual input. See Data fields for the full field list and the image exception.
Response
| Field | Type | Description |
|---|---|---|
_id | ID | The Credential's unique ID. Use this to look up or reference the Credential later. |
credential_number | Int | Human-readable Credential number visible in the Breeze UI. May be null if the Template does not assign a number at order time. |
status | String | Status immediately after ordering — depends on the Tenant's checkout-flow configuration. See below. |
created | Date | ISO 8601 timestamp of when the order was placed. |
Status values
| Status | Meaning |
|---|---|
in_queue | Sent directly to the production queue (On-the-Fly checkout flow). |
requested | Added to the Tenant's order and checkout process (Default or Scheduled checkout flow). |
waiting_for_approval | An approver must approve the Credential before it moves to production. |
Which status you get depends on how the Tenant's checkout flow and approval rules are configured — ask the Tenant administrator which flow applies. No further API call is needed in any case; the Credential proceeds through the configured flow automatically.
Example
- Request
- Success
- Error
mutation OrderCredential($credential: CredentialOrderInput!) {
CredentialOrderV1(credential: $credential) {
_id
credential_number
status
created
}
}
Variables:
{
"credential": {
"template_id": "template_card123",
"external_id": "EMP-00412",
"data": [
{ "data_field": "personFirstName", "string_value": "Jane" },
{ "data_field": "personLastName", "string_value": "Smith" },
{ "data_field": "cardValidUntilDate", "date_value": "2029-12-31T12:00:00.000Z" },
{ "data_field": "personPhoto1", "url_value": "https://hr.example.com/photos/jane_smith.jpg" }
]
}
}
{
"data": {
"CredentialOrderV1": {
"_id": "cred_abc123",
"credential_number": 1042,
"status": "in_queue",
"created": "2026-05-27T10:14:22.000Z"
}
}
}
{
"errors": [
{
"message": "Field 'cardValidUntilDate' expects a date value",
"extensions": { "code": "BAD_USER_INPUT" }
}
],
"data": null
}
Error cases
| Code | Cause | Resolution |
|---|---|---|
UNAUTHENTICATED | Token missing or expired | Request a new token — see Authentication |
FORBIDDEN | No access to the target Tenant, or userId does not have allow_api enabled | Verify the Tenant is within your API user's scope; confirm the target user has API access enabled in Breeze |
BAD_USER_INPUT | Invalid template_id, missing required field, wrong value type for a field, or image URL unreachable | Check message for the specific field; verify field names and types against Data fields; confirm image URLs are publicly accessible |
NOT_FOUND | Template not found or not accessible to the Tenant | Verify template_id using CredentialTemplatesV2 |
See also
- Order a Credential — use-case guide
CredentialTemplatesV2- Data fields