Contracts & Obligations
Create and manage payment obligations, invoices, loans, and annuities
01
Create Obligation
Create a payment obligation representing an invoice, loan, annuity, or any future payment commitment:
curl -X POST https://pay.yieldfabric.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation { createObligation(input: { counterpart: \"counterpart@yieldfabric.com\", denomination: \"aud-token-asset\", obligor: \"issuer@yieldfabric.com\", notional: \"100\", expiry: \"2025-11-01T23:59:59+00:00\" }) { success contractId messageId } }"
}'02
Obligation Types
Invoices
Payment due on specific date
Loans
Structured repayment schedules
Annuities
Recurring payment streams
Custom Commitments
Any future payment obligation
03
Create Annuity Stream
Create an obligation with scheduled payments over time:
curl -X POST https://pay.yieldfabric.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation($initialPayments: InitialPaymentsInput, $data: JSON) { createObligation(input: { counterpart: \"issuer@yieldfabric.com\", denomination: \"aud-token-asset\", obligor: \"issuer@yieldfabric.com\", notional: \"5\", expiry: \"2025-11-01\", data: $data, initialPayments: $initialPayments }) { success contractId } }",
"variables": {
"data": { "name": "Annuity Stream", "description": "5-day annuity" },
"initialPayments": {
"amount": "5",
"payments": [
{ "unlockSender": "2025-11-01T00:00:00+00:00", "unlockReceiver": "2025-11-01T00:00:00+00:00" },
{ "unlockSender": "2025-11-02T00:00:00+00:00", "unlockReceiver": "2025-11-02T00:00:00+00:00" },
{ "unlockSender": "2025-11-03T00:00:00+00:00", "unlockReceiver": "2025-11-03T00:00:00+00:00" },
{ "unlockSender": "2025-11-04T00:00:00+00:00", "unlockReceiver": "2025-11-04T00:00:00+00:00" },
{ "unlockSender": "2025-11-05T00:00:00+00:00", "unlockReceiver": "2025-11-05T00:00:00+00:00" }
]
}
}
}'04
Accept Obligation
Accept a pending obligation to commit to the payment schedule:
curl -X POST https://pay.yieldfabric.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation { acceptObligation(input: { contractId: \"CONTRACT-OBLIGATION-1760932171982\" }) { success message obligationId } }"
}'05
Self-Referential Obligations
Why Self-Referential?
- Build complex structures without counterparty risk
- Lock the structure by accepting your own obligation
- Atomically transfer to actual counterparty via swap
- Ensures secure construction and settlement
Create obligations with yourself as both obligor and counterpart, then atomically swap them to the real counterparty. See Workflows for complete examples.
06
Query Contracts
Get all contracts for your account:
curl -X POST https://pay.yieldfabric.com/graphql \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "query GetEntityContracts($entityId: ID!) { contractFlow { coreContracts { byEntityId(entityId: $entityId) { id name status contractType payments { id amount status } } } } }",
"variables": {
"entityId": "your-entity-id"
}
}'