Checkout questions, now with ten types

A payment link can now ask for a number, a date, a phone number, a country, a choice from a list or a ticked box, and checks each answer before payment.

4 min read Checkout

The extra questions of a payment link: a short text question with a pattern, then a number, a country and a dropdown

A payment link has always been able to ask a few extra questions, but every answer was a line of free text. One customer wrote "3", the next "three seats", and a country came in every spelling. Now each question has a type, and the checkout checks the answer before the customer is shown where to pay.

Ten types of question

  • Short text and long text, with the fewest and most characters you accept.
  • Number, between the lowest and highest you set, for seats, a quantity or a size.
  • Email and link, checked as an email address and as a web address.
  • Phone, with the country picked from a list of flags, and the number checked against that country's numbering plan.
  • Date, between the earliest and latest you allow, for a booking or a start date.
  • Dropdown, with up to 20 options in the order you write them.
  • Checkbox, for agreeing to your terms. A required one has to be ticked.
  • Country, picked from the list of countries.

Open a payment link and find Extra questions. Pick each question's type, mark it required or not, and open its settings for a placeholder, a line of help under the field and the limits its type takes. A link asks up to 10 questions, in the order you put them in.

What your customer sees

Each type gets the field it needs: a number field, a phone field with flags, a list to choose from, a box to tick. An answer that does not fit is pointed out under its field, so you never receive an order with a quantity of "lots".

A checkout asking for a Discord username, a number of seats, a billing country, an edition and agreement to the licence terms, all filled in

Hold a short answer to a pattern

A short text question can also take a regular expression that the whole answer has to match, with your own message for a customer whose answer does not. [A-Z]{3}-\d{4} asks for an order reference like ABC-1234, and [a-z0-9_.]{2,32} for a Discord username.

A pattern that takes too long to decide counts as no match, so even a badly written one cannot hold up your checkout.

Answers on the charge

Every answer is kept on the charge and shown on its page the way it was asked: a date written out, a phone number in its international form, a country with its flag, a ticked box as a tick.

In the API and in webhooks, the charge's custom_fields lists each answer with its label , value and type . The value is always a string, written one way whatever the customer typed: yes for a ticked box, YYYY-MM-DD for a date, E.164 such as +33612345678 for a phone number and the two-letter code for a country.

The answers on a charge

Copy failed. Select the code and copy it manually.

{
  "custom_fields": [
    {"label": "Discord username", "value": "mara", "type": "text"},
    {"label": "Seats", "value": "3", "type": "number"},
    {"label": "Billing country", "value": "FR", "type": "country"},
    {"label": "Edition", "value": "Studio", "type": "select"},
    {"label": "I accept the licence terms", "value": "yes", "type": "checkbox"}
  ]
}

Through the API and the MCP server

POST /v1/payment-links and PATCH /v1/payment-links/{id} take each question's type and settings in custom_fields , and so do the MCP tools create_payment_link and update_payment_link .

cURL

Copy failed. Select the code and copy it manually.

curl -X POST https://api.velirapay.com/v1/payment-links \
  -H "Authorization: Bearer $VELIRAPAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Pro license, 1 year",
    "pricing_type": "fixed",
    "amount": "49.00",
    "currency": "USD",
    "custom_fields": [
      {"label": "Discord username", "type": "text", "pattern": "[a-z0-9_.]{2,32}", "pattern_hint": "Use your Discord username, without the @."},
      {"label": "Seats", "type": "number", "required": true, "min": "1", "max": "25"},
      {"label": "Billing country", "type": "country", "required": true},
      {"label": "Edition", "type": "select", "required": true, "options": ["Personal", "Studio", "Team"]},
      {"label": "I accept the licence terms", "type": "checkbox", "required": true}
    ]
  }'

Nothing you built before needs to change. A question sent as a label alone, with or without required , is still a short text question, and links made before types existed keep their questions as short text.

Never a wallet secret

No question, placeholder, help line, option or message may ask for a recovery phrase or a private key, and an answer that looks like one is refused. A checkout can ask what you need to fulfil an order, and never what would empty your customer's wallet.

The payment links guide lists every setting and the limits of each type.

Share this article
X LinkedIn