Skip to content

Approve a committed design

POST
/v1/designs/{id}/approve
curl --request POST \
--url https://api.pixonaut.app/v1/designs/example/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "consent": { "at": 1790000050000, "kind": "checkbox", "ref": "WEB-10482" }, "expectedRevision": 1 }'

Operation ID: designs.approve

Approves now, or after afterDays days when the tenant wants a window for the customer to change their mind. Safe to retry: approving now a design already approved at expectedRevision (or at any revision, when none is given) answers approved again and records nothing more; one rejected, or approved at another revision, is refused not_committed. Through a deciding proof page link, approves now only, must carry expectedRevision (else bad_request), and is refused proof_outdated unless the design’s proof shows its current revision, which a design committed without a proof never has.

id
required
string
Media typeapplication/json
object
afterDays

Approve after this many days instead of now, 1 to 60: a window for the customer to change their mind. Left out, the design is approved now.

integer
> 0 <= 60
consent

How the customer agreed to the design, kept on it (approvalConsent) and in the approval’s audit entry. Left out, none is kept. Through a deciding proof page link, refused bad_request: the link’s approval records its own, a proof_page consent naming the link.

object
at
required

When the customer agreed, epoch milliseconds.

integer
kind
required

How the customer agreed: by adding the design to their cart, by ticking a box, on a proof page, by approving it again on your store after correcting it (edit), or by letting your store’s own approval deadline pass (deadline). More kinds may be added.

string
Allowed values: add_to_cart checkbox proof_page edit deadline
ref

Your own reference for the consent, such as the cart line or checkout it was given at. Through a proof page link, the link’s id.

string | null
>= 1 characters <= 256 characters
expectedRevision

The design’s revision as the caller read it. When the design has been corrected since, the decision is refused revision_changed with the revision it has now. Required through a proof page link: a customer decides the revision whose proof they were shown.

integer
> 0

Examples

A connected store, from connect to delivery: 4. Approve it, with the customer's consent

{
"consent": {
"at": 1790000050000,
"kind": "checkbox",
"ref": "WEB-10482"
},
"expectedRevision": 1
}

Approved now, or scheduled to be

Media typeapplication/json
object
status
required
string

Examples

A connected store, from connect to delivery: 4. Approve it, with the customer's consent

{
"status": "approved"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: bad_request

Media typeapplication/json
object
error
required
string

Examples

Examplebad_request

bad_request

{
"error": "bad_request"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: unauthorized

Media typeapplication/json
object
error
required
string

Examples

Exampleunauthorized

unauthorized

{
"error": "unauthorized"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: origin_forbidden, forbidden, feature_disabled, workspace_suspended

Media typeapplication/json
object
error
required
string
feature

The feature the tenant does not have. Always sent with feature_disabled.

string

Examples

feature_disabled

{
"error": "feature_disabled",
"feature": "api"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_found

Media typeapplication/json
object
error
required
string

Examples

Examplenot_found

not_found

{
"error": "not_found"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: not_committed, proof_outdated, revision_changed

Media typeapplication/json
object
error
required
string
revision

Always sent with revision_changed.

integer

Examples

not_committed

{
"error": "not_committed"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: payload_too_large

Media typeapplication/json
object
bytes
number
error
required
string
maxBytes

Always sent with payload_too_large.

number

Examples

Examplepayload_too_large

payload_too_large

{
"error": "payload_too_large",
"maxBytes": 0
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: rate_limited

Media typeapplication/json
object
error
required
string

Examples

Examplerate_limited

rate_limited

{
"error": "rate_limited"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Refused: db_error. A request that failed unexpectedly answers as text instead.

object
error
required
string

Examples

Exampledb_error

db_error

{
"error": "db_error"
}
X-Request-Id
required
string

Every response names the request it answers in X-Request-Id: the id the request was sent with in that header, when it is well formed, else one the API gave it. Quote it when reporting a refusal or a failure: the API’s log lines for that request carry it.

Questions? Write to [email protected].

Status · Terms of service · Privacy policy · Subprocessors