# encodePDPCapabilities

> **encodePDPCapabilities**(`pdpOffering`, `capabilities?`): \[`string`[], `` `0x${string}` ``[]\]

Defined in: [packages/synapse-core/src/utils/pdp-capabilities.ts:107](https://github.com/FilOzone/synapse-sdk/blob/814fc2e242f2b236f8d2ba4078ebd703cedb5cf2/packages/synapse-core/src/utils/pdp-capabilities.ts#L107)

Encode a [PDPOffering](/reference/filoz/synapse-core/sp-registry/interfaces/pdpoffering/) plus optional user-supplied extras into the
`(keys[], values[])` tuple consumed by `registerProvider` / `addProduct` /
`updateProduct` on `ServiceProviderRegistry`.

Behavior notes:
- Reserved PDP keys (see [PDP\_OFFERING\_KEYS\_SET](/reference/filoz/synapse-core/utils/variables/pdp_offering_keys_set/)) cannot be
  passed via `capabilities`; they are written from `pdpOffering`. A collision
  would desync the contract's capability-keys array (duplicates kept) from
  the capability-value mapping (last-wins).
- `capabilities` values are hex-encoded verbatim if they already look like
  hex (e.g. `'0x01'` for a flag byte), otherwise UTF-8-encoded. Empty
  strings are rejected — callers that want a flag byte must pass `'0x01'`
  explicitly instead of `''`.

Total-count and per-entry byte-length limits are enforced by
`validateCapabilities` at each `*Call` site, so they are not re-checked here.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pdpOffering` | [`PDPOffering`](/reference/filoz/synapse-core/sp-registry/interfaces/pdpoffering/) | The PDP offering to encode. |
| `capabilities?` | [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\> | Optional non-reserved extra capabilities. |

## Returns

\[`string`[], `` `0x${string}` ``[]\]

A `[keys, values]` tuple ready for the contract call.

## Throws

Errors [ValidationError](/reference/filoz/synapse-core/errors/classes/validationerror/) when `capabilities` contains a reserved PDP key or an empty value