Simultaneously create a merchant, registers the merchant, and creates a user record in a single request, associating them together.
Create a merchant, its registration, and an associated user with one POST /admin/enroll request from your server-side integration.
This API reference is for developers using the Partner API, not for merchants completing Dashboard setup. Authenticate with a partner-level API key (a credential that grants access to partner operations).
On success, you receive the merchant record, registration data, user record, ephemeral bearer token (a temporary credential that authenticates requests as the user), and action summary.
Create and associate multiple records simultaneously to streamline the merchant enrollment process.
Send an enrollment request
- Obtain your partner-level API key and a valid
registration.pricing_planfor your brand. Keep the key on your server; do not put it in browser code or source control. - Install Python 3 to run the example below. Enter the company name, contact email, and user details when prompted. For a new user, provide a name and matching password fields. For an existing user, the API uses the email and ignores the remaining user fields.
- Run this script once for the merchant you want to enroll. It sends the required merchant, registration, and user fields and uses
premiumfor the merchant's Stax Pay plan, as in this endpoint's request example.
import getpass
import json
import sys
import urllib.error
import urllib.request
def main():
api_key = getpass.getpass("Partner API key: ").strip()
company_name = input("Company name: ").strip()
contact_email = input("Business contact email: ").strip()
pricing_plan = input("Valid registration pricing plan for your brand: ").strip()
owner_email = input("Principal owner's email: ").strip()
user_email = input("User email: ").strip()
user_name = input("User full name (required for a new user): ").strip()
password = getpass.getpass("User password (required for a new user): ")
confirmation = getpass.getpass("Confirm user password: ")
if not all((api_key, company_name, contact_email, pricing_plan, owner_email, user_email)):
sys.exit("Missing required input. No request was sent.")
if password != confirmation:
sys.exit("Passwords do not match. No request was sent.")
payload = {
"merchant": {
"plan": "premium",
"company_name": company_name,
"contact_email": contact_email,
},
"registration": {
"pricing_plan": pricing_plan,
"business_email": contact_email,
"email": owner_email,
},
"user": {
"email": user_email,
"name": user_name,
"password": password,
"password_confirmation": confirmation,
},
}
request = urllib.request.Request(
"https://apiprod.fattlabs.com/admin/enroll",
data=json.dumps(payload).encode("utf-8"),
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"Accept": "application/json",
},
method="POST",
)
try:
with urllib.request.urlopen(request, timeout=30) as response:
status = response.status
result = json.load(response)
except urllib.error.HTTPError as error:
print(f"HTTP {error.code}: enrollment failed.", file=sys.stderr)
print(error.read().decode("utf-8", errors="replace"), file=sys.stderr)
sys.exit(1)
except (urllib.error.URLError, TimeoutError, OSError) as error:
sys.exit(f"Request did not complete: {error}. Verify the merchant record before retrying.")
except (ValueError, UnicodeError):
sys.exit("Response was not valid JSON. Verify the merchant record before retrying.")
if status != 200 or not isinstance(result, dict):
sys.exit("Unexpected response. Verify the merchant record before retrying.")
# Use IDs from this API response; this request does not need Dashboard IDs.
merchant = result.get("merchant")
user = result.get("user")
registration = result.get("registration")
if not (
isinstance(merchant, dict) and merchant.get("id")
and isinstance(user, dict) and user.get("id")
and isinstance(registration, dict)
):
sys.exit("Response is missing expected records. Verify enrollment before retrying.")
print("HTTP 200: enrollment records returned.")
print(f"Merchant ID: {merchant['id']}")
print(f"User ID: {user['id']}")
print("Registration data returned. Enrollment does not mean the merchant is approved or active.")
# Avoid printing the full response because it includes a bearer token.
if __name__ == "__main__":
main()For the IDs in the documented success response, the output is:
HTTP 200: enrollment records returned.
Merchant ID: 7fe97e0f-2e7a-4817-872b-6eb86eea842c
User ID: 40fe8a52-fb71-4bec-89b3-a48f1dc18a50
Registration data returned. Enrollment does not mean the merchant is approved or active.Your response contains IDs for your merchant and user. Store those returned IDs for subsequent API requests; you do not need to locate an existing merchant ID in the Dashboard before enrollment.
For HTTP 422, correct the field errors in the response before retrying. Check required merchant fields, the registration pricing plan, and new-user details. The API also reports errors when the existing user's brand does not match the API key's brand or when you lack permission to request a user token. After a timeout or an unexpected response, verify whether the merchant exists before submitting another enrollment request.
Handle existing users and registration fields
Existing User Handling
If the specified user email already exists, the API:
- Associates the existing user record with the merchant
- Ignores the remaining user fields in the request
- Returns an error if the email belongs to a Stax Connect-level user, because the API cannot generate temporary user credentials for those users
Self-Registration Field Permissions
Configure self-registration (the pages where merchants complete their application) through the enrollment endpoint, POST /admin/enroll.
Optional: Hide prefilled fields automatically
Set "hide_prefilled_fields": true at the top level of your request body. The registration pages then hide fields whose values you supplied in the request.
Optional: Control individual fields
Add field_permissions inside registration to control field visibility and editing. Merge this valid JSON fragment into your enrollment request; it is not a complete enrollment request:
{
"registration": {
"field_permissions": {
"business_dba": null,
"business_website": "read",
"company_type": "write"
}
}
}When the merchant opens self-registration, these settings have the following results:
| Field | Permission | Expected result |
|---|---|---|
business_dba | null | Hide the business's doing-business-as name (the name it trades under). |
business_website | "read" | Show the website as read-only. |
company_type | "write" | Let the merchant edit the company type. |
If you supply values for every field in a section and mark those fields as hidden, self-registration hides the section and its horizontal bars. If every field on a page meets those conditions, self-registration also removes that page from the sidebar tracker.
The review step does not show fields that you hide and prefill. Confirm your field permissions before directing the merchant to self-registration.
Parameter Notes
Required merchant fields
| Field | Type | Requirement |
|---|---|---|
merchant.company_name | string | Supply the company name. |
merchant.contact_email | string | Supply the email address for merchant communications. |
merchant.plan | string | Supply the plan that configures Stax Pay. The request example uses "premium"; the schema's documented default is "connect-a". Set this field explicitly. |
Also supply registration.pricing_plan, registration.business_email, registration.email, and user.email. Use a registration pricing plan valid for your brand. For a new user, also supply user.name, user.password, and user.password_confirmation with matching password values.
Optional: Configure enrollment behavior
| Field | Type | Default | Behavior and constraints |
|---|---|---|---|
skip_account_page | boolean | Not specified | Set to true to skip the Set password page when the user logs in. |
hide_prefilled_fields | boolean | Not specified | Set to true to hide prefilled fields during self-registration. |
merchant.hosted_payments_token | string | Generated if omitted | Unique merchant identifier for Stax.js (the JavaScript library for collecting payment information). If you supply a value, make it unique. Otherwise, the API generates one using the company name and a random string. |
merchant.currency | array of strings | ["USD"] | Supply one currency, such as ["USD"] or ["CAD"]. Only one currency is supported at a time. |
Read merchant.hosted_payments_token from the enrollment response rather than copying another merchant's value. For example, the documented response contains "Fattmerchant-c3073a83d4a2"; use the value returned for your own merchant when integrating Stax.js.
Registration response fields
Read the following fields from the registration response object; do not add them to your enrollment request. In the descriptions below, ACH means Automated Clearing House (bank-account payments), card-present means the customer presents a physical card, and card-not-present means a remote or online payment. Underwriting means reviewing a merchant's application and business risk before approval.
| Field | Type | Description |
|---|---|---|
user_id | string | The ID of the user associated with this registration. |
merchant_id | string | The ID of the merchant associated with this registration. |
created_at | string | Timestamp when the registration was created. |
updated_at | string | Timestamp when the registration was last updated. |
plan_txamnt | string | Per-transaction fee amount (e.g., ".15"). |
plan_dcamnt | string | Discount rate amount (e.g., "2.99"). |
plan_ach_txamnt | string | ACH per-transaction fee amount. |
plan_ach_dcamnt | string | ACH discount rate amount. |
plan_ach_cap | string | ACH transaction cap. |
cp_transaction_rate | string | Card-present transaction rate. |
cp_per_item_rate | string | Card-present per-item fee. |
cp_amex_rate | string | Card-present AMEX rate. |
cp_amex_per_item_rate | string | Card-present AMEX per-item fee. |
credit_qual_disc_rate | string | Credit qualified discount rate. |
credit_qual_trans_fee | string | Credit qualified transaction fee. |
credit_mid_disc_rate | string | Credit mid-qualified discount rate. |
credit_mid_trans_fee | string | Credit mid-qualified transaction fee. |
credit_non_disc_rate | string | Credit non-qualified discount rate. |
credit_non_trans_fee | string | Credit non-qualified transaction fee. |
amex_qual_disc_rate | string | AMEX qualified discount rate. |
amex_qual_trans_fee | string | AMEX qualified transaction fee. |
amex_mid_disc_rate | string | AMEX mid-qualified discount rate. |
amex_mid_trans_fee | string | AMEX mid-qualified transaction fee. |
amex_non_disc_rate | string | AMEX non-qualified discount rate. |
amex_non_trans_fee | string | AMEX non-qualified transaction fee. |
is_flat_rate | boolean | Whether the merchant is on a flat-rate pricing plan. |
cp_credit_surcharge_rate | string \| null | Card-present credit surcharge rate, if applicable. |
cnp_credit_surcharge_rate | string \| null | Card-not-present credit surcharge rate, if applicable. |
cp_debit_trans_fee | string \| null | Card-present debit transaction fee, if applicable. |
cnp_debit_trans_fee | string \| null | Card-not-present debit transaction fee, if applicable. |
cp_debit_discount_rate | string \| null | Card-present debit discount rate, if applicable. |
cnp_debit_discount_rate | string \| null | Card-not-present debit discount rate, if applicable. |
plus_card_rate | string \| null | Tiered pricing plus card rate, if applicable. |
premium_card_rate | string \| null | Tiered pricing premium card rate, if applicable. |
files | array | Array of file objects associated with the registration. |
brand | string | The brand associated with this registration (e.g., "fattmerchant"). |
underwriting_substatus | string \| null | Current underwriting sub-status, if any. |
empty_required_fields | array | List of registration field names that are still required but have not been provided. Use this to determine what data is missing before underwriting. |
latest_file_uploaded_at | string \| null | Timestamp of the most recently uploaded file, or null if no files have been uploaded. |
merchant | object | The full merchant object associated with this registration. |
user | object | The full user object associated with this registration. |
Understand compliance responsibilities
If you use the returned hosted payments token with Stax.js, its hosted card fields send sensitive card information directly from the browser to Stax. This supports your Payment Card Industry Data Security Standard (PCI DSS) compliance efforts; it does not guarantee compliance or replace applicable requirements.
Required API fields are enrollment requirements, not a determination of your compliance obligations. Recommendations in this reference, such as verifying a merchant record before retrying an interrupted request, are integration guidance. Consult your legal and compliance teams regarding requirements specific to your integration.
Continue after enrollment
On HTTP 200, confirm that the response includes merchant, registration, user, and the action summary in message. Save merchant.id and user.id from this response for subsequent API requests; registration.merchant_id and registration.user_id identify the associated records. The documented response does not include registration.id, so do not depend on it. Enrollment creates or associates records; it does not mean the merchant is approved or active.
