WooCommerce Code Reference

RestApiUtil
in package

Utility methods related to the REST API.

Table of Contents

get_endpoint_data()  : array<string|int, mixed>|WP_Error
Get data from a WooCommerce API endpoint.

Methods

get_endpoint_data()

Get data from a WooCommerce API endpoint.

public get_endpoint_data(string $endpoint[, array<string|int, mixed> $params = array() ]) : array<string|int, mixed>|WP_Error

This method used to be part of the WooCommerce Legacy REST API.

Parameters
$endpoint : string

Endpoint.

$params : array<string|int, mixed> = array()

Params to pass with request.

Tags
since
9.0.0
Return values
array<string|int, mixed>|WP_Error