Skip to content

Customers API

The Customers API allows you to manage customer information for both authenticated users and guest customers.

Base URL

https://your-instance.pubflow.com/bridge-payment

Authentication

Include one of the following in your requests:

  • Header: X-Session-ID: <session_id> (recommended)
  • Header: Authorization: Bearer <token>
  • Query Parameter: ?session_id=<session_id>
  • Guest: Provide guest_data in request body (no auth required)

Endpoints Overview

MethodEndpointDescription
POST/customersCreate customer
GET/customers/:idGet customer
GET/customersList customers
PUT/customers/:idUpdate customer
DELETE/customers/:idDelete customer

Create Customer

Create a new customer record.

Request

http
POST /bridge-payment/customers
Content-Type: application/json
X-Session-ID: <session_id>

Request Body

FieldTypeRequiredDescription
provider_idstringYesPayment provider (stripe, paypal, authorize_net)
emailstringYesCustomer email
namestringNoFull name
first_namestringNoFirst name
last_namestringNoLast name
phonestringNoPhone number
organization_idstringNoOrganization ID
metadataobjectNoAdditional metadata
Guest Data
guest_dataobjectNo*Guest customer data (*required for guests)
guest_data.emailstringYesGuest email
guest_data.namestringYesGuest name
guest_data.phonestringNoGuest phone

Response

json
{
  "id": "cust_1234567890",
  "provider_id": "stripe",
  "provider_customer_id": "cus_stripe_abc123",
  "email": "[email protected]",
  "name": "John Doe",
  "first_name": "John",
  "last_name": "Doe",
  "phone": "+1234567890",
  "is_guest": false,
  "organization_id": "org_456",
  "created_at": "2025-01-15T10:30:00Z"
}

Examples

Authenticated User Customer

bash
curl -X POST "https://your-instance.pubflow.com/bridge-payment/customers" \
  -H "Content-Type: application/json" \
  -H "X-Session-ID: session_abc123" \
  -d '{
    "provider_id": "stripe",
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "+1234567890"
  }'

Guest Customer

bash
curl -X POST "https://your-instance.pubflow.com/bridge-payment/customers" \
  -H "Content-Type: application/json" \
  -d '{
    "provider_id": "stripe",
    "guest_data": {
      "email": "[email protected]",
      "name": "Guest User",
      "phone": "+1234567890"
    }
  }'

Get Customer

Retrieve a specific customer by ID.

Request

http
GET /bridge-payment/customers/:id
X-Session-ID: <session_id>

Response

Returns complete customer object.

Example

bash
curl -X GET "https://your-instance.pubflow.com/bridge-payment/customers/cust_123" \
  -H "X-Session-ID: session_abc123"

List Customers

List all customers for authenticated user or organization.

Request

http
GET /bridge-payment/customers
X-Session-ID: <session_id>

Query Parameters

ParameterTypeDescription
organization_idstringFilter by organization
provider_idstringFilter by provider
limitnumberLimit results (default: 100)
offsetnumberOffset for pagination

Response

json
[
  {
    "id": "cust_123",
    "provider_id": "stripe",
    "email": "[email protected]",
    "name": "John Doe",
    "is_guest": false,
    "created_at": "2025-01-15T10:30:00Z"
  },
  {
    "id": "cust_456",
    "provider_id": "stripe",
    "email": "[email protected]",
    "name": "Jane Smith",
    "is_guest": false,
    "created_at": "2025-01-10T08:20:00Z"
  }
]

Example

bash
curl -X GET "https://your-instance.pubflow.com/bridge-payment/customers?limit=10" \
  -H "X-Session-ID: session_abc123"

Update Customer

Update customer information.

Request

http
PUT /bridge-payment/customers/:id
Content-Type: application/json
X-Session-ID: <session_id>

Request Body

FieldTypeDescription
emailstringUpdate email
namestringUpdate full name
first_namestringUpdate first name
last_namestringUpdate last name
phonestringUpdate phone
metadataobjectUpdate metadata

Example

bash
curl -X PUT "https://your-instance.pubflow.com/bridge-payment/customers/cust_123" \
  -H "Content-Type: application/json" \
  -H "X-Session-ID: session_abc123" \
  -d '{
    "phone": "+1987654321",
    "metadata": {
      "preferred_contact": "email"
    }
  }'

Response

Returns updated customer object.


Delete Customer

Delete a customer record.

Cascade Deletion

Deleting a customer will also delete:

  • Associated payment methods
  • Payment history (if configured)
  • Subscription records (if configured)

Use with caution in production.

Request

http
DELETE /bridge-payment/customers/:id
X-Session-ID: <session_id>

Response

http
HTTP/1.1 204 No Content

Example

bash
curl -X DELETE "https://your-instance.pubflow.com/bridge-payment/customers/cust_123" \
  -H "X-Session-ID: session_abc123"

Customer Types

Authenticated Users

Customers linked to Flowless user accounts:

json
{
  "id": "cust_123",
  "user_id": "user_456",
  "email": "[email protected]",
  "is_guest": false
}

Guest Customers

Customers without user accounts:

json
{
  "id": "cust_789",
  "user_id": null,
  "email": "[email protected]",
  "is_guest": true,
  "guest_email": "[email protected]"
}

Organization Customers

Customers belonging to organizations:

json
{
  "id": "cust_101",
  "user_id": "user_456",
  "organization_id": "org_789",
  "email": "[email protected]",
  "is_guest": false
}

Next Steps