Inttegro PHP SDK

Price extends DomainValue
in package

FinalYes

A reusable catalog price that can be attached to products and order line items.

This immutable value hydrates decoded API snake_case data into typed camelCase properties. Use fromArray() for wire data; toArray(), array access, and JSON serialization expose the API wire representation. Nullable properties correspond to optional API fields.

Tags
see
DomainValue

Table of Contents

Properties

$about  : string|null
Longer description of this price.
$active  : bool
Whether this price is active and usable in new flows.
$archivedAt  : DateTimeImmutable|null
Archive timestamp (if archived).
$createdAt  : DateTimeImmutable
Price creation timestamp.
$customerSelectedAmount  : CustomerSelectedAmount|null
Optional. PHP type: `CustomerSelectedAmount|null`; wire field: `customer_selected_amount` (`object`).
$fixedAmount  : Amount|null
Optional. PHP type: `Amount|null`; wire field: `fixed_amount` (`object`).
$id  : string
Unique price identifier with pr_ prefix.
$label  : string|null
Short label for this price.
$nominal  : Amount
Price amount.
$product  : EmbeddedProduct|null
Embedded product details, if this price belongs to a product.
$productId  : string|null
Product ID when the operation returns the relationship by reference.
$type  : Type
Required. PHP type: `Type`; wire field: `type` (`string`).
$updatedAt  : DateTimeImmutable|null
Last update timestamp.

Methods

__construct()  : mixed
Hydrates a Price from decoded Inttegro API data.
fromArray()  : static
Creates a Price from its decoded API wire representation.
jsonSerialize()  : array<string, mixed>
Returns the same API wire object as `toArray()` for `json_encode()`.
offsetExists()  : bool
Reports whether a non-null property exists for a PHP or API field name.
offsetGet()  : mixed
Reads a typed property through PHP `ArrayAccess`.
offsetSet()  : void
Rejects mutation because domain values are immutable.
offsetUnset()  : void
Rejects unsetting because domain values are immutable.
toArray()  : array<string, mixed>
Converts typed properties back to the API's wire representation.

Properties

$about read-only

Longer description of this price.

public string|null $about

Optional response field. PHP type: string|null; wire field: about (string).

$active read-only

Whether this price is active and usable in new flows.

public bool $active

Required response field. PHP type: bool; wire field: active (boolean).

$archivedAt read-only

Archive timestamp (if archived).

public DateTimeImmutable|null $archivedAt

Optional response field. PHP type: DateTimeImmutable|null; wire field: archived_at (ISO-8601 string with UTC offset). The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.

$createdAt read-only

Price creation timestamp.

public DateTimeImmutable $createdAt

Required response field. PHP type: DateTimeImmutable; wire field: created_at (ISO-8601 string with UTC offset). The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.

$customerSelectedAmount read-only

Optional. PHP type: `CustomerSelectedAmount|null`; wire field: `customer_selected_amount` (`object`).

public CustomerSelectedAmount|null $customerSelectedAmount

$fixedAmount read-only

Optional. PHP type: `Amount|null`; wire field: `fixed_amount` (`object`).

public Amount|null $fixedAmount

$id read-only

Unique price identifier with pr_ prefix.

public string $id

Required response field. PHP type: string; wire field: id (string).

$label read-only

Short label for this price.

public string|null $label

Optional response field. PHP type: string|null; wire field: label (string).

$nominal read-only

Price amount.

public Amount $nominal

Required response field. PHP type: Amount; wire field: nominal (object).

$product read-only

Embedded product details, if this price belongs to a product.

public EmbeddedProduct|null $product

Optional response field. PHP type: \Inttegro\Price\EmbeddedProduct|null; wire field: product (object).

$productId read-only

Product ID when the operation returns the relationship by reference.

public string|null $productId

Optional response field. PHP type: string|null; wire field: product_id (string).

$type read-only

Required. PHP type: `Type`; wire field: `type` (`string`).

public Type $type

$updatedAt read-only

Last update timestamp.

public DateTimeImmutable|null $updatedAt

Optional response field. PHP type: DateTimeImmutable|null; wire field: updated_at (ISO-8601 string with UTC offset). The SDK parses the offset-bearing timestamp into an immutable PHP date-time value.

Methods

__construct()

Hydrates a Price from decoded Inttegro API data.

public __construct(array<string, mixed> $data) : mixed
Parameters
$data : array<string, mixed>

Wire object keyed by snake_case API field names.

fromArray()

Creates a Price from its decoded API wire representation.

public static fromArray(array<string, mixed> $data) : static
Parameters
$data : array<string, mixed>

Wire object keyed by snake_case API field names.

Return values
static —

A typed, immutable Price value.

jsonSerialize()

Returns the same API wire object as `toArray()` for `json_encode()`.

public jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>

offsetExists()

Reports whether a non-null property exists for a PHP or API field name.

public offsetExists(mixed $offset) : bool

Both paymentId and payment_id address the same typed property.

Parameters
$offset : mixed

PHP camelCase or wire snake_case field name.

Return values
bool

offsetGet()

Reads a typed property through PHP `ArrayAccess`.

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

PHP camelCase or wire snake_case field name.

Return values
mixed —

The PHP-native property value.

offsetSet()

Rejects mutation because domain values are immutable.

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed

Ignored field name.

$value : mixed

Ignored replacement value.

Tags
throws
LogicException

Always.

offsetUnset()

Rejects unsetting because domain values are immutable.

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

Ignored field name.

Tags
throws
LogicException

Always.

toArray()

Converts typed properties back to the API's wire representation.

public toArray() : array<string, mixed>

Property names become snake_case. Nested values, arrays, backed enums, and timestamps are normalized recursively so the result is safe to pass to json_encode().

Return values
array<string, mixed> —

The recursively normalized API object.

On this page

Search results