Implementing custom field at checkout

Hello,

I’m currently developing an app on the Square platform and would appreciate some guidance.

The core functionality I’m aiming to implement is as follows:

  1. When a merchant installs the app through app integration, it should create a custom field at checkout (both in Square Online and the POS system).
  2. This custom field will allow customers to enter a 16-digit membership number.
  3. Upon entering the membership number, the app will validate it.
  4. If the membership number is valid, the app will apply a discount to the customer’s order.

I have a few specific questions:

What is the best approach (specific API) to create and manage custom fields in the Square checkout process?
How can I efficiently validate the 16-digit membership number during the checkout process?
What are the recommended methods for applying discounts programmatically once the membership number is validated?
Are there any potential pitfalls or best practices I should be aware of when integrating this functionality into both the Square’s online and POS system?

Thank you in advance for your help!

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Payment API: Process Online and In-Person Payments
Build on iOS: Point of Sale API
App Marketplace Requirements

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

To implement the functionality you described, you would likely need to use a combination of Square’s APIs.

  1. Creating a custom field at checkout: Currently, Square’s APIs do not support the creation of custom fields at checkout in the Square Online or POS system. You would need to build a custom solution to capture and validate the membership number.

  2. Validating the membership number: The validation of the membership number would need to be handled within your own system. Square’s APIs do not provide a built-in method for validating custom input like a membership number.

  3. Applying discounts: You can use the Orders API to programmatically apply discounts to an order. You would create an Order object with a line item for the product and a line item for the discount, then use the CreatePayment endpoint of the Payments API to charge the order.

  4. Potential pitfalls and best practices: Since Square does not support custom fields at checkout, you would need to ensure your custom solution integrates smoothly with the checkout process. This could involve creating a custom checkout flow in your own application, which could be complex. You would also need to ensure your solution is secure and compliant with all relevant regulations, particularly if you are handling sensitive customer information.

Remember, any changes to the checkout flow or payment process should be thoroughly tested to ensure they work correctly and provide a good user experience.

This answer was reviewed by @Bryan-Square.

I have a follow-up question for clarification: When creating a custom solution, does this involve only adding a custom field for the membership number, or do I need to build an entire custom checkout flow (including order details, custom field, and payment options)?

Can I make it using .NET Square sdk in .NET core web app?

You can add a custom field to checkouts created with the Checkout API or you can create an style your own unique checkout experience with the Web Payments SDK. :slightly_smiling_face: