Skip to main content

Custom data connectors

Prosper planEnterprise plan

Map your custom data to subscriber and subscription properties for segmentation and routing logic with custom data connector endpoints that are called when a cancel session is launched.

When a cancel flow session is started, ProsperStack will send a request to your configured data connector endpoints with a payload describing the subscriber and subscription. The endpoint can return data that ProsperStack will map to your subscriber and subscription custom properties.

Creating a data connector

Click the gear icon in the main header to open Settings, then select Integrations. Click Configure in the Data connectors section.

Click the Create data connector button to configure a new endpoint.

Create a data connector

Enter the URL of your application endpoint that ProsperStack should deliver requests to when a cancel flow session is started.

Check Enable this data connector immediately to enable the endpoint when it is created. If enabled, ProsperStack will begin delivering requests to this endpoint when the next cancel flow session is started. Click Submit to create the data connector.

Enabling or disabling a data connector

To enable or disable a data connector, click the gear icon in the main header and then the Integrations tab. From there, click Configure in the Data connectors section.

To activate an existing connector, click Enable in its row and then click Enable again to confirm. To stop sending new requests to a connector, click Disable and then click Disable again to confirm. Enabling the connector resumes requests for future cancellation flow sessions.

Data connector payloads

The payload sent to your data connector endpoints contains data about the subscriber and subscription that is entering a cancel flow.

An example payload looks like:

{
"data_connector_id": "dcon_Ga3w4qnkM4AvhgDUQm0rrZ7b",
"data": {
"subscription": {
"id": "subn_RZXvXXN4593m8gFsjWLz3djc",
"platform_id": "sub_1PeJ5bIjqaXshPw8qbLporJy",
"subscriber_id": "subr_0qASIhh5cu3y7sXRKTaZ3by3",
"mrr": "14.99",
"status": "active",
"properties": [],
"created_at": "2024-07-19T15:51:41.418Z",
"updated_at": "2024-07-19T15:51:41.418Z"
},
"subscriber": {
"id": "subr_0qASIhh5cu3y7sXRKTaZ3by3",
"platform_id": "cus_QTtOWyPkKPuuMI",
"name": "Guybrush Threepwood",
"email": "guybrush@example.com",
"status": "active",
"properties": [],
"created_at": "2024-07-19T15:51:41.399Z",
"updated_at": "2024-07-19T15:51:41.447Z"
}
}
}

The structure of the subscriber and subscription objects are identical to the objects returned by the ProsperStack API. See the API documentation for full details.

Expected response

Your data connector endpoint should respond with a JSON-encoded payload that contains subscriber and subscription properties.

An example response might look like:

{
"subscriber": {
"properties": {
"total_deliveries": 37,
"is_professional": true
}
},
"subscription": {
"properties": {
"num_contacts": 5800,
"has_premium_support": true
}
}
}

Response object

  • subscriber - Object containing details for the subscriber.
    • properties - Object containing subscriber custom properties.
  • subscription - Object containing details for the subscription.
    • properties - Object containing subscription custom properties.

The keys of each properties object should map to the unique identifier of a ProsperStack custom property. Learn more about formatting values for custom properties.

Verifying requests

To verify that a data connector request came from ProsperStack, check the request's ProsperStack-Signature header. Learn more about verifying requests.