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 response including the paginated list of transactions:
{ "items": [ { "id": "<TRANSACTION_ID>", "orderId": "<ORDER_ID>", "type": "<TRANSACTION_TYPE>", "status": "<TRANSACTION_STATUS>", "amount": { "value": "<TRANSACTION_AMOUNT>", "currency": "<ISO_4217_CURRENCY_CODE>" }, "createdAt": "<ISO8601_CREATED_TIMESTAMP>", "updatedAt": "<ISO8601_UPDATED_TIMESTAMP>" } ], "page": 1, "pageSize": 20 }
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
id: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?