Cadence
API Reference

Subscribers

Check, retrieve, update, cancel, and list invoices for subscribers.

GET /subscribers/check

Check if a customer email has an active subscription.

Base URL

https://cadence-api.pleasurebyplease.com

Request

GET https://cadence-api.pleasurebyplease.com/subscribers/check

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Query Parameters

NameTypeRequiredDescriptionExample
emailstringYesCustomer email address to check for an active subscriptionjohn@example.com

Response

FieldTypeDescription
statusstring"success"
existsbooleanWhether a customer with this email exists
hasActiveSubscriptionbooleanWhether the customer has an active subscription (only when exists=true)
dataobject | nullCustomer and subscription details (null when exists=false)
data.customerobjectCustomer info (id, segnoId, email, name, surname)
data.subscriptionobject | nullSubscription details if one exists (id, segnoId, iyzicoReference, planReference, status, createdAt, graceEndsAt, inGracePeriod)

Example Response

{
  "status": "success",
  "exists": true,
  "hasActiveSubscription": true,
  "data": {
    "customer": {
      "id": "c1d2e3f4-a5b6-7890-cdef-ab1234567890",
      "segnoId": "cust_id_3m7k9p2q",
      "email": "john@example.com",
      "name": "John",
      "surname": "Doe"
    },
    "subscription": {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "segnoId": "sub_id_5x4n2v8k",
      "iyzicoReference": "SUB-12345",
      "planReference": "PLAN-abc123",
      "status": "ACTIVE",
      "createdAt": "2026-01-16T12:00:00.000Z",
      "graceEndsAt": null,
      "inGracePeriod": false
    }
  }
}

GET /subscribers

Retrieve a subscriber by iyzico reference code or internal ID.

Base URL

https://cadence-api.pleasurebyplease.com

Request

GET https://cadence-api.pleasurebyplease.com/subscribers

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Query Parameters

NameTypeRequiredDescriptionExample
iyzico-subscriber-codestringNoThe iyzico subscription reference code (required if segno-id is not provided)SUB-12345
segno-idstringNoOptional internal Segno subscriber ID (or legacy UUID) to look up directlysub_id_5x4n2v8k

TypeScript Interfaces

interface GetSubscriberQuery {
  "iyzico-subscriber-code": string; // The iyzico subscription reference code
  "segno-id"?: string;              // Optional internal Segno subscriber ID
}

interface GetSubscriberResponse {
  status: "success" | "failure";
  data: {
    id: string;
    segnoId: string;
    iyzicoReference: string;
    customerReference: string;
    planReference: string;
    subscriptionStatus: string;
    createdAt: string;
    customer: {
      id: string;
      name: string;
      surname: string;
      email: string;
      gsmNumber: string;
    } | null;
    latestInvoice: {
      id: string;
      segnoId: string;
      invoiceNumber: string;
      status: string;
      amount: string;
      currency: string;
      date: string;
      pdfUrl: string | null;
    } | null;
  };
}

Response

FieldTypeDescription
statusstring"success" or "failure"
data.idstringInternal subscription ID (UUID)
data.segnoIdstringInternal Cadence subscriber identifier
data.iyzicoReferencestringIyzico subscription reference code
data.customerReferencestringIyzico customer reference code
data.planReferencestringCurrent plan reference code
data.subscriptionStatusstringSubscription status (ACTIVE, CANCELLED, etc.)
data.createdAtstringCreation timestamp
data.customerobjectAssociated customer data (name, surname, email, gsmNumber)
data.latestInvoiceobject | nullMost recent invoice for this subscriber
data.latestInvoice.idstringLatest invoice UUID
data.latestInvoice.segnoIdstringLatest invoice Segno ID
data.latestInvoice.invoiceNumberstringLatest invoice number
data.latestInvoice.statusstringLatest invoice status (PAID, PENDING, etc.)
data.latestInvoice.amountstringLatest invoice amount
data.latestInvoice.currencystringLatest invoice currency
data.latestInvoice.datestringLatest invoice date timestamp
data.latestInvoice.pdfUrlstring | nullLatest invoice PDF URL

Example Response

{
  "status": "success",
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "segnoId": "sub_id_5x4n2v8k",
    "iyzicoReference": "SUB-12345",
    "customerReference": "CUST-67890",
    "planReference": "PLAN-abc123",
    "subscriptionStatus": "ACTIVE",
    "createdAt": "2026-01-16T12:00:00.000Z",
    "customer": {
      "id": "c1d2e3f4-a5b6-7890-cdef-ab1234567890",
      "name": "John",
      "surname": "Doe",
      "email": "john@example.com",
      "gsmNumber": "+905551234567"
    },
    "latestInvoice": {
      "id": "4f7414f8-a7ee-4f56-b40f-a458ef8ea7d4",
      "segnoId": "inv_id_2hn4k90s",
      "invoiceNumber": "FAT-2026-00192",
      "status": "PAID",
      "amount": "999.90",
      "currency": "TRY",
      "date": "2026-03-20T09:10:11.000Z",
      "pdfUrl": "https://api.parasut.com/e_archives/123/pdf?signature=..."
    }
  }
}

GET /subscribers/invoices

List invoices for a subscriber with cursor pagination and signed Parasut PDF data.

Base URL

https://cadence-api.pleasurebyplease.com

Request

GET https://cadence-api.pleasurebyplease.com/subscribers/invoices

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Query Parameters

NameTypeRequiredDescriptionExample
subscriber-idstringNoSubscriber reference ID (required when segno-id is not provided)SUB-12345
segno-idstringNoInternal Cadence subscriber ID (required when subscriber-id is not provided)sub_id_5x4n2v8k
limitnumberNoNumber of invoices to return (default: 10, max: 100)10
starting_afterstringNoReturn results after this invoice ID cursor4f7414f8-a7ee-4f56-b40f-a458ef8ea7d4
ending_beforestringNoReturn results before this invoice ID cursor8c535fb0-4d66-4489-a5e6-bb47dfd19e3d

TypeScript Interfaces

interface ListSubscriberInvoicesQuery {
  "subscriber-id"?: string;
  "segno-id"?: string;
  limit?: number; // default: 10, max: 100
  starting_after?: string; // invoice UUID cursor
  ending_before?: string; // invoice UUID cursor
}

interface SubscriberInvoiceListItem {
  id: string;
  segnoId: string;
  invoiceNumber: string;
  status: string;
  amount: string;
  currency: string;
  date: string;
  pdfUrl: string | null;
  signedPdf: {
    provider: 'parasut';
    eArchiveId: string;
    url: string;
    expiresAt: string | null;
    signedAt: string;
  } | null;
  pdfStatus: 'ready' | 'processing' | 'unavailable' | 'error';
  pdfMessage: string | null;
}

interface ListSubscriberInvoicesResponse {
  status: 'success';
  object: 'list';
  url: '/subscribers/invoices';
  has_more: boolean;
  limit: number;
  starting_after: string | null;
  ending_before: string | null;
  subscriber: {
    id: string;
    segnoId: string;
    subscriberId: string;
  };
  data: SubscriberInvoiceListItem[];
}

Response

FieldTypeDescription
statusstring"success"
objectstringAlways "list"
urlstringEndpoint path: /subscribers/invoices
has_morebooleanWhether there are more records for pagination
limitnumberApplied page size limit
starting_afterstring | nullEchoed starting_after cursor
ending_beforestring | nullEchoed ending_before cursor
subscriberobjectResolved subscriber context (id, segnoId, subscriberId)
dataarrayList of invoice objects
data[].idstringInvoice UUID
data[].segnoIdstringInvoice Segno ID
data[].invoiceNumberstringHuman-readable invoice number
data[].statusstringInvoice status (PAID, PENDING, etc.)
data[].amountstringInvoice amount
data[].currencystringCurrency code
data[].datestringInvoice date timestamp
data[].pdfUrlstring | nullPDF download URL when available
data[].signedPdfobject | nullSigned PDF details from Parasut (url, expiresAt)
data[].pdfStatusstringPDF readiness: ready | processing | unavailable | error
data[].pdfMessagestring | nullOptional status/error details for PDF resolution

Example Response

{
  "status": "success",
  "object": "list",
  "url": "/subscribers/invoices",
  "has_more": true,
  "limit": 2,
  "starting_after": null,
  "ending_before": null,
  "subscriber": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "segnoId": "sub_id_5x4n2v8k",
    "subscriberId": "SUB-12345"
  },
  "data": [
    {
      "id": "4f7414f8-a7ee-4f56-b40f-a458ef8ea7d4",
      "segnoId": "inv_id_2hn4k90s",
      "invoiceNumber": "FAT-2026-00192",
      "status": "PAID",
      "amount": "999.90",
      "currency": "TRY",
      "date": "2026-03-20T09:10:11.000Z",
      "pdfUrl": "https://api.parasut.com/e_archives/123/pdf?signature=...",
      "signedPdf": {
        "provider": "parasut",
        "eArchiveId": "123",
        "url": "https://api.parasut.com/e_archives/123/pdf?signature=...",
        "expiresAt": "2026-03-20T10:10:11.000Z",
        "signedAt": "2026-03-20T09:11:02.000Z"
      },
      "pdfStatus": "ready",
      "pdfMessage": null
    },
    {
      "id": "8c535fb0-4d66-4489-a5e6-bb47dfd19e3d",
      "segnoId": "inv_id_70k3n5xz",
      "invoiceNumber": "FAT-2026-00191",
      "status": "PAID",
      "amount": "999.90",
      "currency": "TRY",
      "date": "2026-02-20T09:10:11.000Z",
      "pdfUrl": null,
      "signedPdf": null,
      "pdfStatus": "processing",
      "pdfMessage": "E-archive PDF is still processing."
    }
  ]
}

PUT /subscribers

Update a subscriber's plan. If both segno IDs are provided, only updates database without iyzico sync.

Base URL

https://cadence-api.pleasurebyplease.com

Request

PUT https://cadence-api.pleasurebyplease.com/subscribers

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Request Body

NameTypeRequiredDescriptionExample
iyzico-subscriber-reference-codestringNoThe iyzico subscription reference code. Required if segno-subscriber-id is not provided; use with iyzico-plan-reference-code (mutually exclusive with segno pair)SUB-12345
iyzico-plan-reference-codestringNoThe new plan reference code to upgrade to. Required if segno-plan-id is not provided; use with iyzico-subscriber-reference-code (mutually exclusive with segno pair)PLAN-67890
segno-subscriber-idstringNoInternal Cadence subscriber ID. Required if iyzico pair not provided; use with segno-plan-id. If both segno IDs provided, updates database only (no iyzico sync)sub_id_5x4n2v8k
segno-plan-idstringNoInternal Cadence plan ID. Required if iyzico pair not provided; use with segno-subscriber-id. If both segno IDs provided, updates database only (no iyzico sync)plan_id_8r2n3k1p
resetRecurrenceCountbooleanNoReset recurrence count on upgrade (default: true)true
useTrialbooleanNoUse trial period on new planfalse
upgradePeriodstring ("NOW" | "NEXT_PERIOD")NoWhen to apply upgradeNOW

TypeScript Interfaces

interface UpdateSubscriberBody {
  "iyzico-subscriber-reference-code"?: string; // Iyzico subscription reference (use with iyzico-plan-reference-code)
  "iyzico-plan-reference-code"?: string;      // New plan reference (use with iyzico-subscriber-reference-code)
  "segno-subscriber-id"?: string;             // Segno subscriber ID (use with segno-plan-id, mutually exclusive with iyzico pair)
  "segno-plan-id"?: string;                   // Cadence plan ID (use with segno-subscriber-id)
  resetRecurrenceCount?: boolean;              // Default: true
  useTrial?: boolean;                         // Default: false
  upgradePeriod?: "NOW" | "NEXT_PERIOD";      // Default: NOW
}

interface UpdateSubscriberResponse {
  status: "success" | "failure";
  message: string;
  data: {
    id: string;
    segnoId: string;
    iyzicoReference: string;
    newPlanReference: string;
    newPlanSegnoId?: string;  // When using segno IDs
    syncedWithIyzico: boolean;
    iyzicoResponse?: unknown;
  };
}

Response

FieldTypeDescription
statusstring"success" or "failure"
messagestringSuccess/error message
data.idstringInternal subscription ID
data.segnoIdstringInternal Cadence subscriber identifier
data.iyzicoReferencestringIyzico subscription reference code
data.newPlanReferencestringNew plan reference code
data.newPlanSegnoIdstringInternal Cadence plan identifier for new plan (when using segno IDs)
data.syncedWithIyzicobooleanWhether the update was synced with iyzico
data.iyzicoResponseobjectRaw iyzico response (only when synced)

Example Response

{
  "status": "success",
  "message": "Subscriber plan upgraded successfully",
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "segnoId": "sub_id_5x4n2v8k",
    "iyzicoReference": "SUB-12345",
    "newPlanReference": "PLAN-67890",
    "newPlanSegnoId": "plan_id_8r2n3k1p",
    "syncedWithIyzico": true,
    "iyzicoResponse": {
      "referenceCode": "SUB-12345",
      "status": "ACTIVE"
    }
  }
}

DELETE /subscribers

Cancel a subscription at period end. If segno-id is provided, only schedules cancellation in the database.

Base URL

https://cadence-api.pleasurebyplease.com

Request

DELETE https://cadence-api.pleasurebyplease.com/subscribers

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Request Body

NameTypeRequiredDescriptionExample
iyzico-subscriber-reference-codestringNoThe iyzico subscription reference code. Required if segno-id is not provided (mutually exclusive)SUB-12345
segno-idstringNoInternal Cadence subscriber ID. Required if iyzico-subscriber-reference-code is not provided (mutually exclusive). If provided, schedules cancellation in the database onlysub_id_5x4n2v8k

TypeScript Interfaces

interface CancelSubscriberBody {
  "iyzico-subscriber-reference-code"?: string; // Iyzico subscription reference (mutually exclusive with segno-id)
  "segno-id"?: string;                        // Segno subscriber ID (mutually exclusive with iyzico code)
}

interface CancelSubscriberResponse {
  status: "success" | "failure";
  message: string;
  data: {
    id: string;
    segnoId: string;
    iyzicoReference: string;
    status: "ACTIVE";
    cancelAtPeriodEnd: boolean;
    cancelledAt: string;
    accessUntil: string | null;
    syncedWithIyzico: boolean;
  };
}

Response

FieldTypeDescription
statusstring"success" or "failure"
messagestringSuccess/error message
data.idstringInternal subscription ID
data.segnoIdstringInternal Cadence subscriber identifier
data.iyzicoReferencestringIyzico subscription reference code
data.statusstringCurrent status (remains ACTIVE until period end)
data.cancelAtPeriodEndbooleanWhether cancellation is scheduled for period end
data.cancelledAtstringWhen cancellation was requested (ISO timestamp)
data.accessUntilstringAccess end time (period end, ISO timestamp)
data.syncedWithIyzicobooleanWhether the cancellation was synced with iyzico

Example Response

{
  "status": "success",
  "message": "Subscription will be cancelled at period end",
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "segnoId": "sub_id_5x4n2v8k",
    "iyzicoReference": "SUB-12345",
    "status": "ACTIVE",
    "cancelAtPeriodEnd": true,
    "cancelledAt": "2026-02-03T12:00:00.000Z",
    "accessUntil": "2026-02-04T12:00:00.000Z",
    "syncedWithIyzico": false
  }
}

POST /subscribers/undo-cancel

Undo a pending cancellation before the buffer window. If segno-id is provided, only updates the database.

Base URL

https://cadence-api.pleasurebyplease.com

Request

POST https://cadence-api.pleasurebyplease.com/subscribers/undo-cancel

Headers

  • X-Api-Key: {your-api-key}
  • X-Api-Secret: {your-api-secret}

Request Body

NameTypeRequiredDescriptionExample
iyzico-subscriber-reference-codestringNoThe iyzico subscription reference code. Required if segno-id is not provided (mutually exclusive)SUB-12345
segno-idstringNoInternal Cadence subscriber ID. Required if iyzico-subscriber-reference-code is not provided (mutually exclusive). If provided, undo cancellation in the database onlysub_id_5x4n2v8k

TypeScript Interfaces

interface UndoCancelSubscriberBody {
  "iyzico-subscriber-reference-code"?: string; // Iyzico subscription reference (mutually exclusive with segno-id)
  "segno-id"?: string;                        // Segno subscriber ID (mutually exclusive with iyzico code)
}

interface UndoCancelSubscriberResponse {
  status: "success" | "failure";
  message: string;
  data: {
    id: string;
    segnoId: string;
    iyzicoReference: string;
    status: "ACTIVE";
    cancelAtPeriodEnd: boolean;
    cancelledAt: string | null;
    accessUntil: string | null;
    syncedWithIyzico: boolean;
  };
}

Response

FieldTypeDescription
statusstring"success" or "failure"
messagestringSuccess/error message
data.idstringInternal subscription ID
data.segnoIdstringInternal Cadence subscriber identifier
data.iyzicoReferencestringIyzico subscription reference code
data.statusstringCurrent status (ACTIVE)
data.cancelAtPeriodEndbooleanWhether cancellation is scheduled for period end
data.cancelledAtstringWhen cancellation was requested (null if not cancelled)
data.accessUntilstringAccess end time (period end, ISO timestamp)
data.syncedWithIyzicobooleanWhether the undo was synced with iyzico

Example Response

{
  "status": "success",
  "message": "Subscription cancellation undone",
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "segnoId": "sub_id_5x4n2v8k",
    "iyzicoReference": "SUB-12345",
    "status": "ACTIVE",
    "cancelAtPeriodEnd": false,
    "cancelledAt": null,
    "accessUntil": "2026-02-04T12:00:00.000Z",
    "syncedWithIyzico": false
  }
}

On this page