inline prices. * For the list of inactive prices, set active to false. * * @param null|array{active?: bool, created?: array|int, currency?: string, ending_before?: string, expand?: string[], limit?: int, lookup_keys?: string[], product?: string, recurring?: array{interval?: string, meter?: string, usage_type?: string}, starting_after?: string, type?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Collection<\Stripe\Price> * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function all($params = null, $opts = null) { return $this->requestCollection('get', '/v1/prices', $params, $opts); } /** * Creates a new Price for an * existing Product. The Price * can be recurring or one-time. * * @param null|array{active?: bool, billing_scheme?: string, currency: string, currency_options?: array, custom_unit_amount?: array{enabled: bool, maximum?: int, minimum?: int, preset?: int}, expand?: string[], lookup_key?: string, metadata?: array, nickname?: string, product?: string, product_data?: array{active?: bool, id?: string, metadata?: array, name: string, statement_descriptor?: string, tax_code?: string, unit_label?: string}, recurring?: array{interval: string, interval_count?: int, meter?: string, trial_period_days?: int, usage_type?: string}, tax_behavior?: string, tiers?: (array{flat_amount?: int, flat_amount_decimal?: string, unit_amount?: int, unit_amount_decimal?: string, up_to: array|int|string})[], tiers_mode?: string, transfer_lookup_key?: bool, transform_quantity?: array{divide_by: int, round: string}, unit_amount?: int, unit_amount_decimal?: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Price * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function create($params = null, $opts = null) { return $this->request('post', '/v1/prices', $params, $opts); } /** * Retrieves the price with the given ID. * * @param string $id * @param null|array{expand?: string[]} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Price * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function retrieve($id, $params = null, $opts = null) { return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); } /** * Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use * search in read-after-write flows where strict consistency is necessary. Under * normal operating conditions, data is searchable in less than a minute. * Occasionally, propagation of new or updated data can be up to an hour behind * during outages. Search functionality is not available to merchants in India. * * @param null|array{expand?: string[], limit?: int, page?: string, query: string} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\SearchResult<\Stripe\Price> * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function search($params = null, $opts = null) { return $this->requestSearchResult('get', '/v1/prices/search', $params, $opts); } /** * Updates the specified price by setting the values of the parameters passed. Any * parameters not provided are left unchanged. * * @param string $id * @param null|array{active?: bool, currency_options?: null|array, expand?: string[], lookup_key?: string, metadata?: null|array, nickname?: string, tax_behavior?: string, transfer_lookup_key?: bool} $params * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts * * @return \Stripe\Price * * @throws \Stripe\Exception\ApiErrorException if the request fails */ public function update($id, $params = null, $opts = null) { return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); } }