---
title: "Crear oferta de credencial"
---

> Documentation Index
> Fetch the complete documentation index at: https://sovra-id-docs-1044960690985.us-central1.run.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Crear oferta de credencial

Path: Sovra ID API › Credenciales

`POST /api/v1/issuer/credential-offer`

URL: `https://test-api-sovra.flagonsa.com/api/v1/issuer/credential-offer`

Crea una oferta OID4VCI pre-autorizada.

`schema_id` es el slug del esquema (no su UUID); se usa siempre su última versión. `claims` se preasocian a la oferta y se copian en la credencial cuando el holder la canjea.

La respuesta trae `credential_id` (identificador estable de todo el ciclo de vida), `offer_uri` (para el QR), `expires_at` (24 h) y `credential` (vista previa **sin firmar**).

El SD-JWT firmado llega después, en el webhook `credential.issued`.

Rate limit: 120 req/min por API key.

## Authentication

- `apiKey`, http bearer, header `Authorization`

## Request body

_Required._

- `schema_id` (`createCredentialOffer.schema_id`; string, optional)
- `claims` (`createCredentialOffer.claims`; object, optional)
  - `full_name` (`createCredentialOffer.claims.full_name`; string, optional)
  - `age_over_18` (`createCredentialOffer.claims.age_over_18`; boolean, optional)

## Example requests

### Crear oferta de credencial

```json
{
  "schema_id": "<schemaId>",
  "claims": {
    "full_name": "Ada Lovelace",
    "age_over_18": true
  }
}
```

### Crear oferta (24 claims)

```json
{
  "schema_id": "driving_licence_v2",
  "valid_until": "2030-10-22T23:59:59Z",
  "claims": {
    "given_name": "Sofía",
    "family_name": "Demo",
    "second_family_name": "Lambda",
    "birth_date": "1990-01-01",
    "document_number": "NL-2026-0001",
    "issue_date": "2026-10-22",
    "expiry_date": "2030-10-22",
    "driving_privileges": [
      {
        "vehicle_category_code": "B",
        "issue_date": "2026-10-22",
        "expiry_date": "2030-10-22",
        "codes": [
          {
            "code": "01",
            "sign": "<=",
            "value": "70"
          }
        ]
      }
    ],
    "portrait": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
    "signature_usual_mark": "iVBORw0KGgoAAAANSUhEUgAAA...",
    "issuing_authority": "Secretaría de Movilidad y Planeación Urbana",
    "street": "Av. Constitución",
    "exterior_number": "1234",
    "interior_number": "5B",
    "neighborhood": "Centro",
    "resident_city": "Monterrey",
    "resident_postal_code": "64000",
    "issuing_country": "MX",
    "age_over_18": true,
    "curp": "DELS900101MNLXXX01",
    "organ_donor": true,
    "blood_type": "O+",
    "allergies": "Penicilina",
    "emergency_phone": "8181234567"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://test-api-sovra.flagonsa.com/api/v1/issuer/credential-offer \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "schema_id": "<schemaId>",
  "claims": {
    "full_name": "Ada Lovelace",
    "age_over_18": true
  }
}
'
```

### TypeScript

```typescript
const url = 'https://test-api-sovra.flagonsa.com/api/v1/issuer/credential-offer';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    schema_id: '<schemaId>',
    claims: {full_name: 'Ada Lovelace', age_over_18: true}
  })
};

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

### Python

```python
import requests

url = "https://test-api-sovra.flagonsa.com/api/v1/issuer/credential-offer"

payload = {
    "schema_id": "<schemaId>",
    "claims": {
        "full_name": "Ada Lovelace",
        "age_over_18": True
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Respuesta exitosa. La colección de Postman de origen no incluye el cuerpo de la respuesta; ver la guía de referencia.


Source: https://sovra-id-docs-1044960690985.us-central1.run.app/api/create-credential-offer/index.md
