Developers often integrate multiple APIs to leverage their individual features. For example, you can get customer profiles from a payment services provider like Stripe and add those profiles as contacts on a marketing platform like Brevo. This tutorial shows you how to do this with Postman Flows.
Create a flow that gets a list of customer profiles from Stripe and adds them as contacts to a database in Brevo.
Open the Integration Flows public workspace and fork the Brevo API collection, the Stripe API collection, and the Stripe + Brevo environment to your workspace.
In your workspace, open the Stripe + Brevo environment.
Replace the stripe_secret_key variable’s value, your key here, with your Stripe API key.
Create a new flow module and click Send a request.
Click Find or create new request and select Stripe API > Customers > List all customers.
Click Add environment and select Stripe + Brevo. The HTTP Request block shows the request’s three variables. The baseUrl and stripe_secret_key variables are populated automatically from values stored in the request’s collection and environment.
Next to the limit variable, click Add data blocks and select Number. Enter “5” to specify how many contacts to include in each page of results. This tutorial uses 15 contacts, so a limit of 5 will send three pages of results.
Connect the HTTP Request block’s Success output to a Select block.
Click Enter path and enter “body.has_more”.
Connect the HTTP Request block’s Success output to another Select block.
Click Enter path and enter “body.data”.
Connect the has_more Select block’s output to an If block’s variable input and rename value1 to has_more.
Click Start writing TypeScript and enter “has_more”.
Connect the body.data Select block’s output to the If block’s Data input.
Connect an Evaluate block’s variable input to the If block’s THEN output. Rename value1 to contacts.
Click Start writing TypeScript and enter “contacts[$count(contacts)-1].id”. This gets the ID of the last object when there is at least one more contact in the original response.
Connect an HTTP Request block to the Evaluate block’s Result output.
Click Find or create new request and select Stripe API > Customers > List all customers pagination. The block automatically selects the Stripe + Brevo environment.
Next to the limit variable, click Add data blocks and select Number. Enter “5” to specify how many contacts to include in each page of results.
Connect the Evaluate block’s Result output to the starting_after variable in the HTTP Request block.
Connect the HTTP Request block’s Success output to both the body.has_next and the body.data Select blocks’ inputs.
Connect the If block’s THEN and ELSE outputs to a For block’s List input.
Connect the For block’s Item output to an HTTP Request block.
In the HTTP Request block, click Find or create new request and select Brevo API > Contact management > Contacts > POST Create a contact. Click Add environment and select Stripe + Brevo.
Connect the For block’s Item output to the email and first_name variables’ inputs. Enter “name” for the first_name variable and “email” for the email variable.
Run the flow and confirm the records are added to Brevo.
Last modified: 2025/11/17