Create a new payment request (Async)
View as MarkdownCreate a new payment request for the specified store.
Full description
Create a new payment request for the specified store. This is an asynchronous operation. Async Processing: - Returns
202 Acceptedwith immediatepaymentRequestIdfor tracking - Processing happens in the background with status updates via callbacks - Use callbacks (if configured) or polling GET endpoint for completion status - A new payment request returns with statusQUEUED. A retry with an existingpaymentRequestIdreturns that request's current status - A request staysQUEUEDuntil the terminal responds. It doesn't time out, and no operation cancels it Idempotency: - A repeatedX-Request-Idfor the same store within 30 minutes returns409 DUPLICATE_REQUEST, not the existing payment request - To retry safely, send your ownpaymentRequestIdwith a newX-Request-Id. When a payment request with that ID already exists in the store, the API returns it instead of creating a new one. This works for 90 days after you create the request - The retry body isn't compared with the original, so use a newpaymentRequestIdfor each new charge Required Properties: -type- Payment request type (SALEorREFUND) -amount- Payment request amount, except for aREFUNDwithoriginalTransactionIdOptional Properties: -paymentRequestId- Your own UUID for the payment request, which makes create safe to retry -originalTransactionId- Transaction to refund,REFUNDonly -deviceId- Device identifier for this payment request -paymentInstructions- Payment instructions -notes- Additional notes about the payment request -references- External system references -callbackConfig- Configuration for async status notifications Error codes: A400validation error carriesMALFORMED_REQUEST,VALIDATION_ERROR,INVALID_ARGUMENT,INVALID_PARAMETER, orCONSTRAINT_VIOLATIONinname.EXTERNAL_SERVICE_ERRORmeans the service that delivers the request to the device rejected it (for example, an unknowndeviceId), and the response takes that service's HTTP status, which isn't always400. After anEXTERNAL_SERVICE_ERROR, the payment request is still stored with statusFAILED, so retry with a newpaymentRequestId.
Authorization
PAT commerce.payment-request:writePersonal Access Token (PAT). Include as Authorization: Bearer $GODADDY_PAT. Required scopes: commerce.payment-request:write, commerce.payment-request:read.
In: header
Scope: commerce.payment-request:write
Path Parameters
Unique identifier for the store
uuidHeader Parameters
Unique identifier for this call, used for duplicate detection and tracing. A repeated value for the
same store within 30 minutes returns 409 DUPLICATE_REQUEST. It doesn't make create safe to
retry: send a new value on every call, and reuse paymentRequestId to retry the same charge.
uuidRequest Body
application/json
A Payment Request represents an intent to process a payment transaction. It contains all the necessary information to initiate payment processing on a device and track the payment lifecycle from creation through completion.
Lifecycle Overview:
- Created with initial status (RECEIVED/QUEUED)
- Sent to device for customer interaction
- Customer completes payment flow on device
- Transaction(s) created and associated with payment request
- Final status reached (COMPLETED/FAILED)
Key Concepts:
- Async Processing: Payment requests are processed asynchronously with status updates via callbacks
- Device Integration: Payment requests are sent to physical payment devices (terminals, tablets, etc.)
- Transaction Association: Completed payments generate transaction records linked via transactionIds
Integration Patterns:
- Use callbacks for real-time status updates during async processing
- Poll the GET endpoint if callbacks are not configured
- Handle race conditions gracefully (payment may complete while processing other operations)
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/payment-requests" \ -H "Content-Type: application/json" \ -d '{ "paymentRequestId": "f6a2d8e7-06e9-466f-84b8-9a8b42b2cdf9", "type": "SALE", "amount": { "amount": 5000, "currency": "USD", "amountType": "SIMPLE" }, "paymentInstructions": { "multiTender": true, "skipReceiptScreen": true, "skipSignatureScreen": true, "disableTip": true }, "deviceId": "urn:tid:2cf6f478-e7c6-3378-8cda-74ee60715e13", "notes": "Table 5 - Split payment with card", "references": [ { "type": "CUSTOM", "value": "ORD-2024-001", "additionalLabel": "POS Order" } ], "callbackConfig": { "url": "https://merchant.example.com/webhooks/payment-status", "authentication": { "type": "hmac", "value": "your-shared-secret-key-12345" }, "payloadConfig": { "includeFields": [ "paymentRequestId", "type", "amount", "storeId", "deviceId", "transactionIds", "transactions" ], "legacyMode": false } } }'{ "paymentRequestId": "a1b2c3d4-e5f6-4789-9abc-def123456789", "type": "SALE", "transactionRefNum": "a1b2c3d4-e5f6-4789-9abc-def123456789", "originalTransactionId": "b2c3d4e5-f6a7-8901-bcde-f123456789ab", "storeId": "12345678-90ab-cdef-1234-567890abcdef", "deviceId": "urn:tid:2cf6f478-e7c6-3378-8cda-74ee60715e13", "amount": { "amount": 0, "currency": "str", "amountType": "SIMPLE" }, "paymentInstructions": { "multiTender": true, "skipReceiptScreen": true, "skipSignatureScreen": true, "disableTip": true }, "createdAt": "2022-07-21T17:32:28Z", "updatedAt": "2022-07-21T17:32:28Z", "status": "RECEIVED", "notes": "Table 5 - Split payment with card", "references": [ { "type": "CUSTOM", "value": "ORD-2024-001", "additionalLabel": "POS Order" } ], "transactionIds": [ "11111111-2222-3333-4444-555555555555" ], "links": [ { "href": "http://example.com", "rel": "string", "title": "string", "targetMediaType": "string", "targetSchema": null, "method": "string", "submissionMediaType": "application/json", "submissionSchema": null } ], "activities": [], "callbackConfig": { "url": "https://client.example.com/webhooks/payment-requests", "authentication": { "type": "hmac", "value": "your-shared-secret-key" }, "payloadConfig": { "includeFields": [ "paymentRequestId", "type", "amount", "storeId", "transactions" ], "legacyMode": false } }}Last updated on
How is this guide?