Deleted Resource
When you delete a resource (e.g., a Customer, Billing Statement, Billing Statement Line Item, or Webhook Endpoint), the API returns a DeletedResource object confirming the deletion.
php
use LegionHQ\LaravelPayrex\Facades\Payrex;
$deleted = Payrex::customers()->delete('cus_xxxxx');
$deleted->id; // 'cus_xxxxx'
$deleted->resource; // 'customer'
$deleted->deleted; // trueExample Response:
json
{
"id": "cus_xxxxx",
"resource": "customer",
"deleted": true
}Deleted Resource Object
| Field | Type | Description |
|---|---|---|
id | string | The ID of the deleted resource |
resource | string | The resource type (e.g., customer, billing_statement, webhook) |
deleted | boolean | Always true |
Property Access
Access fields as typed properties on the DeletedResource DTO — e.g., $deleted->id, $deleted->deleted. See Response Data for details.