POST
/
invoices
/
{id}
/
send-to-spv
curl -X POST https://api.contazen.ro/v1/invoices/inv_9z8y7x6w5v/send-to-spv?environment=test \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "object": "efactura_submission",
    "success": true,
    "invoice_id": "inv_9z8y7x6w5v",
    "invoice_number": "CTZ-2024-00123",
    "status": "submitted",
    "environment": "test",
    "message": "Invoice successfully submitted to SPV for processing",
    "submission": {
      "id": 456,
      "upload_id": "5090000456",
      "submitted_at": "2024-03-20T14:30:00Z"
    }
  },
  "meta": {
    "version": "v1",
    "response_time": "2345.67ms"
  }
}

Description

Submits a fiscal invoice to the Romanian SPV (Sistem de Preluare și Validare) e-Factura system via ANAF. This endpoint handles the complete submission process including validation, XML generation, and transmission to ANAF’s servers.
OAuth Required: Your account must have valid ANAF OAuth authentication configured for the target environment before using this endpoint.

Request

id
string
required
The invoice ID to send to SPV
environment
string
The ANAF environment to use for submissionOptions:
  • test - Test/sandbox environment for development
  • live - Production environment for real invoices
If not specified, uses the firm’s default e-Factura environment setting.

Requirements

Before sending an invoice to SPV, ensure:
  1. Invoice Type: Must be a fiscal invoice (not proforma)
  2. Invoice Status: Must be finalized (not draft) and not voided
  3. OAuth Authentication: Valid ANAF OAuth token for the target environment
  4. Client Data: Complete client information including:
    • Name and address
    • CUI/CIF for B2B clients
    • Valid Romanian fiscal data

Validation Checks

The API performs comprehensive validation before submission:
CheckRequirementError Code
Invoice TypeMust be fiscalnot_fiscal_invoice
Draft StatusCannot be draftinvoice_is_draft
Voided StatusCannot be voidedinvoice_is_voided
Already SentNot already submittedalready_sent_to_spv
OAuth TokenValid and not expiredoauth_not_configured
Client DataComplete and validinvalid_client_data

Response

success
boolean
Indicates if the request was successful
data
object
Submission details

SPV Processing Flow

After submission:
  1. Invoice status changes to submitted
  2. ANAF processes the invoice (usually within minutes)
  3. Check status via the retrieve invoice endpoint
  4. Final status will be accepted or rejected
curl -X POST https://api.contazen.ro/v1/invoices/inv_9z8y7x6w5v/send-to-spv?environment=test \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "object": "efactura_submission",
    "success": true,
    "invoice_id": "inv_9z8y7x6w5v",
    "invoice_number": "CTZ-2024-00123",
    "status": "submitted",
    "environment": "test",
    "message": "Invoice successfully submitted to SPV for processing",
    "submission": {
      "id": 456,
      "upload_id": "5090000456",
      "submitted_at": "2024-03-20T14:30:00Z"
    }
  },
  "meta": {
    "version": "v1",
    "response_time": "2345.67ms"
  }
}

OAuth Configuration

Before using this endpoint, configure ANAF OAuth:
  1. Access e-Factura Settings in your Contazen account
  2. Choose Environment: Select test or live
  3. Authenticate with ANAF: Complete OAuth flow
  4. Token Validity: Tokens expire after 60 days
Production Environment: Only use environment=live for real invoices. Test environment submissions are not legally valid.

Common Issues

Missing CUI/CIF

For B2B invoices, ensure the client has a valid Romanian CUI/CIF:
// Correct B2B client data
{
  "name": "Example Company SRL",
  "cui": "RO12345678",  // Required for companies
  "address": "Str. Example 123",
  "city": "București"
}

Token Expiration

OAuth tokens expire after 60 days. Check token status:
GET /api/v1/settings
# Check efactura.oauth_expires_at field

Environment Mismatch

Ensure you’re using the correct environment:
  • Test: For development and testing
  • Live: For real, legally-binding invoices

Webhook Events

After submission, monitor invoice status changes via webhooks or polling:
StatusMeaningNext Action
submittedSent to ANAFWait for processing
processingANAF is validatingContinue waiting
acceptedSuccessfully processedDownload from ANAF
rejectedFailed validationCheck errors and resubmit