Account credit request form
What you'll build
Customers will:
- Select a recent purchase.
- Add one or more line items they want credit for.
- Choose a reason for each line item.
- Give extra details depending on the reason.
- Upload photos or supporting files.
- Submit the request for review.
Your team can then:
- Track the request's status and assign it to someone
- Approve or decline it, and record the approved credit amount
- Add internal notes
- Run actions when a request is approved or declined
How it works
Customer picks items
Adds evidence
Submits
Team reviews
Workflow acts
You can start simple, by collecting requests and notifying your team. Add automation later, such as approval buttons, applying credit to the customer's account automatically on approval, and sending data to other systems.
Before you start
This form works best when customers are signed in before they open it. SparkLayer can then identify the customer and use their customer, purchase and customer group data.
Before you build, decide:
- Which purchases customers can choose from (which purchase or order data).
- Which credit reasons you support.
- What evidence each reason needs.
- Who reviews requests.
- Whether customers get a confirmation email.
- What happens after approval or decline, for example sending the request to your ERP, helpdesk, finance system or support team.
Test on your store, not in Preview
The form shows each customer their own purchases, so it needs a logged-in customer. The Preview tab has no customer, so it can't show the purchase options. Embed the form on a page of your store where the SparkLayer Core Script is loaded, and test it there. The page can be private or hidden at first.
Create the form
- In the SparkLayer Dashboard, go to Forms (opens in your SparkLayer Dashboard in a new tab) and click Start with a blank form.
- On the Settings tab, enter the Form title "Account Credit Request" and click Save in the save bar.
- Go back to the Form tab to add fields.
Add the customer fields
The customer fills in these fields. On the Form tab, add:
| Field | Type | Notes |
|---|---|---|
| Purchase | Select | The purchase the request relates to. Required. |
| Credit request items | Group, with Repeatable on | Lets customers add several line items. Holds the fields below. |
| Reason category | Radio (or Select) | Inside the group. For example: Damaged, Missing, Incorrect item, Quality issue, Pricing issue, Other. Required. |
| Line item | Select | Inside the group. Options come from the selected purchase. Required. |
| Quantity affected | Number | Inside the group. Useful when only part of a line item needs credit. Required. |
| Reason for credit request | Long text | Inside the group. Lets the customer explain the issue. Required. |
| Supporting files | File upload | Inside the group. Photos, delivery notes or other evidence. |
| Preferred resolution | Radio (or Select) | Inside the group. Optional. For example: Credit note, Replacement, Contact me. |
To set up the repeatable group:
- Add a Group field and name it Credit request items.
- On its Properties tab, turn on Repeatable, so customers can add the group more than once.
- Add the reason, line item, quantity, description, file upload and resolution fields inside the group.
A repeatable group suits this form because one purchase can have several items that need credit.
Show the customer's purchases as options
The Purchase field takes its options from the customer's purchases, not from a list you type.
- Select the Purchase field.
- In Options, switch from Manual to Data source.
- Click Select data source.... In the Select a reference picker, click See advanced options to see every source, not only the form's fields.
- Open SparkLayer > Purchasing and click Select on Entry Customer's Purchases (the purchases for the SparkLayer customer associated with this entry).
- Click the Option label field reference and choose a clear label, such as Purchase Identifiers > Visible ID.
Entry Customer's Purchases is already filtered to the signed-in customer. Don't use Store's Purchases, which lists orders from all customers.
Show the purchase's line items as options
The Line item field then lists the items in the purchase the customer picked.
- Select the Line item field inside the group.
- In Options, switch to Data source and click Select data source..., then See advanced options.
- Open SparkLayer > Purchasing.
- Under Specific Purchase by SparkLayer ID, click Reference and Select your Purchase field.
- Scroll down and click Select on All Packages' Line Items (line items from every package in this purchase).
- Click the Option label field reference and choose a clear label, such as Line item Identifiers > SKU.
Show extra questions for each reason (optional)
Use display logic so customers only see the fields that matter for their reason:
| Reason | Extra fields to show |
|---|---|
| Damaged item | Photo upload, damage description |
| Missing item | Missing quantity, delivery note upload |
| Incorrect item received | Expected item, item received, photo upload |
| Quality issue | Description, photo upload |
| Pricing issue | Expected price, explanation |
| Other | General explanation |
For example, to show Supporting files only for damaged items:
- Select the Supporting files field.
- Open the Display logic tab.
- Under Conditional display logic, set Field to Credit request items > Reason category.
- Set Condition to Equals and Value to
damaged.
See Conditional logic for more.
Add validation
Check each request is complete before it reaches your team:
| Field | Validation |
|---|---|
| Purchase | Required |
| Line item | Required |
| Reason category | Required |
| Quantity affected | Required, greater than 0 |
| Reason for credit request | Required for "Other" or complex reasons |
| Supporting files | Required for damaged or quality issue requests |
Most fields only need to be required. Select the field and tick Required under Basic properties on the Properties tab. For anything more, such as "greater than 0", use the Validation tab. See Validation rules.
Add internal review fields (optional)
To manage the review in SparkLayer, add internal fields: fields only your team sees, next to each entry in the Dashboard. Customers never see them. If you review credit requests in your ERP or another system, you may not need this.
On the Internal fields tab, add fields such as:
| Internal field | Type | Purpose |
|---|---|---|
| Review status | Select | New, In review, Approved, Declined, Actioned. |
| Assigned to | Text or Select | Who's handling the request. |
| Decision | Select | Approved or declined. |
| Approved credit amount | Number | The amount the reviewer approves. |
| Reviewer notes | Long text | Internal comments. |
| External reference ID | Text | A ticket, ERP or finance system reference. |
| Approve button | Workflow trigger button | Starts the approval workflow. |
| Decline button | Workflow trigger button | Optional. Starts a decline workflow. |
This keeps the customer's form short while giving your team a structured place to record the review.
Review a request
When a customer submits the form, the request appears as an entry. Your team opens it, reviews the answers and uploaded files, and updates the internal fields. A typical review:
- Set Review status to In review.
- Add reviewer notes.
- Set a decision.
- If approved, enter the approved credit amount.
- Click Approve or Decline. A workflow handles the next action.
Notify your team on submission
Add a workflow that emails your team for every new submission:
- On the Workflows tab, click Create workflow.
- Add the Form submitted trigger.
- Add a Send email step to your team's address.
Forms made from a template already have one, called Notification of submission.
Send the customer a confirmation (optional)
To email the customer as well, add a second Send email step to that workflow on the Workflows tab. See Form workflows.
Clear line items when the purchase changes (optional)
The line item options depend on the selected purchase. If a customer picks a purchase, chooses line items, then changes the purchase, the old line items stay selected. A workflow can clear them.
- On the Workflows tab, add a workflow and name it "Reset credit items when purchase changes".
- Click + Add Trigger, choose Answer updated and set it to watch the Purchase field.
- Add a Clear answer step and set its Target reference to Credit request items.
Answer updated
Clear answer
Customer chooses again
This is a good example of using a workflow to keep dependent fields accurate (see Reset a dependent field).
Approve requests
After review, a workflow can handle the next action, for example sending the approved request to another system, emailing the customer and updating the entry's status. Create a workflow called "Credit request approved". Use either the Approve button or the Review status field as the trigger.
Option A: an internal button
| Part | Value |
|---|---|
| Trigger | Internal button clicked, on the Approve button |
| Step 1 | Condition |
| Step 2 | API request or Send email |
| Step 3 | Update entry or row |
Option B: a status field
| Part | Value |
|---|---|
| Trigger | Internal field updated, watching Review status |
| Condition | Review status equals "Approved" |
| Step 1 | API request or Send email |
| Step 2 | Update entry or row |
Common approval actions
Whichever trigger you use, the workflow can:
- Send the approved request to an ERP or finance system with an API request step
- Create a support ticket by calling an external API
- Email the customer
- Set Review status to "Actioned"
- Update the customer record with an Update customer step
Decline requests
For a structured decline process, create a second workflow called "Credit request declined".
| Part | Value |
|---|---|
| Trigger | Internal button clicked (the Decline button), or Internal field updated |
| Condition | Decision equals "Declined" |
| Step 1 | Send email |
| Step 2 | Update entry or row |
Common decline actions are emailing the customer, setting Review status to "Declined", adding an internal note and storing the date the request was declined.
Keep the customer's message short and clear. If the request needs a personal explanation, ask the reviewer to write an internal note, and include it in the email.
Send approved requests to another system (optional)
If your finance, ERP, helpdesk or support system accepts API requests, add an API request step after approval. A developer usually sets this step up, as they know what data your other system expects. The request can include:
- Customer details
- Purchase or order details
- The requested line items and reasons
- Uploaded file references
- The approved amount and reviewer notes
- A link to the entry
- The external reference ID
Build the request body in the template editor. Insert values with + Reference rather than typing reference paths (see Data references). Use + Loop to output each item in the Credit request items group, and + Condition for conditional content.
Example JSON template for your developer
Here's an example JSON template. Your field IDs and the fields your system expects will differ:
{
"purchase_id": "{{sparklayer:purchases.purchases[purchase_identifiers.sparklayer={entry:current.answers.order_id}][0].purchase_identifiers.platform}}",
"returns": [{% for item in {{entry:current.answers.returns}} %}
{
"sku": "{{item.sku}}",
"quantity": "{{item.quantity}}",
"reason": "{{item.reason}}",
"images": [{% for img in item.images %}"{{img}}"{% if not forloop.Last %},{% endif %}{% endfor %}]
}{% if not forloop.Last %},{% endif %}
{% endfor %}]
}Each uploaded file's value is a SparkLayer file ID. Your system can fetch the files securely with the Files API.
Publish, embed and test
- When the form, internal fields and workflows are ready, click Publish and include all three (see Versions and publishing).
- Decide where customers will find the form: on an account page, linked from an order or support page, or shared as a link with selected customers.
- Add the form to your store with the options on the Embed tab. Use a page where the SparkLayer Core Script is loaded, and where customers can sign in and see the SparkLayer account and cart widgets. See Embed and style a form.
The Preview tab is less useful for this form, because it has no logged-in customer. For this and any other advanced form, test on your store.
Testing checklist
- A logged-in customer can open the form.
- The Purchase field shows the expected purchases.
- The Line item field shows the selected purchase's line items.
- Changing the purchase clears previously selected line items.
- Reason-specific fields show and hide correctly.
- Required fields stop incomplete submissions.
- File uploads work.
- A submitted request appears as an entry.
- The right internal fields appear next to entries.
- Submission notification emails are sent.
- Approval and decline workflows run correctly.
- API requests send the expected data, if you use them.
If you use customer-specific purchase data, test with more than one customer account.
Tips
- Keep the customer's form short: the purchase, affected line items, reason and evidence.
- Use a repeatable group for line items, so customers don't submit a separate form for each item.
- Use display logic for reason-specific questions, so extra fields only appear when needed.
- Use file uploads for evidence. Photos help most with damaged or quality-related requests.
- Keep admin-only statuses, notes and decisions in internal fields, never on the customer's form.
- Clear dependent fields when the field they depend on changes.
- Use workflows for notifications, approvals, API requests, status updates and other repeatable admin steps.
- Start simple: launch with manual review, then add API integrations later.
- Test with real customer accounts to check purchases and line items show as expected.
Last updated