Skip to content

Customer Profile API

Customer-facing endpoints for managing profiles, viewing orders, handling addresses, and accessing downloads. These endpoints are used by the storefront customer portal.

Base URL: https://your-site.com/wp-json/fluent-cart/v2

Policy: CustomerFrontendPolicy (requires authenticated customer)

These are frontend endpoints accessed by logged-in customers, not admin users. The policy checks is_user_logged_in() and each endpoint verifies that the authenticated user matches the requested customer record.

All monetary values are in cents (e.g., $10.00 = 1000).


Customer Management

Endpoints under the customers prefix for retrieving and updating the current customer's details.

Get Customer Details

GET /fluent-cart/v2/customers/{customerId}

Retrieve the details of the currently authenticated customer. The customerId must match the logged-in customer's record.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
witharrayqueryNoRelationships to eager-load (e.g., billing_address, shipping_address, orders)

Response

Success (200):

json
{
    "customer": {
        "id": 1,
        "user_id": 5,
        "email": "[email protected]",
        "first_name": "John",
        "last_name": "Doe",
        "status": "active",
        "purchase_value": {},
        "purchase_count": 3,
        "ltv": 15000,
        "country": "US",
        "city": "New York",
        "state": "NY",
        "postcode": "10001",
        "created_at": "2025-01-10 08:00:00",
        "updated_at": "2025-06-20 14:00:00"
    }
}

Error (403):

json
{
    "message": "You are not authorized to view this customer"
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customers/1?with[]=billing_address" \
  --cookie "wordpress_logged_in_xxx=..."

Update Customer Details

PUT /fluent-cart/v2/customers/{customerId}

Update the authenticated customer's profile details. The customerId must match the logged-in customer's record.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
emailstringbodyYesCustomer email address. Must be unique and valid. Max 255 characters.
first_namestringbodyConditionalCustomer first name. Required when store uses separate name fields. Max 255 characters.
last_namestringbodyNoCustomer last name. Max 255 characters.
full_namestringbodyConditionalCustomer full name. Required when store uses full name mode. Max 255 characters.
citystringbodyNoCustomer city
statestringbodyNoCustomer state/province code
postcodestringbodyNoCustomer postal/zip code
countrystringbodyNoCustomer country code (e.g., US, GB)
notesstringbodyNoInternal notes about the customer
statusstringbodyNoCustomer status

Response

Success (200):

json
{
    "message": "Customer updated successfully!",
    "data": {
        "id": 1,
        "email": "[email protected]",
        "first_name": "John",
        "last_name": "Doe"
    }
}

Error (403):

json
{
    "message": "You are not authorized to update this customer"
}

Example

bash
curl -X PUT "https://example.com/wp-json/fluent-cart/v2/customers/1" \
  -H "Content-Type: application/json" \
  -d '{"first_name": "John", "last_name": "Smith", "email": "[email protected]"}' \
  --cookie "wordpress_logged_in_xxx=..."

Get Customer Orders (Customer Prefix)

GET /fluent-cart/v2/customers/{customerId}/orders

Retrieve a paginated list of orders for the specified customer. The customerId must match the logged-in user.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
per_pageintegerqueryNoNumber of items per page (default: 15)

Response

Success (200):

json
{
    "orders": {
        "total": 25,
        "per_page": 15,
        "current_page": 1,
        "last_page": 2,
        "data": [
            {
                "id": 101,
                "invoice_no": "INV-000101",
                "total_amount": 4999,
                "uuid": "abc-123-def",
                "type": "one-time",
                "status": "completed",
                "created_at": "2025-06-15 10:30:00"
            }
        ]
    }
}

Error (returns empty when unauthorized):

json
{
    "orders": []
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customers/1/orders?per_page=10" \
  --cookie "wordpress_logged_in_xxx=..."

Address Management (Customer Prefix)

Endpoints under the customers prefix for managing customer addresses during checkout and in the customer account.

Select Address for Checkout

GET /fluent-cart/v2/customers/{customerAddressId}/update-address-select

Select an existing address and apply it to the current cart/checkout session. Updates the cart's checkout data with the selected address and returns the rendered address HTML along with updated checkout fragments.

Parameters

ParameterTypeLocationRequiredDescription
customerAddressIdintegerpathYesThe address record ID to select
witharrayqueryNoRelationships to eager-load on the address
fct_cart_hashstringqueryNoCart hash identifier to locate the active cart session

Response

Success (200):

json
{
    "message": "Address Attached",
    "data": "<div class=\"fct-address-info\">...</div>",
    "fragments": {
        ".fct-checkout-summary": "<div>...updated summary HTML...</div>"
    }
}

Error (404):

json
{
    "message": "Address not found"
}

Error (403):

json
{
    "message": "You are not authorized to view this address"
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customers/5/update-address-select?fct_cart_hash=abc123" \
  --cookie "wordpress_logged_in_xxx=..."

Create Address (Checkout)

POST /fluent-cart/v2/customers/add-address

Create a new address for the currently authenticated customer. Used during checkout to add a new billing or shipping address. After creation, returns updated address selector HTML for the checkout form.

Parameters

ParameterTypeLocationRequiredDescription
typestringbodyYesAddress type: billing or shipping
product_typestringbodyNoProduct fulfillment type (e.g., physical, digital). Used for field validation rules.
labelstringbodyNoShort label for the address (max 15 characters, e.g., Home, Office)
billing_name or shipping_namestringbodyNoContact name (prefixed with address type)
billing_address_1 or shipping_address_1stringbodyYesPrimary street address (prefixed with address type)
billing_address_2 or shipping_address_2stringbodyNoSecondary address line (prefixed with address type)
billing_city or shipping_citystringbodyYesCity (prefixed with address type)
billing_state or shipping_statestringbodyConditionalState/province code. Required if the country has states. (prefixed with address type)
billing_postcode or shipping_postcodestringbodyConditionalPostal/zip code. Validated against country format. (prefixed with address type)
billing_country or shipping_countrystringbodyYesCountry code (e.g., US, GB). (prefixed with address type)
billing_phone or shipping_phonestringbodyNoPhone number (prefixed with address type)
billing_email or shipping_emailstringbodyNoEmail address (prefixed with address type)

Note: All address fields are prefixed with the address type (e.g., billing_address_1 for a billing address, shipping_city for shipping). The prefix is stripped before storage.

Response

Success (200):

json
{
    "message": "Customer address created successfully!",
    "fragment": [
        {
            "selector": "[data-fluent-cart-checkout-page-form-address-modal-address-selector-button-wrapper]",
            "content": "<div>...updated address selector HTML...</div>",
            "type": "replace"
        }
    ]
}

Error (422 - validation):

json
{
    "status": "failed",
    "errors": {
        "billing_country": {
            "required": "Country is required."
        }
    }
}

Error (no customer):

json
{
    "message": "You don't have any associated account"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customers/add-address" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "billing",
    "billing_name": "John Doe",
    "billing_address_1": "123 Main St",
    "billing_city": "New York",
    "billing_state": "NY",
    "billing_postcode": "10001",
    "billing_country": "US",
    "billing_phone": "+1234567890",
    "label": "Home"
  }' \
  --cookie "wordpress_logged_in_xxx=..."

Update Address (Checkout)

PUT /fluent-cart/v2/customers/{customerId}/address

Update an existing address for the authenticated customer. The address ID is passed in the request body.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
address.idintegerbodyYesThe address record ID to update
typestringbodyYesAddress type: billing or shipping
billing_label or shipping_labelstringbodyYesShort label (max 15 characters). Prefixed with address type.
billing_name or shipping_namestringbodyNoContact name (prefixed with address type)
billing_address_1 or shipping_address_1stringbodyYesPrimary street address (prefixed with address type)
billing_address_2 or shipping_address_2stringbodyNoSecondary address line (prefixed with address type)
billing_city or shipping_citystringbodyYesCity (prefixed with address type)
billing_state or shipping_statestringbodyConditionalState/province code (prefixed with address type)
billing_postcode or shipping_postcodestringbodyConditionalPostal/zip code (prefixed with address type)
billing_country or shipping_countrystringbodyYesCountry code (prefixed with address type)

Response

Success (200):

json
{
    "message": "Address updated successfully"
}

Error (403):

json
{
    "message": "You are not authorized to update this address"
}

Example

bash
curl -X PUT "https://example.com/wp-json/fluent-cart/v2/customers/1/address" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "billing",
    "address": {"id": 5},
    "billing_name": "John Doe",
    "billing_address_1": "456 Oak Ave",
    "billing_city": "Boston",
    "billing_state": "MA",
    "billing_postcode": "02101",
    "billing_country": "US",
    "billing_label": "Work"
  }' \
  --cookie "wordpress_logged_in_xxx=..."

Delete Address (Checkout)

DELETE /fluent-cart/v2/customers/{customerId}/address

Delete an existing address for the authenticated customer. The address ID is passed in the request body.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
address.idintegerbodyYesThe address record ID to delete

Response

Success (200):

json
{
    "message": "Address deleted successfully"
}

Error (403):

json
{
    "message": "You are not authorized to delete this address"
}

Example

bash
curl -X DELETE "https://example.com/wp-json/fluent-cart/v2/customers/1/address" \
  -H "Content-Type: application/json" \
  -d '{"address": {"id": 5}}' \
  --cookie "wordpress_logged_in_xxx=..."

Set Address as Primary

POST /fluent-cart/v2/customers/{customerId}/address/make-primary

Mark a specific address as the primary address for its type (billing or shipping). All other addresses of the same type are demoted.

Parameters

ParameterTypeLocationRequiredDescription
customerIdintegerpathYesThe customer ID. Must belong to the authenticated user.
address.idintegerbodyYesThe address record ID to set as primary
address.typestringbodyYesAddress type: billing or shipping

Response

Success (200):

json
{
    "message": "Address successfully set as the primary"
}

Error (403):

json
{
    "message": "You are not authorized to update this address"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customers/1/address/make-primary" \
  -H "Content-Type: application/json" \
  -d '{"address": {"id": 5, "type": "billing"}}' \
  --cookie "wordpress_logged_in_xxx=..."

Profile Management

Endpoints under the customer-profile prefix for the customer portal dashboard and profile settings.

Dashboard Overview

GET /fluent-cart/v2/customer-profile/

Retrieve the customer's dashboard overview including the 5 most recent orders. This is the landing page data for the customer portal.

Parameters

No parameters required.

Response

Success (200):

json
{
    "message": "Success",
    "dashboard_data": {
        "orders": [
            {
                "created_at": "2025-06-15 10:30:00",
                "invoice_no": "INV-000101",
                "total_amount": 4999,
                "uuid": "abc-123-def",
                "type": "one-time",
                "status": "completed",
                "renewals_count": 0,
                "order_items": [
                    {
                        "id": 1,
                        "post_title": "Premium Plugin",
                        "title": "Premium Plugin - Single Site",
                        "quantity": 1,
                        "payment_type": "one-time",
                        "line_meta": {
                            "bundle_parent_item_id": null
                        }
                    }
                ]
            }
        ]
    },
    "sections_parts": {
        "before_orders_table": "",
        "after_orders_table": ""
    }
}

The sections_parts object contains HTML strings injected by extensions via the fluent_cart/customer_dashboard_data filter.

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/" \
  --cookie "wordpress_logged_in_xxx=..."

Get Profile Details

GET /fluent-cart/v2/customer-profile/profile

Retrieve the authenticated customer's profile details including name, email, and associated addresses. If the logged-in user does not yet have a customer record, basic WordPress user data is returned instead.

Parameters

No parameters required.

Response

Success (200) - Existing customer:

json
{
    "message": "Success",
    "data": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "billing_address": [
            {
                "id": 1,
                "customer_id": 1,
                "type": "billing",
                "name": "John Doe",
                "address_1": "123 Main St",
                "address_2": "",
                "city": "New York",
                "state": "NY",
                "postcode": "10001",
                "country": "US",
                "is_primary": "1",
                "status": "active"
            }
        ],
        "shipping_address": []
    }
}

Success (200) - User without customer record:

json
{
    "message": "Success",
    "data": {
        "first_name": "Jane",
        "last_name": "Smith",
        "user_login": "janesmith",
        "user_email": "[email protected]",
        "email": "[email protected]",
        "user_nicename": "janesmith",
        "display_name": "Jane Smith",
        "billing_address": [],
        "shipping_address": [],
        "not_a_customer": true
    }
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/profile" \
  --cookie "wordpress_logged_in_xxx=..."

Update Profile Details

POST /fluent-cart/v2/customer-profile/update

Update the authenticated customer's profile name. Also updates the associated WordPress user's first_name, last_name, and display_name.

Parameters

ParameterTypeLocationRequiredDescription
first_namestringbodyNoCustomer first name. Max 255 characters.
last_namestringbodyNoCustomer last name. Max 255 characters.
emailstringbodyYesCustomer email address. Must be valid.
current_passwordstringbodyNoCurrent password (for password change flow)
new_passwordstringbodyNoNew password (for password change flow)
confirm_new_passwordstringbodyNoConfirm new password (for password change flow)

Response

Success (200):

json
{
    "message": "Profile updated successfully"
}

Error (customer not found):

json
{
    "message": "Customer not found"
}

Error (not logged in):

json
{
    "message": "You are not logged in"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/update" \
  -H "Content-Type: application/json" \
  -d '{"first_name": "John", "last_name": "Smith", "email": "[email protected]"}' \
  --cookie "wordpress_logged_in_xxx=..."

Address Management (Profile)

Endpoints under the customer-profile prefix for managing addresses from the customer portal profile page. These use a simpler interface compared to the checkout address endpoints.

Create Profile Address

POST /fluent-cart/v2/customer-profile/create-address

Create a new address for the authenticated customer from the profile management page.

Parameters

ParameterTypeLocationRequiredDescription
typestringbodyYesAddress type: billing or shipping
namestringbodyYesContact name. Max 255 characters.
labelstringbodyNoShort label for the address (max 15 characters, e.g., Home, Work)
address_1stringbodyNoPrimary street address
address_2stringbodyNoSecondary address line
citystringbodyNoCity. Max 255 characters.
statestringbodyNoState/province code. Max 255 characters.
postcodestringbodyYesPostal/zip code
countrystringbodyYesCountry code (e.g., US, GB)
phonestringbodyNoPhone number
emailstringbodyYesEmail address
company_namestringbodyNoCompany name. Max 255 characters.
is_primaryintegerbodyNoSet to 1 to make this the primary address. Defaults to 0. Automatically set to 1 if no primary address exists.

Response

Success (200):

json
{
    "message": "Customer address created successfully!",
    "data": {
        "is_created": {
            "id": 10,
            "customer_id": 1,
            "type": "billing",
            "name": "John Doe",
            "address_1": "123 Main St",
            "city": "New York",
            "state": "NY",
            "postcode": "10001",
            "country": "US",
            "is_primary": "1",
            "status": "active"
        },
        "total_address_count": 2
    }
}

Error (validation):

json
{
    "message": "Name field is required."
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/create-address" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "billing",
    "name": "John Doe",
    "address_1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "postcode": "10001",
    "country": "US",
    "phone": "+1234567890",
    "email": "[email protected]",
    "label": "Home"
  }' \
  --cookie "wordpress_logged_in_xxx=..."

Update Profile Address

POST /fluent-cart/v2/customer-profile/edit-address

Update an existing address from the profile management page. The address must belong to the authenticated customer.

Parameters

ParameterTypeLocationRequiredDescription
idintegerbodyYesThe address record ID to update
typestringbodyYesAddress type: billing or shipping
namestringbodyYesContact name. Max 255 characters.
labelstringbodyNoShort label (max 15 characters)
address_1stringbodyNoPrimary street address
address_2stringbodyNoSecondary address line
citystringbodyNoCity. Max 255 characters.
statestringbodyNoState/province code. Max 255 characters.
postcodestringbodyYesPostal/zip code
countrystringbodyYesCountry code (e.g., US, GB)
phonestringbodyNoPhone number
emailstringbodyYesEmail address
company_namestringbodyNoCompany name. Max 255 characters.

Response

Success (200):

json
{
    "message": "Customer address updated successfully!",
    "data": {
        "id": 5,
        "customer_id": 1,
        "type": "billing",
        "name": "John Smith",
        "address_1": "456 Oak Ave",
        "city": "Boston",
        "state": "MA",
        "postcode": "02101",
        "country": "US"
    }
}

Error (403):

json
{
    "message": "You are not authorized to update this address"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/edit-address" \
  -H "Content-Type: application/json" \
  -d '{
    "id": 5,
    "type": "billing",
    "name": "John Smith",
    "address_1": "456 Oak Ave",
    "city": "Boston",
    "state": "MA",
    "postcode": "02101",
    "country": "US",
    "email": "[email protected]"
  }' \
  --cookie "wordpress_logged_in_xxx=..."

Make Profile Address Primary

POST /fluent-cart/v2/customer-profile/make-primary-address

Set a specific address as the primary address for its type. All other addresses of the same type for the customer are demoted.

Parameters

ParameterTypeLocationRequiredDescription
addressIdintegerbodyYesThe address record ID to set as primary
typestringbodyYesAddress type: billing or shipping

Response

Success (200):

json
{
    "message": "Address successfully set as the primary"
}

Error (403):

json
{
    "message": "You are not authorized to update this address"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/make-primary-address" \
  -H "Content-Type: application/json" \
  -d '{"addressId": 5, "type": "billing"}' \
  --cookie "wordpress_logged_in_xxx=..."

Delete Profile Address

POST /fluent-cart/v2/customer-profile/delete-address

Delete an address from the customer's profile. The address must belong to the authenticated customer. Primary addresses and the last remaining address cannot be deleted.

Parameters

ParameterTypeLocationRequiredDescription
addressIdintegerbodyYesThe address record ID to delete

Response

Success (200):

json
{
    "message": "Address successfully deleted."
}

Error (address is primary):

json
{
    "message": "Primary address cannot be deleted!"
}

Error (last address):

json
{
    "message": "At least one address must remain. Address deletion failed!"
}

Error (403):

json
{
    "message": "You are not authorized to update this address"
}

Error (missing ID):

json
{
    "message": "Address ID is required"
}

Example

bash
curl -X POST "https://example.com/wp-json/fluent-cart/v2/customer-profile/delete-address" \
  -H "Content-Type: application/json" \
  -d '{"addressId": 5}' \
  --cookie "wordpress_logged_in_xxx=..."

Orders

Endpoints under the customer-profile prefix for viewing orders and managing order-related data in the customer portal.

List Orders

GET /fluent-cart/v2/customer-profile/orders

Retrieve a paginated list of the authenticated customer's orders. Excludes renewal orders that have a parent subscription order. Supports text search across order fields.

Parameters

ParameterTypeLocationRequiredDescription
per_pageintegerqueryNoNumber of items per page (default: 10)
pageintegerqueryNoPage number for pagination (default: 1)
searchstringqueryNoSearch text to filter orders

Response

Success (200):

json
{
    "orders": {
        "total": 25,
        "per_page": 10,
        "current_page": 1,
        "last_page": 3,
        "data": [
            {
                "created_at": "2025-06-15 10:30:00",
                "invoice_no": "INV-000101",
                "total_amount": 4999,
                "uuid": "abc-123-def",
                "type": "one-time",
                "status": "completed",
                "renewals_count": 0,
                "order_items": [
                    {
                        "id": 1,
                        "post_title": "Premium Plugin",
                        "title": "Premium Plugin - Single Site",
                        "quantity": 1,
                        "payment_type": "one-time",
                        "line_meta": {
                            "bundle_parent_item_id": null
                        }
                    }
                ]
            }
        ]
    }
}

The created_at timestamp is converted to the user's timezone (stored in order.config.user_tz, falling back to the site timezone).

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/orders?per_page=10&page=1&search=plugin" \
  --cookie "wordpress_logged_in_xxx=..."

Get Order Details

GET /fluent-cart/v2/customer-profile/orders/{order_uuid}

Retrieve full details for a specific order including line items, transactions, subscriptions, downloads, and addresses. The order must belong to the authenticated customer.

Parameters

ParameterTypeLocationRequiredDescription
order_uuidstringpathYesThe UUID of the order (alphanumeric with dashes)

Response

Success (200):

json
{
    "order": {
        "id": 101,
        "fulfillment_type": "digital",
        "type": "one-time",
        "created_at": "2025-06-15 10:30:00",
        "invoice_no": "INV-000101",
        "currency": "USD",
        "uuid": "abc-123-def",
        "status": "completed",
        "payment_status": "paid",
        "shipping_status": "",
        "billing_address_text": "John Doe, 123 Main St, New York, NY 10001, US",
        "shipping_address_text": "",
        "subtotal": 4999,
        "total_amount": 4999,
        "total_paid": 4999,
        "total_refund": 0,
        "shipping_total": 0,
        "coupon_discount_total": 0,
        "manual_discount_total": 0,
        "tax_total": 0,
        "tax_behavior": "exclusive",
        "shipping_tax": 0,
        "payment_method": "stripe",
        "order_items": [
            {
                "id": 1,
                "variation_id": 10,
                "product_id": 5,
                "post_title": "Premium Plugin",
                "title": "Premium Plugin - Single Site",
                "quantity": 1,
                "unit_price": 4999,
                "subtotal": 4999,
                "payment_type": "one-time",
                "meta_lines": [],
                "extra_amount": 0,
                "image": "https://example.com/wp-content/uploads/product.jpg",
                "variant_image": "",
                "url": "https://example.com/product/premium-plugin/",
                "line_meta": {},
            }
        ],
        "subscriptions": [],
        "downloads": [
            {
                "file_size": "2.5 MB",
                "title": "premium-plugin-v2.zip",
                "download_url": "https://example.com/?fct_download=..."
            }
        ],
        "transactions": [
            {
                "id": 50,
                "uuid": "txn-abc-123",
                "order_id": 101,
                "amount": 4999,
                "status": "succeeded",
                "payment_method": "stripe",
                "created_at": "2025-06-15 10:30:00"
            }
        ]
    },
    "section_parts": {
        "before_summary": "",
        "after_summary": "",
        "after_licenses": "",
        "after_subscriptions": "",
        "after_downloads": "",
        "after_transactions": "",
        "end_of_order": ""
    }
}

The section_parts object contains HTML strings injected by extensions via the fluent_cart/customer/order_details_section_parts filter.

Error (renewal order redirect):

json
{
    "message": "This is a renewal order. Please check the parent order details.",
    "parent_order": {
        "uuid": "parent-abc-123"
    }
}

Error (order not found):

json
{
    "message": "Order not found"
}

Error (not logged in):

json
{
    "message": "You are not logged in"
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/orders/abc-123-def" \
  --cookie "wordpress_logged_in_xxx=..."

Get Upgrade Paths

GET /fluent-cart/v2/customer-profile/orders/{order_uuid}/upgrade-paths

Retrieve available upgrade/downgrade paths for a specific product variation within an order. Used to show plan switching options in the customer portal.

Parameters

ParameterTypeLocationRequiredDescription
order_uuidstringpathYesThe UUID of the order (alphanumeric with dashes)
variation_idintegerqueryYesThe product variation ID to find upgrade paths for

Response

Success (200):

json
{
    "upgradePaths": [
        {
            "variation_id": 15,
            "title": "Premium Plugin - 5 Sites",
            "price": 9999,
            "billing_interval": "year",
            "upgrade_type": "upgrade",
            "prorated_amount": 5000
        },
        {
            "variation_id": 20,
            "title": "Premium Plugin - Unlimited Sites",
            "price": 19999,
            "billing_interval": "year",
            "upgrade_type": "upgrade",
            "prorated_amount": 15000
        }
    ]
}

Error (not logged in):

json
{
    "message": "You must be logged in to view upgrade paths."
}

Error (order not found):

json
{
    "message": "Order not found or you do not have permission to view it."
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/orders/abc-123-def/upgrade-paths?variation_id=10" \
  --cookie "wordpress_logged_in_xxx=..."

Get Transaction Billing Address

GET /fluent-cart/v2/customer-profile/orders/{transaction_uuid}/billing-address

Retrieve the billing address associated with a specific transaction. Used for invoice/receipt editing in the customer portal.

Parameters

ParameterTypeLocationRequiredDescription
transaction_uuidstringpathYesThe UUID of the transaction (alphanumeric with dashes)

Response

Success (200):

json
{
    "message": "Success",
    "data": {
        "address_1": "123 Main St",
        "address_2": "",
        "city": "New York",
        "state": "NY",
        "postcode": "10001",
        "country": "US",
        "name": "John Doe",
        "vat_tax_id": "EU123456789",
        "address_id": 15
    }
}

Success (200) - No billing address found:

json
{
    "message": "",
    "data": {
        "address_1": "",
        "address_2": "",
        "city": "",
        "state": "",
        "postcode": "",
        "country": "",
        "name": "",
        "vat_tax_id": "",
        "address_id": ""
    }
}

Error (customer not found):

json
{
    "message": "Customer not found"
}

Error (transaction not found):

json
{
    "message": "Transaction not found"
}

Error (order not found):

json
{
    "message": "Order not found"
}

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/orders/txn-abc-123/billing-address" \
  --cookie "wordpress_logged_in_xxx=..."

Save Transaction Billing Address

PUT /fluent-cart/v2/customer-profile/orders/{transaction_uuid}/billing-address

Create or update the billing address for a specific transaction's order. Also stores the VAT/Tax ID as order metadata. Validates address fields against country-specific rules.

Parameters

ParameterTypeLocationRequiredDescription
transaction_uuidstringpathYesThe UUID of the transaction (alphanumeric with dashes)
address_idstringbodyNoExisting order address ID to update. If empty, a new address is created.
namestringbodyYesContact name
address_1stringbodyConditionalPrimary street address. Required based on country validation rules.
address_2stringbodyNoSecondary address line
citystringbodyConditionalCity. Required based on country validation rules.
statestringbodyConditionalState/province code. Required for countries with states.
postcodestringbodyConditionalPostal/zip code. Validated against country-specific format.
countrystringbodyYesCountry code (e.g., US, GB)
vat_tax_idstringbodyNoVAT or Tax ID. Stored as order meta.

Response

Success (200) - Address created:

json
{
    "message": "Billing address created successfully",
    "address_id": 25
}

Success (200) - Address updated:

json
{
    "message": "Billing address updated successfully",
    "formatted_address": "John Doe, 123 Main St, New York, NY 10001, US"
}

Error (order not found):

json
{
    "message": "Order not found"
}

Error (validation):

json
{
    "errors": {
        "country": ["The country field is required."]
    }
}

Example

bash
curl -X PUT "https://example.com/wp-json/fluent-cart/v2/customer-profile/orders/txn-abc-123/billing-address" \
  -H "Content-Type: application/json" \
  -d '{
    "address_id": "15",
    "name": "John Doe",
    "address_1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "postcode": "10001",
    "country": "US",
    "vat_tax_id": "EU123456789"
  }' \
  --cookie "wordpress_logged_in_xxx=..."

Downloads

Endpoints for accessing downloadable products from the customer portal.

List Downloads

GET /fluent-cart/v2/customer-profile/downloads

Retrieve a paginated list of downloadable files available to the authenticated customer. Only includes downloads from orders with a successful payment status. Filters downloads based on purchased product variations.

Parameters

ParameterTypeLocationRequiredDescription
pageintegerqueryNoPage number for pagination (default: 1)
per_pageintegerqueryNoNumber of items per page (default: 10)

Response

Success (200):

json
{
    "message": "Success",
    "downloads": {
        "data": [
            {
                "file_size": "2.5 MB",
                "title": "premium-plugin-v2.0.1.zip",
                "download_url": "https://example.com/?fct_download=eyJ0eXAi..."
            },
            {
                "file_size": "1.2 MB",
                "title": "starter-theme-v1.5.zip",
                "download_url": "https://example.com/?fct_download=eyJ0eXAi..."
            }
        ],
        "total": 5,
        "per_page": 10,
        "current_page": 1,
        "last_page": 1
    }
}

Success (200) - Not logged in (empty result):

json
{
    "message": "Success",
    "downloads": {
        "data": [],
        "total": 0,
        "per_page": 10,
        "current_page": 1,
        "last_page": 1
    }
}

The download_url contains a signed/encoded token that authorizes the download. These URLs are generated by Helper::generateDownloadFileLink() and are time-limited.

Example

bash
curl -X GET "https://example.com/wp-json/fluent-cart/v2/customer-profile/downloads?per_page=20&page=1" \
  --cookie "wordpress_logged_in_xxx=..."

FluentCart developer documentation