{"openapi":"3.0.3","info":{"title":"ShaBaasPay Public API","version":"1.0.0","description":"Describes public REST endpoints for authorization, payment agreements, payment initiations,\nrefunds, webhooks, and PayID collection APIs.\n"},"servers":[{"url":"https://dev-api.shabaas.com","description":"Staging"},{"url":"https://api.shabaas.com","description":"Production"}],"tags":[{"name":"Payment Agreement","x-displayName":"Payment Agreement","description":"Create, retrieve, amend, resend, and cancel PayTo payment agreements."}],"x-tagGroups":[{"name":"SHABAASPAY PUBLIC API","tags":["API Keys","Payment Agreement","Payment Initiation","Checkout","B2B Collections","Webhooks"]},{"name":"Internal","tags":["Clients"]}],"security":[{"BearerAuth":[]}],"paths":{"/api/public/payment_agreement/cancel":{"delete":{"tags":["Payment Agreement"],"summary":"Cancel payment agreement","description":"Cancel an existing payment agreement by id.\n\n### Error Codes\n| Code | Status | Reason | What to do |\n| ---- | ------ | ------ | ---------- |\n| PAM_INVALID_OPERATION | 400 | Current agreement state cannot be cancelled | Ensure agreement is in cancellable state. |\n| PAM_SB_PAG_NOT_FOUND_ERROR | 404 | Payment agreement not found | Check `id` and ensure it belongs to this merchant. |\n| MOV_RECALL_FAILED | 404 | Unable to recall agreement | Unable to recall agreement, please check status |\n| PAM_FORBIDDEN_ERROR | 403 | Merchant is not allowed to cancel this agreement | Verify merchant ownership/permissions. |\n","parameters":[{"in":"query","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Payment agreement cancelled successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"},"examples":{"cancelled":{"summary":"Agreement cancelled","value":{"message":"Payment Agreement cancelled successfully","data":{}}}}}}},"404":{"description":"Agreement id not found for this merchant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"not_found":{"summary":"Agreement id not found","value":{"message":"MONOOVA-monoova.PAM_SB_PAG_NOT_FOUND_ERROR","error_code":"GN-0000","data":{"response_time":"2026-04-28T12:00:00.000Z"}}}}}}}}}}},"components":{"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string","example":"Success"},"data":{"type":"object","additionalProperties":true}}},"ErrorResponse":{"type":"object","required":["message","error_code","data"],"properties":{"message":{"type":"string","example":"Payee account cannot receive NPP Payments"},"error_code":{"type":"string","example":"MOV_NPP_PAYMENT_NOT_SUPPORTED"},"data":{"type":"object","additionalProperties":true,"example":{"response_time":"2026-04-08T12:28:26.759Z"}}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token returned by `/api/public/authorization`."}}}}