SevenShores\Hubspot\Resources\Deals::delete PHP Method

delete() public method

public delete ( integer $id ) : mixed
$id integer
return mixed
    function delete($id)
    {
        $endpoint = "https://api.hubapi.com/deals/v1/deal/{$id}";
        return $this->client->request('delete', $endpoint);
    }

Usage Example

Example #1
0
 /**
  * @test
  */
 public function delete()
 {
     $response = $this->createDeal();
     $id = $response['dealId'];
     $response = $this->deals->delete($id);
     $this->assertEquals(204, $response->getStatusCode());
     //Should not be able to find a deal after it was deleted
     $response = $this->deals->getById($id);
     $this->assertEquals(404, $response->getStatusCode());
 }