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-paymentAuthentication ​
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_datain request body (no auth required)
Endpoints Overview ​
| Method | Endpoint | Description |
|---|---|---|
| POST | /customers | Create customer |
| GET | /customers/:id | Get customer |
| GET | /customers | List customers |
| PUT | /customers/:id | Update customer |
| DELETE | /customers/:id | Delete 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 ​
| Field | Type | Required | Description |
|---|---|---|---|
provider_id | string | Yes | Payment provider (stripe, paypal, authorize_net) |
email | string | Yes | Customer email |
name | string | No | Full name |
first_name | string | No | First name |
last_name | string | No | Last name |
phone | string | No | Phone number |
organization_id | string | No | Organization ID |
metadata | object | No | Additional metadata |
| Guest Data | |||
guest_data | object | No* | Guest customer data (*required for guests) |
guest_data.email | string | Yes | Guest email |
guest_data.name | string | Yes | Guest name |
guest_data.phone | string | No | Guest 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 ​
| Parameter | Type | Description |
|---|---|---|
organization_id | string | Filter by organization |
provider_id | string | Filter by provider |
limit | number | Limit results (default: 100) |
offset | number | Offset 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 ​
| Field | Type | Description |
|---|---|---|
email | string | Update email |
name | string | Update full name |
first_name | string | Update first name |
last_name | string | Update last name |
phone | string | Update phone |
metadata | object | Update 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 ContentExample ​
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 ​
- Payment Methods API - Manage payment methods
- Addresses API - Manage customer addresses
- Payments API - Create payments for customers