@param string $id
@param array  $data
@param array  $headers

@throws Exception

@return array|string
428194
public function writeOff(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/write_off', $id);

        return $this->post($url, $data, $headers);
    }
902748
public function stopDunning(string $id, array $headers = [])
    {
        $url = $this->url('invoices/%s/stop_dunning', $id);

        return $this->post($url, [], $headers);
    }
1297948
public function chargeAddonAtTermEnd(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/charge_addon_at_term_end', $id);

        return $this->post($url, $data, $headers);
    }
980446
protected function _update($id, array $data)
    {
        return $this->db->update($this->table, $data, ['id' => $id]);
    }
325534
public function changeBillingDate(string $id, array $data, array $headers = [])
    {
        $url = $this->url('customers/%s/change_billing_date', $id);

        return $this->post($url, $data, $headers);
    }
146838
public function update($data, $id) {

		$bean = \R::findOne( $this->type, ' id = :id ', [ ':id' => $id ] );
		if ( !$bean ) {
			throw new \Exception('This '.$this->type.' does not exist.');
		}
		return $this->set($data, $bean);

	}
203259
public function resume(string $id, array $data = [], array $headers = [])
    {
        $url = $this->url('subscriptions/%s/resume', $id);

        return $this->post($url, $data, $headers);
    }
292319
public function addCouponCodes(string $id, array $data, array $headers = [])
    {
        $url = $this->url('coupon_sets/%s/add_coupon_codes', $id);

        return $this->post($url, $data, $headers);
    }
1062935
public function updateCard(string $id, array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/%s/update_card', $id);

        return $this->post($url, $data, $headers);
    }
549256
public function logout(string $id, array $headers = [])
    {
        $url = $this->url('portal_sessions/%s/logout', $id);

        return $this->post($url, [], $headers);
    }
1145658
public function retrieveWithScheduledChanges(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/retrieve_with_scheduled_changes', $id);

        return $this->get($url, [], $headers);
    }
40679
public function applyCredits(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/apply_credits', $id);

        return $this->post($url, $data, $headers);
    }
1078994
public function travelForward(string $id, array $data, array $headers = [])
    {
        $url = $this->url('time_machines/%s/travel_forward', $id);

        return $this->post($url, $data, $headers);
    }
595121
public function findAsPdf(string $id, array $headers = [])
    {
        $url = $this->url('invoices/%s/pdf', $id);

        return $this->get($url, [], $headers);
    }
905490
public function export(string $id, array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/%s/export_payment_source', $id);

        return $this->post($url, $data, $headers);
    }
1277755
public function overrideBillingProfile(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/override_billing_profile', $id);

        return $this->post($url, $data, $headers);
    }
895304
public function unarchive(string $id, array $headers = [])
    {
        $url = $this->url('plans/%s/unarchive', $id);

        return $this->post($url, [], $headers);
    }