# Create session payments

`POST https://api.parklio.com/v2/terminals/{terminal_id}/sessions/{session_id}/payments`

This endpoint allows the user to create session payments

**Auth:** `Authorization: Bearer <token>`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `terminal_id` | string | yes |  |
| `session_id` | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currency` | string | yes |  |
| `amount_paid` | number | yes | The paid amount is in EUR |
| `payment_method` | string | yes |  |
| `electronic_device_id` | string | no |  |
| `user_id` | number | no |  |
| `user_email` | string | no |  |

```json
{
  "currency": "EUR",
  "amount_paid": 5,
  "payment_method": "CARD",
  "electronic_device_id": "67c83c69c1g512e6b4ti9671",
  "user_id": 1,
  "user_email": "john.doe@example.com"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "origin": "85481355",
    "payment_id": 1,
    "session_id": "854813550000003054",
    "paid_at": "2026-01-15T09:30:00.000Z",
    "currency": "EUR",
    "amount_paid": 20,
    "amount_due": 20,
    "payment_method": "CARD",
    "success": true,
    "error": null,
    "provider_transaction_id": "521911099292",
    "provider_payment_id": "854813550000003054-9a8a-00006894898d",
    "invoice_link": "https://api.spaceinvoices.com/v1/Documents/public/id/pdf"
  }
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

### 422 — Some of the provided request parameters are missing or are invalid. User should add/change them according to response message.

```json
{
  "success": false,
  "errors": [
    {
      "code": 23,
      "message": "Validation error",
      "field": "field"
    }
  ]
}
```

### 503 — the device might not be connected or an internal error happened

```json
{
  "success": false,
  "errors": [
    {
      "code": 40,
      "message": "the message to the remote device timed out"
    }
  ]
}
```

