Code2ASIN

Code2ASIN maps your EAN barcodes to Amazon ASINs, enabling you to list products on Amazon without manual lookups. Jobs run asynchronously on a Celery worker and support confidence-based auto-matching.


POST/code2asin/jobs

Create a job

Creates a Code2ASIN conversion job from an uploaded file (CSV, TXT, or XLSX). The file is stored and processed asynchronously.

Body parameters (multipart/form-data)

  • Name
    supplier_code
    Type
    string
    Description

    Supplier identifier for this conversion batch.

  • Name
    file
    Type
    file
    Description

    CSV, TXT, or XLSX file with EAN codes (and optionally ASINs).

  • Name
    use_amazon_api
    Type
    boolean
    Description

    false (default): direct import from a 2-column file (EAN, ASIN). true: search the Amazon API from a 1-column file (EAN only).

  • Name
    column_mapping
    Type
    string
    Description

    JSON string mapping CSV columns to target fields, e.g. {"EAN": "ean", "ASIN": "asin"}.

  • Name
    options
    Type
    string
    Description

    JSON string of import options (e.g. download_images).

Request

POST
/code2asin/jobs
curl -X POST https://api.pixeepim.com/api/v1/code2asin/jobs \
  -H "Authorization: Bearer {api_key}" \
  -F "supplier_code=SUP-042" \
  -F "file=@eans.csv" \
  -F "use_amazon_api=true"

Response

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "supplier_code": "SUP-042",
  "total_items": 0,
  "created_at": "2026-09-17T09:00:00Z"
}

GET/code2asin/jobs

List jobs

Returns a paginated list of Code2ASIN jobs.

Query parameters

  • Name
    page
    Type
    integer
    Description

    Page number, 1-indexed (default: 1).

  • Name
    per_page
    Type
    integer
    Description

    Items per page, max 100 (default: 20).

  • Name
    supplier_code
    Type
    string
    Description

    Filter by supplier code.

  • Name
    status
    Type
    string
    Description

    Filter by status: pending, processing, paused, completed, failed, cancelled.

Request

GET
/code2asin/jobs
curl "https://api.pixeepim.com/api/v1/code2asin/jobs?status=completed&per_page=20" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "items": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "import",
      "status": "completed",
      "supplier_code": "SUP-042",
      "total_items": 1500,
      "processed_items": 1500,
      "successful_items": 1380,
      "failed_items": 120,
      "products_enriched": 1380,
      "progress_percentage": 100.0,
      "created_at": "2026-09-14T09:00:00Z",
      "completed_at": "2026-09-14T09:42:00Z"
    }
  ],
  "total": 12,
  "page": 1,
  "per_page": 20,
  "pages": 1
}

GET/code2asin/jobs/{job_id}

Get a job

Returns full details for a job, including file paths, timestamps, and error message if it failed.

Path parameters

  • Name
    job_id
    Type
    string
    Description

    The job UUID.

Request

GET
/code2asin/jobs/{job_id}
curl https://api.pixeepim.com/api/v1/code2asin/jobs/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer {api_key}"

DELETE/code2asin/jobs/{job_id}

Delete a job

Deletes a Code2ASIN job and its results.

Path parameters

  • Name
    job_id
    Type
    string
    Description

    The job UUID.

Request

DELETE
/code2asin/jobs/{job_id}
curl -X DELETE https://api.pixeepim.com/api/v1/code2asin/jobs/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer {api_key}"

POST/code2asin/jobs/{job_id}/start

Control a job

Starts, pauses, resumes, or cancels a job.

EndpointEffectAllowed from
POST /code2asin/jobs/{job_id}/startDispatch a pending job to the workerpending
POST /code2asin/jobs/{job_id}/pausePause a running jobprocessing
POST /code2asin/jobs/{job_id}/resumeResume a paused jobpaused
POST /code2asin/jobs/{job_id}/cancelCancel and revoke the worker taskany active status

Query parameters (resume only)

  • Name
    restart
    Type
    boolean
    Description

    If true, restart from the beginning instead of resuming from the last position (default: false).

Request

POST
/code2asin/jobs/{job_id}/start
curl -X POST https://api.pixeepim.com/api/v1/code2asin/jobs/550e8400-e29b-41d4-a716-446655440000/start \
  -H "Authorization: Bearer {api_key}"

Response

{
  "success": true,
  "message": "Job démarré avec succès",
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending"
}

POST/code2asin/jobs/{job_id}/retry

Retry a job

Re-queues a failed or cancelled job. Other statuses are rejected with 400.

Path parameters

  • Name
    job_id
    Type
    string
    Description

    The job UUID.

Query parameters

  • Name
    reset_retry_counter
    Type
    boolean
    Description

    If true, reset the retry counter to 0 for a fresh manual retry. If false (default), the job is re-queued as-is and retry_count is preserved.

Request

POST
/code2asin/jobs/{job_id}/retry
curl -X POST "https://api.pixeepim.com/api/v1/code2asin/jobs/550e8400-e29b-41d4-a716-446655440000/retry?reset_retry_counter=true" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "success": true,
  "message": "Job marqué pour relance (compteur réinitialisé)",
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "retry_count": 0,
  "max_retries": 5
}

GET/code2asin/jobs/{job_id}/logs

Get job logs

Returns paginated operation-level logs for a job.

Path parameters

  • Name
    job_id
    Type
    string
    Description

    The job UUID.

Query parameters

  • Name
    page
    Type
    integer
    Description

    Page number.

  • Name
    per_page
    Type
    integer
    Description

    Entries per page.

Request

GET
/code2asin/jobs/{job_id}/logs
curl "https://api.pixeepim.com/api/v1/code2asin/jobs/550e8400-e29b-41d4-a716-446655440000/logs?page=1&per_page=50" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "total_entries": 12,
  "page": 1,
  "per_page": 50,
  "entries": [
    {
      "timestamp": "2026-09-14T09:05:30Z",
      "level": "error",
      "message": "No ASIN found for EAN 3760000000001 after 3 attempts"
    }
  ]
}

GET/code2asin/results/{job_id}

Get job results

Returns the ASIN matching results for a job, with pagination and aggregate match statistics.

Path parameters

  • Name
    job_id
    Type
    string
    Description

    The job UUID.

Query parameters

  • Name
    page
    Type
    integer
    Description

    Page number.

  • Name
    per_page
    Type
    integer
    Description

    Items per page.

  • Name
    match_type
    Type
    string
    Description

    Filter by match type: exact, partial, fuzzy, manual.

  • Name
    verified_only
    Type
    boolean
    Description

    Return only manually verified matches.

Request

GET
/code2asin/results/{job_id}
curl "https://api.pixeepim.com/api/v1/code2asin/results/550e8400-e29b-41d4-a716-446655440000?match_type=exact" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "job_id": "550e8400-e29b-41d4-a716-446655440000",
  "job_status": "completed",
  "total": 1500,
  "total_results": 1380,
  "with_asin": 1380,
  "with_images": 1200,
  "with_price": 1300,
  "exact_matches": 1100,
  "fuzzy_matches": 200,
  "partial_matches": 80,
  "manual_matches": 0,
  "avg_confidence": 92.4,
  "items": [
    {
      "id": "7a3b9c00-1234-5678-abcd-000000000001",
      "product_id": "550e8400-e29b-41d4-a716-000000000001",
      "product_ean": "3760000000001",
      "product_title": "Produit exemple",
      "asin": "B0CMGTHZ7J",
      "match_confidence": 98.0,
      "match_type": "exact",
      "amazon_price": 49.9,
      "amazon_currency": "EUR"
    }
  ]
}

GET/code2asin/statistics

Get statistics

Returns aggregate Code2ASIN statistics across jobs for a time period.

Query parameters

  • Name
    supplier_code
    Type
    string
    Description

    Filter by supplier code.

  • Name
    days
    Type
    integer
    Description

    Time period in days (default: 30).

  • Name
    start_date
    Type
    string
    Description

    Explicit start date, overrides days when set.

  • Name
    end_date
    Type
    string
    Description

    Explicit end date.

Request

GET
/code2asin/statistics
curl "https://api.pixeepim.com/api/v1/code2asin/statistics?days=30" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "period_days": 30,
  "supplier_code": null,
  "total_jobs": 12,
  "successful_jobs": 10,
  "failed_jobs": 1,
  "total_codes_processed": 18000,
  "total_codes_matched": 16560,
  "total_codes_unmatched": 1440,
  "avg_success_rate": 91.2,
  "overall_match_rate": 92.0
}

GET/code2asin/stats/errors

Get error statistics

Returns a breakdown of Code2ASIN job errors and the retry backoff schedule.

Query parameters

  • Name
    days
    Type
    integer
    Description

    Time period in days, 1–365 (default: 7).

Request

GET
/code2asin/stats/errors
curl "https://api.pixeepim.com/api/v1/code2asin/stats/errors?days=7" \
  -H "Authorization: Bearer {api_key}"

Response

{
  "period_days": 7,
  "total_errors": 42,
  "error_breakdown": {
    "amazon_not_found": { "count": 30 },
    "timeout": { "count": 12 }
  },
  "top_errors": [
    {
      "error_type": "amazon_not_found",
      "error_message": "No ASIN found for EAN after 3 attempts",
      "count": 30,
      "first_seen": "2026-09-11T08:00:00Z",
      "last_seen": "2026-09-17T07:00:00Z"
    }
  ],
  "retry_backoff_schedule": [1, 5, 15, 60, 240],
  "retry_backoff_description": "Exponential backoff in minutes: [1min, 5min, 15min, 1h, 4h]"
}

Was this page helpful?