Siren

Fulfillments

Batch payout operations — data model, status lifecycle, REST API, and PHP data access.

Last updated: April 9, 2026

Fulfillments

A fulfillment is a batch container that groups together the payouts generated from pending obligations. When it is time to pay collaborators, the “generate” endpoint collects pending obligations, groups them by collaborator, creates payout records for each, and wraps them in a fulfillment batch. The fulfillment then moves through processing states until all payouts are handled.

The fulfillment object

FieldREST namePHP getterTypeDescription
IDidgetId()integerUnique identifier
StatusstatusgetStatus()stringCurrent status (see lifecycle below)
CreateddateCreatedgetCreatedDate()datetimeWhen the fulfillment batch was created
ModifieddateModifiedgetModifiedDate()datetimeWhen the fulfillment was last modified

Status lifecycle

Pending

The fulfillment batch has been generated. Payouts exist but no processing has begun.

Processing

Payment processing is underway for the payouts in this batch.

Complete

All payouts in the batch have been handled.

StatusDescription
pendingThe fulfillment batch has been generated. Payouts exist but no processing has begun.
processingPayment processing is underway for the payouts in this batch.
completeAll payouts in the batch have been handled.
failedThe batch encountered an error. Equivalent to a soft delete; a second DELETE request permanently removes the record.

Accessing fulfillment data

# List pending fulfillments
curl -X GET "https://your-site.com/wp-json/siren/v1/fulfillments?status=pending&fields=id,status,dateCreated" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Get a single fulfillment with extended fields
curl -X GET "https://your-site.com/wp-json/siren/v1/fulfillments/12?fields=id,status,payoutCount,totalValue,currency" \
  -H "Authorization: Bearer YOUR_TOKEN"
use Siren\Fulfillments\Core\Datastores\Fulfillment\Interfaces\FulfillmentDatastore;

class FulfillmentReport
{
    protected FulfillmentDatastore $fulfillments;

    public function __construct(FulfillmentDatastore $fulfillments)
    {
        $this->fulfillments = $fulfillments;
    }

    public function getPendingFulfillments(): array
    {
        return $this->fulfillments->andWhere([
            ['column' => 'status', 'operator' => '=', 'value' => 'pending']
        ]);
    }
}
use Siren\Fulfillments\Core\Facades\Fulfillments;

$pending = Fulfillments::andWhere([
    ['column' => 'status', 'operator' => '=', 'value' => 'pending']
]);

$fulfillment = Fulfillments::getById(12);

Siren is built on an event-driven architecture. Fulfillments and payouts are normally created by the fulfillment generation pipeline in response to admin actions. If you find yourself creating these records manually, consider whether you should be triggering the generation process instead, which ensures obligations are correctly resolved and all downstream events fire.

PHP domain methods

Both the fulfillment and payout datastores support all shared methods documented in the introduction. Neither has additional domain-specific methods beyond standard CRUD.

Extended fields (REST only)

FieldTypeDescription
payoutCountintegerTotal number of payouts in this fulfillment
paidCountintegerNumber of payouts marked as paid
unpaidCountintegerNumber of payouts not yet paid
totalValueintegerSum of all payout values in the fulfillment
currencystringCurrency code for this fulfillment’s payouts
payoutsarrayNested array of payout objects (detail endpoint only)

Relationships

Fulfillments sit downstream of obligations. The generation process collects pending obligations, creates payouts from them, and links each obligation back to its payout via the obligation’s payoutId field.

A fulfillment acts as a batch container for its payouts. Each payout carries a fulfillmentId linking it to its parent, and the fulfillment’s extended fields (payoutCount, totalValue, etc.) are computed aggregates over its child payouts.

REST endpoints

See the individual endpoint pages in the sidebar for full request and response details, or browse the all REST endpoints reference.