Payment request reference
View as MarkdownPayment request types, statuses, field limits, list filters, callback fields, status codes, and the error body for the Payment Requests API.
Overview
This page lists the values, limits, and errors of the Payment Requests API (/v1/commerce/stores/{storeId}/payment-requests). It covers payment request types, statuses, field limits, list filters, callback fields, status codes per operation, and the error body.
Go to How to charge a card on a terminal for the create call and polling. Go to How to handle the result for callbacks and listing. Go to Create a payment request, Get a payment request by ID, and Get all payment requests for the full schemas.
Payment request types
The following table lists the type values these guides cover:
| Type | What it does | Notes |
|---|---|---|
SALE | Charges the card the customer presents on the terminal | Requires amount |
REFUND | Refunds an earlier transaction | Requires originalTransactionId |
Send originalTransactionId only when type is REFUND. Omit amount for a full refund, or send it for a partial refund. A partial refund of a sale that hasn't settled yet might void the whole sale instead, so read the amount on the refund transaction. Refunds without an original transaction aren't supported. The create call doesn't check a refund amount against the original transaction. The API has no void type, so void a payment on the terminal.
Statuses
The following table lists the status values:
| Status | Meaning |
|---|---|
RECEIVED | GoDaddy stored the payment request and is sending it to the terminal |
QUEUED | GoDaddy sent the request, and it's waiting for the terminal |
IN_PROGRESS | The terminal is processing the payment |
COMPLETED | The payment or refund succeeded |
FAILED | GoDaddy couldn't send the request to the terminal, the payment failed, or the customer cancelled it on the terminal |
COMPLETED and FAILED are final. A QUEUED request stays QUEUED until the terminal responds, which can take days: GoDaddy doesn't time it out, and the API has no cancel or delete operation. Clear a stuck request on the terminal. A FAILED request has no reason field, and GoDaddy doesn't add entries to the activities[] log, so you can't tell a customer cancel from a decline or a timeout. A customer cancel creates no transaction.
For a SALE, transactionIds lists the transaction the terminal created. For a REFUND, transactionIds and the callback list the original sale, not the refund. The refund is a separate REFUND transaction whose parentTransactionId is the sale. The sale transaction's links[] has an entry with rel set to REFUND, and its href is the refund's transaction ID, not a URL.
Field limits
The following table lists the request fields with limits:
| Field | Limit |
|---|---|
amount.amount | Integer in the currency's minor units, like 5000 for 50.00 USD |
amount.currency | 3-letter currency code |
amount.amountType | SIMPLE only |
deviceId | UUID or urn:tid: form |
notes | 512 characters |
paymentInstructions | 40 keys, including referenceId, with string values up to 256 characters |
references[].value | 128 characters, required |
references[].type | 32 characters in uppercase, required |
references[].additionalLabel | 32 characters |
transactionRefNum | UUID |
When deviceId has no urn:tid: prefix, GoDaddy adds it before it sends the request to the terminal. The stored deviceId keeps the value you sent. A paymentInstructions value can also be a boolean or a number. references[].type takes a supported type like CUSTOM or POYNT_ORDER, and an unsupported type returns 400.
GoDaddy sets the paymentInstructions keys amount, currency, transactionNumber, notes, references, and action itself, and replaces values you send under those keys. When you don't send a non-blank string referenceId, GoDaddy sets it to the paymentRequestId and adds it to the transaction as a CUSTOM reference. The callback's paymentInstructions doesn't include that default. The terminal ignores a referenceId it has already seen, so make a value you send unique per payment.
Go to About Payment Requests for how paymentRequestId and X-Request-Id make create safe to retry.
List filters
The following table lists the query parameters of GET /v1/commerce/stores/{storeId}/payment-requests:
| Parameter | Default | Notes |
|---|---|---|
pageSize | 10 | 1–100 |
pageToken | None | The pageToken from the previous response |
updatedAtAfter | 1 day ago | RFC 3339 date-time |
updatedAtBefore | None | RFC 3339 date-time |
status | None | One status from Statuses |
deviceId | None | Matches the value exactly as you sent it on create |
type | None | Like SALE or REFUND |
sortBy | updatedAt | updatedAt only |
sortOrder | DESC | ASC or DESC |
A response without pageToken is the last page.
Callbacks
The following table lists the callbackConfig fields:
| Field | Required | What it does |
|---|---|---|
url | Yes | The https:// URL GoDaddy sends status updates to |
payloadConfig.includeFields | Yes | At least one payment request field for each callback to carry |
payloadConfig.legacyMode | No | The schema for the transactions field: true for v1, false (default) for v2 |
events | No | Accepted, but GoDaddy doesn't filter callbacks by it |
authentication | No | How GoDaddy authenticates to your endpoint |
GoDaddy sends one callback per payment request, after the terminal reports the result, whatever events lists. This behavior might change, so handle a callback for any status. The create response returns authentication.value encrypted, and get and list responses omit it.
includeFields accepts paymentRequestId, type, transactionRefNum, storeId, deviceId, amount, paymentInstructions, notes, references, transactionIds, links, activities, createdAt, and updatedAt. It also accepts transactions, which adds the full transaction objects next to transactionIds. Every callback also carries status, whatever you list in includeFields.
The following table lists the authentication.type values:
| Type | What GoDaddy sends |
|---|---|
hmac | X-Signature, X-Timestamp, and X-Request-Id headers, signed with the secret in value |
bearer | value as a bearer token in the Authorization header |
apikey | value in the X-API-Key header, or in the header you name in headerName |
none | No authentication headers |
Without authentication, GoDaddy sends no authentication headers.
The following table lists how GoDaddy treats your endpoint's response:
| Your response | What GoDaddy does |
|---|---|
2XX within 5 seconds | Marks the callback delivered |
4XX | Stops delivery without a retry |
5XX, a timeout, or no connection | Retries after 5 seconds, then with doubling delays capped at 15 minutes, for up to 10 retries over about 51 minutes. The schedule might change |
Go to How to handle the result to verify the hmac signature.
Status codes
The following table lists the status codes each operation returns:
| Operation | Success | Errors |
|---|---|---|
| Create a payment request | 202 | 400, 401, 403, 409, 429, 500, or the delivery service's status for EXTERNAL_SERVICE_ERROR |
| Get a payment request by ID | 200 | 400, 401, 403, 404, 429, 500 |
| List payment requests | 200 | 400, 401, 403, 429, 500 |
The following table explains the error status codes:
| Status | Meaning | What to do |
|---|---|---|
400 | Invalid request | Go to Error codes for the code in name |
401 | A missing, expired, or invalid PAT, or a PAT without access to this store | Create a token for the account that owns the store |
403 | Access denied | Check the PAT, its scopes, and the storeId |
404 | No payment request with this ID in the store | Check storeId and paymentRequestId |
409 | DUPLICATE_REQUEST | Retry with the same paymentRequestId and a new X-Request-Id |
429 | Rate limit exceeded | Wait, then retry. Go to Handle rate limits for limits and backoff |
500 | Internal server error | Retry the same call |
A 409 means you already sent this X-Request-Id to this store within the last 30 minutes. A 404 has an empty body, so check the status code before you parse the body. An expired PAT, or a PAT without access to this store, returns a 401 with UNAUTHORIZED_ACCESS in name. Other 401 and 403 responses might have an empty body. List and get need commerce.payment-request:read; create needs commerce.payment-request:write.
Error codes
A 400 validation error carries one of these codes in name: MALFORMED_REQUEST, VALIDATION_ERROR, INVALID_ARGUMENT, INVALID_PARAMETER, or CONSTRAINT_VIOLATION. Read details[] for the field and the issue.
EXTERNAL_SERVICE_ERROR in name means the service that delivers the request to the terminal rejected it, like an unknown deviceId. The response takes that service's HTTP status, so match on name, not on 400. GoDaddy still stores the payment request with status FAILED, so retry with a new paymentRequestId. The create call might time out before it returns this error. Retry with the same paymentRequestId to get the stored request and read its status.
Error body
The following table lists the error body fields:
| Field | Description |
|---|---|
name | The error code, like VALIDATION_ERROR |
message | A human-readable description |
details[] | The fields that caused the error, empty when the error isn't about one field |
links | Related links, usually empty |
The following table lists the details[] fields:
| Field | Description |
|---|---|
field | The field that caused the error, in dot notation like amount.currency |
value | The value that caused the error |
location | Where the field is, like body |
issue | The validation message |
message and issue are human-readable and can change, so branch on name and field instead of parsing them.
The following example shows a 400 error body:
{
"name": "VALIDATION_ERROR",
"message": "Request validation failed",
"details": [
{
"field": "amount.currency",
"value": "USDX",
"location": "body",
"issue": "size must be between 3 and 3"
}
],
"links": []
}Last updated on
How is this guide?