# isrc

> This document is the Markdown version of [valibot.dev/api/isrc/](https://valibot.dev/api/isrc/). For the complete documentation index, see [llms.txt](https://valibot.dev/llms.txt).

Creates an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) validation action.

```ts
const Action = v.isrc<TInput, TMessage>(message);
```

## Generics

- `TInput` `extends string`
- `TMessage` `extends ErrorMessage<IsrcIssue<TInput>> | undefined`

## Parameters

- `message` `TMessage`

### Explanation

With `isrc` you can validate the formatting of a string. If the input is not an ISRC, you can use `message` to customize the error message.

This action supports both compact (`CCXXXYYNNNNN`) and hyphenated (`CC-XXX-YY-NNNNN`) formats.

## Returns

- `Action` `IsrcAction<TInput, TMessage>`

## Examples

The following examples show how `isrc` can be used.

### ISRC schema

Schema to validate an ISRC.

```ts
const IsrcSchema = v.pipe(v.string(), v.isrc('The ISRC is badly formatted.'));

// Valid ISRC formats:
// 'USRC17607839'
// 'US-RC1-76-07839'
```

## Related

The following APIs can be combined with `isrc`.

### Schemas

[`any`](/api/any.md), [`custom`](/api/custom.md), [`string`](/api/string.md)

### Methods

[`pipe`](/api/pipe.md)

### Utils

[`isOfKind`](/api/isOfKind.md), [`isOfType`](/api/isOfType.md)
