GoDaddy

Payment request reference

View as Markdown

Payment 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:

TypeWhat it doesNotes
SALECharges the card the customer presents on the terminalRequires amount
REFUNDRefunds an earlier transactionRequires 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:

StatusMeaning
RECEIVEDGoDaddy stored the payment request and is sending it to the terminal
QUEUEDGoDaddy sent the request, and it's waiting for the terminal
IN_PROGRESSThe terminal is processing the payment
COMPLETEDThe payment or refund succeeded
FAILEDGoDaddy 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:

FieldLimit
amount.amountInteger in the currency's minor units, like 5000 for 50.00 USD
amount.currency3-letter currency code
amount.amountTypeSIMPLE only
deviceIdUUID or urn:tid: form
notes512 characters
paymentInstructions40 keys, including referenceId, with string values up to 256 characters
references[].value128 characters, required
references[].type32 characters in uppercase, required
references[].additionalLabel32 characters
transactionRefNumUUID

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:

ParameterDefaultNotes
pageSize101–100
pageTokenNoneThe pageToken from the previous response
updatedAtAfter1 day agoRFC 3339 date-time
updatedAtBeforeNoneRFC 3339 date-time
statusNoneOne status from Statuses
deviceIdNoneMatches the value exactly as you sent it on create
typeNoneLike SALE or REFUND
sortByupdatedAtupdatedAt only
sortOrderDESCASC or DESC

A response without pageToken is the last page.

Callbacks

The following table lists the callbackConfig fields:

FieldRequiredWhat it does
urlYesThe https:// URL GoDaddy sends status updates to
payloadConfig.includeFieldsYesAt least one payment request field for each callback to carry
payloadConfig.legacyModeNoThe schema for the transactions field: true for v1, false (default) for v2
eventsNoAccepted, but GoDaddy doesn't filter callbacks by it
authenticationNoHow 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:

TypeWhat GoDaddy sends
hmacX-Signature, X-Timestamp, and X-Request-Id headers, signed with the secret in value
bearervalue as a bearer token in the Authorization header
apikeyvalue in the X-API-Key header, or in the header you name in headerName
noneNo authentication headers

Without authentication, GoDaddy sends no authentication headers.

The following table lists how GoDaddy treats your endpoint's response:

Your responseWhat GoDaddy does
2XX within 5 secondsMarks the callback delivered
4XXStops delivery without a retry
5XX, a timeout, or no connectionRetries 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:

OperationSuccessErrors
Create a payment request202400, 401, 403, 409, 429, 500, or the delivery service's status for EXTERNAL_SERVICE_ERROR
Get a payment request by ID200400, 401, 403, 404, 429, 500
List payment requests200400, 401, 403, 429, 500

The following table explains the error status codes:

StatusMeaningWhat to do
400Invalid requestGo to Error codes for the code in name
401A missing, expired, or invalid PAT, or a PAT without access to this storeCreate a token for the account that owns the store
403Access deniedCheck the PAT, its scopes, and the storeId
404No payment request with this ID in the storeCheck storeId and paymentRequestId
409DUPLICATE_REQUESTRetry with the same paymentRequestId and a new X-Request-Id
429Rate limit exceededWait, then retry. Go to Handle rate limits for limits and backoff
500Internal server errorRetry 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:

FieldDescription
nameThe error code, like VALIDATION_ERROR
messageA human-readable description
details[]The fields that caused the error, empty when the error isn't about one field
linksRelated links, usually empty

The following table lists the details[] fields:

FieldDescription
fieldThe field that caused the error, in dot notation like amount.currency
valueThe value that caused the error
locationWhere the field is, like body
issueThe 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?

On this page