[Beta]{class="badge informative"}
Ingest payments data from your Stripe account to Experience Platform using APIs
Read the following tutorial to learn how to ingest your payments data from Stripe to Adobe Experience Platform using the Flow Service API.
Get started
This guide requires a working understanding of the following components of Experience Platform:
- Sources: Experience Platform allows data to be ingested from various sources while providing you with the ability to structure, label, and enhance incoming data using Platform services.
- Sandboxes: Experience Platform provides virtual sandboxes that partition a single Platform instance into separate virtual environments to help develop and evolve digital experience applications.
Authentication
Read the Stripe overview for information on how to retrieve your authentication credentials.
Using Platform APIs
For information on how to successfully make calls to Platform APIs, see the guide on getting started with Platform APIs.
Connect Stripe to Experience Platform
Follow the guide below to learn how to authenticate your Stripe source, create a source connection, and create a dataflow to bring your payments data to Experience Platform.
Create a base connection base-connection
A base connection retains information between your source and Experience Platform, including your source’s authentication credentials, the current state of the connection, and your unique base connection ID. You can explore and navigate files from within your source using the base connection ID. Additionally, you can identify the specific items you wish to ingest, including details on the data types and formats of those items.
To create a base connection ID, make a POST request to the /connections
endpoint while providing your Stripe authentication credentials as part of the request body.
API format
POST /connections
Request
The following request creates a base connection for Stripe:
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/connections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stripe base connection",
"description": "Authenticated base connection for Stripe",
"connectionSpec": {
"id": "cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3",
"version": "1.0"
},
"auth": {
"specName": "OAuth2 Refresh Code",
"params": {
"accessToken": "{ACCESS_TOKEN}",
}
}
}'
name
description
connectionSpec.id
cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3
, and this ID is fixed.auth.specName
auth.params.accessToken
Response
A successful response returns the newly created base connection, including its unique connection identifier (id
). This ID is required to explore your source’s file structure and contents in the next step.
{
"id": "a9950001-a386-4642-a0cd-5eaac6db5556",
"etag": "\"dc01244d-0000-0200-0000-65ea4e500000\""
}
Explore your source explore
Once you have your base connection ID, you can now explore the content and structure of your source data by performing a GET request to the /connections
endpoint while providing your base connection ID as a query parameter.
API format
GET /connections/{BASE_CONNECTION_ID}/explore?objectType=rest&object={OBJECT}&fileType={FILE_TYPE}&preview={PREVIEW}&sourceParams={SOURCE_PARAMS}
Request
When performing GET requests to explore your source’s file structure and contents, you must include the query parameters that are listed in the table below:
{BASE_CONNECTION_ID}
objectType=rest
rest
.{OBJECT}
json
.fileType=json
json
is the only supported file type.{PREVIEW}
{SOURCE_PARAMS}
A Base64-encoded string that points to the resource path you want to explore. Your resource path needs to be encoded in Base64 in order to obtain the approved format for {SOURCE_PARAMS}
. For example, {"resourcePath":"charges"}
is encoded as eyJyZXNvdXJjZVBhdGgiOiJjaGFyZ2VzIn0%3D
. The list of available resource paths include:
charges
subscriptions
refunds
balance_transactions
customers
prices
curl -X GET \
'https://platform.adobe.io/data/foundation/flowservice/connections/a9950001-a386-4642-a0cd-5eaac6db5556/explore?objectType=rest&object=json&fileType=json&preview=false&sourceParams=eyJyZXNvdXJjZVBhdGgiOiJjaGFyZ2VzIn0%3D' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}'
Response
A successful response returns a JSON structure like the following:
code language-json |
---|
|
Create a source connection source-connection
You can create a source connection by making a POST request to the /sourceConnections
endpoint of the Flow Service API. A source connection consists of a connection ID, a path to the source data file, and a connection spec ID.
API format
POST /sourceConnections
Request
The following request creates a source connection for Stripe.
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/sourceConnections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stripe Source Connection For Charges Data",
"description": "Stripe source connection for charges data",
"baseConnectionId": "a9950001-a386-4642-a0cd-5eaac6db5556",
"connectionSpec": {
"id": "cc2c31d6-7b8c-4581-b49f-5c8698aa3ab3",
"version": "1.0"
},
"data": {
"format": "json"
},
"params": {
"resourcePath": "charges"
},
}'
name
description
baseConnectionId
connectionSpec.id
data.format
json
.A successful response returns the unique identifier (id
) of the newly created source connection. This ID is required in a later step to create a dataflow.
{
"id": "abbfac4e-202c-4e04-902d-6f73e9041068",
"etag": "\"0a033818-0000-0200-0000-65ea5a770000\""
}
Create a target XDM schema target-schema
In order for the source data to be used in Experience Platform, a target schema must be created to structure the source data according to your needs. The target schema is then used to create a Platform dataset in which the source data is contained.
A target XDM schema can be created by performing a POST request to the Schema Registry API.
For detailed steps on how to create a target XDM schema, see the tutorial on creating a schema using the API.
Create a target dataset target-dataset
A target dataset can be created by performing a POST request to the Catalog Service API, providing the ID of the target schema within the payload.
For detailed steps on how to create a target dataset, see the tutorial on creating a dataset using the API.
Create a target connection target-connection
A target connection represents the connection to the destination where the ingested data is to be stored. To create a target connection, you must provide the fixed connection spec ID that corresponds to the data lake. This ID is: c604ff05-7f1a-43c0-8e18-33bf874cb11c
.
You now have the unique identifiers a target schema a target dataset and the connection spec ID to the data lake. Using these identifiers, you can create a target connection using the Flow Service API to specify the dataset that will contain the inbound source data.
API format
POST /targetConnections
Request
The following request creates a target connection for Stripe:
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/targetConnections' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stripe Target Connection For Charges Data",
"description": "Stripe target connection for charges data",
"connectionSpec": {
"id": "c604ff05-7f1a-43c0-8e18-33bf874cb11c",
"version": "1.0"
},
"data": {
"format": "parquet_xdm",
"schema": {
"id": "https://ns.adobe.com/{ORG_ID}/schemas/5f76be8c4e4b847fdac13ca42aa6b596a89a5b91dea48b16",
"version": "application/vnd.adobe.xed-full+json;version=1.3"
}
},
"params": {
"dataSetId": "65e622315f78042c9e8166e8"
}
}'
name
description
connectionSpec.id
c604ff05-7f1a-43c0-8e18-33bf874cb11c
.data.format
params.dataSetId
Response
A successful response returns the new target connection’s unique identifier (id
). This ID is required in later steps.
{
"id": "69879751-ba43-48df-8cd0-39d2bb76a5b8",
"etag": "\"4b02ef5b-0000-0200-0000-65ea5f730000\""
}
Create a mapping mapping
In order for the source data to be ingested into a target dataset, it must first be mapped to the target schema that the target dataset adheres to. This is achieved by performing a POST request to the Data Prep API with data mappings defined within the request payload.
API format
POST /conversion/mappingSets
The following request creates a mapping for Stripe.
code language-shell |
---|
|
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 | |
---|---|
Property | Description |
xdmSchema |
The ID of your target XDM schema. This ID is generated by creating a target XDM schema. |
destinationXdmPath |
The XDM field that the source attribute is being mapped to. |
sourceAttribute |
The source data field that is being mapped. |
identity |
A boolean value that defines whether the field will be persisted in Identity Service. |
version |
The mapping version that you are using. |
Response
A successful response returns details of the newly created mapping including its unique identifier (id
). This value is required in a later step to create a dataflow.
{
"id": "f4aad280fdec4770b7e33066945919d8",
"version": 0,
"createdDate": 1709860257007,
"modifiedDate": 1709860257007,
"createdBy": "{CREATED_BY}",
"modifiedBy": "{MODIFIED_BY}"
}
Create a flow flow
The last step towards bringing data from Stripe to Platform is to create a dataflow. By now, you have the following required values prepared:
A dataflow is responsible for scheduling and collecting data from a source. You can create a dataflow by performing a POST request while providing the previously mentioned values within the payload.
API format
POST /flows
Request
curl -X POST \
'https://platform.adobe.io/data/foundation/flowservice/flows' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'x-sandbox-name: {SANDBOX_NAME}' \
-H 'Content-Type: application/json' \
-d '{
"name": "Stripe Connector Flow Generic Rest",
"description": "Stripe Connector Description Flow Generic Rest",
"flowSpec": {
"id": "6499120c-0b15-42dc-936e-847ea3c24d72",
"version": "1.0"
},
"sourceConnectionIds": [
"abbfac4e-202c-4e04-902d-6f73e9041068"
],
"targetConnectionIds": [
"69879751-ba43-48df-8cd0-39d2bb76a5b8"
],
"transformations": [
{
"name": "Mapping",
"params": {
"mappingId": "f4aad280fdec4770b7e33066945919d8",
"mappingVersion": 0
}
}
],
"scheduleParams": {
"startTime": "1710267858",
"frequency": "minute",
"interval": {{interval}}
}
}'
name
description
flowSpec.id
6499120c-0b15-42dc-936e-847ea3c24d72
.flowSpec.version
1.0
.sourceConnectionIds
targetConnectionIds
transformations
transformations.name
transformations.params.mappingId
transformations.params.mappingVersion
0
.scheduleParams.startTime
scheduleParams.frequency
The frequency at which the dataflow will collect data. You can configure the ingestion frequency to:
- Once: Set your frequency to
once
to create a one-time ingestion. Configurations for interval and backfill are unavailable when creating a one-time ingestion dataflow. By default, the scheduling frequency is set to once. - Minute: Set your frequency to
minute
to schedule your dataflow to ingest data on a per-minute basis. - Hour:Set your frequency to
hour
to schedule your dataflow to ingest data on a per-hour basis. - Day: Set your frequency to
day
to schedule your dataflow to ingest data on a per-day basis. - Week: Set your frequency to
week
to schedule your dataflow to ingest data on a per-week basis.
scheduleParams.interval
The interval designates the period between two consecutive flow runs. For example, if you set your frequency to day and configure the interval to 15, then your dataflow will run every 15 days. The interval value should be a non-zero integer. The minimum accepted interval value for each frequency is as follows:
- Once: n/a
- Minute: 15
- Hour: 1
- Day: 1
- Week: 1
Response
A successful response returns the ID (id
) of the newly created dataflow. You can use this ID to monitor, update, or delete your dataflow.
{
"id": "84c64142-1741-4b0b-95a9-65644eba0cf6",
"etag": "\"3901770b-0000-0200-0000-655708970000\""
}
Appendix
The following section provides information on the steps you can take to monitor, update, and delete your dataflow.
Monitor your dataflow
Once your dataflow has been created, you can monitor the data that is being ingested through it to see information on flow runs, completion status, and errors. For complete API examples, read the guide on monitoring your sources dataflows using the API.
Update your dataflow
Update the details of your dataflow, such as its name and description, as well as its run schedule and associated mapping sets, by making a PATCH request to the /flows endpoint of the Flow Service API while providing the ID of your dataflow. When making a PATCH request, you must provide your dataflow’s unique etag
in the If-Match
header. For complete API examples, read the guide on updating sources dataflows using the API.
Update your account
Update the name, description, and credentials of your source account by performing a PATCH request to the Flow Service API while providing your base connection ID as a query parameter. When making a PATCH request, you must provide your source account’s unique etag
in the If-Match
header. For complete API examples, read the guide on updating your source account using the API.
Delete your dataflow
Delete your dataflow by performing a DELETE request to the Flow Service API while providing the ID of the dataflow you want to delete as part of the query parameter. For complete API examples, read the guide on deleting your dataflows using the API.
Delete your account
Delete your account by performing a DELETE request to the Flow Service API while providing the base connection ID of the account you want to delete. For complete API examples, read the guide on deleting your source account using the API.