POST /users/:ref/kyc
Create a KYC verification session for a user.
POST /users/:ref/kyc
Create a KYC verification session. The user completes verification at the returned URL, then is redirected back to your application.
This endpoint is only available if your partner account uses the MexicoP2P-provided KYC model. If you manage KYC yourself (partner-managed model), pass kycAttestation when calling POST /users instead — this endpoint will return KYC_NOT_AVAILABLE. See KYC: Two models for details.
Request
curl -X POST \
-H "X-API-Key: mp2p_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"level": "BASIC",
"returnUrl": "https://your-app.com/kyc/complete"
}' \
https://mexicop2p.org/api/v1/users/user_12345/kycRequest body
| Field | Type | Required | Description |
|---|---|---|---|
level | string | Yes | "BASIC" or "FULL" |
returnUrl | string | Yes | URL to redirect user after KYC |
Response 201
{
"sessionId": "did_session_abc123",
"sessionUrl": "https://verify.didit.me/session/did_session_abc123"
}Response fields
| Field | Type | Description |
|---|---|---|
sessionId | string | Didit verification session ID |
sessionUrl | string | URL to redirect the user for KYC |
KYC pricing
| Level | Price per verification |
|---|---|
| BASIC | $1.00 |
| FULL | $2.50 |
Free and Growth tiers include a monthly KYC allocation. Overages are billed to the partner.
Errors
| Code | HTTP | When |
|---|---|---|
KYC_NOT_AVAILABLE | 400 | Partner uses PARTNER_MANAGED KYC |
VALIDATION_ERROR | 400 | Missing level or returnUrl |
NOT_FOUND | 404 | User doesn't exist |
KYC_LIMIT_REACHED | 403 | Monthly KYC limit exceeded for tier |
KYC_SESSION_FAILED | 502 | Didit API returned an error |