Offers

Offers are the core of the Adlocaite API - they represent real-time opportunities to display advertisements on specific screens. When you request an offer for a screen, our matching engine evaluates available ads and returns the best match with pricing and timing information.

The offer model

The offer model contains all the information you need to evaluate and respond to a programmatic DOOH advertising opportunity.

Subcent pricing

All price fields (bid_price_cents, accepted_price_cents, min_bid_cents, net_price_cents, commission_cents, gross_price_cents) now return and accept decimal values. For example, 0.25 means 0.25 cents (= 0.0025 EUR). The field names still contain _cents for backward compatibility, but values can be fractional. Integer values are still accepted as input.

Properties

  • Name
    offer_id
    Type
    string
    Description

    Unique identifier for the offer.

  • Name
    bid_price_cents
    Type
    number
    Description

    Bid price offered in cents. Returns a decimal value (e.g., 0.25 = 0.25 cents = 0.0025 EUR).

  • Name
    asset_url
    Type
    string
    Description

    Direct URL to the advertisement asset (image/video).

  • Name
    expires_at
    Type
    timestamp
    Description

    When this offer expires and must be responded to.

  • Name
    duration
    Type
    integer
    Description

    Optional. Playout duration of the asset in seconds. Only included when the duration is known.

  • Name
    billing_code
    Type
    string | null
    Description

    Billing code for the organization-publisher combination. Always returns the currently configured value. Can be null if no code is configured.

  • Name
    vast
    Type
    string
    Description

    Optional. VAST 4.0 XML string containing advertisement metadata and tracking events. Only included when the vast=true query parameter is used in the request. The tracking URLs inside already point to the tracking host of the environment you called and carry the publisher and screen ID, see Event Tracking.


Screen identification

You can identify screens in offer requests using either UUIDs (recommended) or external IDs (fallback only).

UUID (recommended)

Use UUIDs for optimal performance. This is the recommended method for all integrations:

GET /offers/request/a1b2c3d4-e5f6-7890-abcd-ef1234567890

External ID (fallback only)

Performance Impact: External IDs significantly reduce API performance. Only use if your CMS/playout system cannot support UUIDs:

GET /offers/request/external-id/SCREEN-001

Learn more: See the External Screen IDs documentation for requirements, setup instructions, and important performance considerations.


Request an offer

This endpoint supports both UUID (recommended for best performance) and External ID (fallback only for legacy systems) identification methods.

Using UUID

Demo mode

Demo responses are available on the staging environment only. See Demo mode.

This endpoint allows you to request a real-time offer for a specific screen. The matching engine will evaluate all eligible advertisements and return the best match based on your criteria.

Optional parameters

  • Name
    min_bid_cents
    Type
    number
    Description

    Minimum bid amount in cents to consider for offers. Accepts decimal values (e.g., 0.5 for half a cent).

  • Name
    demo
    Type
    boolean
    Description

    Set to true to get demo responses for testing. Staging only, ignored on production. See Demo mode.

  • Name
    vast
    Type
    boolean
    Description

    Set to true to include VAST XML in the response for programmatic advertising integrations. The VAST XML follows the VAST 4.0 standard and includes tracking events and advertisement metadata.

Request

GET
/functions/v1/api/offers/request/[screenId]
curl -X GET "https://api.adlocaite.com/functions/v1/api/offers/request/[screenId]?min_bid_cents=200" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "offer_id": "32c7c9b5-8b2a-4cac-b298-146320100325",
  "bid_price_cents": 2.53,
  "asset_url": "https://cdn.example.com/assets/ad_image_1920x1080.jpg",
  "expires_at": "2025-08-19 14:49:52.874089+00",
  "duration": 10,
  "billing_code": "ORG001-PUB-2024"
}

Demo Response

{
  "offer_id": "test-offer-test",
  "bid_price_cents": 250,
  "asset_url": "https://via.placeholder.com/1920x1080",
  "expires_at": "2025-08-27 14:10:00.000000+00",
  "duration": 15,
  "billing_code": "DEMO-BILL-001"
}

Response with VAST XML

{
  "offer_id": "32c7c9b5-8b2a-4cac-b298-146320100325",
  "bid_price_cents": 2.53,
  "asset_url": "https://cdn.example.com/assets/ad_image_1920x1080.jpg",
  "expires_at": "2025-08-19 14:49:52.874089+00",
  "billing_code": "ORG001-PUB-2024",
  "vast": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"4.0\" xmlns=\"http://www.iab.com/VAST\">\n  <Ad id=\"32c7c9b5-8b2a-4cac-b298-146320100325\">\n    <InLine>\n      <AdSystem version=\"1.0\">Adlocaite</AdSystem>\n      <AdTitle><![CDATA[Digital Out-of-Home Advertisement]]></AdTitle>\n      <Advertiser><![CDATA[Advertiser]]></Advertiser>\n      <Expires>2025-08-19 14:49:52.874089+00</Expires>\n      <Creatives>\n        <Creative id=\"32c7c9b5-8b2a-4cac-b298-146320100325_creative\" sequence=\"1\">\n          <Linear>\n            <MediaFiles>\n              <MediaFile id=\"32c7c9b5-8b2a-4cac-b298-146320100325_media\" delivery=\"progressive\" type=\"image/jpeg\" scalable=\"true\" maintainAspectRatio=\"true\">\n                <![CDATA[https://cdn.example.com/assets/ad_image_1920x1080.jpg]]>\n              </MediaFile>\n            </MediaFiles>\n            <TrackingEvents>\n              <Tracking event=\"complete\">\n                <![CDATA[https://tracking.adlocaite.io/track?offer_id=32c7c9b5-8b2a-4cac-b298-146320100325&event=complete&ts=1729426192874&pub=pub-123-uuid&scr=screen-456-uuid]]>\n              </Tracking>\n            </TrackingEvents>\n          </Linear>\n        </Creative>\n      </Creatives>\n      <Extensions>\n        <Extension type=\"adlocaite\">\n          <AdlocaiteData>\n            <OfferId>32c7c9b5-8b2a-4cac-b298-146320100325</OfferId>\n            <BidPriceCents>2.53</BidPriceCents>\n            <BillingCode>ORG001-PUB-2024</BillingCode>\n          </AdlocaiteData>\n        </Extension>\n      </Extensions>\n    </InLine>\n  </Ad>\n</VAST>"
}

Error Response (422)

{
  "error": "No matches meet minimum bid requirement",
  "status": 422
}

Error Response (404)

{
  "error": "No matches available",
  "status": 404
}

Using External ID

Performance Warning

External IDs significantly reduce API performance. Only use this endpoint if your CMS or playout system cannot work with UUIDs. Your account must be activated for external IDs - contact support@adlocaite.com.

This endpoint returns the same offer data as the UUID version, but allows you to identify screens using your own external identifiers. Use only if UUIDs are not technically feasible in your system.

Path parameters

  • Name
    externalId
    Type
    string
    Description

    Your custom identifier for the screen (e.g., "SCREEN-001", "berlin-hauptbahnhof").

Query parameters

  • Name
    min_bid_cents
    Type
    number
    Description

    Optional minimum bid amount in cents to consider for offers. Accepts decimal values (e.g., 0.5 for half a cent).

  • Name
    demo
    Type
    boolean
    Description

    Set to true to get demo responses for testing. Staging only, ignored on production. See Demo mode.

  • Name
    vast
    Type
    boolean
    Description

    Set to true to include VAST XML in the response for programmatic advertising integrations. The VAST XML follows the VAST 4.0 standard and includes tracking events and advertisement metadata.

Request

GET
/functions/v1/api/offers/request/external-id/[externalId]
curl -X GET "https://api.adlocaite.com/functions/v1/api/offers/request/external-id/SCREEN-001?min_bid_cents=150" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "offer_id": "f1e2d3c4-b5a6-7890-abcd-ef9876543210",
  "bid_price_cents": 2.50,
  "asset_url": "https://storage.example.com/ad-99999.jpg",
  "expires_at": "2025-10-07T12:40:00Z",
  "billing_code": "ORG-PUB-12345"
}

Error Response (404)

{
  "error": "Screen not found with external_id: SCREEN-001"
}

Error Response (422)

{
  "error": "No matches meet minimum bid requirement",
  "status": 422
}

POST/functions/v1/api/offers/response/[offerId]

Respond to an offer

Demo mode

On the staging environment, the demo offer test-offer-test can be accepted or rejected. See Demo mode.

This endpoint allows you to accept or reject an offer. Once you respond, the offer becomes invalid and cannot be changed.

Required attributes

  • Name
    action
    Type
    string
    Description

    The response to the offer. Must be either accept or reject.

  • Name
    accepted_price_cents
    Type
    number
    Description

    Required when action is accept. The accepted price in cents (must be positive). Accepts decimal values (e.g., 2.53). Integer values are also accepted for backward compatibility.

Optional attributes

  • Name
    rejection_reason
    Type
    string
    Description

    Optional when action is reject. Reason for rejecting the offer. Stored with the offer outcome (up to 500 characters) and used in reporting, so a short, consistent vocabulary such as no_slot, content_policy or technical_error is more useful than free text.

Request

POST
/functions/v1/api/offers/response/[offerId]
curl -X POST https://api.adlocaite.com/functions/v1/api/offers/response/[offerId] \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "accept",
    "accepted_price_cents": 2.53
  }'

Response (Accept)

{
  "success": true,
  "action": "accepted",
  "deal_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "billing_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "net_price_cents": 1.90,
  "commission_cents": 0.63,
  "gross_price_cents": 2.53,
  "message": "Offer accepted, deal created, and commission billed",
  "billing_code": "123456789"
}

Response (Reject)

{
  "success": true,
  "action": "rejected",
  "message": "Offer rejected and removed",
  "rejection_reason": "Not suitable for our audience",
  "billing_code": "123456789"
}

Demo Response (Accept, staging only)

{
  "success": true,
  "action": "accept",
  "deal_id": "test-deal-test",
  "billing_id": "test-billing-test",
  "price_cents": 250,
  "message": "Demo offer accepted successfully"
}

Demo Response (Reject, staging only)

{
  "success": true,
  "action": "reject",
  "rejection_reason": "Demo rejection",
  "message": "Demo offer rejected successfully"
}

Error Response (400)

{
  "error": "Action must be \"accept\" or \"reject\""
}

Error Response (400)

{
  "error": "Accepted price must be provided"
}

Error Response (401)

{
  "error": "Invalid or expired API key"
}

Error Response (404)

{
  "error": "Offer not found, expired, or access denied"
}

Error Response (500)

{
  "error": "Failed to process offer"
}

Deal confirmation

When you accept an offer, it becomes a confirmed deal. The deal contains all the information needed to display the advertisement, including the asset URL and exact timing requirements.

Deal properties

  • Name
    deal_id
    Type
    string
    Description

    Unique identifier for the confirmed deal.

  • Name
    action
    Type
    string
    Description

    Action taken - will be accepted for accepted offers.

  • Name
    message
    Type
    string
    Description

    Confirmation message about the deal.

  • Name
    success
    Type
    boolean
    Description

    Whether the action was successful.

  • Name
    billing_id
    Type
    string
    Description

    Unique identifier for the billing record.

  • Name
    net_price_cents
    Type
    number
    Description

    Publisher revenue from this deal in cents (after commission). Returns a decimal value.

  • Name
    commission_cents
    Type
    number
    Description

    Platform commission for this deal in cents. Returns a decimal value.

  • Name
    gross_price_cents
    Type
    number
    Description

    Total deal price in cents (net + commission). Returns a decimal value.

  • Name
    billing_code
    Type
    string | null
    Description

    Billing code for the organization-publisher combination. Enables publisher-specific billing identification.


Demo mode

Demo mode returns fixed responses without touching any data. It exists on the staging environment only (https://staging.api.adlocaite.com/functions/v1/api). Use your staging API key.

On staging, request a demo offer with the fixed external ID test-display-test, or add ?demo=true to an offer request:

Request a demo offer (staging only)

curl -X GET "https://staging.api.adlocaite.com/functions/v1/api/offers/request/external-id/test-display-test?demo=true&vast=true" \
  -H "Authorization: Bearer YOUR_STAGING_API_KEY"

Accept the demo offer (staging only)

curl -X POST https://staging.api.adlocaite.com/functions/v1/api/offers/response/test-offer-test \
  -H "Authorization: Bearer YOUR_STAGING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "accept",
    "accepted_price_cents": 250
  }'

Demo Response (Accept)

{
  "success": true,
  "action": "accept",
  "deal_id": "test-deal-test",
  "billing_id": "test-billing-test",
  "price_cents": 250,
  "message": "Demo offer accepted successfully"
}
  • The fixed ID test-display-test works on the external ID paths only, for example /offers/request/external-id/test-display-test and /screens/external-id/test-display-test/cacheable-assets. The UUID paths reject it with 400, because it is not a UUID.
  • The demo offer has the ID test-offer-test, a fixed bid price of 250 cents (2.50 EUR), a duration of 15 seconds, the billing code DEMO-BILL-001 and an expiration time of 12 minutes.
  • POST /offers/response/test-offer-test accepts or rejects the demo offer. Accepting requires accepted_price_cents (otherwise 400) and returns the deal ID test-deal-test; rejecting returns the rejection_reason you sent.
  • Nothing is stored. The demo responses are fixed data, so a demo deal does not appear anywhere afterwards.
  • Playouts are reported through the VAST tracking events of the offer (request it with vast=true, see Playout tracking); there is no demo response for playout confirmation.

On production, demo mode does not exist. ?demo=true is ignored and test-display-test is treated like any other screen ID:

RequestStatus
Invalid API key401
Valid API key, unknown screen (including test-display-test)404 with SCREEN_NOT_FOUND
test-display-test on a UUID path400
POST /offers/response/test-offer-test400, test-offer-test is not a UUID

Test your integration on staging before you go live. Staging has its own API keys, provided during onboarding.

Was this page helpful?