get_status, and can read and resolve the failed GAM orders in it with the
same tools an agent uses for any other work item.
Read the queue
Callget_status with include: ["pendingOperations"]. Only a seller account takes it. A buyer, organization or
developer account that sends it is refused with VALIDATION_ERROR on the field include.
pendingOperations object. A group appears only when something is in it, so an
empty object means nothing is waiting on anyone. null means the read failed: pendingOperationsDiagnostic says so,
and the rest of the status is still returned. When the call does not ask for it, the key is absent and the status is
exactly what it was before.
Each group carries
count, and each item says who it is waiting on and since when. manualSourceWork is the one group
that pages. It returns up to 200 items; count and mediaBuyCount cover the whole backlog, and nextOffset is where the
next page starts. Send manualWorkTake (1 to 200) and manualWorkSkip with include: ["pendingOperations"] to read it
a page at a time. Sending either without the include is refused.
The answer is the same one the Pending operations page reads. It is not a copy, so the two cannot disagree.
Read a failed GAM order
When a booking fails after the platform created an order in your GAM, the platform tries to clear the order. When it cannot, the order waits on you. It is a work item of the kindgam_cleanup.
search with that to list them, or get with kind: "work_item", workItemKind: "gam_cleanup" and the item’s
id to read one. A cleanup is pending until you resolve it, and a resolved cleanup leaves the list, so pending is
the only status you can filter for. A read of one that is resolved, or that the platform archived, answers NOT_FOUND.
Resolve a failed GAM order
Callsave_work_item with kind: "gam_cleanup", status: "completed" and a gamCleanup object. There are two ways
to resolve a cleanup.
Ask the platform to archive the order. It checks again that the order is safe to archive, then archives it in your GAM:
note of up to 500 characters, saying what you did, is
required for manual and is not allowed for archive:
- Only an administrator of the Storefront account can resolve a cleanup. Anyone else is refused with
ACCESS_DENIED. orderIdmust match the order of that cleanup, or the call is refused withVALIDATION_ERRORand nothing changes.- A resolution needs no approval on our site. The order is yours, you have already read it, and the platform archives only an order it verified is an unbooked draft. This is not a billing or access change.
- An archive the platform could not complete does not resolve the cleanup. The answer is an error with the code
GAM_CLEANUP_NOT_RESOLVEDand anattemptobject (outcome,retryDisposition,safeNextActionandrequiredPermission) that says what to do next. The cleanup stays pending. - Repeating the same resolution succeeds again and does nothing a second time. Resolving an order a second time by the
other method is refused with
CONFLICT. - A successful answer has
action: "created"and anobjectwithstatus: "completed", and the cleanup no longer appears in the queue.