Skip to content

Quote a campaign

POST
/campaigns/quote
curl --request POST \
--url https://ads.wortise.com/api/public/v1/campaigns/quote \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "budget": 1, "currency": "BRL", "organization": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "CPC", "unitPrice": 1 }'

Prices a campaign: launch cost in USD, objective, organization minimums and balance shortfall.

Requires the campaigns:read scope.

Media typeapplication/json
object
_id
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
budget
required

Budget in the campaign currency

number
> 0
currency
required

Currency ISO 4217. E.g. USD, EUR. A draft saved without it takes the currency of the account that saves it, else USD.

string
Allowed values: BRL ARS UYU COP CLP MXN EUR USD
organization
required
string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$/
type
string
default: CPM
Allowed values: CPC CPM CPE
unitPrice

Unit price in local currency (CPM or CPC bid). Only for a campaign without ad groups

number
> 0

The campaign quote.

Media typeapplication/json
object
balance
required

Organization balance in USD

number
canLaunch
required

Whether the balance covers the cost and the campaign has at least one creative

boolean
cost
required

Balance in USD debited at launch

number
exchange
required

Exchange rate from the campaign currency to USD

number
minCpc
required

Organization minimum CPC in USD

number
minCpm
required

Organization minimum CPM in USD

number
objective
required

Impressions (CPM) or clicks (CPC) the budget buys

number
revenue
required

Unit price in USD sent to the ad server

number
shortfall
required

Part of the cost the balance does not cover, in USD

number

Example generated

{
"balance": 1,
"canLaunch": true,
"cost": 1,
"exchange": 1,
"minCpc": 1,
"minCpm": 1,
"objective": 1,
"revenue": 1,
"shortfall": 1
}

The JSON body is malformed or fails the input validation.

Media typeapplication/json
Any of:
object
errors
required

Zod issues

Array<object>
object
code
required
string
Allowed values: custom invalid_element invalid_format invalid_key invalid_type invalid_union invalid_value not_multiple_of too_big too_small unrecognized_keys
message
required
string
path
required

Location of the invalid field in the procedure input

Array
key
additional properties
message
required
string
Allowed value: Validation Error

Example

{
"errors": [
{
"code": "custom"
}
],
"message": "Validation Error"
}

The API key is missing, invalid, disabled or expired.

Media typeapplication/json
object
code
required

TRPC error code, e.g. UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT

string
Allowed values: PARSE_ERROR BAD_REQUEST INTERNAL_SERVER_ERROR NOT_IMPLEMENTED BAD_GATEWAY SERVICE_UNAVAILABLE GATEWAY_TIMEOUT UNAUTHORIZED PAYMENT_REQUIRED FORBIDDEN NOT_FOUND METHOD_NOT_SUPPORTED TIMEOUT CONFLICT PRECONDITION_FAILED PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE UNPROCESSABLE_CONTENT PRECONDITION_REQUIRED TOO_MANY_REQUESTS CLIENT_CLOSED_REQUEST
message
required
string

Example

{
"code": "PARSE_ERROR"
}

The API key lacks the scope, or its owner lacks the dashboard permission.

Media typeapplication/json
object
code
required

TRPC error code, e.g. UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT

string
Allowed values: PARSE_ERROR BAD_REQUEST INTERNAL_SERVER_ERROR NOT_IMPLEMENTED BAD_GATEWAY SERVICE_UNAVAILABLE GATEWAY_TIMEOUT UNAUTHORIZED PAYMENT_REQUIRED FORBIDDEN NOT_FOUND METHOD_NOT_SUPPORTED TIMEOUT CONFLICT PRECONDITION_FAILED PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE UNPROCESSABLE_CONTENT PRECONDITION_REQUIRED TOO_MANY_REQUESTS CLIENT_CLOSED_REQUEST
message
required
string

Example

{
"code": "PARSE_ERROR"
}

The API key exceeded its rate limit; retry after the Retry-After seconds.

Media typeapplication/json
object
code
required

TRPC error code, e.g. UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT

string
Allowed values: PARSE_ERROR BAD_REQUEST INTERNAL_SERVER_ERROR NOT_IMPLEMENTED BAD_GATEWAY SERVICE_UNAVAILABLE GATEWAY_TIMEOUT UNAUTHORIZED PAYMENT_REQUIRED FORBIDDEN NOT_FOUND METHOD_NOT_SUPPORTED TIMEOUT CONFLICT PRECONDITION_FAILED PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE UNPROCESSABLE_CONTENT PRECONDITION_REQUIRED TOO_MANY_REQUESTS CLIENT_CLOSED_REQUEST
message
required
string

Example

{
"code": "PARSE_ERROR"
}
Retry-After
integer

Seconds to wait before retrying.

Unexpected server error.

Media typeapplication/json
object
code
required

TRPC error code, e.g. UNAUTHORIZED, FORBIDDEN, NOT_FOUND, CONFLICT

string
Allowed values: PARSE_ERROR BAD_REQUEST INTERNAL_SERVER_ERROR NOT_IMPLEMENTED BAD_GATEWAY SERVICE_UNAVAILABLE GATEWAY_TIMEOUT UNAUTHORIZED PAYMENT_REQUIRED FORBIDDEN NOT_FOUND METHOD_NOT_SUPPORTED TIMEOUT CONFLICT PRECONDITION_FAILED PAYLOAD_TOO_LARGE UNSUPPORTED_MEDIA_TYPE UNPROCESSABLE_CONTENT PRECONDITION_REQUIRED TOO_MANY_REQUESTS CLIENT_CLOSED_REQUEST
message
required
string

Example

{
"code": "PARSE_ERROR"
}