Automattic\WooCommerce\Internal\RestApi\Routes\V4\Fulfillments\Schema
FulfillmentSchema::get_item_schema_properties
Return all properties for the item schema.
Note that context determines under which context data should be visible. For example, edit would be the context used when getting records with the intent of editing them. embed context allows the data to be visible when the item is being embedded in another response.
Method of the class: FulfillmentSchema{}
No Hooks.
Returns
Array.
Usage
$FulfillmentSchema = new FulfillmentSchema(); $FulfillmentSchema->get_item_schema_properties(): array;
FulfillmentSchema::get_item_schema_properties() FulfillmentSchema::get item schema properties code WC 10.8.1
public function get_item_schema_properties(): array {
return array(
'id' => array(
'description' => __( 'Unique identifier for the fulfillment.', 'woocommerce' ),
'type' => 'integer',
'context' => self::VIEW_EDIT_CONTEXT,
'readonly' => true,
),
'entity_type' => array(
'description' => __( 'The type of entity for which the fulfillment is created.', 'woocommerce' ),
'type' => 'string',
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
'entity_id' => array(
'description' => __( 'Unique identifier for the entity.', 'woocommerce' ),
'type' => 'string',
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
'status' => array(
'description' => __( 'The status of the fulfillment.', 'woocommerce' ),
'type' => 'string',
'default' => 'unfulfilled',
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
'is_fulfilled' => array(
'description' => __( 'Whether the fulfillment is fulfilled.', 'woocommerce' ),
'type' => 'boolean',
'default' => false,
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
'date_updated' => array(
'description' => __( 'The date the fulfillment was last updated.', 'woocommerce' ),
'type' => 'string',
'context' => self::VIEW_EDIT_CONTEXT,
'readonly' => true,
'required' => true,
),
'date_deleted' => array(
'description' => __( 'The date the fulfillment was deleted.', 'woocommerce' ),
'anyOf' => array(
array(
'type' => 'string',
),
array(
'type' => 'null',
),
),
'default' => null,
'context' => self::VIEW_EDIT_CONTEXT,
'readonly' => true,
'required' => true,
),
'meta_data' => array(
'description' => __( 'Meta data for the fulfillment.', 'woocommerce' ),
'type' => 'array',
'required' => true,
'items' => array(
'type' => 'object',
'properties' => array(
'id' => array(
'description' => __( 'The unique identifier for the meta data. Set `0` for new records.', 'woocommerce' ),
'type' => 'integer',
'context' => self::VIEW_EDIT_CONTEXT,
'readonly' => true,
),
'key' => array(
'description' => __( 'The key of the meta data.', 'woocommerce' ),
'type' => 'string',
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
'value' => array(
'description' => __( 'The value of the meta data.', 'woocommerce' ),
'type' => array( 'string', 'number', 'boolean', 'object', 'array', 'null' ),
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
),
),
'required' => true,
'context' => self::VIEW_EDIT_CONTEXT,
'readonly' => true,
),
),
);
}