<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# Get a pay frequency

`GET https://marketplace-api.sequifi.com/v1/pay-frequency/{id}`

Module: Pay Frequency · operationId: `getPayFrequency` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequifi.com/#/api/get-pay-frequency

Returns one active pay frequency by id. Ids are fixed: `2` Weekly, `3` Bi-Weekly, `4` Semi-Monthly, `5` Monthly, `6` Daily (on demand). Id `1` does not exist and returns 404.

**What happens:**

- The frequency comes back in `data.frequency_type` as a one-item array, in the same envelope as the list.
- A frequency your company has not turned on returns 404.

**Errors:**

- `400 Invalid frequency type id`: the id is not a positive whole number (for example `2abc`).
- `400 Cannot use query parameters when fetching a single frequency type by id`: remove the query string.
- `404 Frequency type not found`: no such id, or the frequency is not active.

**Related:**

- GET /v1/pay-frequency lists all active frequencies.

## Path parameters

- `id` (integer, **required**): Pay frequency id. Minimum: 1. Example: `2`.

## Example request

```bash
curl -X GET "https://marketplace-api.sequifi.com/v1/pay-frequency/2" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: The pay frequency

- `status` (integer): The HTTP status code, repeated. Example: `200`.
- `message` (string): Short text. Wording varies by endpoint; branch on the HTTP status, not on this text. Example: `success`.
- `data` (object)
  - `requested_by` (string): Label of the API credential that made the call.
  - `current_page` (integer): Always `1`.
  - `per_page` (integer): Always `1`.
  - `total` (integer): Always `1`.
  - `last_page` (integer): Always `1`.
  - `filters` (object, nullable): Always null.
  - `frequency_type` (array of object): One pay frequency.
    - `id` (integer): Pay frequency id.
    - `name` (string): Display name.
    - `status` (string): Always `Active`.

```json
{
  "status": 200,
  "message": "success",
  "data": {
    "requested_by": "acme",
    "current_page": 1,
    "per_page": 1,
    "total": 1,
    "last_page": 1,
    "filters": null,
    "frequency_type": [
      {
        "id": 2,
        "name": "Weekly",
        "status": "Active"
      }
    ]
  }
}
```

### 400: Invalid id, or query parameters sent with the id

Example (invalid_id): Id is not a positive whole number

```json
{
  "status": 400,
  "message": "Invalid frequency type id",
  "data": {}
}
```

### 401: Missing, invalid or expired token. The gateway rejects the call before it reaches Sequifi, so the body has only a `message`.

```json
{
  "message": "Unauthorized"
}
```

### 404: No active pay frequency with this id

```json
{
  "status": 404,
  "message": "Frequency type not found",
  "data": {}
}
```

### 500: Internal server error

```json
{
  "status": 500,
  "message": "Internal Server Error",
  "data": {}
}
```
