{"openapi":"3.1.0","info":{"title":"Case Payment Orders API","description":"Case payment orders","contact":{"name":"CDM","url":"https://tools.hmcts.net/confluence/display/RCCD/Reform%3A+Core+Case+Data+Home","email":"corecasedatateam@hmcts.net"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"version":"v1.0.0"},"externalDocs":{"description":"README","url":"https://github.com/hmcts/rpe-pdf-service"},"servers":[{"url":"http://localhost","description":"Generated server url"}],"paths":{"/case-payment-orders":{"get":{"tags":["case-payment-orders-controller"],"summary":"Get payment orders for a case","description":"Get payment orders for a case","operationId":"getCasePaymentOrders","parameters":[{"name":"ids","in":"query","description":"list of case payment orders ids","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"case_ids","in":"query","description":"list of ccd case reference numbers","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"page","in":"query","description":"page number, indexes from (0,1) to page-size."},{"name":"size","in":"query","description":"page size"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCasePaymentOrder"}}}},"400":{"description":"One or more of the following reasons:\n1) Case payment orders cannot be filtered by both id and case id.\n2) Case ID has to be a valid 16-digit Luhn number.\n3) ID is invalid.","content":{"application/json":{"example":{"status":"400","error":"Bad Request","message":"Input not valid","path":"/case-payment-orders","details":["Case ID has to be a valid 16-digit Luhn number."]}}}},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCasePaymentOrder"}}}},"403":{"description":"Unauthorised S2S service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCasePaymentOrder"}}}},"404":{"description":"The following Case Payment Orders do not exist : ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageCasePaymentOrder"}}}}}},"put":{"tags":["case-payment-orders-controller"],"summary":"Update Case Payment Order","description":"Updates a case payment order","operationId":"updateCasePaymentOrderRequest","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Update Case Payment Order Request"}}},"required":true},"responses":{"202":{"description":"Case Payment Order Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"400":{"description":"One or more of the following reasons:\n1) ID is invalid.\n2) ID is required.\n3) Case ID has to be a valid 16-digit Luhn number.\n4) Case ID is required.\n5) Action is required.\n6) Responsible Party is required.\n7) Order Reference has invalid format.\n8) Order Reference is required.\n9) Idam ID cannot be retrieved.","content":{"application/json":{"example":{"status":"400","error":"Bad Request","message":"Input not valid","path":"/case-payment-orders","details":["ID is required."]}}}},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"403":{"description":"Unauthorised S2S service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"404":{"description":"Case Payment Order does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"409":{"description":"A case payment order with the specified Order Reference already exists on the case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}}}},"post":{"tags":["case-payment-orders-controller"],"summary":"Create Case Payment Order","description":"Create Case Payment Order","operationId":"createCasePaymentOrderRequest","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Create Case Payment Order Request"}}},"required":true},"responses":{"201":{"description":"Case Payment Order Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"400":{"description":"One or more of the following reasons:\n1) Case ID has to be a valid 16-digit Luhn number.\n2) Case ID is required.\n3) Action is required.\n4) Responsible Party is required.\n5) Order Reference has invalid format.\n6) Order Reference is required.\n7) Idam ID cannot be retrieved.","content":{"application/json":{"example":{"status":"400","error":"Bad Request","message":"Input not valid","path":"/case-payment-orders","details":["Case ID has to be a valid 16-digit Luhn number."]}}}},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"403":{"description":"Unauthorised S2S service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}},"409":{"description":"A case payment order with the specified Order Reference already exists on the case.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CasePaymentOrder"}}}}}},"delete":{"tags":["case-payment-orders-controller"],"summary":"Delete specified case payment orders","operationId":"deleteCasePaymentOrdersById","parameters":[{"name":"ids","in":"query","description":"list of IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"case_ids","in":"query","description":"list of Case IDs","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"204":{"description":"Case Payment Orders Deleted"},"400":{"description":"One or more of the following reasons:\n1) ID is invalid.\n2) Case ID has to be a valid 16-digit Luhn number.\n3) Cannot delete Case Payment Orders by both ids and case-ids","content":{"application/json":{"example":{"status":"400","error":"Bad Request","message":"Input not valid","path":"/case-payment-orders","details":["Cannot delete Case Payment Orders by both ids and case-ids"]}}}},"401":{"description":"Authentication failure due to invalid / expired tokens (IDAM / S2S)."},"403":{"description":"Unauthorised S2S service."},"404":{"description":"The following Case Payment Orders do not exist : "}}}}},"components":{"schemas":{"Update Case Payment Order Request":{"type":"object","properties":{"Case Id for which the record applies":{"type":"string","example":"2061729969689088","minLength":1},"Action that initiated the creation of the case payment order":{"type":"string","example":"Case Submit","minLength":1},"Description of the party responsible for the case payment order":{"type":"string","example":"Jane Doe","minLength":1},"Description of the Payments system order reference":{"type":"string","example":"2021-1122334455667","pattern":"^2[0-9]{3}-[0-9]{13}$"},"Case Payment Order ID to update":{"type":"string","example":"77d30e7f-ead9-4529-a499-6bf8b0f2d08e","minLength":1}},"required":["Action that initiated the creation of the case payment order","Case Id for which the record applies","Case Payment Order ID to update","Description of the Payments system order reference","Description of the party responsible for the case payment order"]},"CasePaymentOrder":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdTimestamp":{"type":"string","format":"date-time"},"caseId":{"type":"integer","format":"int64"},"action":{"type":"string"},"responsibleParty":{"type":"string"},"orderReference":{"type":"string"},"createdBy":{"type":"string"},"historyExists":{"type":"boolean"}}},"Create Case Payment Order Request":{"type":"object","properties":{"Case Id for which the record applies":{"type":"string","example":"2061729969689088","minLength":1},"Action that initiated the creation of the case payment order":{"type":"string","example":"Case Submit","minLength":1},"Description of the party responsible for the case payment order":{"type":"string","example":"Jane Doe","minLength":1},"Description of the Payments system order reference":{"type":"string","example":"2021-1122334455667","pattern":"^2[0-9]{3}-[0-9]{13}$"}},"required":["Action that initiated the creation of the case payment order","Case Id for which the record applies","Description of the Payments system order reference","Description of the party responsible for the case payment order"]},"PageCasePaymentOrder":{"type":"object","properties":{"totalPages":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"size":{"type":"integer","format":"int32"},"content":{"type":"array","items":{"$ref":"#/components/schemas/CasePaymentOrder"}},"number":{"type":"integer","format":"int32"},"sort":{"$ref":"#/components/schemas/SortObject"},"pageable":{"$ref":"#/components/schemas/PageableObject"},"numberOfElements":{"type":"integer","format":"int32"},"first":{"type":"boolean"},"last":{"type":"boolean"},"empty":{"type":"boolean"}}},"PageableObject":{"type":"object","properties":{"offset":{"type":"integer","format":"int64"},"sort":{"$ref":"#/components/schemas/SortObject"},"paged":{"type":"boolean"},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"unpaged":{"type":"boolean"}}},"SortObject":{"type":"object","properties":{"empty":{"type":"boolean"},"sorted":{"type":"boolean"},"unsorted":{"type":"boolean"}}}},"securitySchemes":{"headerServiceAuthorization":{"description":"Valid Service-to-Service JWT token for a whitelisted micro-service","name":"ServiceAuthorization","in":"header"},"headerAuthorization":{"description":"Keyword `Bearer` followed by a valid IDAM user token","name":"Authorization","in":"header"}}}}
