Siren

Obligations

Payment obligations owed to collaborators — data model, status lifecycle, REST API, and PHP data access.

Last updated: October 28, 2026

An obligation represents a debt the business owes a collaborator as a result of a conversion. Obligations sit downstream of conversions and upstream of fulfillments. They are the “IOU” in Siren’s attribution pipeline. When a conversion is recorded, the incentive system evaluates the program’s rules and creates a draft obligation for the calculated reward amount. When the conversion is approved, the obligation becomes approved, the one status fulfillment generation pays. When a fulfillment puts it in a payout, its status becomes complete.

The obligation object

FieldREST namePHP getterTypeDescription
IDidgetId()integerUnique identifier
CollaboratorcollaboratorIdgetCollaboratorId()integerThe collaborator this obligation is owed to
StatusstatusgetStatus()stringCurrent status (see lifecycle below)
Award typeawardTypegetAwardType()stringThe currency the reward is paid in (e.g., USD, or a custom currency’s code)
ValuevaluegetValue()integerReward amount at the currency’s stored scale (hundredths for money, whole units for points and store credit)
PayoutpayoutIdgetPayoutId()integer or nullThe payout this obligation is in, if any
Hold reasonholdReasongetHoldReason()string or nullforeign_currency when the reward is held for review because the sale is in a currency the program doesn’t pay in. The reward is held while it’s a draft with this set, and the field stays set after the reward is approved or rejected, as a record of why it waited. Read only, and returned only when you request it with ?fields=
CreateddateCreatedgetCreatedDate()datetimeWhen the record was created
ModifieddateModifiedgetModifiedDate()datetimeWhen the record was last updated

The value field stores amounts as integers at the currency’s stored scale (hundredths for money, whole units for points and store credit). A $15.00 commission is stored as 1500, and 500 points as 500. This avoids floating-point precision issues in financial calculations.

The payoutId is null until the obligation is included in a payout. When fulfillment generation puts it in a payout and marks it complete, the payoutId links it to that payout record.

Extended fields (REST only, via ?fields=)

These fields are resolved dynamically by the REST API field resolver system and must be explicitly requested.

List endpoint (GET /obligations): collaboratorName, collaboratorEmail

Detail endpoint (GET /obligations/{id}): collaboratorName, collaboratorEmail, conversionId, conversionType, conversionDate, conversionAmount, programId, programName, supersededBy, supersedes

supersededBy is set when a refund of part of the sale rejected the obligation: obligationId (the obligation that replaced it, or null when the reward came to nothing), reason (refund), changeReference (the refund’s id), transactionId, and date. It’s null otherwise. supersedes lists the obligations this one replaced, in the same shape, with obligationId naming the replaced obligation.

Status lifecycle

Draft

A conversion is recorded but not yet approved. The obligation exists but is not payable.

Approved

The conversion has been approved and the obligation is owed, waiting for a fulfillment.

Complete

A fulfillment put it in a payout. The payoutId field links it to that payout.

StatusDescription
draftInitial state when a conversion is recorded but not yet approved. The obligation exists but is not payable. The admin screen labels it “Awaiting conversion approval”.
approvedOwed and waiting for a fulfillment. Set when the conversion is approved, when an allocation completes, or by the bulk approve action. The only status fulfillment generation pays.
completePut in a payout by a fulfillment. The payoutId field links it to that payout, which may not be paid yet.
rejectedWill not be paid. Set by hand, when the linked conversion is rejected (e.g., due to a refund), or when a refund of part of the sale replaces the obligation with a new one.
deletedIn the Trash, from the bulk delete action. The bulk restore action brings it back.
cancelledSoft deleted by the first DELETE request. A second DELETE request permanently removes the record. A cancelled obligation doesn’t show in the Obligations screen’s Trash, and the bulk restore action skips it.

Two moves go backwards. Moving a conversion back to pending returns its approved obligation to draft, as long as the obligation isn’t in a payout. The bulk approve action turns a draft or rejected obligation that isn’t in a payout into approved, except a rejected one that a partial refund replaced. Changing such an obligation’s status to a payable one answers 409, because its replacement carries the reward. When a conversion is rejected, its obligation is rejected too, and if it sits in a payout that hasn’t been sent (unpaid or failed), Siren takes it out of that payout. An obligation in a payout that is processing or paid is left as it is.

See How Refunds Work for a complete walkthrough of how refunds cascade through conversions and obligations.

Accessing obligation data

# List approved (owed, not yet in a payout) obligations for a collaborator
curl -X GET "https://your-site.com/wp-json/siren/v1/obligations?collaboratorId=42&status=approved&fields=id,value,status,awardType" \
  -H "Authorization: Bearer YOUR_TOKEN"

# Get a single obligation with extended fields
curl -X GET "https://your-site.com/wp-json/siren/v1/obligations/15?fields=id,value,status,collaboratorName,programName" \
  -H "Authorization: Bearer YOUR_TOKEN"
use Siren\Obligations\Core\Datastores\Obligation\Interfaces\ObligationDatastore;

class PayoutReport
{
    protected ObligationDatastore $obligations;

    public function __construct(ObligationDatastore $obligations)
    {
        $this->obligations = $obligations;
    }

    public function getApprovedObligations(int $collaboratorId): array
    {
        return $this->obligations->andWhere([
            ['column' => 'collaboratorId', 'operator' => '=', 'value' => $collaboratorId],
            ['column' => 'status', 'operator' => '=', 'value' => 'approved']
        ]);
    }
}
use Siren\Obligations\Core\Facades\Obligations;

$approved = Obligations::andWhere([
    ['column' => 'collaboratorId', 'operator' => '=', 'value' => $collaboratorId],
    ['column' => 'status', 'operator' => '=', 'value' => 'approved']
]);

$obligation = Obligations::find(42);

Siren is built on an event-driven architecture. Creating obligations manually via PHP bypasses the incentive calculation. The program’s reward rules won’t be applied, the conversion won’t be linked, and the ObligationIssued event won’t fire. Downstream listeners that bind obligations to conversions and trigger fulfillment workflows depend on that event. If you need an obligation, let the pipeline create it from a conversion, then approve the conversion to make it payable.

PHP domain methods

Looking up an obligation by conversion

getByConversionId retrieves the obligation that was created for a specific conversion. This is useful when you have a conversion record and need to check whether an obligation was issued and what its current state is. This method is only available through dependency injection.

use Siren\Obligations\Core\Datastores\Obligation\Interfaces\ObligationDatastore;
use PHPNomad\Datastore\Exceptions\RecordNotFoundException;

class ConversionInspector
{
    protected ObligationDatastore $obligations;

    public function __construct(ObligationDatastore $obligations)
    {
        $this->obligations = $obligations;
    }

    public function getObligationForConversion(int $conversionId): ?Obligation
    {
        try {
            return $this->obligations->getByConversionId($conversionId);
        } catch (RecordNotFoundException $e) {
            return null;
        }
    }
}

Not every conversion results in an obligation. The incentive system may determine the conversion doesn’t qualify, and a reward of zero, such as a percentage of a free trial’s $0 first payment, creates no obligation. A fixed reward on a $0 sale isn’t zero, so it still creates one. An obligation for a conversion that is still pending exists as a draft.

If you already have the conversion’s obligationId, you can skip this lookup and use find directly:

$obligationId = $conversion->getObligationId();

if ($obligationId !== null) {
    $obligation = $this->obligations->find($obligationId);
}

Querying by payout

To find all obligations that were settled in a specific payout batch:

$settled = $this->obligations->andWhere([
    ['column' => 'payoutId', 'operator' => '=', 'value' => $payoutId]
]);

Summing owed amounts

There is no built-in sum method, but you can combine a filtered query with array reduction:

$approved = $this->obligations->andWhere([
    ['column' => 'collaboratorId', 'operator' => '=', 'value' => $collaboratorId],
    ['column' => 'status', 'operator' => '=', 'value' => 'approved']
]);

$totalOwed = array_reduce($approved, fn(int $sum, Obligation $o) => $sum + $o->getValue(), 0);

Access control (REST)

The list endpoint uses AutoFilterByOwnerMiddleware to enforce access control. Admin users see all obligations across all collaborators, while collaborator-role users are automatically filtered to see only obligations linked to their own collaboratorId. The middleware maps the authenticated user to their collaborator record and injects the filter before the query executes, which is how the collaborator portal shows “my earnings” without exposing other collaborators’ data.

Relationships

Every obligation belongs to exactly one collaborator via collaboratorId.

Upstream, obligations are created as a downstream effect of a conversion and become payable when it is approved. The link between the two is maintained via the conversion’s obligationId field.

When a fulfillment puts an obligation in a payout, it is linked to that payout record via payoutId. The payout records the disbursement to the collaborator once it’s sent. Payouts are grouped into fulfillment batches, so the obligation connects to the fulfillment indirectly through its payout.

REST endpoints

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

Your privacy choices

Account, checkout and chat you request work without optional tracking. Choose whether to allow these other uses on this website.

You can change or withdraw your choices at any time using “Privacy choices.” We remember your choice for 180 days. Read our privacy policy.