{
 "openapi":"3.1.0",
 "info":{"title":"InfiniStack proposed payment API","version":"0.1.0-draft","description":"Design contract only. No hosted sandbox or live payment API is active. Reserved .example server addresses are intentionally non-operational."},
 "servers":[{"url":"https://sandbox.infinistack.example","description":"Reserved example address. Not an active API."}],
 "security":[{"bearerAuth":[]}],
 "paths":{
  "/v1/payments":{"post":{"summary":"Proposed payment intent creation","operationId":"createPayment","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePayment"}}}},"responses":{"201":{"description":"Proposed created intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"409":{"description":"Key reused with a different payload"},"503":{"description":"Route unavailable"}}}},
  "/v1/payments/{id}":{"get":{"summary":"Proposed status verification","operationId":"getPayment","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Proposed intent status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"404":{"description":"Not found"}}}},
  "/v1/payment-links":{"post":{"summary":"Planned payment link creation","responses":{"501":{"description":"Not implemented"}}}},
  "/v1/payment-methods":{"get":{"summary":"Planned authorised route listing","responses":{"501":{"description":"Not implemented"}}}},
  "/v1/refunds":{"post":{"summary":"Planned capability-dependent refund request","responses":{"501":{"description":"Not implemented"}}}},
  "/v1/settlements":{"get":{"summary":"Planned settlement tracking","responses":{"501":{"description":"Not implemented"}}}},
  "/v1/webhook-endpoints":{"post":{"summary":"Planned notification endpoint registration","responses":{"501":{"description":"Not implemented"}}}}
 },
 "components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{
  "CreatePayment":{"type":"object","additionalProperties":false,"required":["amount","currency","country","reference","payment_method","customer"],"properties":{"amount":{"type":"integer","minimum":100,"maximum":10000000},"currency":{"type":"string","const":"XAF"},"country":{"type":"string","enum":["TD","CM"]},"reference":{"type":"string","maxLength":100},"payment_method":{"type":"string","enum":["airtel","moov","mtn","orange"]},"customer":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"Fictional sandbox phone number"}}}}},
  "Payment":{"type":"object","required":["id","status","amount","currency","checkout_url"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["CREATED","PROCESSING","PENDING","SUCCEEDED","FAILED","EXPIRED","UNKNOWN"]},"amount":{"type":"integer"},"currency":{"type":"string","const":"XAF"},"checkout_url":{"type":"string","format":"uri"}}}
 }}
}
