Skip to content

Addresses API ​

The Addresses API allows you to manage billing and shipping addresses for 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/addressesCreate address
GET/addressesList addresses
GET/addresses/:idGet address
PUT/addresses/:idUpdate address
DELETE/addresses/:idDelete address
POST/addresses/:id/set-defaultSet as default

Create Address ​

Create a new address for a customer.

Request ​

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

Request Body ​

FieldTypeRequiredDescription
line1stringYesAddress line 1 (street address)
line2stringNoAddress line 2 (apt, suite, etc.)
citystringYesCity
statestringYesState/Province
postal_codestringYesPostal/ZIP code
countrystringYesCountry code (ISO 3166-1 alpha-2)
typestringNoAddress type (billing, shipping)
is_defaultbooleanNoSet as default (default: false)
aliasstringNoFriendly name for address
Guest Data
guest_dataobjectNo*Guest customer data (*required for guests)
guest_data.emailstringYesGuest email
guest_data.namestringYesGuest name

Response ​

json
{
  "id": "addr_1234567890",
  "line1": "123 Main St",
  "line2": "Apt 4B",
  "city": "New York",
  "state": "NY",
  "postal_code": "10001",
  "country": "US",
  "type": "billing",
  "is_default": false,
  "alias": "Home Address",
  "is_guest_address": false,
  "created_at": "2025-01-15T10:30:00Z"
}

Examples ​

Authenticated User Address ​

bash
curl -X POST "https://your-instance.pubflow.com/bridge-payment/addresses" \
  -H "Content-Type: application/json" \
  -H "X-Session-ID: session_abc123" \
  -d '{
    "line1": "123 Main St",
    "line2": "Apt 4B",
    "city": "New York",
    "state": "NY",
    "postal_code": "10001",
    "country": "US",
    "type": "billing",
    "alias": "Home Address"
  }'

Guest Address ​

bash
curl -X POST "https://your-instance.pubflow.com/bridge-payment/addresses" \
  -H "Content-Type: application/json" \
  -d '{
    "line1": "456 Oak Ave",
    "city": "Los Angeles",
    "state": "CA",
    "postal_code": "90001",
    "country": "US",
    "guest_data": {
      "email": "[email protected]",
      "name": "Guest User"
    }
  }'

List Addresses ​

List all addresses for authenticated user.

Request ​

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

Query Parameters ​

ParameterTypeDescription
typestringFilter by type (billing, shipping)
limitnumberLimit results (default: 100)
offsetnumberOffset for pagination

Response ​

json
[
  {
    "id": "addr_123",
    "line1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "postal_code": "10001",
    "country": "US",
    "type": "billing",
    "is_default": true,
    "alias": "Home Address",
    "created_at": "2025-01-15T10:30:00Z"
  },
  {
    "id": "addr_456",
    "line1": "789 Business Blvd",
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94102",
    "country": "US",
    "type": "billing",
    "is_default": false,
    "alias": "Office Address",
    "created_at": "2025-01-10T08:20:00Z"
  }
]

Example ​

bash
curl -X GET "https://your-instance.pubflow.com/bridge-payment/addresses?type=billing" \
  -H "X-Session-ID: session_abc123"

Get Address ​

Retrieve a specific address by ID.

Request ​

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

Response ​

Returns complete address object.

Example ​

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

Update Address ​

Update address information.

Request ​

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

Request Body ​

All fields are optional. Only include fields you want to update.

FieldTypeDescription
line1stringUpdate address line 1
line2stringUpdate address line 2
citystringUpdate city
statestringUpdate state
postal_codestringUpdate postal code
countrystringUpdate country
typestringUpdate type
is_defaultbooleanSet as default
aliasstringUpdate alias

Example ​

bash
curl -X PUT "https://your-instance.pubflow.com/bridge-payment/addresses/addr_123" \
  -H "Content-Type: application/json" \
  -H "X-Session-ID: session_abc123" \
  -d '{
    "line2": "Suite 100",
    "alias": "Updated Office Address"
  }'

Response ​

Returns updated address object.


Delete Address ​

Delete an address.

Request ​

http
DELETE /bridge-payment/addresses/: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/addresses/addr_123" \
  -H "X-Session-ID: session_abc123"

Set Default Address ​

Set an address as the default.

Request ​

http
POST /bridge-payment/addresses/:id/set-default
X-Session-ID: <session_id>

Response ​

Returns updated address with is_default: true.

Example ​

bash
curl -X POST "https://your-instance.pubflow.com/bridge-payment/addresses/addr_123/set-default" \
  -H "X-Session-ID: session_abc123"

Address Types ​

Billing Address ​

Used for payment method billing information:

json
{
  "id": "addr_123",
  "type": "billing",
  "line1": "123 Main St",
  "city": "New York",
  "state": "NY",
  "postal_code": "10001",
  "country": "US"
}

Shipping Address ​

Used for order delivery:

json
{
  "id": "addr_456",
  "type": "shipping",
  "line1": "456 Oak Ave",
  "city": "Los Angeles",
  "state": "CA",
  "postal_code": "90001",
  "country": "US"
}

Country Codes ​

Use ISO 3166-1 alpha-2 country codes:

  • US - United States
  • CA - Canada
  • GB - United Kingdom
  • AU - Australia
  • DE - Germany
  • FR - France
  • ES - Spain
  • IT - Italy
  • MX - Mexico
  • BR - Brazil

Full list of country codes


Next Steps ​