Testing

Check a deal request against this API's rules with a dry run before you create the deal.

Dry runs

POST /deal-requests accepts a dryRun query parameter. With ?dryRun=true,
Sovrn runs the request through every check this API makes (authentication,
schema validation, business rules, and resolution of every referenced value
such as demand partner slugs, targeting attributes and audience segment IDs)
and then stops, without contacting the deal system. Nothing is created and
nothing is persisted.

curl -X POST "https://api.sovrn.com/sovrnos/v1/deal-requests?dryRun=true" \
  -H "x-api-key: $SOVRN_API_KEY" \
  -H "Content-Type: application/json" \
  -d @deal-request.json

A request that passes returns 200:

{
  "dryRun": true,
  "valid": true,
  "message": "Deal request passed validation. No deal was created."
}

A request that fails returns exactly the error a real submission would, the
same 400 shapes described on the Errors page, so you can fix
and retry until the payload is clean.

📘

Same body, same key

The request body is byte-identical between a dry run and a real submission:
once a dry run returns 200, resend the same body without the query parameter
(or with dryRun=false, the default) to create the deal. Dry runs require the
same API key and write permission as real submissions.

🚧

Dry runs are for POST only

PATCH /deal-requests/{id} has no dry-run mode. ?dryRun=true on a PATCH
is ignored and the edit is applied, a status of archived included.

Recommended integration flow

  1. Dry-run until clean. Iterate on your payload with ?dryRun=true until
    you get a 200.
  2. Submit for real. Send the same body without dryRun. A 201 returns
    the deal's SVN_… ID immediately.
  3. Confirm state. GET /deal-requests/{id} and check status (see
    Deal lifecycle for what each status means).
  4. Coordinate delivery testing. A dry run proves the request passes this
    API's checks. It never contacts the deal system, so it proves neither that
    the deal will be created nor that it will deliver. Before validating bid
    activity or spend end to end, contact your Sovrn representative.

Did this page help you?