-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp-errors.html
More file actions
167 lines (164 loc) · 7.96 KB
/
Copy pathhttp-errors.html
File metadata and controls
167 lines (164 loc) · 7.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text x='16' y='24' font-family='system-ui,sans-serif' font-size='22' font-weight='700' fill='%23f85149' text-anchor='middle'>!</text></svg>">
<title>All HTTP Daraja Errors — Codes, Causes & Fixes | Daraja M-Pesa Error Reference</title>
<meta name="description" content="Every Safaricom Daraja HTTP error code with a one-line answer, likely causes, and a copy-paste fix.">
<meta name="robots" content="index, follow, max-snippet:-1">
<link rel="canonical" href="https://ronnyabuto.github.io/daraja-error-codes/http-errors.html">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CollectionPage",
"name": "All HTTP Daraja Errors — Codes, Causes & Fixes",
"url": "https://ronnyabuto.github.io/daraja-error-codes/http-errors.html",
"dateModified": "2026-06-21",
"about": {
"@type": "Thing",
"name": "Safaricom Daraja HTTP API"
},
"mainEntity": {
"@type": "ItemList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Error 400.002.02: Bad Request — Invalid Request Parameter",
"url": "https://ronnyabuto.github.io/daraja-error-codes/400.002.02.html"
},
{
"@type": "ListItem",
"position": 2,
"name": "Error 401.003.01: Invalid Access Token (OAuth Step)",
"url": "https://ronnyabuto.github.io/daraja-error-codes/401.003.01.html"
},
{
"@type": "ListItem",
"position": 3,
"name": "Error 404.001.03: Access Token Expired or Missing",
"url": "https://ronnyabuto.github.io/daraja-error-codes/404.001.03.html"
},
{
"@type": "ListItem",
"position": 4,
"name": "Error 429: Rate Limited — Spike Arrest Violation",
"url": "https://ronnyabuto.github.io/daraja-error-codes/429.html"
}
]
}
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Daraja Error Codes",
"item": "https://ronnyabuto.github.io/daraja-error-codes/"
},
{
"@type": "ListItem",
"position": 2,
"name": "HTTP Errors",
"item": "https://ronnyabuto.github.io/daraja-error-codes/http-errors.html"
}
]
}
</script>
<style>
*, *::before, *::after { box-sizing: border-box; }
body {
margin: 0; padding: 0;
background: #f5f5f5;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
color: #222; line-height: 1.6;
}
.container { max-width: 720px; margin: 0 auto; padding: 40px 20px 60px; }
.back { font-size: 13px; color: #0066ff; text-decoration: none; display: inline-block; margin-bottom: 24px; }
.back:hover { text-decoration: underline; }
.card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 28px; }
.card-top-row {
display: flex; align-items: center; justify-content: space-between;
flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.code { font-family: monospace; font-size: 26px; font-weight: 700; color: #0066ff; }
.api-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.api-stk-push { background: #fff3cd; color: #856404; }
.api-http { background: #f8d7da; color: #721c24; }
.api-c2b { background: #d1ecf1; color: #0c5460; }
.api-b2c { background: #d4edda; color: #155724; }
.api-b2b { background: #d4edda; color: #155724; }
.api-go-live { background: #e2d9f3; color: #4a235a; }
h1 { font-size: 22px; font-weight: 700; margin: 0 0 12px; color: #111; }
p { font-size: 14px; color: #444; margin: 0 0 8px; }
.quick-answer {
background: #eef5ff; border-left: 3px solid #0066ff;
padding: 12px 14px; border-radius: 0 6px 6px 0;
font-size: 15px; color: #14315c; margin: 0 0 16px;
}
.verified {
display: inline-block; font-size: 12px; font-weight: 600;
color: #155724; background: #e8f6ec; border: 1px solid #b7e1c1;
padding: 3px 10px; border-radius: 12px; margin: 0 0 12px;
}
.section-label {
font-size: 11px; font-weight: 700; text-transform: uppercase;
letter-spacing: 0.08em; color: #666; margin-top: 18px; margin-bottom: 6px;
}
ul { margin: 6px 0; padding-left: 20px; font-size: 14px; color: #444; }
ul li { margin-bottom: 4px; }
.fix-text {
background: #f0fff4; border-left: 3px solid #28a745;
padding: 10px 14px; border-radius: 0 6px 6px 0;
font-size: 14px; margin: 0; color: #333;
}
.notes-text {
background: #fff8e1; border-left: 3px solid #ffc107;
padding: 10px 14px; border-radius: 0 6px 6px 0;
font-size: 13px; color: #555; margin: 0;
}
.faq-q { font-size: 14px; font-weight: 700; color: #222; margin: 12px 0 2px; }
.faq-a { font-size: 14px; color: #444; margin: 0 0 8px; }
.related-list, .hub-list { list-style: none; padding: 0; margin: 6px 0; }
.related-list li, .hub-list li { margin-bottom: 10px; }
.related-list a, .hub-list a { color: #0066ff; text-decoration: none; font-size: 14px; font-weight: 600; }
.related-list a:hover, .hub-list a:hover { text-decoration: underline; }
.hub-list .ha { display: block; font-size: 13px; font-weight: 400; color: #555; margin-top: 2px; }
.page-footer { margin-top: 32px; font-size: 13px; color: #888; text-align: center; }
.page-footer a { color: #0066ff; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
@media (max-width: 600px) {
.card-top-row { flex-direction: column; align-items: flex-start; }
.code { font-size: 20px; }
}
</style>
</head>
<body>
<main class="container">
<a href="https://ronnyabuto.github.io/daraja-error-codes/" class="back">← All Daraja Error Codes</a>
<article class="card">
<h1>All HTTP Daraja Errors — Codes, Causes & Fixes</h1>
<p>Every Safaricom Daraja HTTP error code with a one-line answer, likely causes, and a copy-paste fix.</p>
<div class="section-label">HTTP Error Codes</div>
<ul class="hub-list">
<li><a href="400.002.02.html">Error 400.002.02: Bad Request — Invalid Request Parameter</a><span class="ha">Daraja error 400.002.02 is a request-validation error — read the errorMessage suffix; it names the exact invalid field (BusinessShortCode, Timestamp, Amount, or CheckoutRequestID).</span></li>
<li><a href="401.003.01.html">Error 401.003.01: Invalid Access Token (OAuth Step)</a><span class="ha">Error 401.003.01 means the access token was rejected at the OAuth step — regenerate it for the correct environment (sandbox vs production).</span></li>
<li><a href="404.001.03.html">Error 404.001.03: Access Token Expired or Missing</a><span class="ha">Error 404.001.03 means your access token is expired or missing — cache the token and refresh before its 1-hour expiry instead of regenerating per request.</span></li>
<li><a href="429.html">Error 429: Rate Limited — Spike Arrest Violation</a><span class="ha">HTTP 429 'Spike arrest' means Daraja rate-limited you — back off and retry the same request with exponential backoff; do not drop it.</span></li>
</ul>
</article>
<p class="page-footer">
Part of the <a href="https://ronnyabuto.github.io/daraja-error-codes/">Daraja Error Code Reference</a> —
first-hand notes from building and stress-testing
<a href="https://github.com/ronnyabuto/mpesa-stk" target="_blank" rel="noopener">mpesa-stk</a>
against the live Daraja sandbox. Open source on
<a href="https://github.com/ronnyabuto/daraja-error-codes" target="_blank" rel="noopener">GitHub</a>.
</p>
</main>
</body>
</html>