404.001.04Daraja API errorM-Pesa error 404.001.04: Invalid authentication header
This is a Daraja API error — Safaricom rejects the request itself, before any customer prompt, usually over authentication or payload validation.
What causes it
The Authorization header is missing or incorrectly formatted, so the request cannot be authenticated (HTTP 404).
How to fix it
Ensure the header is exactly 'Authorization: Bearer <access_token>' with no extra whitespace.
How paylod handles this
paylod manages Daraja OAuth tokens, request signing, and payload formatting for you — the whole class of authentication and malformed-request errors is handled by the wrapper, so you send one clean REST call and get a typed response.
See the paylod M-Pesa API