Bird
0
0

You receive this webhook payload:

medium📝 Debug Q14 of 15
Rest API - Webhooks and Events
You receive this webhook payload:
{"event": "payment_failed", "timestamp": "2024-06-01T16:00:00Z", "data": {"payment_id": 789}}

What is wrong with this payload?
APayment ID should be a string, not a number
BTimestamp format is incorrect
CEvent name should be inside data object
DMissing closing brace for the JSON object
Step-by-Step Solution
Solution:
  1. Step 1: Check JSON completeness

    The payload ends without a closing brace '}' for the outermost JSON object, making it invalid JSON.
  2. Step 2: Verify other parts

    Timestamp format is ISO 8601 and correct. Event name is correctly outside data. Payment ID can be number or string depending on design.
  3. Final Answer:

    Missing closing brace for the JSON object -> Option D
  4. Quick Check:

    JSON must have matching braces [OK]
Quick Trick: Always check for matching braces in JSON payloads [OK]
Common Mistakes:
MISTAKES
  • Ignoring missing braces
  • Assuming timestamp format is wrong
  • Thinking event must be inside data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes