# Scan a ticket
Source: https://docs.lomi.africa/api/events/EventsApiController_scan

Scan a ticket

***

title: "Scan a ticket"
description: "Scan a ticket"
full: true
method: post
path: /events/{id}/scan
operationId: EventsApiController\_scan
--------------------------------------

## Overview

Requires Ticketing. The first scan admits the code. A second scan is already used.

## Authentication

Merchant routes require an API key in the `X-API-KEY` header. Use a test key against `https://sandbox.api.lomi.africa` and a live key against `https://api.lomi.africa`.

## Endpoint

`POST /events/{id}/scan`

## Request

### Path parameters

| Name | Required | Schema   | Description |
| ---- | -------- | -------- | ----------- |
| `id` | Yes      | `string` | Event id    |

### Request body

| Field  | Required | Type     | Description |
| ------ | -------- | -------- | ----------- |
| `code` | Yes      | `string` | Ticket code |

## Responses

| Status | Description      |
| ------ | ---------------- |
| `200`  | Success          |
| `403`  | Ticketing is off |

## Errors

**403** means Ticketing is off. **401** means the API key is missing or invalid. **404** means this event is not in the organization. **429** means too many requests.

## Example

```bash
curl -sS -X POST "https://sandbox.api.lomi.africa/events/evt_EXAMPLE/scan" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: evt-1" \
  -d '{"code":"ticket-code"}'
```

## OpenAPI

* **operationId**: `EventsApiController_scan`
* **Operation**: `POST /events/{id}/scan`
