{"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":"Checkout","x-displayName":"Checkout","description":"Generate checkout and pay links for web checkout flows."}],"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/get_external_url":{"post":{"tags":["Checkout"],"summary":"post","description":"Generate an external checkout URL using amount, notes, and checkout parameters.\n\n### Error Codes\n| Code | Status | Reason | What to do |\n| ---- | ------ | ------ | ---------- |\n| GN-0000 | 401 | Unauthorized Access to an operation | Send valid API key in `Authorization` header |\n| GN-0000 | 422 | Invalid amount (amount <= 0) | Provide a positive amount. |\n| PA-0008 | 422 | Amount exceeds allowed threshold | Reduce amount and retry. |\n| GN-0000 | 422 | Checkout is not supported for merchant | Enable standalone checkout for merchant. |\n","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalCheckoutRequest"},"examples":{"basic":{"value":{"amount":"50","notes":"testing","checkout":{"first_and_last_name":"Jon Doe","company_name":"Test Corp","business_abn":"111111111","email":"customer@example.com","phone_number":"6141012233"}}}}}}},"responses":{"200":{"description":"External checkout URL generated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLinkResponse"},"examples":{"generated":{"value":{"message":"Success","data":{"checkout_url":"https://checkout.shabaas.com/au/staging-demo-merchant?token=eyJhbGci..."}}}}}}},"401":{"description":"Unauthorized merchant context.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation or business-rule error while generating external checkout URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ExternalCheckoutRequest":{"type":"object","required":["amount","checkout"],"properties":{"amount":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"External checkout amount.","example":"50"},"notes":{"type":"string","description":"Optional checkout notes.","example":"testing"},"checkout":{"type":"object","description":"External checkout parameter object.","additionalProperties":true,"example":{"first_and_last_name":"Jon Doe","company_name":"Test Corp","business_abn":"111111111","email":"customer@example.com","phone_number":"6141012233"}}}},"CheckoutLinkResponse":{"type":"object","properties":{"message":{"type":"string","example":"Success"},"data":{"type":"object","properties":{"checkout_url":{"type":"string","example":"https://checkout.shabaas.com/au/staging-demo-merchant?token=eyJhbGci..."}}}}},"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`."},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Merchant API key in `Authorization` header."}}}}