Skip to content

Account credit request form

Steps for

What you'll build

Customers will:

  1. Select a recent purchase.
  2. Add one or more line items they want credit for.
  3. Choose a reason for each line item.
  4. Give extra details depending on the reason.
  5. Upload photos or supporting files.
  6. 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

The credit request process

Customer picks items

They choose a purchase, then each affected line item and a reason.
(this flows forward)

Adds evidence

Extra fields appear for the reason; they upload photos or files.
(this flows forward)

Submits

The request arrives as an entry and your team is notified.
(this flows forward)

Team reviews

Reviewers update internal fields and decide.
(this flows forward)

Workflow acts

Approve or decline: email the customer or send it to another system.

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

  1. In the SparkLayer Dashboard, go to Forms (opens in your SparkLayer Dashboard in a new tab) and click Start with a blank form.
  2. On the Settings tab, enter the Form title "Account Credit Request" and click Save in the save bar.
  3. Go back to the Form tab to add fields.

Add the customer fields

The customer fills in these fields. On the Form tab, add:

FieldTypeNotes
PurchaseSelectThe purchase the request relates to. Required.
Credit request itemsGroup, with Repeatable onLets customers add several line items. Holds the fields below.
Reason categoryRadio (or Select)Inside the group. For example: Damaged, Missing, Incorrect item, Quality issue, Pricing issue, Other. Required.
Line itemSelectInside the group. Options come from the selected purchase. Required.
Quantity affectedNumberInside the group. Useful when only part of a line item needs credit. Required.
Reason for credit requestLong textInside the group. Lets the customer explain the issue. Required.
Supporting filesFile uploadInside the group. Photos, delivery notes or other evidence.
Preferred resolutionRadio (or Select)Inside the group. Optional. For example: Credit note, Replacement, Contact me.

To set up the repeatable group:

  1. Add a Group field and name it Credit request items.
  2. On its Properties tab, turn on Repeatable, so customers can add the group more than once.
  3. 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.

  1. Select the Purchase field.
  2. In Options, switch from Manual to Data source.
  3. Click Select data source.... In the Select a reference picker, click See advanced options to see every source, not only the form's fields.
  4. Open SparkLayer > Purchasing and click Select on Entry Customer's Purchases (the purchases for the SparkLayer customer associated with this entry).
  5. 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.

  1. Select the Line item field inside the group.
  2. In Options, switch to Data source and click Select data source..., then See advanced options.
  3. Open SparkLayer > Purchasing.
  4. Under Specific Purchase by SparkLayer ID, click Reference and Select your Purchase field.
  5. Scroll down and click Select on All Packages' Line Items (line items from every package in this purchase).
  6. 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:

ReasonExtra fields to show
Damaged itemPhoto upload, damage description
Missing itemMissing quantity, delivery note upload
Incorrect item receivedExpected item, item received, photo upload
Quality issueDescription, photo upload
Pricing issueExpected price, explanation
OtherGeneral explanation

For example, to show Supporting files only for damaged items:

  1. Select the Supporting files field.
  2. Open the Display logic tab.
  3. Under Conditional display logic, set Field to Credit request items > Reason category.
  4. 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:

FieldValidation
PurchaseRequired
Line itemRequired
Reason categoryRequired
Quantity affectedRequired, greater than 0
Reason for credit requestRequired for "Other" or complex reasons
Supporting filesRequired 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 fieldTypePurpose
Review statusSelectNew, In review, Approved, Declined, Actioned.
Assigned toText or SelectWho's handling the request.
DecisionSelectApproved or declined.
Approved credit amountNumberThe amount the reviewer approves.
Reviewer notesLong textInternal comments.
External reference IDTextA ticket, ERP or finance system reference.
Approve buttonWorkflow trigger buttonStarts the approval workflow.
Decline buttonWorkflow trigger buttonOptional. 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:

  1. Set Review status to In review.
  2. Add reviewer notes.
  3. Set a decision.
  4. If approved, enter the approved credit amount.
  5. 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:

  1. On the Workflows tab, click Create workflow.
  2. Add the Form submitted trigger.
  3. 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.

  1. On the Workflows tab, add a workflow and name it "Reset credit items when purchase changes".
  2. Click + Add Trigger, choose Answer updated and set it to watch the Purchase field.
  3. Add a Clear answer step and set its Target reference to Credit request items.
Reset credit items when purchase changes

Answer updated

Watching Purchase.
(this flows forward)

Clear answer

Target: Credit request items.
(this flows forward)

Customer chooses again

They pick line items from the new purchase.

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

PartValue
TriggerInternal button clicked, on the Approve button
Step 1Condition
Step 2API request or Send email
Step 3Update entry or row

Option B: a status field

PartValue
TriggerInternal field updated, watching Review status
ConditionReview status equals "Approved"
Step 1API request or Send email
Step 2Update 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".

PartValue
TriggerInternal button clicked (the Decline button), or Internal field updated
ConditionDecision equals "Declined"
Step 1Send email
Step 2Update 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

  1. When the form, internal fields and workflows are ready, click Publish and include all three (see Versions and publishing).
  2. 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.
  3. 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.
Was this page helpful?

Last updated