Stripe Create Customer
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Forms,Connectors,Stripe account
Creates a customer in Stripe and saves the card the user entered in a Stripe Credit Card field as the customer's default card. The action puts the new customer ID in a token, so you can store it and charge or subscribe the customer later.
The card is sent from the browser straight to Stripe, which returns a one-time token. Only that token reaches your server, so card numbers never pass through your site.
This action is part of the Stripe add-on (DnnSharp.Stripe). The add-on is installed separately and needs the STRIPE feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Stripe actions, the add-on isn't installed.
Typical Use Cases
- Register a paying customer with a card on file when they sign up
- Create the customer that Stripe Create Subscription subscribes to a plan
- Save the Stripe customer ID with your user or account record
Don't use it to
- Take a payment. Use Stripe Checkout instead.
- Create a customer and charge the same card in one submission. Stripe Payment with Token (not SCA compliant) creates its own customer, and a card token can only be used once.
- Update an existing customer. The action always creates a new one.
Related Actions
| Action Name | Description |
|---|---|
| Add Stripe Connector | Creates the Stripe connector that holds your secret key. |
| Stripe Create Subscription | Subscribes the new customer to a plan. |
| Stripe Create Plan | Creates the plan to subscribe the customer to. |
| Stripe Checkout | Takes a payment, and can link it to the customer with Customer ID. |
| Run SQL Query | Saves the customer ID in your database. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| API Connector | The Stripe connector with your secret key. See Add Stripe Connector. When using an expression, the value must be the connector ID. | Yes | None | Yes |
| Payee Email | The customer's email, for example [Email]. | Yes | empty string | No |
| Description | A description that helps you find the customer in the Stripe dashboard, for example [FirstName] [LastName] - account [AccountId]. | Yes | empty string | No |
| Card Field | The form's Stripe Credit Card field. The list shows fields of that type only. | Yes | empty string | Yes |
| Output Token Name | The name of a token to save the new customer ID in, for example StripeCustomerId. | No | empty string | No |
| On Error | Actions to run when Stripe rejects the request, for example when the card is declined. The error is in [Stripe:ErrorMessage]. | No | None | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Output Token Name | The ID of the new customer, for example cus_.... It's empty if the action fails. |
The action also sets [Stripe:ErrorMessage] in On Error.
The Stripe Credit Card field
Add a Stripe Credit Card field to the form and set its Publishable key, for example pk_test_.... The key must belong to the same Stripe account, and the same test or live mode, as the connector's secret key.
When the user submits the form, the field sends the card to Stripe and gets back a token. The field's value is that token, as JSON. This action reads the token's id and sends it to Stripe with the customer. If the field has address fields linked to it, the address is saved with the card.
Considerations
- Actions after it run on success. Unlike some Stripe actions, there's no On Success list. The actions after this one run, with the customer ID in the output token.
- On Error only covers Stripe errors. A declined card or a wrong key runs On Error. If it's empty, the action fails with the error. A missing connector or an empty card field fails the action with an exception, and On Error doesn't run.
- One token, one use. Stripe accepts a card token only once. Don't use the same card field in another Stripe action in the same submission.
- Every run creates a customer. Stripe doesn't check for duplicates. Save the ID and reuse it, rather than creating a new customer each time.
- No SCA. The card is saved without Strong Customer Authentication (3D Secure). Later charges to cards that need authentication, for example many European cards, may be declined.
- Test first. Use test keys (
sk_test_...in the connector,pk_test_...in the field) and Stripe's test cards. - Where it works. Forms only, because the card comes from a form field.
Examples
To understand how to use the below examples, please see Running Examples.
1. Create a customer and save the ID
This action creates a customer from the card in the StripeCard field and saves the customer ID in [StripeCustomerId]. Replace the connector ID with your Stripe connector.
{
"Title": "Stripe Create Customer",
"ActionType": "StripeCreateCustomer",
"Description": "Create the Stripe customer with the card on file",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"PayeeEmail": "[Email]",
"Description": "[FirstName] [LastName]",
"CardField": "StripeCard",
"OutputTokenName": "StripeCustomerId"
}
}
2. Show an error when the card is declined
This action creates the customer, and shows Stripe's message if the card is declined. The actions after it, such as saving [StripeCustomerId], should have the condition [StripeCustomerId] != "".
{
"Title": "Stripe Create Customer",
"ActionType": "StripeCreateCustomer",
"Description": "Create the Stripe customer",
"Parameters": {
"Credentials": {
"IsExpression": true,
"Entry": "[StripeConnectorId]"
},
"PayeeEmail": "[Email]",
"Description": "Account [AccountId]",
"CardField": "StripeCard",
"OutputTokenName": "StripeCustomerId",
"OnError": [
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Parameters": {
"Message": "<p>We couldn't save your card: [Stripe:ErrorMessage]</p>"
}
}
]
}
}
Revised 09/27/2026