{"openapi":"3.1.0","info":{"title":"Enrollments","version":"v1"},"servers":[{"url":"https://enrollment-api.qa.txp-externalapis.nonprod.ppro.int","description":"Enrollment API QA server"},{"url":"https://enrollment-api.txp-externalapis-sandbox.prod.ppro.int","description":"Enrollment API Sandbox server"},{"url":"https://enrollment-api.txp-externalapis-pci.prod.ppro.int","description":"Enrollment API Production server"}],"tags":[{"name":"Enrollment Endpoints"}],"paths":{"/v1/merchants/{merchant-id}/enrollments":{"get":{"tags":["Enrollment Endpoints"],"summary":"List enrollments","operationId":"list","parameters":[{"name":"merchant-id","in":"path","description":"Unique identifier for the merchant","required":true,"schema":{"type":"string"},"example":"MERCHANTID456"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEnrollmentsResponse"}}}},"504":{"description":"Response timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResponseBody","additionalProperties":{},"contains":{},"items":{},"unevaluatedItems":{}}}}}}},"post":{"tags":["Enrollment Endpoints"],"summary":"Enroll a payment method","operationId":"enroll","parameters":[{"name":"merchant-id","in":"path","description":"Unique identifier for the merchant","required":true,"schema":{"type":"string"},"example":"MERCHANTID456"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"409":{"description":"When the merchant is already enrolled in the given payment method.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResponseBody","additionalProperties":{},"contains":{},"items":{},"unevaluatedItems":{}}}}},"504":{"description":"Response timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResponseBody","additionalProperties":{},"contains":{},"items":{},"unevaluatedItems":{}}}}}}}},"/v1/merchants/{merchant-id}/enrollments/{enrollment-id}":{"get":{"tags":["Enrollment Endpoints"],"summary":"Get enrollment","operationId":"fetch","parameters":[{"name":"merchant-id","in":"path","description":"Unique identifier for the merchant","required":true,"schema":{"type":"string"},"example":"MERCHANTID456"},{"name":"enrollment-id","in":"path","description":"Unique identifier for the enrollment","required":true,"schema":{"type":"string"},"example":"enrollment_XGAvKrnL8EsQjQwGj8FUc"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentResponse"}}}},"504":{"description":"Response timeout.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExceptionResponseBody","additionalProperties":{},"contains":{},"items":{},"unevaluatedItems":{}}}}}}}}},"components":{"schemas":{"EnrollmentRequest":{"type":"object","properties":{"paymentMethod":{"type":"string","description":"The payment method to be enrolled.","example":"WERO","minLength":1},"webhooksUrl":{"type":"string","description":"The URL to which the enrollment state changes will be notified.","example":"https://webshop.com/webhooks/enrollment-status","pattern":"^(https)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"}},"required":["paymentMethod"]},"ExceptionResponseBody":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"failureMessage":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"extensions":{"type":"object","additionalProperties":{}}}},"EnrollmentFailure":{"type":"object","properties":{"failureType":{"type":"string","description":"The failure type.","enum":["INTERNAL_ERROR","INTERNAL_DECLINE","PROVIDER_ERROR","PROVIDER_DECLINE"]},"failureCode":{"type":"string","description":"The failure code."},"providerFailureCode":{"type":"string","description":"The payment provider failure code."},"failureMessage":{"type":"string","description":"The failure message."}}},"EnrollmentResponse":{"type":"object","properties":{"id":{"type":"string","description":"The enrollment identifier.","example":"enrollment_XGAvKrnL8EsQjQwGj8FUc"},"status":{"type":"string","description":"The enrollment status.","enum":["INITIATED","PROVIDER_PENDING","ACTIVE","INACTIVE","SUSPENDED","FAILED"]},"paymentMethod":{"type":"string","description":"The enrollment payment method.","example":"WERO"},"failure":{"$ref":"#/components/schemas/EnrollmentFailure","description":"The enrollment processing failure."},"createdAt":{"type":"string","format":"date-time","description":"The enrollment creation timestamp in ISO 8601 format.","example":"2026-04-21T11:23:47.123Z"},"updatedAt":{"type":"string","format":"date-time","description":"The enrollment update timestamp in ISO 8601 format.","example":"2026-04-21T11:23:47.123Z"}}},"ListEnrollmentsResponse":{"type":"object","properties":{"data":{"type":"array","description":"The merchant enrollments.","items":{"$ref":"#/components/schemas/EnrollmentResponse"}}}}}}}