From 0aba1a424d3c394728f0dd1811509e43b225ffdf Mon Sep 17 00:00:00 2001 From: appscisumup Date: Fri, 13 Mar 2026 18:52:18 +0000 Subject: [PATCH 1/2] chore: synced local 'openapi.json' with remote 'specs/openapi.json' --- openapi.json | 244 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 243 insertions(+), 1 deletion(-) diff --git a/openapi.json b/openapi.json index ebdb778..03378dd 100755 --- a/openapi.json +++ b/openapi.json @@ -3006,6 +3006,22 @@ } } } + }, + "401": { + "description": "Authentication failed or missing required scope.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401, + "detail": "Authentication credentials are missing or invalid." + } + } + } } }, "deprecated": true, @@ -3094,6 +3110,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/forbidden", + "title": "Forbidden", + "status": 403, + "detail": "You do not have permission to perform this action." } } } @@ -3145,6 +3167,22 @@ } } } + }, + "401": { + "description": "Authentication failed or missing required scope.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401, + "detail": "Authentication credentials are missing or invalid." + } + } + } } }, "deprecated": true, @@ -3244,6 +3282,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -3403,6 +3447,38 @@ } } } + }, + "400": { + "description": "Invalid query parameter combination.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." + } + } + } + }, + "401": { + "description": "Authentication failed or missing required scope.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401, + "detail": "Authentication credentials are missing or invalid." + } + } + } } }, "security": [ @@ -3549,6 +3625,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -3665,6 +3747,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -3675,16 +3763,28 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } }, "429": { - "description": "Too many invitations sent to that user. The limit is 10 requests per 5 minutes and the Retry-After header is set to the number of minutes until the reset of the limit.", + "description": "Too many invitations were sent to that user and the rate limit was exceeded. The Retry-After header indicates when the client can retry.", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/too-many-requests", + "title": "Too Many Requests", + "status": 429, + "detail": "Too many requests were sent. Please try again later." } } } @@ -3758,6 +3858,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -3882,6 +3988,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -3892,6 +4004,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/forbidden", + "title": "Forbidden", + "status": 403, + "detail": "You do not have permission to perform this action." } } } @@ -3902,6 +4020,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -3912,6 +4036,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/conflict", + "title": "Conflict", + "status": 409, + "detail": "The request conflicts with the current state of the resource." } } } @@ -3976,6 +4106,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4050,6 +4186,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4153,6 +4295,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -4163,6 +4311,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4236,6 +4390,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4300,6 +4460,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -4310,6 +4476,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4424,6 +4596,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -4434,6 +4612,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4775,6 +4959,22 @@ } } } + }, + "401": { + "description": "Authentication failed or missing required scope.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401, + "detail": "Authentication credentials are missing or invalid." + } + } + } } }, "security": [ @@ -4894,6 +5094,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "Request validation failed." } } } @@ -4904,6 +5110,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -4914,6 +5126,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/conflict", + "title": "Conflict", + "status": 409, + "detail": "The request conflicts with the current state of the resource." } } } @@ -5011,6 +5229,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -5078,6 +5302,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } @@ -5170,6 +5400,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/forbidden", + "title": "Forbidden", + "status": 403, + "detail": "You do not have permission to perform this action." } } } @@ -5180,6 +5416,12 @@ "application/problem+json": { "schema": { "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/not-found", + "title": "Requested resource couldn't be found.", + "status": 404, + "detail": "The requested resource doesn't exist or does not belong to you." } } } From 2b7a1544d7963b25babdaf69591e2f26507f3e4e Mon Sep 17 00:00:00 2001 From: "sumup-bot[bot]" <241716704+sumup-bot[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 18:53:43 +0000 Subject: [PATCH 2/2] chore: generate code --- src/Memberships/Memberships.php | 5 ++++- src/Readers/Readers.php | 4 +++- src/Subaccounts/Subaccounts.php | 8 ++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Memberships/Memberships.php b/src/Memberships/Memberships.php index 9d318a9..1e386eb 100644 --- a/src/Memberships/Memberships.php +++ b/src/Memberships/Memberships.php @@ -202,6 +202,9 @@ public function list(?MembershipsListParams $queryParams = null, ?RequestOptions $response = $this->client->send('GET', $path, $payload, $headers, $requestOptions); - return ResponseDecoder::decodeOrThrow($response, \SumUp\Services\MembershipsListResponse::class, null, 'GET', $path); + return ResponseDecoder::decodeOrThrow($response, \SumUp\Services\MembershipsListResponse::class, [ + '400' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + ], 'GET', $path); } } diff --git a/src/Readers/Readers.php b/src/Readers/Readers.php index 7722afe..d9c8f86 100644 --- a/src/Readers/Readers.php +++ b/src/Readers/Readers.php @@ -309,7 +309,9 @@ public function list(string $merchantCode, ?RequestOptions $requestOptions = nul $response = $this->client->send('GET', $path, $payload, $headers, $requestOptions); - return ResponseDecoder::decodeOrThrow($response, \SumUp\Services\ReadersListResponse::class, null, 'GET', $path); + return ResponseDecoder::decodeOrThrow($response, \SumUp\Services\ReadersListResponse::class, [ + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + ], 'GET', $path); } /** diff --git a/src/Subaccounts/Subaccounts.php b/src/Subaccounts/Subaccounts.php index cb90510..d0ba328 100644 --- a/src/Subaccounts/Subaccounts.php +++ b/src/Subaccounts/Subaccounts.php @@ -180,7 +180,9 @@ public function compatGetOperator(string $operatorId, ?RequestOptions $requestOp $response = $this->client->send('GET', $path, $payload, $headers, $requestOptions); - return ResponseDecoder::decodeOrThrow($response, \SumUp\Types\Operator::class, null, 'GET', $path); + return ResponseDecoder::decodeOrThrow($response, \SumUp\Types\Operator::class, [ + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + ], 'GET', $path); } /** @@ -254,7 +256,9 @@ public function listSubAccounts(?SubaccountsListSubAccountsParams $queryParams = return ResponseDecoder::decodeOrThrow($response, [ '200' => ['type' => 'array', 'items' => ['type' => 'class', 'class' => \SumUp\Types\Operator::class]], - ], null, 'GET', $path); + ], [ + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + ], 'GET', $path); } /**