Get purchase
After you order imaging data from a catalog using the purchaseFrame operation, it can take some time to process the order and deliver the imaging products.
During this time, you can call the getPurchase operation to check on the status of your order.
To check on the order, you need to have the PURCHASE_ID of the order (which is returned in the response to the purchaseFrame operation).
Purchases are updated until they reach a terminal status.
Purchase lifecycle
-
The Catalog API receives the order and adds it to the queue as
active. -
When all requested products are available, the purchase transitions to
closedandlistPurchaseProductsreturns the available products. -
If the order cannot be fulfilled, the purchase transitions to
failed. This is a terminal state in which no products will become available for this purchase.
Purchase status
The purchase status can have one of the following values:
| Purchase status | Description |
|---|---|
|
The order is being processed. For purchases that specify the
|
|
The order has been processed and the image products are available via |
|
The order could not be fulfilled. This is a terminal state; no products will become available for this purchase. Please reach out to COSP for more information. |
The active transition to next status is one-way: an active
purchase will eventually become either closed (the requested products are available) or
failed (the order could not be fulfilled).
Example
Request
Enter the following curl command, remembering to replace the ${VARNAME} variables with the appropriate values:
curl --location "${API_BASE_URL}/api/catalog/v2/purchases/${PURCHASE_ID}" \
--header "Authorization: Bearer ${API_ACCESS_TOKEN}"
Response
On success, returns a 200 status code and a JSON object containing the status of the purchased frame.
{
"id": "766cc4d6-7754-448e-9c6c-0ef3d209d65e",
"frameID": "XXXXXXXXXX",
"contractID": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"createdAt": "2024-04-23T11:40:57.484585Z",
"status": "closed",
"reference": "purchase reference 123-456",
"eula": "STANDARD"
}