Skip to main content

Confirm an offer

POST 

/chat/plans/:planId/confirm

Says yes to an offer the agent made and starts its run. THIS SPENDS CREDITS: the run is launched from the stored plan at the price the offer showed (plan.price.totalCredits), never from anything sent here. Answers 202 with the run; confirming a plan that already started answers 200 with the SAME run and starts nothing. An offer of pictures for a draft piece (reply.proposal.pieceOffer) has no run: it answers pieceId instead of runId, read the piece with GET /pieces/{pieceId} (its slides say waiting while a picture is being made), and only the pictures actually made are charged, at most plan.price.totalCredits. An offer to MAKE a designed piece (reply.proposal.draftOffer) makes the piece only now, then its pictures: it answers the new pieceId, and total is the pictures it will make (0 when its design holds no picture: the piece is made and nothing is charged). A piece that cannot be made as the offer stands (the account lost the feature, a product or brand was deleted) answers AGENT_CHAT_PLAN_CANNOT_RUN, with nothing charged. An offer whose pictures name no product, on an account that cannot have a picture made from a description alone (its start says needs-product), is never made: confirming it answers AGENT_CHAT_PLAN_NEEDS_PRODUCT and nothing is made or charged. A price that moved since the offer was shown is refused with nothing charged. The key needs chat and runs:write.

Request​

Responses​

The plan had already started: the same run.