GoDaddy

Create a new payment request (Async)

View as Markdown

Create 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 Accepted with immediate paymentRequestId for 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 status QUEUED. A retry with an existing paymentRequestId returns that request's current status - A request stays QUEUED until the terminal responds. It doesn't time out, and no operation cancels it Idempotency: - A repeated X-Request-Id for the same store within 30 minutes returns 409 DUPLICATE_REQUEST, not the existing payment request - To retry safely, send your own paymentRequestId with a new X-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 new paymentRequestId for each new charge Required Properties: - type - Payment request type (SALE or REFUND) - amount - Payment request amount, except for a REFUND with originalTransactionId Optional Properties: - paymentRequestId - Your own UUID for the payment request, which makes create safe to retry - originalTransactionId - Transaction to refund, REFUND only - 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: A 400 validation error carries MALFORMED_REQUEST, VALIDATION_ERROR, INVALID_ARGUMENT, INVALID_PARAMETER, or CONSTRAINT_VIOLATION in name. EXTERNAL_SERVICE_ERROR means the service that delivers the request to the device rejected it (for example, an unknown deviceId), and the response takes that service's HTTP status, which isn't always 400. After an EXTERNAL_SERVICE_ERROR, the payment request is still stored with status FAILED, so retry with a new paymentRequestId.

POST
/stores/{storeId}/payment-requests

Authorization

PAT commerce.payment-request:write
AuthorizationBearer <token>

Personal 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

storeId*string

Unique identifier for the store

Formatuuid

Header Parameters

X-Request-Id?string

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.

Formatuuid

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

  1. Created with initial status (RECEIVED/QUEUED)
  2. Sent to device for customer interaction
  3. Customer completes payment flow on device
  4. Transaction(s) created and associated with payment request
  5. 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?