Send information from one system to another using Postman Flows

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.

Goal

Create a flow that gets a list of customer profiles from Stripe and adds them as contacts to a database in Brevo.

Prerequisites

  • A Stripe account and API key.
  • At least 15 Stripe customers.
  • A Brevo account and API key.

Create the flow, collections, and environment

  1. Open the Integration Flows public workspace and fork the Brevo API collection, the Stripe API collection, and the Stripe + Brevo environment to your workspace.

  2. In your workspace, open the Stripe + Brevo environment.

  3. Replace the stripe_secret_key variable’s value, your key here, with your Stripe API key.

  4. Create a new flow module and click Send a request.

Set up the initial Stripe request

  1. Click Find or create new request and select Stripe API > Customers > List all customers.

  2. 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.

  3. Next to the limit variable, click Add icon 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.

    Create a new flow

Add pagination logic

  1. Connect the HTTP Request block’s Success output to a Select block.

  2. Click Enter path and enter “body.has_more”.

    Select body.has_more
  3. Connect the HTTP Request block’s Success output to another Select block.

  4. Click Enter path and enter “body.data”.

    Select body.data
  5. Connect the has_more Select block’s output to an If block’s variable input and rename value1 to has_more.

  6. Click Start writing TypeScript and enter “has_more”.

  7. Connect the body.data Select block’s output to the If block’s Data input.

    Add an If block
  8. Connect an Evaluate block’s variable input to the If block’s THEN output. Rename value1 to contacts.

  9. 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.

    Add an Evaluate block

Add a paginated request

  1. Connect an HTTP Request block to the Evaluate block’s Result output.

  2. Click Find or create new request and select Stripe API > Customers > List all customers pagination. The block automatically selects the Stripe + Brevo environment.

  3. Next to the limit variable, click Add icon Add data blocks and select Number. Enter “5” to specify how many contacts to include in each page of results.

  4. Connect the Evaluate block’s Result output to the starting_after variable in the HTTP Request block.

  5. Connect the HTTP Request block’s Success output to both the body.has_next and the body.data Select blocks’ inputs.

    Add another HTTP Request block

Add a loop to send contacts to Brevo

  1. Connect the If block’s THEN and ELSE outputs to a For block’s List input.

  2. Connect the For block’s Item output to an HTTP Request block.

    Add a For block
  3. 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.

    Select the POST request
  4. 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.

    Set variables

Run and verify the flow

Run the flow and confirm the records are added to Brevo.

Run the flow and verify contacts

Last modified: 2025/11/17