Automattic\WooCommerce\Internal\RestApi\Routes\V4\Refunds\Schema
RefundSchema::add_cogs_related_schema
Add the Cost of Goods Sold related fields to the schema.
Method of the class: RefundSchema{}
No Hooks.
Returns
Array. The updated schema.
Usage
$result = RefundSchema::add_cogs_related_schema( $schema ): array;
- $schema(array) (required)
- The original schema.
RefundSchema::add_cogs_related_schema() RefundSchema::add cogs related schema code WC 10.4.3
private static function add_cogs_related_schema( array $schema ): array {
$schema['cost_of_goods_sold'] = array(
'description' => __( 'Cost of Goods Sold data.', 'woocommerce' ),
'type' => 'object',
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
'readonly' => true,
'properties' => array(
'total_value' => array(
'description' => __( 'Total value of the Cost of Goods Sold for the refund.', 'woocommerce' ),
'type' => 'number',
'readonly' => true,
'context' => self::VIEW_EDIT_EMBED_CONTEXT,
),
),
);
return $schema;
}