Skip to content

Make coupons from a CSV, its bytes the body (UTF-8, up to 50 000 rows and 5 MiB; columns code, match, campaign, offer, precedence, status, ends_at and note), each row made or refused on its own; validate_only checks it, making nothing

POST
/v1/buyer/coupons/import
curl --request POST \
--url https://example.com/v1/buyer/coupons/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data binary

Who: a workspace’s buyer, or its key. API keys with the buyer:write scope.

Idempotency-Key
string
<= 64 characters

Made once per action and sent again on every retry of it, so the service acts once: the request_id of the create or money-moving call; a new one when left out

delimiter
string
time_zone
string
validate_only
string
string format: binary
<= 5243904 characters

OK

Media typeapplication/json
object
delimiter
required
string
made
required
integer format: int32
refused
required
integer format: int32
results
required
Array<object>
object
column
required
string
malformed
required
boolean
reason
required
string | null
Allowed values: campaign_not_found flow_not_found lander_not_found offer_not_found network_not_found event_type_not_found connection_not_found template_not_found event_type_exists in_use archived cost_model_not_allowed reviewer_targeted click_id_macro_required invalid_path bot_list_full url_key_unavailable attribution_days_too_long flow_too_large import_key_taken path_not_found last_active_path rule_not_found page_lander vt_macro_required impressions_not_supported protection_not_allowed pass_macro_required coupon_not_found coupon_taken coupon_limit invalid_coupon ck_macro_required direct_offer_capped origin_in_use lookback_too_long owner_required
row
required
integer format: int32
value
required
string
rows
required
integer format: int32

Example

{
"results": [
{
"reason": "campaign_not_found"
}
]
}

An error, as go-commons apperr maps it

Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string

Example generated

{
"error": {
"code": "example",
"fields": {
"additionalProperty": "example"
},
"message": "example"
}
}