From dd1a0a4ae51e10e9426379faff028a06ac286aae Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:55:05 +0000 Subject: [PATCH 1/2] chore: synced local 'openapi.json' with remote 'specs/openapi31.json' --- openapi.json | 897 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 805 insertions(+), 92 deletions(-) diff --git a/openapi.json b/openapi.json index 7b95b9e..a08e3f0 100644 --- a/openapi.json +++ b/openapi.json @@ -103,6 +103,15 @@ "$ref": "#/components/schemas/Merchant" } ] + }, + { + "name": "Tokens", + "description": "Merchant tokens let your application accept card-present payments with SumUp SDKs that support token-based authentication. Use them when you want users to sign in to your application with your own authentication, then accept payments for a SumUp merchant account.\n\nCreate tokens on your backend using one of the [supported authentication methods](https://developer.sumup.com/api/authentication). Keep your authentication credentials on your backend. Return only the short-lived merchant token to your application and pass its `access_token` to the SDK.\n\nBefore returning a token, authenticate the user in your application and check that they can accept payments for the requested merchant account. A merchant token is limited to that account and the requested actions, and does not grant permissions beyond those of the identity that created it.\n\nTokens expire 15 minutes after creation. Use `expires_in` to determine the remaining lifetime and create a new token when needed. This endpoint does not return a refresh token. Treat merchant tokens as secrets: send them over HTTPS and keep them out of URLs, logs, and source code.", + "x-core-objects": [ + { + "$ref": "#/components/schemas/Token" + } + ] } ], "paths": { @@ -1602,29 +1611,7 @@ "$ref": "#/components/schemas/ErrorExtended" }, { - "type": "object", - "required": [ - "instance", - "error_code", - "error_message" - ], - "properties": { - "instance": { - "type": "string", - "description": "Unique identifier of this error occurrence.", - "example": "32a44c6c-85d3-49e8-86bf-a5bba98c4621" - }, - "error_code": { - "type": "string", - "description": "Platform code for the error.", - "example": "INVALID" - }, - "error_message": { - "type": "string", - "description": "Short description of the error.", - "example": "customer_id" - } - } + "$ref": "#/components/schemas/CustomerValidationError" } ] }, @@ -5573,7 +5560,7 @@ } } }, - "description": "Creates a Checkout for a Reader.\n\nThis process is asynchronous and the actual transaction may take some time to be started on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise checkout won't be accepted\n* After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.\n", + "description": "Creates a Checkout for a Reader.\n\nThis process is asynchronous and the actual transaction may take some time to be started on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise checkout won't be accepted\n* After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.\n\n\nOptionally include an `affiliate` object to attach integrator metadata to the payment.\nProvide both `app_id` and `key` when including this object.\n", "operationId": "CreateReaderCheckout", "parameters": [ { @@ -5622,16 +5609,22 @@ "400": { "content": { "application/json": { + "example": { + "errors": { + "detail": "Invalid affiliate key.", + "type": "INVALID_AFFILIATE_KEY" + } + }, "schema": { "$ref": "#/components/schemas/CreateReaderCheckoutError" } }, "application/problem+json": { "example": { - "detail": "Bad Request", + "detail": "Invalid affiliate key.", "status": 400, - "title": "Bad Request", - "type": "https://developer.sumup.com/problem/bad-request" + "title": "Invalid Affiliate Key", + "type": "https://developer.sumup.com/problem/invalid-affiliate-key" }, "schema": { "$ref": "#/components/schemas/Problem" @@ -5690,11 +5683,23 @@ } }, "application/problem+json": { - "example": { - "detail": "Validation failed", - "status": 422, - "title": "Unprocessable Entity", - "type": "https://developer.sumup.com/problem/validation-error" + "examples": { + "PaymentMethodNotAllowed": { + "value": { + "detail": "Payment method not allowed for this merchant.", + "status": 422, + "title": "Payment Method Not Allowed", + "type": "https://developer.sumup.com/problem/payment-method-not-allowed" + } + }, + "ValidationError": { + "value": { + "detail": "Validation failed", + "status": 422, + "title": "Unprocessable Content", + "type": "https://developer.sumup.com/problem/validation-error" + } + } }, "schema": { "$ref": "#/components/schemas/Problem" @@ -5856,14 +5861,14 @@ ] } }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate": { - "post": { + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings": { + "get": { "callbacks": {}, - "description": "Terminate a Reader Checkout stops the current transaction on the target device.\n\nThis process is asynchronous and the actual termination may take some time to be performed on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise terminate won't be accepted\n* The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc.\n* There is no confirmation of the termination.\n\nIf a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.\n", - "operationId": "CreateReaderTerminate", + "description": "Returns the menu lock settings for a Solo reader.\n\nFor an online reader, returns the current settings. For an offline reader,\nreturns the last saved settings, which may differ from its current configuration.\nReturns `404` if the reader is offline and no saved settings are available.\n\nThe response may include the menu lock PIN.\n", + "operationId": "GetReaderSettings", "parameters": [ { - "description": "Merchant Code", + "description": "The merchant code of the account that owns the reader.", "example": "MC0X0ABC", "in": "path", "name": "merchant_code", @@ -5873,7 +5878,132 @@ } }, { - "description": "The unique identifier of the Reader", + "description": "The unique identifier of the reader.", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "in": "path", + "name": "reader_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetReaderSettingsResponse" + } + } + }, + "description": "Reader settings retrieved successfully." + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsError" + } + }, + "application/problem+json": { + "example": { + "detail": "Unauthorized", + "status": 401, + "title": "Unauthorized", + "type": "https://developer.sumup.com/problem/unauthorized" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "Unauthorized" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFound" + } + }, + "application/problem+json": { + "example": { + "detail": "The requested resource doesn't exist or does not belong to you.", + "status": 404, + "title": "Requested resource couldn't be found.", + "type": "https://developer.sumup.com/problem/not-found" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "The reader was not found, or it is offline and has no saved settings." + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsUnprocessableEntity" + } + }, + "application/problem+json": { + "example": { + "detail": "Reader settings are only supported for Solo readers.", + "status": 422, + "title": "Unsupported Device Model", + "type": "https://developer.sumup.com/problem/unsupported-device-model" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "The reader model is not supported, or the reader could not return its settings." + } + }, + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [ + "readers.read" + ] + } + ], + "summary": "Get Reader Settings", + "tags": [ + "Readers" + ], + "x-codegen": { + "method_name": "get_reader_settings" + }, + "x-permissions": [ + "readers.checkouts.view" + ], + "x-scopes": [ + "readers.read" + ] + }, + "patch": { + "callbacks": {}, + "description": "Updates the menu lock settings for a Solo reader. The reader must be online.\nA successful response confirms that the reader applied the update.\n\nInclude at least one of `menu_lock.enabled` or `menu_lock.passcode`.\nOmitted settings keep their current values. The response contains only the\nsettings included in the request.\n\nWhen enabling menu lock for a reader without a PIN, include a four-digit PIN\nin `menu_lock.passcode` in the same request.\n", + "operationId": "UpdateReaderSettings", + "parameters": [ + { + "description": "The merchant code of the account that owns the reader.", + "example": "MC0X0ABC", + "in": "path", + "name": "merchant_code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The unique identifier of the reader.", "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", "in": "path", "name": "reader_id", @@ -5885,23 +6015,31 @@ ], "requestBody": { "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsRequest" + } + } }, - "description": "A checkout initial attributes", - "required": false + "description": "Menu lock settings to update.", + "required": true }, "responses": { - "202": { + "200": { "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsResponse" + } + } }, - "description": "The Terminate action was successfully dispatched for the given reader." + "description": "Reader settings updated successfully." }, "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderTerminateError" + "$ref": "#/components/schemas/UpdateReaderSettingsError" } }, "application/problem+json": { @@ -5916,13 +6054,13 @@ } } }, - "description": "Response when given params (or one of them) are invalid" + "description": "The request body is malformed." }, "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderTerminateError" + "$ref": "#/components/schemas/UpdateReaderSettingsError" } }, "application/problem+json": { @@ -5958,13 +6096,19 @@ } } }, - "description": "Response when given reader is not found" + "description": "The reader was not found." }, "422": { "content": { "application/json": { + "example": { + "errors": { + "detail": "The device is offline.", + "type": "READER_OFFLINE" + } + }, "schema": { - "$ref": "#/components/schemas/CreateReaderTerminateUnprocessableEntity" + "$ref": "#/components/schemas/UpdateReaderSettingsUnprocessableEntity" } }, "application/problem+json": { @@ -5979,7 +6123,7 @@ } } }, - "description": "Response when given params (or one of them) are invalid" + "description": "The settings are invalid, the reader is offline, the reader model is not supported, or the reader could not apply the update." } }, "security": [ @@ -5992,26 +6136,26 @@ ] } ], - "summary": "Terminate a Reader Checkout", + "summary": "Update Reader Settings", "tags": [ "Readers" ], "x-codegen": { - "method_name": "terminate_checkout" + "method_name": "update_reader_settings" }, "x-permissions": [ - "readers.checkouts.delete" + "readers.checkouts.create" ], "x-scopes": [ "readers.write" ] } }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout/{checkout_id}": { - "get": { + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate": { + "post": { "callbacks": {}, - "description": "Get a Checkout for a Reader.\n", - "operationId": "GetReaderCheckout", + "description": "Terminate a Reader Checkout stops the current transaction on the target device.\n\nThis process is asynchronous and the actual termination may take some time to be performed on the device.\n\n\nThere are some caveats when using this endpoint:\n* The target device must be online, otherwise terminate won't be accepted\n* The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc.\n* There is no confirmation of the termination.\n\nIf a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.\n\n\n**Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.\n", + "operationId": "CreateReaderTerminate", "parameters": [ { "description": "Merchant Code", @@ -6032,34 +6176,48 @@ "schema": { "type": "string" } - }, - { - "description": "The unique identifier of the Checkout", - "example": "74ecff66-1655-43ed-8ce3-193f49fa602f", - "in": "path", - "name": "checkout_id", - "required": true, - "schema": { - "type": "string" - } } ], + "requestBody": { + "content": { + "application/json": {} + }, + "description": "A checkout initial attributes", + "required": false + }, "responses": { - "200": { + "202": { + "content": { + "application/json": {} + }, + "description": "The Terminate action was successfully dispatched for the given reader." + }, + "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetReaderCheckoutResponse" + "$ref": "#/components/schemas/CreateReaderTerminateError" + } + }, + "application/problem+json": { + "example": { + "detail": "Bad Request", + "status": 400, + "title": "Bad Request", + "type": "https://developer.sumup.com/problem/bad-request" + }, + "schema": { + "$ref": "#/components/schemas/Problem" } } }, - "description": "The Checkout got successfully retrieved for the given reader." + "description": "Response when given params (or one of them) are invalid" }, "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutError" + "$ref": "#/components/schemas/CreateReaderTerminateError" } }, "application/problem+json": { @@ -6095,7 +6253,28 @@ } } }, - "description": "Response when given reader or checkout is not found" + "description": "Response when given reader is not found" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateReaderTerminateUnprocessableEntity" + } + }, + "application/problem+json": { + "example": { + "detail": "The device is offline.", + "status": 422, + "title": "Reader Offline", + "type": "https://developer.sumup.com/problem/reader-offline" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "Response when given params (or one of them) are invalid" } }, "security": [ @@ -6104,7 +6283,123 @@ }, { "oauth2": [ - "readers.read" + "readers.write" + ] + } + ], + "summary": "Terminate a Reader Checkout", + "tags": [ + "Readers" + ], + "x-codegen": { + "method_name": "terminate_checkout" + }, + "x-permissions": [ + "readers.checkouts.delete" + ], + "x-scopes": [ + "readers.write" + ] + } + }, + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout/{checkout_id}": { + "get": { + "callbacks": {}, + "description": "Get a Checkout for a Reader.\n", + "operationId": "GetReaderCheckout", + "parameters": [ + { + "description": "Merchant Code", + "example": "MC0X0ABC", + "in": "path", + "name": "merchant_code", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The unique identifier of the Reader", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "in": "path", + "name": "reader_id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The unique identifier of the Checkout", + "example": "74ecff66-1655-43ed-8ce3-193f49fa602f", + "in": "path", + "name": "checkout_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetReaderCheckoutResponse" + } + } + }, + "description": "The Checkout got successfully retrieved for the given reader." + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateReaderCheckoutError" + } + }, + "application/problem+json": { + "example": { + "detail": "Unauthorized", + "status": 401, + "title": "Unauthorized", + "type": "https://developer.sumup.com/problem/unauthorized" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "Unauthorized" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFound" + } + }, + "application/problem+json": { + "example": { + "detail": "The requested resource doesn't exist or does not belong to you.", + "status": 404, + "title": "Requested resource couldn't be found.", + "type": "https://developer.sumup.com/problem/not-found" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "Response when given reader or checkout is not found" + } + }, + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [ + "readers.read" ] } ], @@ -6122,6 +6417,157 @@ "readers.read" ] } + }, + "/v0.1/merchants/{merchant_code}/tokens": { + "post": { + "summary": "Create a merchant token", + "description": "Creates a short-lived token for the merchant account identified by `merchant_code` and the requested actions.\n\nCall this endpoint from your backend using a [supported authentication method](https://developer.sumup.com/api/authentication). You must have access to the merchant account. Before returning the token, check that the user signed in to your application is allowed to accept payments for that account.\n\nPass the returned `access_token` to the SDK. The token expires 15 minutes after creation; use `expires_in` for its remaining lifetime. To continue after it expires, create a new token through this endpoint.", + "operationId": "CreateMerchantToken", + "tags": [ + "Tokens" + ], + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [] + } + ], + "x-scopes": [], + "x-codegen": { + "method_name": "create" + }, + "x-permissions": [ + { + "relation": "tokens.create", + "object_type": "merchant", + "object_id_param": "merchant_code" + } + ], + "parameters": [ + { + "in": "path", + "name": "merchant_code", + "description": "Unique code of the merchant account that will receive the payments.", + "required": true, + "schema": { + "type": "string", + "example": "MC0X0ABC" + } + } + ], + "requestBody": { + "description": "Actions the merchant token should allow.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "actions" + ], + "properties": { + "actions": { + "type": "array", + "description": "Actions the token allows for this merchant account.", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "checkout" + ] + }, + "example": [ + "checkout" + ] + } + } + }, + "example": { + "actions": [ + "checkout" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Merchant token created. Pass its access_token to the SDK.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Token" + }, + "example": { + "access_token": "MERCHANT_TOKEN", + "token_type": "Bearer", + "expires_in": 899 + } + } + } + }, + "400": { + "description": "The request body is invalid or contains unsupported or duplicate actions.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/bad-request", + "title": "Bad Request", + "status": 400, + "detail": "The request contains an unsupported action." + } + } + } + }, + "401": { + "description": "Authentication is missing, invalid, or expired.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401 + } + }, + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/unauthorized", + "title": "Unauthorized", + "status": 401, + "detail": "Token is invalid or expired." + } + } + } + }, + "403": { + "description": "The authenticated identity does not have permission to create tokens for this merchant account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Problem" + }, + "example": { + "type": "https://developer.sumup.com/problem/forbidden", + "title": "Forbidden", + "status": 403 + } + } + } + } + } + } } }, "components": { @@ -6768,6 +7214,33 @@ } } }, + "CustomerValidationError": { + "title": "Customer Validation Error", + "description": "Details of a customer validation error.", + "type": "object", + "required": [ + "instance", + "error_code", + "error_message" + ], + "properties": { + "instance": { + "type": "string", + "description": "Unique identifier of this error occurrence.", + "example": "32a44c6c-85d3-49e8-86bf-a5bba98c4621" + }, + "error_code": { + "type": "string", + "description": "Platform code for the error.", + "example": "INVALID" + }, + "error_message": { + "type": "string", + "description": "Short description of the error.", + "example": "customer_id" + } + } + }, "Error": { "title": "Error", "type": "object", @@ -9783,6 +10256,32 @@ "minLength": 8, "maxLength": 9 }, + "UpdateReaderSettingsError": { + "description": "Details of a failed reader settings request.", + "properties": { + "errors": { + "properties": { + "detail": { + "description": "Error message", + "type": "string" + }, + "type": { + "description": "Error code", + "type": "string" + } + }, + "required": [ + "detail" + ], + "type": "object" + } + }, + "required": [ + "errors" + ], + "title": "UpdateReaderSettingsError", + "type": "object" + }, "CreateReaderCheckoutUnprocessableEntity": { "description": "Unprocessable entity", "example": { @@ -9800,7 +10299,7 @@ "must be a valid URL" ], "tip_rates": [ - "must be between 0.01 and 0.99" + "has an invalid entry" ], "total_amount": [ "must be greater than 0" @@ -9818,6 +10317,15 @@ } } }, + "PaymentMethodNotAllowed": { + "description": "Error returned when the requested payment method is not supported for the merchant (e.g. pix for non-BR merchants).", + "value": { + "errors": { + "detail": "Payment method not allowed for this merchant.", + "type": "PAYMENT_METHOD_NOT_ALLOWED" + } + } + }, "ReaderBusy": { "description": "Error returned when a checkout was requested in the last 60 seconds.", "value": { @@ -9883,6 +10391,7 @@ "client_transaction_id": "00e33a36-c99b-4cb2-b635-b90c1455c9c8", "created_at": "2026-07-07T20:41:16.315434Z", "installments": 1, + "payment_failure_reason": null, "payment_status": "pending", "payment_type": "card", "reader_firmware_version": "3.3.3.21", @@ -9901,10 +10410,11 @@ "data": { "properties": { "card_type": { - "description": "Type of the card. Required for some countries", + "description": "Type of the card, or null when no card type was specified.", "enum": [ "credit", - "debit" + "debit", + null ], "type": [ "string", @@ -9933,14 +10443,14 @@ ] }, "payment_failure_reason": { - "description": "Payment failure reason", + "description": "Reason for the payment failure, or null when no failure reason is available.", "type": [ "string", "null" ] }, "payment_status": { - "description": "Payment status from payments v2 event", + "description": "Status of the payment, or null when no payment status is available.", "type": [ "string", "null" @@ -10029,6 +10539,7 @@ "reader_firmware_version", "installments", "payment_status", + "payment_failure_reason", "valid_until", "created_at", "updated_at", @@ -10044,6 +10555,70 @@ "title": "GetReaderCheckoutResponse", "type": "object" }, + "GetReaderSettingsResponse": { + "description": "Menu lock settings reported by the reader, or the last saved settings when offline.\n", + "example": { + "data": { + "menu_lock": { + "enabled": true, + "passcode": "1234" + } + } + }, + "properties": { + "data": { + "properties": { + "menu_lock": { + "description": "Menu lock configuration. Fields may be absent if no value is available.", + "properties": { + "enabled": { + "description": "Whether menu lock is enabled.", + "example": true, + "type": "boolean" + }, + "passcode": { + "description": "Four-digit PIN used to unlock the reader's menu.", + "example": "1234", + "format": "password", + "pattern": "^[0-9]{4}$", + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "menu_lock" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "title": "GetReaderSettingsResponse", + "type": "object" + }, + "UpdateReaderSettingsUnprocessableEntity": { + "description": "The reader cannot complete the settings request, or the settings are invalid.", + "example": { + "errors": { + "detail": "Reader settings are only supported for Solo readers.", + "type": "UNSUPPORTED_DEVICE_MODEL" + } + }, + "properties": { + "errors": { + "additionalProperties": true, + "type": "object" + } + }, + "required": [ + "errors" + ], + "title": "UpdateReaderSettingsUnprocessableEntity", + "type": "object" + }, "StatusResponse": { "description": "Status of a device", "example": { @@ -10202,6 +10777,8 @@ "type": { "description": "Key indicating type of error", "enum": [ + "INVALID_AFFILIATE_KEY", + "APP_OUTDATED", "INVALID_BEARER_TOKEN", "INVALID_USER_AGENT", "NOT_ENOUGH_UNPAID_PAYOUTS", @@ -10238,7 +10815,7 @@ "type": "string" }, "client_transaction_id": { - "description": "The client transaction ID is a unique identifier for the transaction that is generated for the client.\n\nIt can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).\n", + "description": "Unique identifier for the transaction associated with this checkout.\nUse this value to match the checkout with payment events and transaction records.\n", "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "string" } @@ -10255,6 +10832,95 @@ "title": "CreateReaderCheckoutResponse", "type": "object" }, + "UpdateReaderSettingsRequest": { + "description": "Menu lock settings to update for a Solo reader.", + "example": { + "menu_lock": { + "enabled": true, + "passcode": "1234" + } + }, + "properties": { + "menu_lock": { + "description": "Menu lock configuration. Provide at least one of `enabled` or `passcode`.", + "minProperties": 1, + "properties": { + "enabled": { + "description": "Whether menu lock is enabled.", + "example": true, + "type": "boolean" + }, + "passcode": { + "description": "Four-digit PIN used to unlock the reader's menu.", + "example": "1234", + "format": "password", + "pattern": "^[0-9]{4}$", + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "menu_lock" + ], + "title": "UpdateReaderSettingsRequest", + "type": "object" + }, + "UpdateReaderSettingsResponse": { + "description": "Menu lock settings applied to the reader.", + "example": { + "data": { + "menu_lock": { + "enabled": true, + "passcode": "1234" + }, + "status": "applied" + } + }, + "properties": { + "data": { + "properties": { + "menu_lock": { + "description": "Settings included in the update. Omitted fields are not returned.", + "properties": { + "enabled": { + "description": "Whether menu lock is enabled.", + "example": true, + "type": "boolean" + }, + "passcode": { + "description": "Four-digit PIN used to unlock the reader's menu.", + "example": "1234", + "format": "password", + "pattern": "^[0-9]{4}$", + "type": "string" + } + }, + "type": "object" + }, + "status": { + "description": "Indicates that the reader applied the settings update.", + "enum": [ + "applied" + ], + "example": "applied", + "type": "string" + } + }, + "required": [ + "status", + "menu_lock" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "title": "UpdateReaderSettingsResponse", + "type": "object" + }, "Unauthorized": { "description": "401 Unauthorized", "example": { @@ -10291,7 +10957,7 @@ "type": "object" }, "CreateReaderCheckoutRequest": { - "description": "Reader Checkout", + "description": "Payment details for a Reader Checkout.\n", "example": { "aade": { "provider_id": "123", @@ -10302,7 +10968,10 @@ "app_id": "com.example.app", "foreign_transaction_id": "123456", "key": "ef7b684a-d6f4-4e93-9b1b-6acdd6564a8e", - "tags": {} + "tags": { + "custom_key_1": "custom_value_1", + "custom_key_2": "custom_value_2" + } }, "card_type": "debit", "description": "This is a description...", @@ -10348,26 +11017,26 @@ "type": "object" }, "affiliate": { - "description": "Affiliate metadata for the transaction.\nIt is a field that allow for integrators to track the source of the transaction.\n", + "description": "Optional affiliate metadata associated with the checkout's payment.\nProvide both `app_id` and `key` when including this object.\n", "properties": { "app_id": { - "description": "Application ID of the affiliate.\nIt is a unique identifier for the application and should be set by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.\n", + "description": "Integrator application identifier from the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.\nRequired when the affiliate object is provided.\n", "example": "com.example.app", "type": "string" }, "foreign_transaction_id": { - "description": "Foreign transaction ID of the affiliate.\nIt is a unique identifier for the transaction.\nIt can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).\n", + "description": "Integrator-owned transaction reference. Optional.\nCan be used to retrieve the transaction via the [Transactions API](https://developer.sumup.com/api/transactions/get).\n", "example": "19e12390-72cf-4f9f-80b5-b0c8a67fa43f", "type": "string" }, "key": { - "description": "Key of the affiliate.\nIt is a unique identifier for the key and should be generated by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.\n", + "description": "Affiliate key generated in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.\nRequired when the affiliate object is provided.\n", "example": "123e4567-e89b-12d3-a456-426614174000", "type": "string" }, "tags": { "additionalProperties": true, - "description": "Additional metadata for the transaction.\nIt is key-value object that can be associated with the transaction.\n", + "description": "Optional key-value metadata associated with the transaction.\n", "example": { "custom_key_1": "custom_value_1", "custom_key_2": "custom_value_2" @@ -10377,8 +11046,7 @@ }, "required": [ "app_id", - "key", - "foreign_transaction_id" + "key" ], "title": "Affiliate", "type": [ @@ -10387,7 +11055,7 @@ ] }, "card_type": { - "description": "The card type of the card used for the transaction.\nIs is required only for some countries (e.g: Brazil).\n", + "description": "The card type of the card used for the transaction.\nIt is required only for some countries (e.g: Brazil).\n", "enum": [ "credit", "debit" @@ -10400,7 +11068,7 @@ "type": "string" }, "installments": { - "description": "Number of installments for the transaction.\nIt may vary according to the merchant country.\nFor example, in Brazil, the maximum number of installments is 12.\n\nOmit if the merchant country does support installments.\nOtherwise, the checkout will be rejected.\n", + "description": "Number of installments for the transaction.\nIt may vary according to the merchant country.\nFor example, in Brazil, the maximum number of installments is 12.\n\nOmit if the merchant country does not support installments.\nOtherwise, the checkout will be rejected.\n", "example": 1, "minimum": 1, "type": [ @@ -10408,6 +11076,16 @@ "null" ] }, + "payment_type": { + "default": "card", + "description": "The payment method type for the transaction. Defaults to `card`.\n\nUse `pix` to initiate a Pix QR-code payment flow on the device.\nPix is only supported for Brazilian merchants; other merchants will receive a 422 error.\n", + "enum": [ + "card", + "pix" + ], + "example": "card", + "type": "string" + }, "return_url": { "description": "Webhook URL to which the payment result will be sent.\nIt must be a HTTPS url.\n", "example": "https://www.example.com", @@ -10415,13 +11093,18 @@ "type": "string" }, "tip_rates": { - "description": "List of tipping rates to be displayed to the cardholder.\nThe rates are in percentage and should be between 0.01 and 0.99.\nThe list should be sorted in ascending order.\n", + "description": "Exactly three distinct tipping rates to be displayed to the cardholder.\nEach rate is a fraction between 0.01 and 1.00 in increments of 0.01.\nThe rates are sorted in ascending order by the server.\n", "items": { "format": "float", + "maximum": 1, + "minimum": 0.01, "multipleOf": 0.01, "type": "number" }, - "type": "array" + "maxItems": 3, + "minItems": 3, + "type": "array", + "uniqueItems": true }, "tip_timeout": { "default": 30, @@ -10566,6 +11249,36 @@ ], "title": "NotFound", "type": "object" + }, + "Token": { + "type": "object", + "description": "A short-lived credential for the requested merchant account and actions. Pass access_token to a SumUp SDK that supports merchant tokens.", + "required": [ + "access_token", + "token_type", + "expires_in" + ], + "properties": { + "access_token": { + "type": "string", + "description": "Secret token to pass to the SDK. Treat this value as an opaque string; do not parse it or depend on its format.", + "example": "MERCHANT_TOKEN" + }, + "token_type": { + "type": "string", + "description": "Authentication scheme used by the token. Always Bearer.", + "enum": [ + "Bearer" + ], + "example": "Bearer" + }, + "expires_in": { + "type": "integer", + "description": "Remaining lifetime of the token in seconds when the response is created. Tokens expire 15 minutes after creation. Request a new token when needed.", + "minimum": 0, + "example": 899 + } + } } }, "requestBodies": { From 2424302db165c61107908b0ed5f6acaf2ed41426 Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:57:08 +0000 Subject: [PATCH 2/2] chore: generate code --- .../java/com/sumup/sdk/SumUpAsyncClient.java | 12 ++ src/main/java/com/sumup/sdk/SumUpClient.java | 12 ++ .../sumup/sdk/clients/ReadersAsyncClient.java | 142 +++++++++++++++++- .../com/sumup/sdk/clients/ReadersClient.java | 138 ++++++++++++++++- .../sumup/sdk/clients/TokensAsyncClient.java | 108 +++++++++++++ .../com/sumup/sdk/clients/TokensClient.java | 107 +++++++++++++ .../java/com/sumup/sdk/models/Affiliate2.java | 47 +++--- .../sdk/models/BadRequestErrorsType.java | 3 + .../models/CreateMerchantTokenRequest.java | 45 ++++++ ...CreateMerchantTokenRequestActionsItem.java | 54 +++++++ .../models/CreateReaderCheckoutRequest.java | 52 +++++-- .../CreateReaderCheckoutRequestCardType.java | 2 +- ...reateReaderCheckoutRequestPaymentType.java | 61 ++++++++ .../CreateReaderCheckoutResponseData.java | 12 +- .../sdk/models/CustomerValidationError.java | 78 ++++++++++ .../models/GetReaderCheckoutResponseData.java | 13 +- ...GetReaderCheckoutResponseDataCardType.java | 4 +- .../sdk/models/GetReaderSettingsResponse.java | 43 ++++++ .../models/GetReaderSettingsResponseData.java | 44 ++++++ ...GetReaderSettingsResponseDataMenuLock.java | 58 +++++++ src/main/java/com/sumup/sdk/models/Token.java | 89 +++++++++++ .../com/sumup/sdk/models/TokenTokenType.java | 52 +++++++ .../sdk/models/UpdateReaderSettingsError.java | 44 ++++++ .../UpdateReaderSettingsErrorErrors.java | 59 ++++++++ .../models/UpdateReaderSettingsRequest.java | 45 ++++++ .../UpdateReaderSettingsRequestMenuLock.java | 58 +++++++ .../models/UpdateReaderSettingsResponse.java | 44 ++++++ .../UpdateReaderSettingsResponseData.java | 61 ++++++++ ...ateReaderSettingsResponseDataMenuLock.java | 58 +++++++ ...pdateReaderSettingsResponseDataStatus.java | 55 +++++++ ...dateReaderSettingsUnprocessableEntity.java | 43 ++++++ 31 files changed, 1584 insertions(+), 59 deletions(-) create mode 100644 src/main/java/com/sumup/sdk/clients/TokensAsyncClient.java create mode 100644 src/main/java/com/sumup/sdk/clients/TokensClient.java create mode 100644 src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequest.java create mode 100644 src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequestActionsItem.java create mode 100644 src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestPaymentType.java create mode 100644 src/main/java/com/sumup/sdk/models/CustomerValidationError.java create mode 100644 src/main/java/com/sumup/sdk/models/GetReaderSettingsResponse.java create mode 100644 src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseData.java create mode 100644 src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseDataMenuLock.java create mode 100644 src/main/java/com/sumup/sdk/models/Token.java create mode 100644 src/main/java/com/sumup/sdk/models/TokenTokenType.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsError.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsErrorErrors.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequest.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequestMenuLock.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponse.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseData.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataMenuLock.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataStatus.java create mode 100644 src/main/java/com/sumup/sdk/models/UpdateReaderSettingsUnprocessableEntity.java diff --git a/src/main/java/com/sumup/sdk/SumUpAsyncClient.java b/src/main/java/com/sumup/sdk/SumUpAsyncClient.java index d4e2dff..c657a5d 100644 --- a/src/main/java/com/sumup/sdk/SumUpAsyncClient.java +++ b/src/main/java/com/sumup/sdk/SumUpAsyncClient.java @@ -10,6 +10,7 @@ import com.sumup.sdk.clients.ReadersAsyncClient; import com.sumup.sdk.clients.ReceiptsAsyncClient; import com.sumup.sdk.clients.RolesAsyncClient; +import com.sumup.sdk.clients.TokensAsyncClient; import com.sumup.sdk.clients.TransactionsAsyncClient; import com.sumup.sdk.core.ApiClient; import java.net.http.HttpClient; @@ -31,6 +32,7 @@ public final class SumUpAsyncClient { private final ReadersAsyncClient readers; private final ReceiptsAsyncClient receipts; private final RolesAsyncClient roles; + private final TokensAsyncClient tokens; private final TransactionsAsyncClient transactions; /** Creates a SumUpAsyncClient using the API key from the SUMUP_API_KEY environment variable. */ @@ -71,6 +73,7 @@ private SumUpAsyncClient(ApiClient apiClient) { this.readers = new ReadersAsyncClient(this.apiClient); this.receipts = new ReceiptsAsyncClient(this.apiClient); this.roles = new RolesAsyncClient(this.apiClient); + this.tokens = new TokensAsyncClient(this.apiClient); this.transactions = new TransactionsAsyncClient(this.apiClient); } @@ -214,6 +217,15 @@ public RolesAsyncClient roles() { return roles; } + /** + * Returns the TokensAsyncClient client for the "Tokens" API group. + * + * @return Client for the associated API group. + */ + public TokensAsyncClient tokens() { + return tokens; + } + /** * Returns the TransactionsAsyncClient client for the "Transactions" API group. * diff --git a/src/main/java/com/sumup/sdk/SumUpClient.java b/src/main/java/com/sumup/sdk/SumUpClient.java index c3fa2f4..b3d9e0a 100644 --- a/src/main/java/com/sumup/sdk/SumUpClient.java +++ b/src/main/java/com/sumup/sdk/SumUpClient.java @@ -10,6 +10,7 @@ import com.sumup.sdk.clients.ReadersClient; import com.sumup.sdk.clients.ReceiptsClient; import com.sumup.sdk.clients.RolesClient; +import com.sumup.sdk.clients.TokensClient; import com.sumup.sdk.clients.TransactionsClient; import com.sumup.sdk.core.ApiClient; import java.net.http.HttpClient; @@ -31,6 +32,7 @@ public final class SumUpClient { private final ReadersClient readers; private final ReceiptsClient receipts; private final RolesClient roles; + private final TokensClient tokens; private final TransactionsClient transactions; /** Creates a SumUpClient using the API key from the SUMUP_API_KEY environment variable. */ @@ -71,6 +73,7 @@ private SumUpClient(ApiClient apiClient) { this.readers = new ReadersClient(this.apiClient); this.receipts = new ReceiptsClient(this.apiClient); this.roles = new RolesClient(this.apiClient); + this.tokens = new TokensClient(this.apiClient); this.transactions = new TransactionsClient(this.apiClient); } @@ -214,6 +217,15 @@ public RolesClient roles() { return roles; } + /** + * Returns the TokensClient client for the "Tokens" API group. + * + * @return Client for the associated API group. + */ + public TokensClient tokens() { + return tokens; + } + /** * Returns the TransactionsClient client for the "Transactions" API group. * diff --git a/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java b/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java index bdd1764..0b1e104 100644 --- a/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReadersAsyncClient.java @@ -92,7 +92,9 @@ public CompletableFuture create( * The target device must be online, otherwise checkout won't be accepted * After the checkout is * accepted, the system has 60 seconds to start the payment on the target device. During this * time, any other checkout for the same device will be rejected. **Note**: If the target device - * is a Solo, it must be in version 3.3.24.3 or higher. + * is a Solo, it must be in version 3.3.24.3 or higher. Optionally include an `affiliate` object + * to attach integrator metadata to the payment. Provide both `app_id` and `key` when including + * this object. * *

Operation ID: CreateReaderCheckout * @@ -121,7 +123,9 @@ public CompletableFuture crea * The target device must be online, otherwise checkout won't be accepted * After the checkout is * accepted, the system has 60 seconds to start the payment on the target device. During this * time, any other checkout for the same device will be rejected. **Note**: If the target device - * is a Solo, it must be in version 3.3.24.3 or higher. + * is a Solo, it must be in version 3.3.24.3 or higher. Optionally include an `affiliate` object + * to attach integrator metadata to the payment. Provide both `app_id` and `key` when including + * this object. * *

Operation ID: CreateReaderCheckout * @@ -414,6 +418,67 @@ public CompletableFuture getChec requestOptions); } + /** + * Get Reader Settings + * + *

Returns the menu lock settings for a Solo reader. For an online reader, returns the current + * settings. For an offline reader, returns the last saved settings, which may differ from its + * current configuration. Returns `404` if the reader is offline and no saved settings are + * available. The response may include the menu lock PIN. + * + *

Operation ID: GetReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return CompletableFuture resolved with com.sumup.sdk.models.GetReaderSettingsResponse parsed + * response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture getReaderSettings( + String merchantCode, String readerId) throws ApiException { + return getReaderSettings(merchantCode, readerId, null); + } + + /** + * Get Reader Settings + * + *

Returns the menu lock settings for a Solo reader. For an online reader, returns the current + * settings. For an offline reader, returns the last saved settings, which may differ from its + * current configuration. Returns `404` if the reader is offline and no saved settings are + * available. The response may include the menu lock PIN. + * + *

Operation ID: GetReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.GetReaderSettingsResponse parsed + * response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture getReaderSettings( + String merchantCode, String readerId, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + return this.apiClient.sendAsync( + HttpMethod.GET, + path, + null, + null, + null, + new TypeReference() {}, + requestOptions); + } + /** * Get a Reader Status * @@ -667,6 +732,79 @@ public CompletableFuture update( requestOptions); } + /** + * Update Reader Settings + * + *

Updates the menu lock settings for a Solo reader. The reader must be online. A successful + * response confirms that the reader applied the update. Include at least one of + * `menu_lock.enabled` or `menu_lock.passcode`. Omitted settings keep their current values. The + * response contains only the settings included in the request. When enabling menu lock for a + * reader without a PIN, include a four-digit PIN in `menu_lock.passcode` in the same request. + * + *

Operation ID: UpdateReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param request Menu lock settings to update. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return CompletableFuture resolved with com.sumup.sdk.models.UpdateReaderSettingsResponse + * parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture updateReaderSettings( + String merchantCode, + String readerId, + com.sumup.sdk.models.UpdateReaderSettingsRequest request) + throws ApiException { + return updateReaderSettings(merchantCode, readerId, request, null); + } + + /** + * Update Reader Settings + * + *

Updates the menu lock settings for a Solo reader. The reader must be online. A successful + * response confirms that the reader applied the update. Include at least one of + * `menu_lock.enabled` or `menu_lock.passcode`. Omitted settings keep their current values. The + * response contains only the settings included in the request. When enabling menu lock for a + * reader without a PIN, include a four-digit PIN in `menu_lock.passcode` in the same request. + * + *

Operation ID: UpdateReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param request Menu lock settings to update. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.UpdateReaderSettingsResponse + * parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture updateReaderSettings( + String merchantCode, + String readerId, + com.sumup.sdk.models.UpdateReaderSettingsRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + return this.apiClient.sendAsync( + HttpMethod.PATCH, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** Optional header overrides for this request. */ public static final class GetReaderHeaders { private final Map values = new LinkedHashMap<>(); diff --git a/src/main/java/com/sumup/sdk/clients/ReadersClient.java b/src/main/java/com/sumup/sdk/clients/ReadersClient.java index 983f09b..94c648c 100644 --- a/src/main/java/com/sumup/sdk/clients/ReadersClient.java +++ b/src/main/java/com/sumup/sdk/clients/ReadersClient.java @@ -91,7 +91,9 @@ public com.sumup.sdk.models.Reader create( * The target device must be online, otherwise checkout won't be accepted * After the checkout is * accepted, the system has 60 seconds to start the payment on the target device. During this * time, any other checkout for the same device will be rejected. **Note**: If the target device - * is a Solo, it must be in version 3.3.24.3 or higher. + * is a Solo, it must be in version 3.3.24.3 or higher. Optionally include an `affiliate` object + * to attach integrator metadata to the payment. Provide both `app_id` and `key` when including + * this object. * *

Operation ID: CreateReaderCheckout * @@ -119,7 +121,9 @@ public com.sumup.sdk.models.CreateReaderCheckoutResponse createCheckout( * The target device must be online, otherwise checkout won't be accepted * After the checkout is * accepted, the system has 60 seconds to start the payment on the target device. During this * time, any other checkout for the same device will be rejected. **Note**: If the target device - * is a Solo, it must be in version 3.3.24.3 or higher. + * is a Solo, it must be in version 3.3.24.3 or higher. Optionally include an `affiliate` object + * to attach integrator metadata to the payment. Provide both `app_id` and `key` when including + * this object. * *

Operation ID: CreateReaderCheckout * @@ -403,6 +407,65 @@ public com.sumup.sdk.models.GetReaderCheckoutResponse getCheckout( requestOptions); } + /** + * Get Reader Settings + * + *

Returns the menu lock settings for a Solo reader. For an online reader, returns the current + * settings. For an offline reader, returns the last saved settings, which may differ from its + * current configuration. Returns `404` if the reader is offline and no saved settings are + * available. The response may include the menu lock PIN. + * + *

Operation ID: GetReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.GetReaderSettingsResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.GetReaderSettingsResponse getReaderSettings( + String merchantCode, String readerId) throws ApiException { + return getReaderSettings(merchantCode, readerId, null); + } + + /** + * Get Reader Settings + * + *

Returns the menu lock settings for a Solo reader. For an online reader, returns the current + * settings. For an offline reader, returns the last saved settings, which may differ from its + * current configuration. Returns `404` if the reader is offline and no saved settings are + * available. The response may include the menu lock PIN. + * + *

Operation ID: GetReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.GetReaderSettingsResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.GetReaderSettingsResponse getReaderSettings( + String merchantCode, String readerId, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + return this.apiClient.send( + HttpMethod.GET, + path, + null, + null, + null, + new TypeReference() {}, + requestOptions); + } + /** * Get a Reader Status * @@ -650,6 +713,77 @@ public com.sumup.sdk.models.Reader update( requestOptions); } + /** + * Update Reader Settings + * + *

Updates the menu lock settings for a Solo reader. The reader must be online. A successful + * response confirms that the reader applied the update. Include at least one of + * `menu_lock.enabled` or `menu_lock.passcode`. Omitted settings keep their current values. The + * response contains only the settings included in the request. When enabling menu lock for a + * reader without a PIN, include a four-digit PIN in `menu_lock.passcode` in the same request. + * + *

Operation ID: UpdateReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param request Menu lock settings to update. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.UpdateReaderSettingsResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.UpdateReaderSettingsResponse updateReaderSettings( + String merchantCode, + String readerId, + com.sumup.sdk.models.UpdateReaderSettingsRequest request) + throws ApiException { + return updateReaderSettings(merchantCode, readerId, request, null); + } + + /** + * Update Reader Settings + * + *

Updates the menu lock settings for a Solo reader. The reader must be online. A successful + * response confirms that the reader applied the update. Include at least one of + * `menu_lock.enabled` or `menu_lock.passcode`. Omitted settings keep their current values. The + * response contains only the settings included in the request. When enabling menu lock for a + * reader without a PIN, include a four-digit PIN in `menu_lock.passcode` in the same request. + * + *

Operation ID: UpdateReaderSettings + * + * @param merchantCode The merchant code of the account that owns the reader. + * @param readerId The unique identifier of the reader. + * @param request Menu lock settings to update. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.UpdateReaderSettingsResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.UpdateReaderSettingsResponse updateReaderSettings( + String merchantCode, + String readerId, + com.sumup.sdk.models.UpdateReaderSettingsRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(readerId, "readerId"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId))); + + return this.apiClient.send( + HttpMethod.PATCH, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + /** Optional header overrides for this request. */ public static final class GetReaderHeaders { private final Map values = new LinkedHashMap<>(); diff --git a/src/main/java/com/sumup/sdk/clients/TokensAsyncClient.java b/src/main/java/com/sumup/sdk/clients/TokensAsyncClient.java new file mode 100644 index 0000000..0754c6b --- /dev/null +++ b/src/main/java/com/sumup/sdk/clients/TokensAsyncClient.java @@ -0,0 +1,108 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.clients; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sumup.sdk.core.ApiClient; +import com.sumup.sdk.core.ApiException; +import com.sumup.sdk.core.HttpMethod; +import com.sumup.sdk.core.RequestOptions; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; + +/** + * Client for the "Tokens" API group. + * + *

Merchant tokens let your application accept card-present payments with SumUp SDKs that support + * token-based authentication. Use them when you want users to sign in to your application with your + * own authentication, then accept payments for a SumUp merchant account. Create tokens on your + * backend using one of the [supported authentication + * methods](https://developer.sumup.com/api/authentication). Keep your authentication credentials on + * your backend. Return only the short-lived merchant token to your application and pass its + * `access_token` to the SDK. Before returning a token, authenticate the user in your application + * and check that they can accept payments for the requested merchant account. A merchant token is + * limited to that account and the requested actions, and does not grant permissions beyond those of + * the identity that created it. Tokens expire 15 minutes after creation. Use `expires_in` to + * determine the remaining lifetime and create a new token when needed. This endpoint does not + * return a refresh token. Treat merchant tokens as secrets: send them over HTTPS and keep them out + * of URLs, logs, and source code. + */ +public final class TokensAsyncClient { + private final ApiClient apiClient; + + /** + * Creates a new TokensAsyncClient instance backed by the provided ApiClient. + * + * @param apiClient Configured API client used to send HTTP requests. + */ + public TokensAsyncClient(ApiClient apiClient) { + this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); + } + + /** + * Create a merchant token + * + *

Creates a short-lived token for the merchant account identified by `merchant_code` and the + * requested actions. Call this endpoint from your backend using a [supported authentication + * method](https://developer.sumup.com/api/authentication). You must have access to the merchant + * account. Before returning the token, check that the user signed in to your application is + * allowed to accept payments for that account. Pass the returned `access_token` to the SDK. The + * token expires 15 minutes after creation; use `expires_in` for its remaining lifetime. To + * continue after it expires, create a new token through this endpoint. + * + *

Operation ID: CreateMerchantToken + * + * @param merchantCode Unique code of the merchant account that will receive the payments. + * @param request Actions the merchant token should allow. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return CompletableFuture resolved with com.sumup.sdk.models.Token parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture create( + String merchantCode, com.sumup.sdk.models.CreateMerchantTokenRequest request) + throws ApiException { + return create(merchantCode, request, null); + } + + /** + * Create a merchant token + * + *

Creates a short-lived token for the merchant account identified by `merchant_code` and the + * requested actions. Call this endpoint from your backend using a [supported authentication + * method](https://developer.sumup.com/api/authentication). You must have access to the merchant + * account. Before returning the token, check that the user signed in to your application is + * allowed to accept payments for that account. Pass the returned `access_token` to the SDK. The + * token expires 15 minutes after creation; use `expires_in` for its remaining lifetime. To + * continue after it expires, create a new token through this endpoint. + * + *

Operation ID: CreateMerchantToken + * + * @param merchantCode Unique code of the merchant account that will receive the payments. + * @param request Actions the merchant token should allow. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.Token parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture create( + String merchantCode, + com.sumup.sdk.models.CreateMerchantTokenRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/merchants/{merchant_code}/tokens"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + + return this.apiClient.sendAsync( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } +} diff --git a/src/main/java/com/sumup/sdk/clients/TokensClient.java b/src/main/java/com/sumup/sdk/clients/TokensClient.java new file mode 100644 index 0000000..ad03a24 --- /dev/null +++ b/src/main/java/com/sumup/sdk/clients/TokensClient.java @@ -0,0 +1,107 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.clients; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sumup.sdk.core.ApiClient; +import com.sumup.sdk.core.ApiException; +import com.sumup.sdk.core.HttpMethod; +import com.sumup.sdk.core.RequestOptions; +import java.util.Objects; + +/** + * Client for the "Tokens" API group. + * + *

Merchant tokens let your application accept card-present payments with SumUp SDKs that support + * token-based authentication. Use them when you want users to sign in to your application with your + * own authentication, then accept payments for a SumUp merchant account. Create tokens on your + * backend using one of the [supported authentication + * methods](https://developer.sumup.com/api/authentication). Keep your authentication credentials on + * your backend. Return only the short-lived merchant token to your application and pass its + * `access_token` to the SDK. Before returning a token, authenticate the user in your application + * and check that they can accept payments for the requested merchant account. A merchant token is + * limited to that account and the requested actions, and does not grant permissions beyond those of + * the identity that created it. Tokens expire 15 minutes after creation. Use `expires_in` to + * determine the remaining lifetime and create a new token when needed. This endpoint does not + * return a refresh token. Treat merchant tokens as secrets: send them over HTTPS and keep them out + * of URLs, logs, and source code. + */ +public final class TokensClient { + private final ApiClient apiClient; + + /** + * Creates a new TokensClient instance backed by the provided ApiClient. + * + * @param apiClient Configured API client used to send HTTP requests. + */ + public TokensClient(ApiClient apiClient) { + this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); + } + + /** + * Create a merchant token + * + *

Creates a short-lived token for the merchant account identified by `merchant_code` and the + * requested actions. Call this endpoint from your backend using a [supported authentication + * method](https://developer.sumup.com/api/authentication). You must have access to the merchant + * account. Before returning the token, check that the user signed in to your application is + * allowed to accept payments for that account. Pass the returned `access_token` to the SDK. The + * token expires 15 minutes after creation; use `expires_in` for its remaining lifetime. To + * continue after it expires, create a new token through this endpoint. + * + *

Operation ID: CreateMerchantToken + * + * @param merchantCode Unique code of the merchant account that will receive the payments. + * @param request Actions the merchant token should allow. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.Token parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.Token create( + String merchantCode, com.sumup.sdk.models.CreateMerchantTokenRequest request) + throws ApiException { + return create(merchantCode, request, null); + } + + /** + * Create a merchant token + * + *

Creates a short-lived token for the merchant account identified by `merchant_code` and the + * requested actions. Call this endpoint from your backend using a [supported authentication + * method](https://developer.sumup.com/api/authentication). You must have access to the merchant + * account. Before returning the token, check that the user signed in to your application is + * allowed to accept payments for that account. Pass the returned `access_token` to the SDK. The + * token expires 15 minutes after creation; use `expires_in` for its remaining lifetime. To + * continue after it expires, create a new token through this endpoint. + * + *

Operation ID: CreateMerchantToken + * + * @param merchantCode Unique code of the merchant account that will receive the payments. + * @param request Actions the merchant token should allow. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.Token parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.Token create( + String merchantCode, + com.sumup.sdk.models.CreateMerchantTokenRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(request, "request"); + String path = "/v0.1/merchants/{merchant_code}/tokens"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + + return this.apiClient.send( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } +} diff --git a/src/main/java/com/sumup/sdk/models/Affiliate2.java b/src/main/java/com/sumup/sdk/models/Affiliate2.java index d8b1e9e..d4df5b2 100644 --- a/src/main/java/com/sumup/sdk/models/Affiliate2.java +++ b/src/main/java/com/sumup/sdk/models/Affiliate2.java @@ -4,34 +4,30 @@ import java.util.Objects; /** - * Affiliate metadata for the transaction. It is a field that allow for integrators to track the - * source of the transaction. + * Optional affiliate metadata associated with the checkout's payment. Provide both `app_id` and + * `key` when including this object. */ public record Affiliate2( /** - * Application ID of the affiliate. It is a unique identifier for the application and should be - * set by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) - * page. + * Integrator application identifier from the [Affiliate + * Keys](https://developer.sumup.com/affiliate-keys) page. Required when the affiliate object is + * provided. */ String appId, /** - * Foreign transaction ID of the affiliate. It is a unique identifier for the transaction. It - * can be used later to fetch the transaction details via the [Transactions - * API](https://developer.sumup.com/api/transactions/get). + * Integrator-owned transaction reference. Optional. Can be used to retrieve the transaction via + * the [Transactions API](https://developer.sumup.com/api/transactions/get). */ String foreignTransactionId, /** - * Key of the affiliate. It is a unique identifier for the key and should be generated by the - * integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page. + * Affiliate key generated in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) + * page. Required when the affiliate object is provided. */ String key, - /** - * Additional metadata for the transaction. It is key-value object that can be associated with - * the transaction. - */ + /** Optional key-value metadata associated with the transaction. */ java.util.Map tags) { /** * Creates a builder for Affiliate2. @@ -54,9 +50,9 @@ private Builder() {} /** * Sets the value for {@code appId}. * - * @param appId Application ID of the affiliate. It is a unique identifier for the application - * and should be set by the integrator in the [Affiliate - * Keys](https://developer.sumup.com/affiliate-keys) page. + * @param appId Integrator application identifier from the [Affiliate + * Keys](https://developer.sumup.com/affiliate-keys) page. Required when the affiliate + * object is provided. * @return This builder instance. */ public Builder appId(String appId) { @@ -67,9 +63,9 @@ public Builder appId(String appId) { /** * Sets the value for {@code foreignTransactionId}. * - * @param foreignTransactionId Foreign transaction ID of the affiliate. It is a unique - * identifier for the transaction. It can be used later to fetch the transaction details via - * the [Transactions API](https://developer.sumup.com/api/transactions/get). + * @param foreignTransactionId Integrator-owned transaction reference. Optional. Can be used to + * retrieve the transaction via the [Transactions + * API](https://developer.sumup.com/api/transactions/get). * @return This builder instance. */ public Builder foreignTransactionId(String foreignTransactionId) { @@ -80,9 +76,9 @@ public Builder foreignTransactionId(String foreignTransactionId) { /** * Sets the value for {@code key}. * - * @param key Key of the affiliate. It is a unique identifier for the key and should be - * generated by the integrator in the [Affiliate - * Keys](https://developer.sumup.com/affiliate-keys) page. + * @param key Affiliate key generated in the [Affiliate + * Keys](https://developer.sumup.com/affiliate-keys) page. Required when the affiliate + * object is provided. * @return This builder instance. */ public Builder key(String key) { @@ -93,8 +89,7 @@ public Builder key(String key) { /** * Sets the value for {@code tags}. * - * @param tags Additional metadata for the transaction. It is key-value object that can be - * associated with the transaction. + * @param tags Optional key-value metadata associated with the transaction. * @return This builder instance. */ public Builder tags(java.util.Map tags) { @@ -110,7 +105,7 @@ public Builder tags(java.util.Map tags) { public Affiliate2 build() { return new Affiliate2( Objects.requireNonNull(appId, "appId"), - Objects.requireNonNull(foreignTransactionId, "foreignTransactionId"), + foreignTransactionId, Objects.requireNonNull(key, "key"), tags); } diff --git a/src/main/java/com/sumup/sdk/models/BadRequestErrorsType.java b/src/main/java/com/sumup/sdk/models/BadRequestErrorsType.java index a421bbc..6051d48 100644 --- a/src/main/java/com/sumup/sdk/models/BadRequestErrorsType.java +++ b/src/main/java/com/sumup/sdk/models/BadRequestErrorsType.java @@ -7,6 +7,9 @@ /** Key indicating type of error */ public final class BadRequestErrorsType { + public static final BadRequestErrorsType INVALID_AFFILIATE_KEY = + new BadRequestErrorsType("INVALID_AFFILIATE_KEY"); + public static final BadRequestErrorsType APP_OUTDATED = new BadRequestErrorsType("APP_OUTDATED"); public static final BadRequestErrorsType INVALID_BEARER_TOKEN = new BadRequestErrorsType("INVALID_BEARER_TOKEN"); public static final BadRequestErrorsType INVALID_USER_AGENT = diff --git a/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequest.java b/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequest.java new file mode 100644 index 0000000..18678db --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequest.java @@ -0,0 +1,45 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +public record CreateMerchantTokenRequest( + /** Actions the token allows for this merchant account. */ + java.util.List actions) { + /** + * Creates a builder for CreateMerchantTokenRequest. + * + * @return Builder that constructs immutable CreateMerchantTokenRequest instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreateMerchantTokenRequest instances. */ + public static final class Builder { + private java.util.List actions; + + private Builder() {} + + /** + * Sets the value for {@code actions}. + * + * @param actions Actions the token allows for this merchant account. + * @return This builder instance. + */ + public Builder actions( + java.util.List actions) { + this.actions = actions; + return this; + } + + /** + * Builds an immutable CreateMerchantTokenRequest instance. + * + * @return Immutable CreateMerchantTokenRequest. + */ + public CreateMerchantTokenRequest build() { + return new CreateMerchantTokenRequest(Objects.requireNonNull(actions, "actions")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequestActionsItem.java b/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequestActionsItem.java new file mode 100644 index 0000000..ab88a4d --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CreateMerchantTokenRequestActionsItem.java @@ -0,0 +1,54 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +public final class CreateMerchantTokenRequestActionsItem { + public static final CreateMerchantTokenRequestActionsItem CHECKOUT = + new CreateMerchantTokenRequestActionsItem("checkout"); + + private final String value; + + private CreateMerchantTokenRequestActionsItem(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a CreateMerchantTokenRequestActionsItem for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static CreateMerchantTokenRequestActionsItem of(String value) { + return new CreateMerchantTokenRequestActionsItem(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static CreateMerchantTokenRequestActionsItem fromValue(String value) { + return value == null ? null : new CreateMerchantTokenRequestActionsItem(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof CreateMerchantTokenRequestActionsItem that + && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequest.java b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequest.java index abfaac8..c54a996 100644 --- a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequest.java +++ b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequest.java @@ -3,7 +3,7 @@ import java.util.Objects; -/** Reader Checkout */ +/** Payment details for a Reader Checkout. */ public record CreateReaderCheckoutRequest( /** * Optional object containing data for transactions from ERP integrators in Greece that comply @@ -14,13 +14,13 @@ public record CreateReaderCheckoutRequest( com.sumup.sdk.models.CreateReaderCheckoutRequestAade aade, /** - * Affiliate metadata for the transaction. It is a field that allow for integrators to track the - * source of the transaction. + * Optional affiliate metadata associated with the checkout's payment. Provide both `app_id` and + * `key` when including this object. */ com.sumup.sdk.models.Affiliate2 affiliate, /** - * The card type of the card used for the transaction. Is is required only for some countries + * The card type of the card used for the transaction. It is required only for some countries * (e.g: Brazil). */ com.sumup.sdk.models.CreateReaderCheckoutRequestCardType cardType, @@ -31,16 +31,24 @@ public record CreateReaderCheckoutRequest( /** * Number of installments for the transaction. It may vary according to the merchant country. * For example, in Brazil, the maximum number of installments is 12. Omit if the merchant - * country does support installments. Otherwise, the checkout will be rejected. + * country does not support installments. Otherwise, the checkout will be rejected. */ Long installments, + /** + * The payment method type for the transaction. Defaults to `card`. Use `pix` to initiate a Pix + * QR-code payment flow on the device. Pix is only supported for Brazilian merchants; other + * merchants will receive a 422 error. + */ + com.sumup.sdk.models.CreateReaderCheckoutRequestPaymentType paymentType, + /** Webhook URL to which the payment result will be sent. It must be a HTTPS url. */ String returnUrl, /** - * List of tipping rates to be displayed to the cardholder. The rates are in percentage and - * should be between 0.01 and 0.99. The list should be sorted in ascending order. + * Exactly three distinct tipping rates to be displayed to the cardholder. Each rate is a + * fraction between 0.01 and 1.00 in increments of 0.01. The rates are sorted in ascending order + * by the server. */ java.util.List tipRates, @@ -72,6 +80,7 @@ public static final class Builder { private com.sumup.sdk.models.CreateReaderCheckoutRequestCardType cardType; private String description; private Long installments; + private com.sumup.sdk.models.CreateReaderCheckoutRequestPaymentType paymentType; private String returnUrl; private java.util.List tipRates; private Long tipTimeout; @@ -96,8 +105,8 @@ public Builder aade(com.sumup.sdk.models.CreateReaderCheckoutRequestAade aade) { /** * Sets the value for {@code affiliate}. * - * @param affiliate Affiliate metadata for the transaction. It is a field that allow for - * integrators to track the source of the transaction. + * @param affiliate Optional affiliate metadata associated with the checkout's payment. Provide + * both `app_id` and `key` when including this object. * @return This builder instance. */ public Builder affiliate(com.sumup.sdk.models.Affiliate2 affiliate) { @@ -108,7 +117,7 @@ public Builder affiliate(com.sumup.sdk.models.Affiliate2 affiliate) { /** * Sets the value for {@code cardType}. * - * @param cardType The card type of the card used for the transaction. Is is required only for + * @param cardType The card type of the card used for the transaction. It is required only for * some countries (e.g: Brazil). * @return This builder instance. */ @@ -133,7 +142,7 @@ public Builder description(String description) { * * @param installments Number of installments for the transaction. It may vary according to the * merchant country. For example, in Brazil, the maximum number of installments is 12. Omit - * if the merchant country does support installments. Otherwise, the checkout will be + * if the merchant country does not support installments. Otherwise, the checkout will be * rejected. * @return This builder instance. */ @@ -142,6 +151,20 @@ public Builder installments(Long installments) { return this; } + /** + * Sets the value for {@code paymentType}. + * + * @param paymentType The payment method type for the transaction. Defaults to `card`. Use `pix` + * to initiate a Pix QR-code payment flow on the device. Pix is only supported for Brazilian + * merchants; other merchants will receive a 422 error. + * @return This builder instance. + */ + public Builder paymentType( + com.sumup.sdk.models.CreateReaderCheckoutRequestPaymentType paymentType) { + this.paymentType = paymentType; + return this; + } + /** * Sets the value for {@code returnUrl}. * @@ -157,9 +180,9 @@ public Builder returnUrl(String returnUrl) { /** * Sets the value for {@code tipRates}. * - * @param tipRates List of tipping rates to be displayed to the cardholder. The rates are in - * percentage and should be between 0.01 and 0.99. The list should be sorted in ascending - * order. + * @param tipRates Exactly three distinct tipping rates to be displayed to the cardholder. Each + * rate is a fraction between 0.01 and 1.00 in increments of 0.01. The rates are sorted in + * ascending order by the server. * @return This builder instance. */ public Builder tipRates(java.util.List tipRates) { @@ -205,6 +228,7 @@ public CreateReaderCheckoutRequest build() { cardType, description, installments, + paymentType, returnUrl, tipRates, tipTimeout, diff --git a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestCardType.java b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestCardType.java index f0af7d9..d1013c7 100644 --- a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestCardType.java +++ b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestCardType.java @@ -6,7 +6,7 @@ import java.util.Objects; /** - * The card type of the card used for the transaction. Is is required only for some countries (e.g: + * The card type of the card used for the transaction. It is required only for some countries (e.g: * Brazil). */ public final class CreateReaderCheckoutRequestCardType { diff --git a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestPaymentType.java b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestPaymentType.java new file mode 100644 index 0000000..620d3a9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutRequestPaymentType.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** + * The payment method type for the transaction. Defaults to `card`. Use `pix` to initiate a Pix + * QR-code payment flow on the device. Pix is only supported for Brazilian merchants; other + * merchants will receive a 422 error. + */ +public final class CreateReaderCheckoutRequestPaymentType { + public static final CreateReaderCheckoutRequestPaymentType CARD = + new CreateReaderCheckoutRequestPaymentType("card"); + public static final CreateReaderCheckoutRequestPaymentType PIX = + new CreateReaderCheckoutRequestPaymentType("pix"); + + private final String value; + + private CreateReaderCheckoutRequestPaymentType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a CreateReaderCheckoutRequestPaymentType for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static CreateReaderCheckoutRequestPaymentType of(String value) { + return new CreateReaderCheckoutRequestPaymentType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static CreateReaderCheckoutRequestPaymentType fromValue(String value) { + return value == null ? null : new CreateReaderCheckoutRequestPaymentType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof CreateReaderCheckoutRequestPaymentType that + && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutResponseData.java b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutResponseData.java index 017b63a..d6971f4 100644 --- a/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutResponseData.java +++ b/src/main/java/com/sumup/sdk/models/CreateReaderCheckoutResponseData.java @@ -8,9 +8,8 @@ public record CreateReaderCheckoutResponseData( String checkoutId, /** - * The client transaction ID is a unique identifier for the transaction that is generated for - * the client. It can be used later to fetch the transaction details via the [Transactions - * API](https://developer.sumup.com/api/transactions/get). + * Unique identifier for the transaction associated with this checkout. Use this value to match + * the checkout with payment events and transaction records. */ String clientTransactionId) { /** @@ -43,10 +42,9 @@ public Builder checkoutId(String checkoutId) { /** * Sets the value for {@code clientTransactionId}. * - * @param clientTransactionId The client transaction ID is a unique identifier for the - * transaction that is generated for the client. It can be used later to fetch the - * transaction details via the [Transactions - * API](https://developer.sumup.com/api/transactions/get). + * @param clientTransactionId Unique identifier for the transaction associated with this + * checkout. Use this value to match the checkout with payment events and transaction + * records. * @return This builder instance. */ public Builder clientTransactionId(String clientTransactionId) { diff --git a/src/main/java/com/sumup/sdk/models/CustomerValidationError.java b/src/main/java/com/sumup/sdk/models/CustomerValidationError.java new file mode 100644 index 0000000..dd0c77a --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CustomerValidationError.java @@ -0,0 +1,78 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Details of a customer validation error. */ +public record CustomerValidationError( + /** Platform code for the error. */ + String errorCode, + + /** Short description of the error. */ + String errorMessage, + + /** Unique identifier of this error occurrence. */ + String instance) { + /** + * Creates a builder for CustomerValidationError. + * + * @return Builder that constructs immutable CustomerValidationError instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CustomerValidationError instances. */ + public static final class Builder { + private String errorCode; + private String errorMessage; + private String instance; + + private Builder() {} + + /** + * Sets the value for {@code errorCode}. + * + * @param errorCode Platform code for the error. + * @return This builder instance. + */ + public Builder errorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Sets the value for {@code errorMessage}. + * + * @param errorMessage Short description of the error. + * @return This builder instance. + */ + public Builder errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Sets the value for {@code instance}. + * + * @param instance Unique identifier of this error occurrence. + * @return This builder instance. + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + + /** + * Builds an immutable CustomerValidationError instance. + * + * @return Immutable CustomerValidationError. + */ + public CustomerValidationError build() { + return new CustomerValidationError( + Objects.requireNonNull(errorCode, "errorCode"), + Objects.requireNonNull(errorMessage, "errorMessage"), + Objects.requireNonNull(instance, "instance")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseData.java b/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseData.java index 9cd8ac9..980d0c0 100644 --- a/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseData.java +++ b/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseData.java @@ -4,7 +4,7 @@ import java.util.Objects; public record GetReaderCheckoutResponseData( - /** Type of the card. Required for some countries */ + /** Type of the card, or null when no card type was specified. */ com.sumup.sdk.models.GetReaderCheckoutResponseDataCardType cardType, /** Unique identifier for the checkout */ @@ -19,10 +19,10 @@ public record GetReaderCheckoutResponseData( /** Number of installments for the transaction. Required for some countries. */ Long installments, - /** Payment failure reason */ + /** Reason for the payment failure, or null when no failure reason is available. */ String paymentFailureReason, - /** Payment status from payments v2 event */ + /** Status of the payment, or null when no payment status is available. */ String paymentStatus, /** Type of the payment. Required for some countries */ @@ -81,7 +81,7 @@ private Builder() {} /** * Sets the value for {@code cardType}. * - * @param cardType Type of the card. Required for some countries + * @param cardType Type of the card, or null when no card type was specified. * @return This builder instance. */ public Builder cardType(com.sumup.sdk.models.GetReaderCheckoutResponseDataCardType cardType) { @@ -136,7 +136,8 @@ public Builder installments(Long installments) { /** * Sets the value for {@code paymentFailureReason}. * - * @param paymentFailureReason Payment failure reason + * @param paymentFailureReason Reason for the payment failure, or null when no failure reason is + * available. * @return This builder instance. */ public Builder paymentFailureReason(String paymentFailureReason) { @@ -147,7 +148,7 @@ public Builder paymentFailureReason(String paymentFailureReason) { /** * Sets the value for {@code paymentStatus}. * - * @param paymentStatus Payment status from payments v2 event + * @param paymentStatus Status of the payment, or null when no payment status is available. * @return This builder instance. */ public Builder paymentStatus(String paymentStatus) { diff --git a/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseDataCardType.java b/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseDataCardType.java index 4a8eb01..fe07808 100644 --- a/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseDataCardType.java +++ b/src/main/java/com/sumup/sdk/models/GetReaderCheckoutResponseDataCardType.java @@ -5,12 +5,14 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Objects; -/** Type of the card. Required for some countries */ +/** Type of the card, or null when no card type was specified. */ public final class GetReaderCheckoutResponseDataCardType { public static final GetReaderCheckoutResponseDataCardType CREDIT = new GetReaderCheckoutResponseDataCardType("credit"); public static final GetReaderCheckoutResponseDataCardType DEBIT = new GetReaderCheckoutResponseDataCardType("debit"); + public static final GetReaderCheckoutResponseDataCardType NULL = + new GetReaderCheckoutResponseDataCardType("null"); private final String value; diff --git a/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponse.java b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponse.java new file mode 100644 index 0000000..e686920 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponse.java @@ -0,0 +1,43 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Menu lock settings reported by the reader, or the last saved settings when offline. */ +public record GetReaderSettingsResponse(com.sumup.sdk.models.GetReaderSettingsResponseData data) { + /** + * Creates a builder for GetReaderSettingsResponse. + * + * @return Builder that constructs immutable GetReaderSettingsResponse instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for GetReaderSettingsResponse instances. */ + public static final class Builder { + private com.sumup.sdk.models.GetReaderSettingsResponseData data; + + private Builder() {} + + /** + * Sets the value for {@code data}. + * + * @param data Value for the data field. + * @return This builder instance. + */ + public Builder data(com.sumup.sdk.models.GetReaderSettingsResponseData data) { + this.data = data; + return this; + } + + /** + * Builds an immutable GetReaderSettingsResponse instance. + * + * @return Immutable GetReaderSettingsResponse. + */ + public GetReaderSettingsResponse build() { + return new GetReaderSettingsResponse(Objects.requireNonNull(data, "data")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseData.java b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseData.java new file mode 100644 index 0000000..d1a43da --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseData.java @@ -0,0 +1,44 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +public record GetReaderSettingsResponseData( + /** Menu lock configuration. Fields may be absent if no value is available. */ + com.sumup.sdk.models.GetReaderSettingsResponseDataMenuLock menuLock) { + /** + * Creates a builder for GetReaderSettingsResponseData. + * + * @return Builder that constructs immutable GetReaderSettingsResponseData instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for GetReaderSettingsResponseData instances. */ + public static final class Builder { + private com.sumup.sdk.models.GetReaderSettingsResponseDataMenuLock menuLock; + + private Builder() {} + + /** + * Sets the value for {@code menuLock}. + * + * @param menuLock Menu lock configuration. Fields may be absent if no value is available. + * @return This builder instance. + */ + public Builder menuLock(com.sumup.sdk.models.GetReaderSettingsResponseDataMenuLock menuLock) { + this.menuLock = menuLock; + return this; + } + + /** + * Builds an immutable GetReaderSettingsResponseData instance. + * + * @return Immutable GetReaderSettingsResponseData. + */ + public GetReaderSettingsResponseData build() { + return new GetReaderSettingsResponseData(Objects.requireNonNull(menuLock, "menuLock")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseDataMenuLock.java b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseDataMenuLock.java new file mode 100644 index 0000000..f021646 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/GetReaderSettingsResponseDataMenuLock.java @@ -0,0 +1,58 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Menu lock configuration. Fields may be absent if no value is available. */ +public record GetReaderSettingsResponseDataMenuLock( + /** Whether menu lock is enabled. */ + Boolean enabled, + + /** Four-digit PIN used to unlock the reader's menu. */ + String passcode) { + /** + * Creates a builder for GetReaderSettingsResponseDataMenuLock. + * + * @return Builder that constructs immutable GetReaderSettingsResponseDataMenuLock instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for GetReaderSettingsResponseDataMenuLock instances. */ + public static final class Builder { + private Boolean enabled; + private String passcode; + + private Builder() {} + + /** + * Sets the value for {@code enabled}. + * + * @param enabled Whether menu lock is enabled. + * @return This builder instance. + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Sets the value for {@code passcode}. + * + * @param passcode Four-digit PIN used to unlock the reader's menu. + * @return This builder instance. + */ + public Builder passcode(String passcode) { + this.passcode = passcode; + return this; + } + + /** + * Builds an immutable GetReaderSettingsResponseDataMenuLock instance. + * + * @return Immutable GetReaderSettingsResponseDataMenuLock. + */ + public GetReaderSettingsResponseDataMenuLock build() { + return new GetReaderSettingsResponseDataMenuLock(enabled, passcode); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/Token.java b/src/main/java/com/sumup/sdk/models/Token.java new file mode 100644 index 0000000..2e87f32 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/Token.java @@ -0,0 +1,89 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * A short-lived credential for the requested merchant account and actions. Pass access_token to a + * SumUp SDK that supports merchant tokens. + */ +public record Token( + /** + * Secret token to pass to the SDK. Treat this value as an opaque string; do not parse it or + * depend on its format. + */ + String accessToken, + + /** + * Remaining lifetime of the token in seconds when the response is created. Tokens expire 15 + * minutes after creation. Request a new token when needed. + */ + Long expiresIn, + + /** Authentication scheme used by the token. Always Bearer. */ + com.sumup.sdk.models.TokenTokenType tokenType) { + /** + * Creates a builder for Token. + * + * @return Builder that constructs immutable Token instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Token instances. */ + public static final class Builder { + private String accessToken; + private Long expiresIn; + private com.sumup.sdk.models.TokenTokenType tokenType; + + private Builder() {} + + /** + * Sets the value for {@code accessToken}. + * + * @param accessToken Secret token to pass to the SDK. Treat this value as an opaque string; do + * not parse it or depend on its format. + * @return This builder instance. + */ + public Builder accessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Sets the value for {@code expiresIn}. + * + * @param expiresIn Remaining lifetime of the token in seconds when the response is created. + * Tokens expire 15 minutes after creation. Request a new token when needed. + * @return This builder instance. + */ + public Builder expiresIn(Long expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Sets the value for {@code tokenType}. + * + * @param tokenType Authentication scheme used by the token. Always Bearer. + * @return This builder instance. + */ + public Builder tokenType(com.sumup.sdk.models.TokenTokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Builds an immutable Token instance. + * + * @return Immutable Token. + */ + public Token build() { + return new Token( + Objects.requireNonNull(accessToken, "accessToken"), + Objects.requireNonNull(expiresIn, "expiresIn"), + Objects.requireNonNull(tokenType, "tokenType")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/TokenTokenType.java b/src/main/java/com/sumup/sdk/models/TokenTokenType.java new file mode 100644 index 0000000..ad6019d --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TokenTokenType.java @@ -0,0 +1,52 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** Authentication scheme used by the token. Always Bearer. */ +public final class TokenTokenType { + public static final TokenTokenType BEARER = new TokenTokenType("Bearer"); + + private final String value; + + private TokenTokenType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a TokenTokenType for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static TokenTokenType of(String value) { + return new TokenTokenType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static TokenTokenType fromValue(String value) { + return value == null ? null : new TokenTokenType(value); + } + + @Override + public boolean equals(Object other) { + return this == other || (other instanceof TokenTokenType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsError.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsError.java new file mode 100644 index 0000000..0a293fe --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsError.java @@ -0,0 +1,44 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Details of a failed reader settings request. */ +public record UpdateReaderSettingsError( + com.sumup.sdk.models.UpdateReaderSettingsErrorErrors errors) { + /** + * Creates a builder for UpdateReaderSettingsError. + * + * @return Builder that constructs immutable UpdateReaderSettingsError instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsError instances. */ + public static final class Builder { + private com.sumup.sdk.models.UpdateReaderSettingsErrorErrors errors; + + private Builder() {} + + /** + * Sets the value for {@code errors}. + * + * @param errors Value for the errors field. + * @return This builder instance. + */ + public Builder errors(com.sumup.sdk.models.UpdateReaderSettingsErrorErrors errors) { + this.errors = errors; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsError instance. + * + * @return Immutable UpdateReaderSettingsError. + */ + public UpdateReaderSettingsError build() { + return new UpdateReaderSettingsError(Objects.requireNonNull(errors, "errors")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsErrorErrors.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsErrorErrors.java new file mode 100644 index 0000000..162a502 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsErrorErrors.java @@ -0,0 +1,59 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +public record UpdateReaderSettingsErrorErrors( + /** Error message */ + String detail, + + /** Error code */ + String type) { + /** + * Creates a builder for UpdateReaderSettingsErrorErrors. + * + * @return Builder that constructs immutable UpdateReaderSettingsErrorErrors instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsErrorErrors instances. */ + public static final class Builder { + private String detail; + private String type; + + private Builder() {} + + /** + * Sets the value for {@code detail}. + * + * @param detail Error message + * @return This builder instance. + */ + public Builder detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Error code + * @return This builder instance. + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsErrorErrors instance. + * + * @return Immutable UpdateReaderSettingsErrorErrors. + */ + public UpdateReaderSettingsErrorErrors build() { + return new UpdateReaderSettingsErrorErrors(Objects.requireNonNull(detail, "detail"), type); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequest.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequest.java new file mode 100644 index 0000000..7516599 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequest.java @@ -0,0 +1,45 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Menu lock settings to update for a Solo reader. */ +public record UpdateReaderSettingsRequest( + /** Menu lock configuration. Provide at least one of `enabled` or `passcode`. */ + com.sumup.sdk.models.UpdateReaderSettingsRequestMenuLock menuLock) { + /** + * Creates a builder for UpdateReaderSettingsRequest. + * + * @return Builder that constructs immutable UpdateReaderSettingsRequest instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsRequest instances. */ + public static final class Builder { + private com.sumup.sdk.models.UpdateReaderSettingsRequestMenuLock menuLock; + + private Builder() {} + + /** + * Sets the value for {@code menuLock}. + * + * @param menuLock Menu lock configuration. Provide at least one of `enabled` or `passcode`. + * @return This builder instance. + */ + public Builder menuLock(com.sumup.sdk.models.UpdateReaderSettingsRequestMenuLock menuLock) { + this.menuLock = menuLock; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsRequest instance. + * + * @return Immutable UpdateReaderSettingsRequest. + */ + public UpdateReaderSettingsRequest build() { + return new UpdateReaderSettingsRequest(Objects.requireNonNull(menuLock, "menuLock")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequestMenuLock.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequestMenuLock.java new file mode 100644 index 0000000..d654a17 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsRequestMenuLock.java @@ -0,0 +1,58 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Menu lock configuration. Provide at least one of `enabled` or `passcode`. */ +public record UpdateReaderSettingsRequestMenuLock( + /** Whether menu lock is enabled. */ + Boolean enabled, + + /** Four-digit PIN used to unlock the reader's menu. */ + String passcode) { + /** + * Creates a builder for UpdateReaderSettingsRequestMenuLock. + * + * @return Builder that constructs immutable UpdateReaderSettingsRequestMenuLock instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsRequestMenuLock instances. */ + public static final class Builder { + private Boolean enabled; + private String passcode; + + private Builder() {} + + /** + * Sets the value for {@code enabled}. + * + * @param enabled Whether menu lock is enabled. + * @return This builder instance. + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Sets the value for {@code passcode}. + * + * @param passcode Four-digit PIN used to unlock the reader's menu. + * @return This builder instance. + */ + public Builder passcode(String passcode) { + this.passcode = passcode; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsRequestMenuLock instance. + * + * @return Immutable UpdateReaderSettingsRequestMenuLock. + */ + public UpdateReaderSettingsRequestMenuLock build() { + return new UpdateReaderSettingsRequestMenuLock(enabled, passcode); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponse.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponse.java new file mode 100644 index 0000000..8bded5e --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponse.java @@ -0,0 +1,44 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Menu lock settings applied to the reader. */ +public record UpdateReaderSettingsResponse( + com.sumup.sdk.models.UpdateReaderSettingsResponseData data) { + /** + * Creates a builder for UpdateReaderSettingsResponse. + * + * @return Builder that constructs immutable UpdateReaderSettingsResponse instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsResponse instances. */ + public static final class Builder { + private com.sumup.sdk.models.UpdateReaderSettingsResponseData data; + + private Builder() {} + + /** + * Sets the value for {@code data}. + * + * @param data Value for the data field. + * @return This builder instance. + */ + public Builder data(com.sumup.sdk.models.UpdateReaderSettingsResponseData data) { + this.data = data; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsResponse instance. + * + * @return Immutable UpdateReaderSettingsResponse. + */ + public UpdateReaderSettingsResponse build() { + return new UpdateReaderSettingsResponse(Objects.requireNonNull(data, "data")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseData.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseData.java new file mode 100644 index 0000000..75c9346 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseData.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +public record UpdateReaderSettingsResponseData( + /** Settings included in the update. Omitted fields are not returned. */ + com.sumup.sdk.models.UpdateReaderSettingsResponseDataMenuLock menuLock, + + /** Indicates that the reader applied the settings update. */ + com.sumup.sdk.models.UpdateReaderSettingsResponseDataStatus status) { + /** + * Creates a builder for UpdateReaderSettingsResponseData. + * + * @return Builder that constructs immutable UpdateReaderSettingsResponseData instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsResponseData instances. */ + public static final class Builder { + private com.sumup.sdk.models.UpdateReaderSettingsResponseDataMenuLock menuLock; + private com.sumup.sdk.models.UpdateReaderSettingsResponseDataStatus status; + + private Builder() {} + + /** + * Sets the value for {@code menuLock}. + * + * @param menuLock Settings included in the update. Omitted fields are not returned. + * @return This builder instance. + */ + public Builder menuLock( + com.sumup.sdk.models.UpdateReaderSettingsResponseDataMenuLock menuLock) { + this.menuLock = menuLock; + return this; + } + + /** + * Sets the value for {@code status}. + * + * @param status Indicates that the reader applied the settings update. + * @return This builder instance. + */ + public Builder status(com.sumup.sdk.models.UpdateReaderSettingsResponseDataStatus status) { + this.status = status; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsResponseData instance. + * + * @return Immutable UpdateReaderSettingsResponseData. + */ + public UpdateReaderSettingsResponseData build() { + return new UpdateReaderSettingsResponseData( + Objects.requireNonNull(menuLock, "menuLock"), Objects.requireNonNull(status, "status")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataMenuLock.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataMenuLock.java new file mode 100644 index 0000000..efc621b --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataMenuLock.java @@ -0,0 +1,58 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Settings included in the update. Omitted fields are not returned. */ +public record UpdateReaderSettingsResponseDataMenuLock( + /** Whether menu lock is enabled. */ + Boolean enabled, + + /** Four-digit PIN used to unlock the reader's menu. */ + String passcode) { + /** + * Creates a builder for UpdateReaderSettingsResponseDataMenuLock. + * + * @return Builder that constructs immutable UpdateReaderSettingsResponseDataMenuLock instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsResponseDataMenuLock instances. */ + public static final class Builder { + private Boolean enabled; + private String passcode; + + private Builder() {} + + /** + * Sets the value for {@code enabled}. + * + * @param enabled Whether menu lock is enabled. + * @return This builder instance. + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Sets the value for {@code passcode}. + * + * @param passcode Four-digit PIN used to unlock the reader's menu. + * @return This builder instance. + */ + public Builder passcode(String passcode) { + this.passcode = passcode; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsResponseDataMenuLock instance. + * + * @return Immutable UpdateReaderSettingsResponseDataMenuLock. + */ + public UpdateReaderSettingsResponseDataMenuLock build() { + return new UpdateReaderSettingsResponseDataMenuLock(enabled, passcode); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataStatus.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataStatus.java new file mode 100644 index 0000000..c46b84a --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsResponseDataStatus.java @@ -0,0 +1,55 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** Indicates that the reader applied the settings update. */ +public final class UpdateReaderSettingsResponseDataStatus { + public static final UpdateReaderSettingsResponseDataStatus APPLIED = + new UpdateReaderSettingsResponseDataStatus("applied"); + + private final String value; + + private UpdateReaderSettingsResponseDataStatus(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a UpdateReaderSettingsResponseDataStatus for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static UpdateReaderSettingsResponseDataStatus of(String value) { + return new UpdateReaderSettingsResponseDataStatus(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static UpdateReaderSettingsResponseDataStatus fromValue(String value) { + return value == null ? null : new UpdateReaderSettingsResponseDataStatus(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof UpdateReaderSettingsResponseDataStatus that + && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsUnprocessableEntity.java b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsUnprocessableEntity.java new file mode 100644 index 0000000..0dceef3 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UpdateReaderSettingsUnprocessableEntity.java @@ -0,0 +1,43 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The reader cannot complete the settings request, or the settings are invalid. */ +public record UpdateReaderSettingsUnprocessableEntity(java.util.Map errors) { + /** + * Creates a builder for UpdateReaderSettingsUnprocessableEntity. + * + * @return Builder that constructs immutable UpdateReaderSettingsUnprocessableEntity instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UpdateReaderSettingsUnprocessableEntity instances. */ + public static final class Builder { + private java.util.Map errors; + + private Builder() {} + + /** + * Sets the value for {@code errors}. + * + * @param errors Value for the errors field. + * @return This builder instance. + */ + public Builder errors(java.util.Map errors) { + this.errors = errors; + return this; + } + + /** + * Builds an immutable UpdateReaderSettingsUnprocessableEntity instance. + * + * @return Immutable UpdateReaderSettingsUnprocessableEntity. + */ + public UpdateReaderSettingsUnprocessableEntity build() { + return new UpdateReaderSettingsUnprocessableEntity(Objects.requireNonNull(errors, "errors")); + } + } +}