Skip to main content

LegitApp Server API (v1)


Flow Diagram

enterprise_info.png


Overview

The LegitApp Developer API enables third-party applications to integrate LegitApp's authentication services into their systems with API and/or Web Submission. Requests and responses use JSON, except image uploads, which use multipart/form-data.


API

Authorization​

All API requests must be authorized with a developer secret key. Set this key in the HTTP Authorization header:

Authorization: Bearer DEVELOPER_SECRET_KEY

Keep your developer secret key on your server. Use the key issued for the target environment; Production and Sandbox credentials are separate.

Developer Secret Key​

You can find your developer secret key in the Developer Portal.

developer_portal_api_key.png

Example Code​

This example demonstrates how to use TypeScript with Express to make LegitApp API calls and handle webhook events from the LegitApp server

https://github.com/legitappcom/legitapp-developer-api-example

Postman collection for testing this sample code

https://legitapp-static.oss-cn-hongkong.aliyuncs.com/developer/legitapp-developer-api-example.postman_collection.json

Base URL​

Production: https://developer-api.legitapp.com/v1

Sandbox: https://developer-api-a7zu.legitapp.com/v1

Localization​

Set the optional Accept-Language header to a single supported language code. It controls localized catalog fields and error messages where translations are available. English is used when the header is omitted or unsupported; localized catalog fields also fall back to English when a translation is unavailable. Brand and model titles are not localized by this header.

LanguageCode
Englishen
Chinese (Simplified)zh-Hans
Chinese (Traditional)zh-Hant
Japaneseja
Koreanko
Polishpl
Spanishes
Vietnamesevi
Thaith
Arabicar
Germande
Frenchfr
Italianit
Dutchnl
Russianru

Webhook content uses the language configured in the Developer Portal, independently of the language used for API requests.

Endpoints​

Each endpoint's Response Fields table describes its successful response body. [] denotes an array element. Fields marked optional may be omitted; fields marked or null may contain an explicit null value. Error responses follow the shared Error Object Structure below.

  1. Get Category List GET /product_category

    Return a list of supported categories. The id of the selected category is required for other endpoints.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}
    Accept-LanguageStringLanguage of category titles. English by default. See Localization for supported language codes and fallback behavior.

    Response Fields

    FieldTypeDescription
    dataArray of objectsSupported categories. An empty array means no categories match the request.
    data[].idNumberCategory ID. Use this value as category_id in subsequent requests.
    data[].titleStringCategory title in the requested language, with English fallback.
    data[].icon_image_urlString or nullCategory icon URL, when available.
    • cURL Example:

      GET https://developer-api.legitapp.com/v1/product_category

      curl --location 'https://developer-api.legitapp.com/v1/product_category' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY' \
      --header 'Accept-Language: en'
    • 200: OK

      {
      "data": [
      {
      "id": 1,
      "title": "Sneakers",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/2022121855af36a336d46fa9.png"
      },
      {
      "id": 2,
      "title": "Streetwear",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/2020080594643c63fba91706.png"
      }
      ]
      }
    • 200: OK (No matching records)

      {
      "data": []
      }
  2. Get Brand List GET /product_brand

    Return a list of supported brands based on the selected category. The id of the selected brand is required for other endpoints.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Query Parameters

    NameTypeDescription
    category_id*Numberid in category object

    Response Fields

    FieldTypeDescription
    dataArray of objectsSupported brands for the selected category. An empty array means no brands match the request.
    data[].idNumberBrand ID. Use this value as brand_id in subsequent requests.
    data[].titleString or nullBrand title. This field is not localized by Accept-Language.
    data[].slugString or nullURL-friendly brand identifier, when available.
    data[].icon_image_urlString or nullBrand icon URL, when available.
    • cURL Example:

      GET https://developer-api.legitapp.com/v1/product_brand?category_id=1

      curl --location 'https://developer-api.legitapp.com/v1/product_brand?category_id=1' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "data": [
      {
      "id": 1,
      "title": "Air Jordan",
      "slug": "air-jordan",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/20200805a364b32e39ccf854.png"
      },
      {
      "id": 2,
      "title": "Nike",
      "slug": "nike",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/202008057146e477927daff3.png"
      }
      ]
      }
    • 200: OK (No matching records)

      {
      "data": []
      }
  3. Get Model List GET /product_model

    Return a list of supported models based on the selected category and brand. The id of the selected model is required for other endpoints.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Query Parameters

    NameTypeDescription
    category_id*Numberid in category object
    brand_id*Numberid in brand object

    Response Fields

    FieldTypeDescription
    dataArray of objectsSupported models for the selected category and brand. An empty array means no models match the request.
    data[].idNumberModel ID. Use this value as model_id in subsequent requests.
    data[].titleString or nullModel title. This field is not localized by Accept-Language.
    data[].icon_image_urlString or nullModel icon URL, when available.
    • cURL Example:

      GET https://developer-api.legitapp.com/v1/product_model?category_id=1&brand_id=1

      curl --location 'https://developer-api.legitapp.com/v1/product_model?category_id=1&brand_id=1' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "data": [
      {
      "id": 1,
      "title": "Jordan 1",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/20200805ad9a76acf6fb75f1.png"
      },
      {
      "id": 2,
      "title": "Jordan 2",
      "icon_image_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/202008057200b9222fb14047.png"
      }
      ]
      }
    • 200: OK (No matching records)

      {
      "data": []
      }
  4. Get Authentication Set GET /authentication_set

    Return an authentication set which decides the supported turnaround times and the required photos for authentication. The set assigned is based on the selected category, brand and model. The authentication_set_id and the turnaround_time_id are required for the submit authentication endpoint.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}
    Accept-LanguageStringLanguage of titles, subtitles and descriptions. English by default. See Localization for supported language codes and fallback behavior.

    Query Parameters

    NameTypeDescription
    category_id*Numberservice sets under this category
    brand_id*Numberservice sets under this brand
    model_id*Numberservice sets under this model
    tag_idStringidentifier of the kicks tag OR luxe tag

    Response Fields

    FieldTypeDescription
    idNumberAuthentication set ID. Use this value as authentication_set_id when submitting an authentication.
    turn_around_time_listArray of objectsSupported turnaround options for the selected category, brand and model.
    turn_around_time_list[].idNumberTurnaround option ID. Use this value as turnaround_time_id when submitting an authentication.
    turn_around_time_list[].titleStringLocalized turnaround title, such as < 30 Minutes.
    turn_around_time_list[].subtitleStringLocalized token-cost description, such as 3 Tokens.
    turn_around_time_list[].minuteNumberTurnaround time in minutes.
    turn_around_time_list[].creditStringToken cost as a decimal string, such as 3.0000.
    guidelineArray of objectsPhoto-taking instructions for the selected authentication set.
    guideline[].titleStringLocalized guideline title.
    guideline[].subtitleStringLocalized photo-taking instructions.
    guideline[].image_urlsStringGuideline image URL(s). Multiple URLs are comma-separated.
    placeholderArray of objectsPhoto requirements for the selected authentication set.
    placeholder[].titleStringLocalized name of the requested view.
    placeholder[].image_urlStringReference image URL for the requested view.
    placeholder[].example_image_urlString or nullExample photo URL, when available.
    placeholder[].descriptionStringLocalized instructions for taking the photo.
    placeholder[].requiredBoolean or NumberWhether this photo is required: true or 1 means required; false or 0 means optional.
    placeholder[].idNumberPhoto placeholder ID. Where photo-to-placeholder binding is enabled, pass it as images[].service_placeholder_id when submitting photos. Omit that optional request field otherwise.
    placeholder[].typeString or nullPlaceholder classification, when available.
    placeholder[].indexNumberDisplay order of the placeholder within the set.
    • cURL Example:

      GET https://developer-api.legitapp.com/v1/authentication_set?category_id=1&brand_id=1&model_id=1

      curl --location 'https://developer-api.legitapp.com/v1/authentication_set?category_id=1&brand_id=1&model_id=1' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY' \
      --header 'Accept-Language: en'
    • 200: OK

      {
      "id": 1,
      "turn_around_time_list": [
      {
      "id": 1,
      "title": "< 30 Minutes",
      "subtitle": "3 Tokens",
      "minute": 30,
      "credit": "3.0000"
      },
      {
      "id": 2,
      "title": "< 15 Minutes",
      "subtitle": "4 Tokens",
      "minute": 15,
      "credit": "4.0000"
      }
      ],
      "guideline": [
      {
      "title": "Exterior Outer",
      "subtitle": "Photograph your product in full (nothing is cropped out).",
      "image_urls": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/202009093d63c684a9ef68e5.png"
      }
      ],
      "placeholder": [
      {
      "title": "Exterior Outer (Left)",
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20210126b831199eb4dd177d.png",
      "example_image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/202009093d63c684a9ef68e5.png",
      "description": "Pinch to zoom and tap to focus.\nPhotograph your product in full.",
      "required": true
      }
      ]
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "We couldn't find the resources. Please check and try again.",
      "code": 404
      }
      ]
      }
  5. Upload Image V1 POST /asset_image

    Upload an image and return its URL for use when submitting an authentication or additional photos.

    • Maximum file size: 10 MiB (10,485,760 bytes). Use multipart/form-data with the file field. Let your HTTP client set the multipart boundary.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Body Parameters (form-data)

    NameTypeDescription
    file*FileJPG, JPEG or PNG image

    Response Fields

    FieldTypeDescription
    urlStringURL of the uploaded image. Use this value as images[].image_url when submitting an authentication or additional photos under the same account.
    • cURL Example:

      POST https://developer-api.legitapp.com/v1/asset_image

      curl --location 'https://developer-api.legitapp.com/v1/asset_image' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY' \
      --form 'file=@"/path/to/file"'
    • 201: Created

      {
      "url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101ac1e3aa40613446f.JPG"
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "We couldn't find the resources. Please check and try again.",
      "code": 404
      }
      ]
      }
  6. Submit Authentication POST /authentication

    After submitting an authentication, $LEGIT Tokens will be deducted according to the selected turnaround time, and an authentication ID will be provided.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Body Parameters

    NameTypeDescription
    authentication_set_id*Numberid in endpoint 4
    category_id*Numberid in endpoint 1
    brand_id*Numberid in endpoint 2
    model_id*Numberid in endpoint 3
    turnaround_time_id*Numberid in turn_around_time_list object in endpoint 4
    images*ArrayArray of image objects. Submit at least six photos and include all required views from the selected authentication set.
    images[’image_url’]*StringThe URL returned by Upload Image V1, uploaded under the same account.
    user_custom_codeStringOptional reference from your system. This field is not an idempotency key and is not guaranteed to be unique.
    user_remarkStringoptional
    tag_idStringoptional; identifier of the kicks tag OR luxe tag

    Photo Requirements

    Upload each photo first using the same account's developer key, then pass the returned URL unchanged. URLs already used by an authentication can be rejected as duplicates. Example URLs below are illustrative; replace them with your uploaded URLs. Do not assume a timed-out submission failed or retry it blindly: check your records and webhook events before creating another authentication.

    Optional image fieldTypeDescription
    images[].sourceString or nullPhoto source: album or camera.
    images[].user_image_remarkString or nullUser-provided remark for the image.
    images[].service_placeholder_idNumber or nullPhoto placeholder ID from Get Authentication Set. Use only where photo-to-placeholder binding is enabled for your environment; otherwise omit this field. The placeholder must belong to the selected authentication set.

    Response Fields

    FieldTypeDescription
    authentication_idStringID of the newly created authentication. Store this value as a string and use it to identify the authentication in subsequent requests and webhook events.
    • cURL Example:

      POST https://developer-api.legitapp.com/v1/authentication

      curl --location 'https://developer-api.legitapp.com/v1/authentication' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY' \
      --data '{
      "authentication_set_id": 1,
      "category_id": 1,
      "brand_id": 1,
      "model_id": 1,
      "turnaround_time_id": 1,
      "images": [
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo1.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo2.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo3.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo4.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo5.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20260101photo6.JPG"
      }
      ],
      "user_custom_code": "ABC123",
      "user_remark": "I bought this from ABC online shop."
      }'
    • 201: Created

      {
      "authentication_id": "1234567890123456"
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "Please provide the category, brand, and model IDs.",
      "code": 400
      }
      ]
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "Please upload all the required photos for authentication.",
      "code": 400
      }
      ]
      }
  7. Submit Extra Photos for Authentication POST /authentication/:id/photo

    Submit photos for an outstanding extra-photo request. Upload each photo first using Upload Image V1 under the same account, then submit the returned URLs.

    Notes

    • Replace :id with the authentication ID belonging to your account.
    • Use the latest authentication.extra_photo event to identify the requested views. This endpoint cannot accept photos after that request has been cancelled.
    • Image objects also accept the optional metadata fields documented under Submit Authentication, including source, user_image_remark, and, where enabled, service_placeholder_id. Placeholder IDs must belong to the existing authentication's set.
    • An optional top-level user_remark string can accompany the photos.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Body Parameters

    NameTypeDescription
    images*ArrayArray of Objects
    images[’image_url’]*StringThe URL returned by Upload Image V1, uploaded under the same account.

    Response Fields

    FieldTypeDescription
    successBooleantrue when the additional photos have been accepted. This confirms photo submission; it does not indicate that authentication is complete.
    • cURL Example:

      POST https://developer-api.legitapp.com/v1/authentication/1234567890123456/photo

      curl --location 'https://developer-api.legitapp.com/v1/authentication/1234567890123456/photo' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY' \
      --data '{
      "images": [
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101ac1e3aa40613446f.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101qw8ebc79qcqecqb7.JPG"
      }
      ]
      }'
    • 200: OK

      {
      "success": true
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "The selected authentication is not available. Please select again.",
      "code": 404
      }
      ]
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "The request for additional photos has been cancelled.",
      "code": 400
      }
      ]
      }
  8. Cancel Authentication PATCH /authentication/:id/cancel

    Cancel an authentication that is waiting for extra photos and refund the applicable service-level and extra-service tokens to your account. Authentications submitted through the LegitApp App, API or Web Submission Integration under the same account are supported.

    Notes

    • The authentication must have a status of user_pending (waiting for extra photos).
    • A pending extra-photo request must exist, and cancellation must be requested within 30 days of that request.
    • On success, the authentication status changes to cancelled, and the applicable tokens are refunded to the same account.
    • Repeated cancellation attempts return a 400 error. A successful cancellation is refunded only once.
    • This endpoint does not emit an authentication.cancelled webhook. That event is sent when an administrator cancels an authentication.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}
    Accept-LanguageStringLanguage of error messages. English by default.

    Path Parameters

    NameTypeDescription
    id*StringThe authentication ID, for example 1234567890123456. The authentication must belong to the account associated with your developer secret key.

    Body Parameters

    No request body is required.

    Response Fields

    FieldTypeDescription
    successBooleantrue when cancellation succeeds. The authentication is cancelled and the applicable tokens are refunded to the account.
    • cURL Example:

      PATCH https://developer-api.legitapp.com/v1/authentication/1234567890123456/cancel

      curl --location --request PATCH 'https://developer-api.legitapp.com/v1/authentication/1234567890123456/cancel' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "success": true
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "This action is not allowed at the moment. Please try again later.",
      "code": 400
      }
      ]
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "The request for additional photos has been cancelled.",
      "code": 400
      }
      ]
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "This action can only be performed within 30 days of the request for additional photos.",
      "code": 400
      }
      ]
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "We couldn't find the resources. Please check and try again.",
      "code": 404
      }
      ]
      }
    • 500: Internal Server Error

      {
      "errors": [
      {
      "id": "INTERNAL_SERVER_ERROR",
      "message": "A system error occurred. Please try again later.",
      "code": 500
      }
      ]
      }
  9. Get Authentication Detail

    GET /authentication/:id

    GET /authentication/tag/:tagId

    GET /authentication/user_custom_code/:code

    Return the details of an authentication with an authentic or replica result, identified by its authentication ID, tag ID or user custom code. Authentications submitted through the LegitApp App, API or Web Submission Integration under the same account are supported.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Notes

    • All three lookups are limited to authentications owned by the account associated with your developer secret key and with an authentic or replica result. Pending, cancelled and inconclusive cases are not available through these detail endpoints.
    • The custom-code lookup performs a partial match and returns one matching authentication. Custom codes are not guaranteed to be unique. Use the authentication ID for an unambiguous lookup.
    • URL-encode path values, for example ABC%201-2%20Hermes for ABC 1-2 Hermes.

    Response Fields

    FieldTypeDescription
    authentication_idStringAuthentication identifier. Keep it as a string.
    authentication_tokenNumberTokens charged for the authentication.
    item, item_full, cover_imageString or nullItem labels and cover image URL, when available.
    turnaround_timeNumberSelected turnaround time in minutes.
    status, resultStringAuthentication state and outcome. A typical completed response has status: completed and result: authentic or replica.
    fake_ratingNumber or nullApplicable to Replica results; otherwise null. A higher value indicates closer resemblance to an authentic item and greater difficulty identifying the replica. It is not a probability of the item being fake.
    category_id, brand_id, model_idNumberSelected catalog identifiers.
    tag_id, user_custom_code, user_remarkString or nullLinked tag identifier and optional user-provided references or remarks.
    created_at, updated_atStringUTC timestamps.
    imagesArrayImage objects containing image_url.
    logsArrayPublic timeline entries with action_title, action_subtitle and created_at.
    extra_photo_requestsArrayAdditional-photo request history. Request details, placeholders and completion timestamps can be null.
    certificate_pdf_urlString or nullURL of the PDF already generated for this authentication. It can remain null after completion until a PDF is generated; this GET request does not generate one. Use Generate PDF Certificate to obtain the current PDF URL.
    certificate_urlString (optional)Public certificate page URL. Included in Production for Authentic or Replica results; omitted in Sandbox. This is a webpage URL, separate from certificate_pdf_url.

    For Authentic and Replica results in Production, certificate_url links to the public certificate page. The same page URL is included in eligible completion webhooks. Anyone with the link can view that page, so share it only with the intended recipients.

    • cURL Example:

      GET https://developer-api.legitapp.com/v1/authentication/1234567890123456

      curl --location 'https://developer-api.legitapp.com/v1/authentication/1234567890123456' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'

      GET https://developer-api.legitapp.com/v1/authentication/tag/S15TQ3RTX5PP

      curl --location 'https://developer-api.legitapp.com/v1/authentication/tag/S15TQ3RTX5PP' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'

      GET https://developer-api.legitapp.com/v1/authentication/user_custom_code/ABC%201-2%20Hermes

      curl --location 'https://developer-api.legitapp.com/v1/authentication/user_custom_code/ABC%201-2%20Hermes' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "authentication_id": "1234567890123456",
      "authentication_token": 20,
      "item": "Luxury Handbags - Hermes",
      "item_full": "Luxury Handbags, Hermes, Double Sens Tote",
      "cover_image": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101mz238n238ncn2377.JPG",
      "turnaround_time": 180,
      "status": "completed",
      "result": "authentic",
      "fake_rating": null,
      "category_id": 4,
      "brand_id": 141,
      "model_id": 457,
      "tag_id": "S15TQ3RTX5PP",
      "user_custom_code": "ABC 1-2 Hermes",
      "user_remark": "I bought this from ABC online shop.",
      "created_at": "2026-01-01T09:00:00.000Z",
      "updated_at": "2026-01-30T04:21:13.000Z",
      "images": [
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101mz238n238ncn2377.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101bv3q2n8324bzm8c2.JPG"
      },
      {
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250101hf32zm3289x3fz83.JPG"
      }
      ],
      "logs": [
      {
      "action_title": "Service Request Submitted",
      "action_subtitle": "Authentication Service - 180 Minutes",
      "created_at": "2026-01-01T09:00:00.000Z"
      },
      {
      "action_title": "Authenticator Reviewed:",
      "action_subtitle": "LegitApp AI Model V1 provided a result. Please wait for our next authenticator.",
      "created_at": "2026-01-01T09:00:10.000Z"
      },
      {
      "action_title": "Authenticator Reviewed:",
      "action_subtitle": "Additional photos required",
      "created_at": "2026-01-01T09:01:00.000Z"
      },
      {
      "action_title": "User:",
      "action_subtitle": "Additional photos uploaded",
      "created_at": "2026-01-01T09:02:00.000Z"
      },
      {
      "action_title": "Authenticator Reviewed:",
      "action_subtitle": "Authenticator - OX1 provided a result. Please wait for our next authenticator.",
      "created_at": "2026-01-01T09:03:00.000Z"
      },
      {
      "action_title": "Authenticator Reviewed:",
      "action_subtitle": "Authenticator - OX2 provided a result.",
      "created_at": "2026-01-01T09:04:00.000Z"
      },
      {
      "action_title": "Final Result:",
      "action_subtitle": "The result is AUTHENTIC.",
      "created_at": "2026-01-01T09:05:00.000Z"
      }
      ],
      "extra_photo_requests": [
      {
      "checker_extra_example_image_urls": null,
      "checker_extra_part_image_required": null,
      "checker_extra_remark": null,
      "placeholder": null,
      "status": "completed",
      "created_at": "2026-01-01T09:01:00.000Z",
      "completed_at": "2026-01-01T09:02:00.000Z"
      }
      ],
      "certificate_pdf_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/certificates/1234567890123456/v1_20260101_123a1b45.pdf",
      "certificate_url": "https://legitapp.com/en/cert/1234567890123456"
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "The selected authentication is not available. Please select again.",
      "code": 404
      }
      ]
      }
  10. Generate PDF Certificate POST /authentication/:id/pdf_certificate

    Generate and return the PDF certificate URL for a completed authentication with an authentic or replica result. Authentications submitted through the LegitApp App, API or Web Submission Integration under the same account are supported.

    Notes

    • If a current PDF already exists for the authentication result, its URL is returned without generating a new PDF. Repeated requests reuse the current PDF. This endpoint does not force regeneration.
    • Only completed authentications with an authentic or replica result are eligible. Inconclusive, pending and cancelled authentications are not eligible.
    • For replica results, the PDF is an Authentication Report.
    • Generated PDF URLs have no scheduled expiry. If the PDF is regenerated through another workflow, the URL may change and the previous PDF may no longer be accessible. Use the latest URL returned by this endpoint.

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}
    Accept-LanguageStringLanguage of error messages. English by default.

    Path Parameters

    NameTypeDescription
    id*StringThe authentication ID, for example 1234567890123456. The authentication must belong to the account associated with your developer secret key.

    Body Parameters

    No request body is required.

    Response Fields

    FieldTypeDescription
    authentication_idStringID of the authentication associated with the PDF.
    certificate_pdf_urlStringURL of the current PDF certificate or Authentication Report. An existing current PDF is reused; otherwise a PDF is generated. Use the latest URL returned by this endpoint.
    • cURL Example:

      POST https://developer-api.legitapp.com/v1/authentication/1234567890123456/pdf_certificate

      curl --location --request POST 'https://developer-api.legitapp.com/v1/authentication/1234567890123456/pdf_certificate' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "authentication_id": "1234567890123456",
      "certificate_pdf_url": "https://legitapp-prod.oss-accelerate.aliyuncs.com/certificates/1234567890123456/v1_20260101_123a1b45.pdf"
      }
    • 400: Bad Request

      {
      "errors": [
      {
      "id": "INVALID_REQUEST",
      "message": "PDF certificates are only available for completed Authentic or Replica authentications.",
      "code": 400
      }
      ]
      }
    • 404: Not Found

      {
      "errors": [
      {
      "id": "NOT_FOUND",
      "message": "We couldn't find the resources. Please check and try again.",
      "code": 404
      }
      ]
      }
    • 500: Internal Server Error

      {
      "errors": [
      {
      "id": "INTERNAL_SERVER_ERROR",
      "message": "A system error occurred. Please try again later.",
      "code": 500
      }
      ]
      }
  11. Get Token Balance GET /token_balance

    Return account’s token balance

    Headers

    NameTypeDescription
    Authorization*StringBearer {{DEVELOPER_SECRET_KEY}}

    Response Fields

    FieldTypeDescription
    token_balanceNumberCurrent token balance of the account associated with your developer secret key. The value may include a fractional amount.
    • cURL Example:

      GET https://developer-api.legitapp.com/v1/token_balance

      curl --location 'https://developer-api.legitapp.com/v1/token_balance' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Bearer DEVELOPER_SECRET_KEY'
    • 200: OK

      {
      "token_balance": 67
      }
    • 401: Unauthorized

      {
      "errors": [
      {
      "id": "INVALID_LOGIN_USER",
      "message": "Your account has been disabled. For more details, please contact us.",
      "code": 401
      }
      ]
      }

Webhook

Receive LegitApp events in your webhook endpoint​

Listen to events in your LegitApp Developer account on your webhook endpoint so your backend systems can automatically execute actions accordingly.

Register a webhook endpoint in the Developer Portal to receive events for your account. LegitApp sends each event as a JSON object in an HTTP POST request. Production endpoints must use HTTPS; Sandbox endpoints may use HTTP or HTTPS.

Get Started

To start receiving webhook events in your server:

  1. Create a webhook endpoint handler to receive event data POST requests.
  2. Register your endpoint in the LegitApp Developer Portal.
  3. Test your webhook endpoint handler.
1. Create a Webhook Endpoint Handler

Set up a publicly reachable endpoint that accepts POST requests with a JSON body. Use HTTPS in Production. HTTP is also supported in Sandbox, provided the endpoint can be reached by LegitApp's servers.

Set up your endpoint function so that it:

  1. Handles POST requests with a JSON payload consisting of an Event object
  2. Returns exactly HTTP 200 within 30 seconds after successfully accepting the event. Keep each event handler brief. For lengthy tasks, save the event first, return 200, and process it separately.

Use event.type in a switch statement to handle each event differently. Replace the handleAuthentication... functions below with your application's logic, and use event.id to prevent duplicate processing.

// This example uses Express to receive webhooks.
const express = require('express');
const app = express();

app.post('/webhook', express.json(), async (request, response, next) => {
const event = request.body;

try {
switch (event.type) {
case 'authentication.cancelled':
await handleAuthenticationCancelled(event);
break;
case 'authentication.new_message':
await handleAuthenticationNewMessage(event);
break;
case 'authentication.extra_photo':
await handleAuthenticationExtraPhoto(event);
break;
case 'authentication.completed':
await handleAuthenticationCompleted(event);
break;
default:
console.log(`Unhandled event type ${event.type}`);
}

// Acknowledge receipt after the handler succeeds.
return response.sendStatus(200);
} catch (error) {
// Return an error so LegitApp can retry delivery.
return next(error);
}
});

app.listen(4242, () => console.log('Running on port 4242'));

Webhook Security

LegitApp currently does not sign webhook requests or include a dedicated verification header. For additional protection, allowlist LegitApp's fixed outbound webhook IP addresses and use a private webhook URL containing a long, randomly generated token. Contact our support team for the outbound IP addresses for your environment. Configure Production endpoints to accept HTTPS only.

2. Register and Configure Your Webhook Endpoint

Visit https://developer.legitapp.com and go to the Web Hook section. Input your server’s destination endpoint URL into the Webhook Endpoint URL field.

Each environment has one configured webhook destination. Events from services using the same developer key are delivered to that destination. Route them within your system using fields such as authentication_id or user_custom_code; multiple destinations and custom-code prefix filters are not currently supported.

You may also choose which order origins should trigger a webhook notification. You can filter events based on your integration needs:

  • Order created via API (Default): Only receive events for orders submitted via API
  • Order created via App: Only receive events for orders submitted via our App.
  • All new orders: Receive events for all orders associated with your business account, regardless of the submission source.

developer_portal_webhook.png

3. Test Your Handler

Testing your webhook logic is the most critical step before moving to production. Before deploying your integration to production, we highly recommend verifying your logic using our Sandbox Testing Environment.

  • Navigate to Orders: Go to the Authentication Orders section to view a list of orders created via the API in your Sandbox environment.
  • Filter by Status: Select the IN PROGRESS tab. Since webhook events are only triggered by active cases, this view allows you to focus on orders ready for testing.
  • Simulate Events: Within the Sandbox, you can manually trigger 3 ****specific event types to ensure your system processes different event type correctly.

developer_portal_sandbox.png

Types of Event

  1. authentication.cancelled

    • Triggered when an administrator cancels the authentication at your request. Cancellations through the Cancel Authentication API do not emit this event.

    • Example:

      {
      "id": "event_34jefj424cd84kr46a67f7fd95jv6a",
      "object": "event",
      "api-version": "v1",
      "created_at": "2025-01-01 00:00:00",
      "livemode": true,
      "type": "authentication.cancelled",
      "data": {
      "event_type": "authentication.cancelled",
      "authentication_id": "1234567890123456",
      "authentication_token": 10,
      "user_custom_code": "ABC 1-2 Hermes",
      "status": "cancelled",
      "cancelled_by": "administrator",
      "cancelled_at": "2025-01-01 00:00:00"
      }
      }
  2. authentication.new_message

    • Triggered when our checkers send you a new message. Messages are read-only in the API; when photos are requested, respond using Submit Extra Photos for Authentication.

    • Example:

      {
      "id": "event_5201ah754c5ebc762a66f7fd9ad7d9",
      "object": "event",
      "api-version": "v1",
      "created_at": "2025-01-01 00:00:00",
      "livemode": true,
      "type": "authentication.new_message",
      "data": {
      "event_type": "authentication.new_message",
      "authentication_id": "1234567890123456",
      "authentication_token": 10,
      "user_custom_code": "ABC 1-2 Hermes",
      "content": "Please take another photo with flashlight ON"
      }
      }
  3. authentication.extra_photo

    • Triggered when our checkers request for extra photo(s)

    • Placeholder titles and descriptions use the language configured in the Developer Portal. checker_extra_example_image_urls is a comma-separated string of image URLs; checker_extra_part_image_required is a comma-separated string of requested views. These fields and checker_extra_remark or placeholder may be null when not supplied.

    • Example:

      {
      "id": "event_a8fm30ff8s5eb87gn3kd7gbd9accna",
      "object": "event",
      "api-version": "v1",
      "created_at": "2025-01-01 00:00:00",
      "livemode": true,
      "type": "authentication.extra_photo",
      "data": {
      "event_type": "authentication.extra_photo",
      "authentication_id": "1234567890123456",
      "authentication_token": 10,
      "user_custom_code": "ABC 1-2 Hermes",
      "checker_extra_example_image_urls": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250102dn3n4aa40613551a.jpg,https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20250102dn3n4aa7fj4l33nf.jpg",
      "checker_extra_part_image_required": "Exterior Outer (Left), Box Label",
      "checker_extra_remark": "Please use camera flash.",
      "placeholder": [
      {
      "title": "Exterior Outer (Left)",
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/20210126b831199eb4dd177d.png",
      "example_image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/202009093d63c684a9ef68e5.png",
      "description": "Pinch to zoom and tap to focus.\nPhotograph your product in full."
      },
      {
      "title": "Box Label",
      "image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/2020080512f59cb060ef1976.png",
      "example_image_url": "https://legitapp-prod.oss-cn-hongkong.aliyuncs.com/202010191ba8a6f7a28699a6.png",
      "description": "Pinch to zoom and tap to focus.\nPhotograph your product in full."
      }
      ]
      }
      }
  4. authentication.completed

    • Triggered when our checkers complete your authentication

    • Example:

      {
      "id": "event_7423fj424c5ebb746a67f7fd9a2j33",
      "object": "event",
      "api-version": "v1",
      "created_at": "2025-01-01 00:00:00",
      "livemode": true,
      "type": "authentication.completed",
      "data": {
      "event_type": "authentication.completed",
      "authentication_id": "1234567890123456",
      "authentication_token": 10,
      "user_custom_code": "ABC 1-2 Hermes",
      "result": "authentic",
      "certificate_url": "https://legitapp.com/en/cert/1234567890123456"
      }
      }
      • result is authentic, replica or inconclusive. certificate_url is the public certificate page URL, available only in Production for Authentic or Replica results. It may be absent in Sandbox test events. This event does not generate a PDF; use Generate PDF Certificate for the PDF URL.

Event Delivery & Retry Logic

A delivery succeeds only when your endpoint returns exactly HTTP 200. Other status codes, including other 2xx responses and redirects, are treated as failures. Each request has a 30-second timeout, and redirects are not followed. These rules apply to initial delivery, automatic retries and manual retries.

Retries reuse the same event id and payload. Handle duplicate deliveries using the event ID. Delivery order is not guaranteed: a retried event can arrive after a newer event. Use event timestamps and your stored state to avoid overwriting newer information.

  • Automated Retry Schedule

    LegitApp makes up to three automatic delivery attempts, including the initial attempt. If an attempt fails, the retry schedule is as follows:

    1. Initial Attempt: Triggered immediately upon the event occurrence.
    2. Second Attempt: Scheduled approximately 30 minutes after the first failure.
    3. Third (Final) Attempt: Scheduled approximately 1 hour after the second failure.

    You can monitor the status of these attempts and see exactly when the next retry is scheduled by visiting the Events page in the Developer Portal.

  • Manual Retries

    You can manually retry a failed event from the Developer Portal, including after automatic retries are exhausted. Successfully delivered events cannot be manually retried. Manual retries do not count toward the three automatic attempts.

    To manually retry an event, go to the Events list in your Developer Portal and click the "Retry Event" button next to the desired log entry.

developer_portal_retry_event.png


Errors

Error Object Structure​

{
"errors": [
{
"id": "INVALID_REQUEST",
"message": "The request is invalid. Please check and try again.",
"code": 400
}
]
}
FieldDescription
idA short, machine-readable identifier representing the specific error type.
messageA human-readable explanation of the error, often including hints to resolve the issue.
codeHTTP status code associated with the error.

Use the HTTP status code and errors[].id for programmatic error handling. Error messages are intended for people and may vary with localization; do not match their wording in application logic. The examples below use English.

HTTP Status Code Summary​

CodeTitleDescription
200OKEverything worked as expected.
201CreatedThe server has successfully created a new resource
400Bad RequestThe request was unacceptable—usually due to missing or invalid parameters.
401UnauthorizedThe provided developer secret key is invalid or expired, or the developer/account access is disabled.
403ForbiddenThe required developer credentials are missing, or the caller does not have permission to perform this action.
404Not FoundThe requested resource does not exist.
500Internal Server ErrorsA server-side failure occurred. Please report to LegitApp team if this happens.
503Service UnavailableThe API service is temporarily unable to handle the request.

Error ID Reference Table​

Error IDDescription
PARAM_REQUIREDOne or more required parameters are missing. Include all required fields and try again.
EXCEED_UPLOAD_LIMITThe uploaded file exceeds the maximum allowed size. Reduce the file size and retry.
VALIDATION_ERROROne or more parameters failed validation. Verify all input fields and try again.
INVALID_REQUESTThe request is malformed or contains invalid data.
DUPLICATED_RECORDA record with the same data already exists and cannot be created again.
INVALID_LOGIN_USERThe user account is disabled and cannot be used to log in.
INVALID_TOKENThe provided authentication token is invalid.
EXPIRED_TOKENThe login session has expired. Please sign in again.
INVALID_PERMISSIONThe user does not have permission to access this resource.
NOT_FOUNDThe requested resource could not be found.
INTERNAL_SERVER_ERRORAn unexpected server error occurred. Please try again later.