>_ Analyst Engineering
Labs / Analyze a payment API Step 3 of 4

03Check the sample responses

Compare four real sandbox responses with the schemas in the contract, and treat every difference as evidence.

Responses are evidence, not decoration

A colleague made four calls against the sandbox last week and saved the responses. Most teams paste these into a wiki as examples. You will use them differently: as evidence of what the API actually does, checked against what the contract says it does.

Every difference between a real response and the schema means one of two things. Either the contract is out of date and the implementation is the truth, or the implementation has drifted and the contract is the truth. You cannot tell which from your desk. What you can do is record the difference precisely and ask.

How to compare

Take each response and walk it field by field against the schema it should match:

  • Fields present in the response but absent from the schema. Undocumented fields. Developers will use them, and they can disappear without notice.
  • Values outside a documented enum. The enum is wrong or the implementation is. Either way, a client that validates against the contract will reject a real response.
  • Types that do not match the domain conventions. Read the world conventions again: minor units, upper-case currency codes. A response that breaks a convention is a finding even if the loose schema technically allows it.
  • Error responses. Compare the error code and message with what the requirements promised the merchant would be able to display.
  • List responses. Check whether the response gives you a way to get the next page.

Write each difference as one line: response, path to the field, what the contract says, what the response shows.

Your task

For each of the four responses, list every field or value that the contract does not predict: a field absent from the schema, a value outside an enum, a type that does not match, a required field missing. Decide for each whether the contract or the implementation is wrong, and add it to your findings.

Evidence for this step

Read it in the page or download it and open it in your own tools.

Mission artifact sample-responses.json 90 lines download show
[
  {
    "request": "POST /v1/payments",
    "request_body": {
      "amount": 125.50,
      "currency": "cad",
      "capture_method": "manual",
      "payment_method": { "type": "card", "token": "tok_visa_3ds" },
      "customer": { "email": "buyer@example.com" },
      "split": [
        { "account_id": "acct_seller_01", "amount": 100.00 },
        { "account_id": "acct_seller_02", "amount": 25.50 }
      ]
    },
    "status_code": 201,
    "response_headers": { "Northline-Request-Id": "req_8f2a1c9d7b3e4f60" },
    "response_body": {
      "id": "pay_7Kq2mN9pX4rT1vW8",
      "object": "payment",
      "status": "requires_action",
      "amount": 125.50,
      "currency": "cad",
      "capture_method": "manual",
      "payment_method": {
        "type": "card",
        "card": { "brand": "visa", "last4": "4242", "exp_month": 12, "exp_year": 2028 }
      },
      "customer": { "email": "buyer@example.com" },
      "next_action": {
        "type": "redirect_to_url",
        "redirect_url": "https://checkout.sandbox.northlinepay.example/3ds/pay_7Kq2mN9pX4rT1vW8"
      },
      "split": [
        { "account_id": "acct_seller_01", "amount": 100.00 },
        { "account_id": "acct_seller_02", "amount": 25.50 }
      ],
      "created_at": "2026-09-08T14:02:11Z"
    }
  },
  {
    "request": "GET /v1/payments/pay_3Hd8sL2kQ9wE6rY5",
    "status_code": 200,
    "response_headers": { "Northline-Request-Id": "req_2c7e9a4b1d8f3e05" },
    "response_body": {
      "id": "pay_3Hd8sL2kQ9wE6rY5",
      "object": "payment",
      "status": "captured",
      "amount": 12550,
      "currency": "CAD",
      "amount_captured": 12550,
      "amount_refunded": 0,
      "capture_method": "automatic",
      "payment_method": {
        "type": "card",
        "card": { "brand": "mastercard", "last4": "4444", "exp_month": 3, "exp_year": 2029 }
      },
      "customer": { "email": "buyer2@example.com" },
      "metadata": { "order_id": "ord_1001" },
      "created_at": "2026-09-08T14:10:42Z",
      "captured_at": "2026-09-08T14:10:44Z"
    }
  },
  {
    "request": "POST /v1/refunds",
    "request_body": { "payment_id": "pay_3Hd8sL2kQ9wE6rY5", "amount": 20000, "reason": "requested_by_customer" },
    "status_code": 400,
    "response_headers": { "Northline-Request-Id": "req_9b1d4f7a2e6c8a31" },
    "response_body": {
      "type": "invalid_request_error",
      "code": "invalid_request",
      "message": "Refund amount exceeds the remaining refundable amount (12550).",
      "param": "amount"
    }
  },
  {
    "request": "GET /v1/payments?limit=100&status=captured",
    "status_code": 200,
    "response_headers": { "Northline-Request-Id": "req_4e8c2a6f9d1b7c53" },
    "response_body": {
      "object": "list",
      "data": [
        { "id": "pay_3Hd8sL2kQ9wE6rY5", "object": "payment", "status": "captured", "amount": 12550, "currency": "CAD", "created_at": "2026-09-08T14:10:42Z" },
        { "id": "pay_9Ws4tG7hJ2mL5nP1", "object": "payment", "status": "captured", "amount": 4999, "currency": "EUR", "created_at": "2026-09-08T13:58:03Z" },
        { "id": "pay_[... 98 more items omitted ...]" }
      ],
      "has_more": true
    }
  }
]