Implement the validation URL
Before you start — you are implementing, not calling
The validation URL is an endpoint you create on your own server. Appmax calls that endpoint during installation (POST /app/client/generate) — you do not call anything from Appmax here.
If you are trying to find out which Appmax endpoint to invoke in order to "validate the URL", you are on the wrong track. What actually happens is:
- Appmax sends a
POSTto your URL with a known payload. - You respond with
HTTP 200and a JSON body containingexternal_id(a UUID v4 generated by you).
To test the endpoint once implemented, use the interactive tool in Test the validation URL.
This guide gives you a ready-to-run handler in Go, Node.js and PHP. Copy it, adjust the route and register the public URL in the application panel.
Contract
Appmax makes a single server-to-server call against the validation URL registered in the panel, as part of processing POST /app/client/generate. Your URL must meet the contract below exactly.
Request — what Appmax sends you
| Item | Value |
|---|---|
| Method | POST |
| Content-Type | application/json |
| Body | JSON with the fields below — only app_id is guaranteed; the rest are optional |
{
"app_id": "123",
"client_id": "MERCHANT_CLIENT_ID",
"client_secret": "MERCHANT_CLIENT_SECRET",
"client_key": "EXTERNAL_KEY",
"external_key": "EXTERNAL_KEY"
}| Field | Type | Required | Description |
|---|---|---|---|
app_id | string | Yes | The application's App Numerical ID, sent as a string (e.g. "123") — not the UUID. The only field always present. |
client_id | string | No | Client ID generated for the merchant in this installation. May not be sent. |
client_secret | string | No | Client Secret generated for the merchant in this installation. May not be sent. |
client_key | string | No | Same value as external_key (kept for backwards compatibility). May not be sent. |
external_key | string | No | Key provided by the merchant when the installation was created (store_id, merchant_id, etc.). May not be sent. |
WARNING
Your handler must only validate the presence of app_id — the remaining fields are optional and their absence must not be treated as an error. Remember that app_id arrives as the Numerical ID in string form (e.g. "123"), not as a UUID: do not reject the payload because the value is not a number type.
Response — what you must return
| Item | Value |
|---|---|
| HTTP status | 200 |
| Content-Type | application/json |
| Body | JSON with external_id (required) and alias (optional) |
{
"external_id": "37bb0791-ee0b-457d-860c-186e32978bcd",
"alias": "My Store"
}| Field | Type | Required | Description |
|---|---|---|---|
external_id | string (UUID v1-v5) | Yes | A UUID generated by you, unique per installation. Appmax stores this value and later returns it as the external-id header in front-end calls through the CDN. |
alias | string | No | Display name of the store in Appmax. If omitted, Appmax uses the default name. |
Failures that abort the installation
If your URL does not respond, responds with an error (4xx/5xx), or without parseable JSON, the POST /app/client/generate step returns 400 and no merchant credentials are issued. A missing, non-UUID, or repeated external_id raises no error — Appmax uses the installation's client_id instead, and the UUID you stored does not work on the front-end. The exception is Payments and Security apps, where a missing external_id also returns 400. Diagnosis in Installation troubleshooting.
Persist the same value you responded with
Appmax recognizes the external_id that is in your response body. Generate the UUID once, respond with it and store that same value, alongside the request's app_id and external_key. Storing a different one (by generating twice, for example) makes the checkout fail with 404 Merchant not found. Full lifecycle in external-id.
Implementation
The examples below are minimal handlers that fulfil the contract. In production, before responding 200, persist the triple external_key → client_id/client_secret → external_id in your database (see the Persistence section).
Minimal dependencies — just net/http from the stdlib plus github.com/google/uuid to generate a UUID v4.
go mod init my-app
go get github.com/google/uuidpackage main
import (
"encoding/json"
"log"
"net/http"
"github.com/google/uuid"
)
type request struct {
AppID string `json:"app_id"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
ClientKey string `json:"client_key"`
ExternalKey string `json:"external_key"`
}
type response struct {
ExternalID string `json:"external_id"`
Alias string `json:"alias,omitempty"`
}
func validationHandler(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
w.Header().Set("Allow", "POST")
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
var req request
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
http.Error(w, "invalid json", http.StatusBadRequest)
return
}
if req.AppID == "" {
http.Error(w, "invalid payload", http.StatusBadRequest)
return
}
// In production: persist req.ClientID, req.ClientSecret and externalID
// linked to req.ExternalKey in your database before responding.
externalID := uuid.New().String()
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(response{ExternalID: externalID})
}
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/appmax/validate", validationHandler)
log.Println("listening on :8080 — POST /appmax/validate")
if err := http.ListenAndServe(":8080", mux); err != nil {
log.Fatal(err)
}
}Persistence
Generate a new UUID on every health check request, reinstallation included: a value that already exists in the database is replaced by the installation's client_id, without warning. Store the external_id the moment you generate it and, if the health check runs again for the same store, keep the new value and discard the previous one.
The minimum persistence structure is:
| Column | Source | Use |
|---|---|---|
external_key | received in the payload | Links the row to the platform's merchant. |
client_id | received in the payload | Credential used later in server-to-server calls. |
client_secret | received in the payload | Credential used later in server-to-server calls. |
external_id | generated by you | Returned in the response and reused as the external-id header on the front end. |
alias | optional | Display name. |
For the service that receives the callback and stores the merchant credentials in Postgres — the other half of the installation —, see Automate credential creation. For the external_id lifecycle after installation, see external-id.
Register the URL in the panel
Once your handler is live at a public URL, open View Application → Develop and fill the Validation URL field with the full URL (including the endpoint path, e.g. https://onboarding.myapp.com/appmax/validate). Details of the other panel fields in Application identifiers and URLs.
Before starting the app's review or a real installation, validate your handler in Test the validation URL — the tool makes two calls with different external_key values and shows both UUIDs side by side, to make sure you are not returning a hardcoded value.
Common limitations
localhostdoes not work — Appmax cannot reach private networks. In development, use ngrok, beeceptor or similar and register the generated public URL.- HTTPS is mandatory in production — in production Appmax only calls
https://URLs. In sandbox the validation tool accepts HTTP, but avoid that setup. - Avoid redirects — the health check follows up to 5 redirects, but each hop is one more point of failure. If your URL redirects (e.g. trailing slash, canonical subdomain), register the final URL in the panel.
- Short timeout — respond in under 5 seconds. Heavy logic (third-party synchronization, welcome emails) must go to an asynchronous queue after the
200. - Respond
200—4xxand5xxfail the installation with400. external_idmust be unique per installation — do not return a hardcoded UUID. The validation tool detects this and marks it as a failure.
See also
- App installation — health check — the full flow where the URL is called.
- Test the validation URL — interactive tool to test the contract.
external-id— lifecycle of the UUID you return here.- Automate credential creation — complete example with callback + Postgres persistence.
- Application identifiers and URLs — reference for the panel fields.