# Approve pending point transactions Approves pending point transactions and converts them to available points. When points are pending: - Orders with pending fulfillment - High-risk transactions requiring manual review - Bulk point grants awaiting approval - Refund/return waiting periods - Custom approval workflows Two approval modes: Mode 1: Approve all pending transactions - Set approveAllPendingTransactions=true - Request body is ignored - Approves ALL pending transactions for the shop - Use for bulk approvals or automated workflows Mode 2: Approve specific transactions - Set approveAllPendingTransactions=false (or omit parameter) - Provide pendingPointsApprovalList in request body - Each item needs: customerId, points, transaction details - Approves only specified transactions - Use for selective/manual approval How approval works: 1. Validates pending transactions exist 2. Queues approval process (asynchronous via AWS Step Functions) 3. Returns 204 immediately (doesn't wait for completion) 4. Background process: - Updates transaction status from PENDING to APPROVED - Adds points to customer's availablePoints - Updates creditedPoints total - Syncs to Shopify metafields - Logs approval activity - Triggers any applicable notifications Important notes: - This is an ASYNCHRONOUS operation - Returns 204 immediately, processing happens in background - Points may take a few seconds to appear in customer account - No rollback after 204 response - Cannot approve already-approved transactions - Cannot approve rejected transactions Request body structure (for specific approvals): json [ { "customerId": 12345, "points": 50.0, "transactionId": 98765, "note": "Order fulfilled, approving points" } ] Best practices: - Use approveAllPendingTransactions=true for scheduled/automated approvals - Use specific approval list for manual review workflows - Monitor for completion by checking customer point balance - Set up webhooks/polling to detect when approval completes - Don't call repeatedly - it's queued asynchronously - Consider rate limiting on your side for bulk approvals Common use cases: - Approve points after order fulfillment - Batch approval at end of day/week - Manual approval after fraud review - Approve after return/refund window closes - Integration with external approval systems Error handling: - 204: Success, approval queued (this is success, not an error) - 400: Invalid request format or missing required data - 401: Invalid API key Endpoint: PUT /api/external/approve-pending-transactions ## Header parameters: - `X-API-Key` (string, required) API key for authentication ## Query parameters: - `approveAllPendingTransactions` (boolean) Set to true to approve all pending transactions (ignores pendingPointsApprovalList) ## Request fields (application/json): - `transactionId` (integer) - `customerId` (integer) ## Response 204 fields