InAppify

Server-to-server consumable delivery

Discover web payment link purchases, credit a wallet once, and acknowledge delivery with a project secret key.

Discover and acknowledge from your backend

When a customer returns to the wallet after paying through a web link, your backend can deliver the purchase. The same flow works for web, Bazaar, and Myket builds without calling syncPendingConsumables() or changing the Flutter SDK.

Use the DirectWeb app that owns the payment link for app_identifier, even when the customer opens a Bazaar or Myket build. Read app_user_id from the authenticated account on your backend. If the identifier is a phone number, use the same format recorded at checkout.

List purchases awaiting delivery

POST /api/v1/consumable-deliveries/pending · consumable-deliveries:read

Example request

POST /api/v1/consumable-deliveries/pending
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
Accept: application/json

{
  "app_identifier": "app_example",
  "app_user_id": "customer_565",
  "limit": 50
}

Successful response (HTTP 200)

{
  "status": true,
  "data": {
    "deliveries": [
      {
        "deliveryId": 12345,
        "productIdentifier": "wallet_20"
      }
    ],
    "nextAfterId": null
  }
}

The list contains only paid, unrefunded direct consumables awaiting delivery. Each entry is already verified for the requested scope. The optional limit defaults to 50 and accepts 1–100. Pass a non-null nextAfterId as the next request’s after_id. Stop at null and start the next reconciliation from the first page.

Acknowledge delivery

POST /api/v1/consumable-deliveries/acknowledge · consumable-deliveries:acknowledge

Map the product to its credit amount on your backend. In one local transaction, credit the wallet and insert a unique ledger entry for (project, deliveryId). After commit, send the request below. If the response is lost or the ledger already contains the entry, retry just the acknowledgement. Repeated success returns the same response. An ineligible purchase or a scope mismatch returns 404 CONSUMABLE_DELIVERY_NOT_FOUND.

Example request

POST /api/v1/consumable-deliveries/acknowledge
Authorization: Bearer YOUR_SECRET_API_KEY
Content-Type: application/json
Accept: application/json

{
  "app_identifier": "app_example",
  "app_user_id": "customer_565",
  "delivery_id": 12345
}

Successful response (HTTP 200)

{
  "status": true,
  "data": {
    "deliveryId": 12345,
    "status": "COMPLETED"
  }
}

Verify a known delivery ID

This endpoint lets your backend verify a consumable delivery directly with InAppify before crediting a wallet or recording inventory. Keep the secret key on your backend; never send it to the app.

Request

POST /consumable-deliveries/verify requires the consumable-deliveries:verify ability. app_identifier is the app identifier key in the same project. Derive app_user_id from the authenticated account on your backend, not from a mutable mobile request field. In the secret key form, this ability is under the “Consumable delivery” group.

POST https://api.example.com/api/v1/consumable-deliveries/verify
Authorization: Bearer YOUR_SECRET_API_KEY
Accept: application/json
Content-Type: application/json

{
  "delivery_id": 12345,
  "app_identifier": "app_example",
  "app_user_id": "customer_565"
}

The endpoint returns only direct deliveries for CONSUMABLE products and matches the paid purchase to the requested project, app, and customer. If the delivery does not belong to that scope, it returns 404 CONSUMABLE_DELIVERY_NOT_FOUND.

Successful response

{
  "status": true,
  "data": {
    "verified": true,
    "deliveryId": 12345,
    "status": "DELIVERY_REQUIRED",
    "source": "direct",
    "appIdentifier": "app_example",
    "appUserIdentifier": "customer_565",
    "productIdentifier": "wallet_500",
    "productType": "CONSUMABLE",
    "paymentStatus": "SUCCEEDED",
    "paymentId": 67890,
    "transactionId": "PAYMENT-ABC123",
    "paidAt": "2026-11-28T10:30:00.000000Z",
    "alreadyDelivered": false
  }
}

verified: true means InAppify found the delivery and successful payment in its own records and matched the requested scope. Map productIdentifier to the wallet credit amount in your server configuration; do not accept a price or credit quantity from the app or its request.

Commit and acknowledge

After a valid response, use one local database transaction to insert the wallet ledger entry with a unique key scoped by project, app, customer, and deliveryId, then increase the balance. If that key already exists, do not credit again and treat the operation as successful. Then return success to the app handler so the SDK can acknowledge the delivery. If verification or the local transaction is unavailable, keep the delivery retryable and return retryLater from the handler.

DELIVERY_REQUIRED means the purchase is awaiting acknowledgement. COMPLETED and alreadyDelivered: true mean the SDK or backend already acknowledged delivery. Check the unique wallet ledger entry to determine whether the wallet was credited.

This endpoint verifies only; it does not change the wallet or inventory in your system. The server-to-server response is authenticated over HTTPS with a scoped project key; it does not add a separate response signature. Keep the key in your backend secret manager and do not forward the response to the app.