Payment Validation

This guide explains how you can reply to Tip4Serv webhooks and how to control the validation (DELIVERED) of orders, either server-wide or per individual command.

Response Semantics

A) 200 OK response with no body

Effect:

  • All orders contained in the event are marked as DELIVERED.

  • The related financial object (payment or subscription) is marked as processed.

This is the default behavior: simple and global. Code example: Create an endpoint


B) 200 OK response with a targeted JSON

To validate only specific servers and/or commands, return application/json in the following format:

{
  "ok": true,
  "results": [
    {
      "server_id": "20859",
      "commands": [
        { "command_id": "0", "delivered": true },
        { "command_id": "1", "delivered": false, "error": "server unreachable" }
      ]
    },
    {
      "server_id": "20861",
      "delivered": true
    }
  ]
}

Priority Rules

  1. Servers/commands absent from the JSON are not modified (they remain undelivered).

  2. If delivered: false + error is provided, the platform logs the error and does not attempt to mark the command as delivered.


Headers & Content-Type

  • Content-Type: application/json; charset=utf-8

  • Always return HTTP 200 if the request was authenticated and functionally processed (even if you reject some commands with delivered: false).

  • Use 401 only for invalid signature/timestamp: Secure & Handle Webhook


3) Usage Examples

Example 1 — Validate everything (global)

Response:

HTTP/1.1 200 OK
Content-Length: 2

ok

Example 2 — Validate only some commands of a server

{
  "ok": true,
  "results": [
    {
      "server_id": "20859",
      "commands": [
        { "command_id": "0", "delivered": true },
        { "command_id": "1", "delivered": false, "error": "server unreachable" }
      ]
    }
  ]
}

Example 3 — Validate an entire server at once

{
  "ok": true,
  "results": [
    { "server_id": "20861", "delivered": true }
  ]
}

Example 4 — Validate nothing (acknowledged but functionally refused)

{
  "ok": true
}

Last updated