Skip to content

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;  // true

Example Response:

json
{
    "id": "cus_xxxxx",
    "resource": "customer",
    "deleted": true
}

Deleted Resource Object

FieldTypeDescription
idstringThe ID of the deleted resource
resourcestringThe resource type (e.g., customer, billing_statement, webhook)
deletedbooleanAlways true

Property Access

Access fields as typed properties on the DeletedResource DTO — e.g., $deleted->id, $deleted->deleted. See Response Data for details.

Released under the MIT License.