How to view transactions
View as MarkdownLook up payment transaction history for a store — authorizations, captures, sales, refunds, and adjustments.
Overview
Transactions represent payment activity associated with orders: authorizations, captures, sales, refunds, and adjustments. The Transaction API is a read-only REST API under v2 (this differs from the other Commerce REST endpoints which use v1).
Prerequisites
The following prerequisites are required before you view transactions:
- a GoDaddy account with an active commerce store
- a Personal Access Token (PAT) with the
commerce.transaction:readscope - your
storeIdFind your store ID
Go to Your stores to find your store ID.
List transactions
GET /v2/commerce/stores/{storeId}/transactions retrieves all transactions for a store. The following optional query parameters narrow the results:
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number to retrieve (default: 1) |
pageSize | integer | Results per page (default: 10) |
totalRequired | boolean | Include total count in the response |
transactionIds | string | Comma-separated transaction IDs to filter |
updatedAtAfter | datetime | Filter transactions updated after this timestamp |
updatedAtBefore | datetime | Filter transactions updated before this timestamp |
sortBy | string | Field to sort by (updatedAt) |
sortOrder | string | Sort direction (ASC or DESC, default: ASC) |
The following procedure lists the most recent 20 transactions.
-
Retrieve a page of transactions:
curl -s "https://api.godaddy.com/v2/commerce/stores/${STORE_ID}/transactions?pageSize=20&sortOrder=DESC" \ -H "Authorization: Bearer $GODADDY_PAT" -
Review the paginated list of transactions in the response:
{ "items": [ { "transactionId": "<TRANSACTION_ID>", "type": "SALE", "status": "COMPLETED", "amount": { "amountType": "DETAILED", "total": 1099, "subTotal": 1099, "currency": "USD" }, "references": [ { "type": "CUSTOM", "value": "<ORDER_ID>" } ], "createdAt": "<ISO8601_CREATED_TIMESTAMP>", "updatedAt": "<ISO8601_UPDATED_TIMESTAMP>" } ], "links": [ { "rel": "self", "href": "/v2/commerce/stores/<STORE_ID>/transactions?page=1&pageSize=20&sortOrder=DESC" } ] }
Response fields
Each transaction returns more fields than shown here, including the funding source and the processor response. type is one of AUTHORIZE, CAPTURE, REFUND, ADJUSTMENT, or SALE. status is one of INITIATED, PENDING, FAILED, COMPLETED, or VOIDED. Amounts are in the currency's minor unit, so 1099 is $10.99. references links the transaction to the order it paid for.
Get a transaction
GET /v2/commerce/stores/{storeId}/transactions/{transactionId} retrieves a single transaction by ID.
The following procedure reads a single transaction by ID.
-
Retrieve a single transaction by its
transactionId:TRANSACTION_ID="<TRANSACTION_ID>" curl -s "https://api.godaddy.com/v2/commerce/stores/${STORE_ID}/transactions/${TRANSACTION_ID}" \ -H "Authorization: Bearer $GODADDY_PAT"
Common errors
The following table lists common errors when viewing transactions, the most likely cause, and additional notes:
| Status | Most likely cause | Note |
|---|---|---|
401 | PAT is missing or expired. | Go to Authentication to generate a new token. |
403 | Token doesn't include the commerce.transaction:read scope. | |
404 | Store ID or transaction ID doesn't exist or isn't accessible with the provided token. | |
429 | Rate limit exceeded. | Honor the Retry-After header before retrying. |
Agent & Automation Notes
commerce.transaction:readRelated
API References
Last updated on
How is this guide?