From 6fc9b9f57690a0ccdcdf5c9ce4e29b7c042acbfc Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:46:16 +0000 Subject: [PATCH 1/2] chore: synced local 'openapi.json' with remote 'specs/openapi31.json' --- openapi.json | 7571 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 4844 insertions(+), 2727 deletions(-) diff --git a/openapi.json b/openapi.json index a08e3f0..2275863 100644 --- a/openapi.json +++ b/openapi.json @@ -104,6 +104,19 @@ } ] }, + { + "name": "Sales", + "description": "Operations related to reading sales data.", + "x-core-objects": [ + { + "$ref": "#/components/schemas/Sale" + }, + { + "$ref": "#/components/schemas/PublicPaymentV10" + } + ], + "x-displayName": "Sales" + }, { "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.", @@ -329,7 +342,21 @@ "description": "A sample checkout", "hosted_checkout": { "enabled": true - } + }, + "redirect_url": "https://example.com/orders/123/complete" + } + }, + "Tokenization": { + "summary": "Save a customer card", + "description": "Create a checkout to collect consent and save a card through the Payment Widget.", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT" } } } @@ -472,6 +499,22 @@ "hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676", "transactions": [] } + }, + "Tokenization": { + "summary": "Checkout for saving a card", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT", + "id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7", + "status": "PENDING", + "date": "2026-10-30T12:00:00+00:00", + "transactions": [] + } } } } @@ -694,17 +737,65 @@ "schema": { "$ref": "#/components/schemas/CheckoutSuccess" }, - "example": { - "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", - "amount": 10.1, - "currency": "EUR", - "merchant_code": "MH4H92C7", - "description": "Purchase", - "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", - "status": "PENDING", - "date": "2020-02-29T10:56:56+00:00", - "transaction_code": "TEENSK4W2K", - "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + "examples": { + "Checkout": { + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 10.1, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PENDING", + "date": "2020-02-29T10:56:56+00:00", + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + } + }, + "PaidCheckout": { + "summary": "Paid checkout with a transaction to refund", + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 42.42, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PAID", + "date": "2020-02-29T10:56:56+00:00", + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transactions": [ + { + "id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transaction_code": "TEENSK4W2K", + "amount": 42.42, + "currency": "EUR", + "status": "SUCCESSFUL", + "timestamp": "2026-10-30T12:00:00+00:00" + } + ] + } + }, + "TokenizedCheckout": { + "summary": "Checkout with a saved card", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT", + "id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7", + "status": "PAID", + "date": "2026-10-30T12:00:00+00:00", + "transactions": [], + "payment_instrument": { + "token": "6878cb7f-6515-47bf-bdd9-1408d270fdce" + } + } + } } } } @@ -923,9 +1014,8 @@ "description": "Process a checkout with a token", "value": { "payment_type": "card", - "installments": 1, - "token": "ba85dfee-c3cf-48a6-84f5-d7d761fbba50", - "customer_id": "MEDKHDTI" + "token": "6878cb7f-6515-47bf-bdd9-1408d270fdce", + "customer_id": "831ff8d4cd5958ab5670" } }, "ProcessBoleto": { @@ -2223,9 +2313,6 @@ "description": "Optional amount for partial refunds.", "content": { "application/json": { - "example": { - "amount": 5 - }, "schema": { "type": "object", "description": "Optional amount for partial refunds of transactions.", @@ -2237,6 +2324,18 @@ "example": 5 } } + }, + "examples": { + "FullRefund": { + "summary": "Full refund", + "value": {} + }, + "PartialRefund": { + "summary": "Partial refund", + "value": { + "amount": 24.42 + } + } } } } @@ -5534,466 +5633,420 @@ ] } }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout": { - "post": { - "callbacks": { - "ReaderCheckoutStatusChange": { - "{$request.body#/return_url}": { - "post": { - "callbacks": {}, - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReaderCheckoutStatusChange" - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "Your server returns this code if it accepts the callback.\nIf the server returns any other code, the callback will be retried up to 5 times with exponential backoff.\n" - } - } - } - } + "/v1.0/merchants/{merchant_code}/sales": { + "get": { + "tags": [ + "Sales" + ], + "summary": "Lists sales", + "description": "Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the\n**newest event** recorded for each sale. Pagination tokens follow that order.\n\nCovers the merchant’s **last two years** of sales. Non-finalised sales are never returned;\nonly fully-paid sales. Use `POST /sales/search` for filtered queries.", + "operationId": "ListSalesV10", + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [ + "sales.read" + ] } - }, - "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", + ], + "x-scopes": [ + "sales.read" + ], + "x-permissions": [ + "merchant_read" + ], "parameters": [ { - "description": "Merchant Code", - "example": "MC0X0ABC", - "in": "path", "name": "merchant_code", + "in": "path", + "description": "The merchant code.", "required": true, "schema": { - "type": "string" + "type": "string", + "example": "MCZM9TGQ", + "maxLength": 30 } }, { - "description": "The unique identifier of the Reader", - "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", - "in": "path", - "name": "reader_id", - "required": true, + "name": "pagination_token", + "in": "query", + "required": false, + "description": "Pagination token for subsequent requests. Should only be set by clients if they have\nreceived a token in the previous response, and this request is an immediate follow-up\nrequest to that response to load the subsequent page. Clients should treat this as an\nopaque token and should not attempt to parse it in any way.", "schema": { "type": "string" - } + }, + "example": "66bcbtzelrubzeuzruzgu76678trncH" + }, + { + "name": "pagination_limit", + "in": "query", + "required": false, + "description": "Maximum number of results per page.", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 25, + "default": 10 + }, + "example": 10 } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutRequest" - } - } - }, - "description": "A checkout initial attributes", - "required": true - }, "responses": { - "201": { + "200": { + "description": "Successful response with a page of sales.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutResponse" + "$ref": "#/components/schemas/SalePage" } } - }, - "description": "The Checkout got successfully created for the given reader." + } }, "400": { + "description": "Validation error on the request.", "content": { - "application/json": { - "example": { - "errors": { - "detail": "Invalid affiliate key.", - "type": "INVALID_AFFILIATE_KEY" - } - }, - "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutError" - } - }, "application/problem+json": { - "example": { - "detail": "Invalid affiliate key.", - "status": 400, - "title": "Invalid Affiliate Key", - "type": "https://developer.sumup.com/problem/invalid-affiliate-key" - }, "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given params (or one of them) are invalid" + } }, "401": { + "description": "The client is not authenticated (auth header is empty or invalid).", "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Unauthorized" + } }, - "404": { + "403": { + "description": "Missing `sales.read`, merchant code mismatch on the token, or no `merchant_read` permission.", "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given reader is not found" + } }, - "422": { + "412": { + "description": "User-Agent header is not present or is empty.", "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutUnprocessableEntity" - } - }, "application/problem+json": { - "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given params (or one of them) are invalid" + } } - }, - "security": [ - { + } + } + }, + "/v1.0/merchants/{merchant_code}/sales/search": { + "post": { + "tags": [ + "Sales" + ], + "summary": "Searches sales", + "description": "Returns a paginated list of `SaleSearchItem` rows matching filter criteria. Results are\nsorted **newest first** by **sale close date**.\n\nFilters from different categories stack with **logical AND**; multiple values in one array\nfield stack with **logical OR**. Results cover the merchant’s **last two years** of sales\n(narrow further with `start_date` / `end_date`). Pagination tokens are not interchangeable\nwith `GET /sales`.", + "operationId": "SearchSalesV10", + "security": [ + { "apiKey": [] }, { "oauth2": [ - "readers.write" + "sales.read" ] } ], - "summary": "Create a Reader Checkout", - "tags": [ - "Readers" + "x-scopes": [ + "sales.read" ], - "x-codegen": { - "method_name": "create_checkout" - }, "x-permissions": [ - "readers.checkouts.create" + "merchant_read" ], - "x-scopes": [ - "readers.write" - ] - } - }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/status": { - "get": { - "callbacks": {}, - "description": "Provides the last known status for a Reader.\n\nThis endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).\n\nSupported States\n\n* `IDLE` – Reader ready for next transaction\n* `SELECTING_TIP` – Waiting for tip input\n* `WAITING_FOR_CARD` – Awaiting card insert/tap\n* `WAITING_FOR_PIN` – Waiting for PIN entry\n* `WAITING_FOR_SIGNATURE` – Waiting for customer signature\n* `UPDATING_FIRMWARE` – Firmware update in progress\n\nDevice Status\n\n* `ONLINE` – Device connected and operational\n* `OFFLINE` – Device disconnected (last state persisted)\n\n**Note**: If the target device is a Solo, it must be in version 3.3.39.0 or higher.\n", - "operationId": "GetReaderStatus", "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", + "description": "The merchant code.", "required": true, "schema": { - "type": "string" + "type": "string", + "example": "MCZM9TGQ", + "maxLength": 30 } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaleSearchRequest" + } + } + } + }, "responses": { "200": { + "description": "Successful response with search results.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StatusResponse" + "$ref": "#/components/schemas/SaleSearchResponse" } } - }, - "description": "Response with the device status." + } }, "400": { + "description": "Validation error on the request.", "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BadRequest" - } - }, "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given params (or one of them) are invalid" + } }, "401": { + "description": "The client is not authenticated (auth header is empty or invalid).", "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Unauthorized" - } - }, "application/problem+json": { - "example": { - "detail": "Unauthorized", - "status": 401, - "title": "Unauthorized", - "type": "https://developer.sumup.com/problem/unauthorized" - }, "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given merchant's token is invalid" + } }, - "404": { + "403": { + "description": "Missing `sales.read`, merchant code mismatch on the token, or no `merchant_read` permission.", "content": { - "application/json": { + "application/problem+json": { "schema": { - "$ref": "#/components/schemas/NotFound" + "$ref": "#/components/schemas/ProblemV10" } - }, + } + } + }, + "412": { + "description": "User-Agent header is not present or is empty.", + "content": { "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Response when given reader is not found" + } } - }, + } + } + }, + "/v1.0/merchants/{merchant_code}/sales/{sale_id}": { + "get": { + "tags": [ + "Sales" + ], + "summary": "Gets a sale", + "description": "Returns `Sale` for `sale_id`, including item lines and `payments[]`.\nNon-finalised sales are never returned; only fully-paid sales.", + "operationId": "GetSaleV10", "security": [ { "apiKey": [] }, { "oauth2": [ - "readers.read" + "sales.read" ] } ], - "summary": "Get a Reader Status", - "tags": [ - "Readers" + "x-scopes": [ + "sales.read" ], - "x-codegen": { - "method_name": "get_status" - }, "x-permissions": [ - "readers.view" + "merchant_read" ], - "x-scopes": [ - "readers.read" - ] - } - }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings": { - "get": { - "callbacks": {}, - "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": "The merchant code of the account that owns the reader.", - "example": "MC0X0ABC", - "in": "path", "name": "merchant_code", + "in": "path", + "description": "The merchant code.", "required": true, "schema": { - "type": "string" + "type": "string", + "example": "MCZM9TGQ", + "maxLength": 30 } }, { - "description": "The unique identifier of the reader.", - "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "name": "sale_id", "in": "path", - "name": "reader_id", + "description": "The sale ID.", "required": true, "schema": { - "type": "string" + "type": "string", + "example": "5965aa65-e45a-4cc1-9063-c1c1e3b8607f" } } ], "responses": { "200": { + "description": "Sale data with item lines and payments.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetReaderSettingsResponse" + "$ref": "#/components/schemas/Sale" + }, + "example": { + "id": "dbe3178d-4b83-5024-9b26-9b8e1b280514", + "currency": { + "code": "EUR", + "scale": 2 + }, + "tax_mode": "GROSS", + "state": "CLOSED", + "price": { + "net_amount": 777, + "gross_amount": 925, + "taxes": [ + { + "id": "tax-vat-19", + "net_amount": 777, + "gross_amount": 925, + "tax_amount": 148 + } + ] + }, + "created_at": "2026-06-02T10:15:00Z", + "closed_at": "2026-06-02T10:20:00Z", + "source": { + "channel": "POS" + }, + "items": [ + { + "id": "line-1", + "type": "CATALOG", + "name": "Cappuccino", + "quantity": 1, + "price": { + "unit_amount": 300, + "total_net_amount": 252, + "total_gross_amount": 300, + "taxes": [ + { + "id": "tax-vat-19", + "net_amount": 252, + "gross_amount": 300, + "tax_amount": 48 + } + ], + "total_net_amount_final": 252, + "total_gross_amount_final": 300, + "taxes_final": [ + { + "id": "tax-vat-19", + "net_amount": 252, + "gross_amount": 300, + "tax_amount": 48 + } + ] + } + } + ], + "payments": [ + { + "method": "apple_pay", + "reference": "TERTYFQ4G3", + "type": "purchase", + "amount": 975, + "status": "SUCCESSFUL", + "processed_at": "2026-06-02T10:20:00Z" + } + ] } } - }, - "description": "Reader settings retrieved successfully." + } }, "401": { + "description": "The client is not authenticated (auth header is empty or invalid).", "content": { - "application/json": { + "application/problem+json": { "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsError" + "$ref": "#/components/schemas/ProblemV10" } - }, + } + } + }, + "403": { + "description": "Missing `sales.read`, merchant code mismatch on the token, or no `merchant_read` permission.", + "content": { "application/problem+json": { - "example": { - "detail": "Unauthorized", - "status": 401, - "title": "Unauthorized", - "type": "https://developer.sumup.com/problem/unauthorized" - }, "schema": { - "$ref": "#/components/schemas/Problem" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "Unauthorized" + } }, "404": { + "description": "Sale not found. Non-finalised sales are never returned; only fully-paid sales.", "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" + "$ref": "#/components/schemas/ProblemV10" } } - }, - "description": "The reader was not found, or it is offline and has no saved settings." + } }, - "422": { + "412": { + "description": "User-Agent header is not present or is empty.", "content": { - "application/json": { + "application/problem+json": { "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsUnprocessableEntity" + "$ref": "#/components/schemas/ProblemV10" } - }, - "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" + } + } + } + } + } + }, + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout": { + "post": { + "callbacks": { + "ReaderCheckoutStatusChange": { + "{$request.body#/return_url}": { + "post": { + "callbacks": {}, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReaderCheckoutStatusChange" + } + } + }, + "required": true }, - "schema": { - "$ref": "#/components/schemas/Problem" + "responses": { + "200": { + "description": "Your server returns this code if it accepts the callback.\nIf the server returns any other code, the callback will be retried up to 5 times with exponential backoff.\n" + } } } - }, - "description": "The reader model is not supported, or the reader could not return its settings." + } } }, - "security": [ - { - "apiKey": [] - }, + "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": [ { - "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.", + "description": "Merchant Code", "example": "MC0X0ABC", "in": "path", "name": "merchant_code", @@ -6003,7 +6056,7 @@ } }, { - "description": "The unique identifier of the reader.", + "description": "The unique identifier of the Reader", "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", "in": "path", "name": "reader_id", @@ -6016,51 +6069,65 @@ "requestBody": { "content": { "application/json": { + "example": { + "return_url": "https://example.com/sumup/webhook", + "total_amount": { + "currency": "EUR", + "minor_unit": 2, + "value": 1500 + } + }, "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsRequest" + "$ref": "#/components/schemas/CreateReaderCheckoutRequest" } } }, - "description": "Menu lock settings to update.", + "description": "A checkout initial attributes", "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsResponse" + "$ref": "#/components/schemas/CreateReaderCheckoutResponse" } } }, - "description": "Reader settings updated successfully." + "description": "The Checkout got successfully created for the given reader." }, "400": { "content": { "application/json": { + "example": { + "errors": { + "detail": "Invalid affiliate key.", + "type": "INVALID_AFFILIATE_KEY" + } + }, "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsError" + "$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" } } }, - "description": "The request body is malformed." + "description": "Response when given params (or one of them) are invalid" }, "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsError" + "$ref": "#/components/schemas/CreateReaderCheckoutError" } }, "application/problem+json": { @@ -6096,34 +6163,40 @@ } } }, - "description": "The reader was not found." + "description": "Response when given reader is not found" }, "422": { "content": { "application/json": { - "example": { - "errors": { - "detail": "The device is offline.", - "type": "READER_OFFLINE" - } - }, "schema": { - "$ref": "#/components/schemas/UpdateReaderSettingsUnprocessableEntity" + "$ref": "#/components/schemas/CreateReaderCheckoutUnprocessableEntity" } }, "application/problem+json": { - "example": { - "detail": "The device is offline.", - "status": 422, - "title": "Reader Offline", - "type": "https://developer.sumup.com/problem/reader-offline" + "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" } } }, - "description": "The settings are invalid, the reader is offline, the reader model is not supported, or the reader could not apply the update." + "description": "Response when given params (or one of them) are invalid" } }, "security": [ @@ -6136,12 +6209,12 @@ ] } ], - "summary": "Update Reader Settings", + "summary": "Create a Reader Checkout", "tags": [ "Readers" ], "x-codegen": { - "method_name": "update_reader_settings" + "method_name": "create_checkout" }, "x-permissions": [ "readers.checkouts.create" @@ -6151,11 +6224,11 @@ ] } }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate": { - "post": { + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/status": { + "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": "Provides the last known status for a Reader.\n\nThis endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).\n\nSupported States\n\n* `IDLE` – Reader ready for next transaction\n* `SELECTING_TIP` – Waiting for tip input\n* `WAITING_FOR_CARD` – Awaiting card insert/tap\n* `WAITING_FOR_PIN` – Waiting for PIN entry\n* `WAITING_FOR_SIGNATURE` – Waiting for customer signature\n* `UPDATING_FIRMWARE` – Firmware update in progress\n\nDevice Status\n\n* `ONLINE` – Device connected and operational\n* `OFFLINE` – Device disconnected (last state persisted)\n\n**Note**: If the target device is a Solo, it must be in version 3.3.39.0 or higher.\n", + "operationId": "GetReaderStatus", "parameters": [ { "description": "Merchant Code", @@ -6178,25 +6251,22 @@ } } ], - "requestBody": { - "content": { - "application/json": {} - }, - "description": "A checkout initial attributes", - "required": false - }, "responses": { - "202": { + "200": { "content": { - "application/json": {} + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusResponse" + } + } }, - "description": "The Terminate action was successfully dispatched for the given reader." + "description": "Response with the device status." }, "400": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderTerminateError" + "$ref": "#/components/schemas/BadRequest" } }, "application/problem+json": { @@ -6217,7 +6287,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderTerminateError" + "$ref": "#/components/schemas/Unauthorized" } }, "application/problem+json": { @@ -6232,7 +6302,7 @@ } } }, - "description": "Unauthorized" + "description": "Response when given merchant's token is invalid" }, "404": { "content": { @@ -6254,27 +6324,6 @@ } }, "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": [ @@ -6283,33 +6332,33 @@ }, { "oauth2": [ - "readers.write" + "readers.read" ] } ], - "summary": "Terminate a Reader Checkout", + "summary": "Get a Reader Status", "tags": [ "Readers" ], "x-codegen": { - "method_name": "terminate_checkout" + "method_name": "get_status" }, "x-permissions": [ - "readers.checkouts.delete" + "readers.view" ], "x-scopes": [ - "readers.write" + "readers.read" ] } }, - "/v0.1/merchants/{merchant_code}/readers/{reader_id}/checkout/{checkout_id}": { + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/settings": { "get": { "callbacks": {}, - "description": "Get a Checkout for a Reader.\n", - "operationId": "GetReaderCheckout", + "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", @@ -6319,7 +6368,7 @@ } }, { - "description": "The unique identifier of the Reader", + "description": "The unique identifier of the reader.", "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", "in": "path", "name": "reader_id", @@ -6327,16 +6376,6 @@ "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": { @@ -6344,17 +6383,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GetReaderCheckoutResponse" + "$ref": "#/components/schemas/GetReaderSettingsResponse" } } }, - "description": "The Checkout got successfully retrieved for the given reader." + "description": "Reader settings retrieved successfully." }, "401": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateReaderCheckoutError" + "$ref": "#/components/schemas/UpdateReaderSettingsError" } }, "application/problem+json": { @@ -6390,7 +6429,28 @@ } } }, - "description": "Response when given reader or checkout is not found" + "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, the firmware version is unsupported, or the reader could not return its settings." } }, "security": [ @@ -6403,12 +6463,12 @@ ] } ], - "summary": "Get a Reader Checkout", + "summary": "Get Reader Settings", "tags": [ "Readers" ], "x-codegen": { - "method_name": "get_checkout" + "method_name": "get_reader_settings" }, "x-permissions": [ "readers.checkouts.view" @@ -6416,353 +6476,783 @@ "x-scopes": [ "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" - } - ], + }, + "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", - "description": "Unique code of the merchant account that will receive the payments.", "required": true, "schema": { - "type": "string", - "example": "MC0X0ABC" + "type": "string" } - } - ], - "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" - ] - } + }, + { + "description": "The unique identifier of the reader.", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "in": "path", + "name": "reader_id", + "required": true, + "schema": { + "type": "string" } } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsRequest" + } + } + }, + "description": "Menu lock settings to update.", + "required": true }, "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 + "$ref": "#/components/schemas/UpdateReaderSettingsResponse" } } - } + }, + "description": "Reader settings updated successfully." }, "400": { - "description": "The request body is invalid or contains unsupported or duplicate actions.", "content": { - "application/problem+json": { + "application/json": { "schema": { - "$ref": "#/components/schemas/Problem" - }, + "$ref": "#/components/schemas/UpdateReaderSettingsError" + } + }, + "application/problem+json": { "example": { - "type": "https://developer.sumup.com/problem/bad-request", - "title": "Bad Request", + "detail": "Bad Request", "status": 400, - "detail": "The request contains an unsupported action." + "title": "Bad Request", + "type": "https://developer.sumup.com/problem/bad-request" + }, + "schema": { + "$ref": "#/components/schemas/Problem" } } - } + }, + "description": "The request body is malformed." }, "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 + "$ref": "#/components/schemas/UpdateReaderSettingsError" } }, "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/Problem" - }, "example": { - "type": "https://developer.sumup.com/problem/unauthorized", - "title": "Unauthorized", + "detail": "Unauthorized", "status": 401, - "detail": "Token is invalid or expired." + "title": "Unauthorized", + "type": "https://developer.sumup.com/problem/unauthorized" + }, + "schema": { + "$ref": "#/components/schemas/Problem" } } - } + }, + "description": "Unauthorized" }, - "403": { - "description": "The authenticated identity does not have permission to create tokens for this merchant account.", + "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." + }, + "422": { + "content": { + "application/json": { + "example": { + "errors": { + "detail": "The device is offline.", + "type": "READER_OFFLINE" + } }, + "schema": { + "$ref": "#/components/schemas/UpdateReaderSettingsUnprocessableEntity" + } + }, + "application/problem+json": { "example": { - "type": "https://developer.sumup.com/problem/forbidden", - "title": "Forbidden", - "status": 403 + "detail": "The device is offline.", + "status": 422, + "title": "Reader Offline", + "type": "https://developer.sumup.com/problem/reader-offline" + }, + "schema": { + "$ref": "#/components/schemas/Problem" } } - } + }, + "description": "The settings are invalid, the reader is offline, the reader model is not supported, the firmware version is unsupported, or the reader could not apply the update." } - } + }, + "security": [ + { + "apiKey": [] + }, + { + "oauth2": [ + "readers.write" + ] + } + ], + "summary": "Update Reader Settings", + "tags": [ + "Readers" + ], + "x-codegen": { + "method_name": "update_reader_settings" + }, + "x-permissions": [ + "readers.checkouts.create" + ], + "x-scopes": [ + "readers.write" + ] } - } - }, - "components": { - "schemas": { - "AddressLegacy": { - "title": "Address Legacy", - "type": "object", - "description": "Profile's personal address information.", - "properties": { - "city": { - "type": "string", - "description": "City name from the address.", - "example": "Berlin" + }, + "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate": { + "post": { + "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", + "parameters": [ + { + "description": "Merchant Code", + "example": "MC0X0ABC", + "in": "path", + "name": "merchant_code", + "required": true, + "schema": { + "type": "string" + } }, - "country": { - "type": "string", - "description": "Two letter country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).", - "example": "DE" + { + "description": "The unique identifier of the Reader", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "in": "path", + "name": "reader_id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": {} }, - "line_1": { - "type": "string", - "description": "First line of the address with details of the street name and number.", - "example": "Sample street" + "description": "A checkout initial attributes", + "required": false + }, + "responses": { + "202": { + "content": { + "application/json": {} + }, + "description": "The Terminate action was successfully dispatched for the given reader." }, - "line_2": { - "type": "string", - "description": "Second line of the address with details of the building, unit, apartment, and floor numbers.", - "example": "ap. 5" + "400": { + "content": { + "application/json": { + "schema": { + "$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": "Response when given params (or one of them) are invalid" }, - "postal_code": { - "type": "string", - "description": "Postal code from the address.", - "example": "10115" - }, - "state": { - "type": "string", - "description": "State name or abbreviation from the address.", - "example": "Berlin" - } - } - }, - "Card": { - "title": "Card", - "type": "object", - "description": "__Required when payment type is `card`.__ Details of the payment card.", - "properties": { - "name": { - "type": "string", - "description": "Name of the cardholder as it appears on the payment card.", - "writeOnly": true, - "example": "FIRSTNAME LASTNAME" - }, - "number": { - "type": "string", - "description": "Number of the payment card (without spaces).", - "writeOnly": true, - "example": "1234567890123456" - }, - "expiry_year": { - "type": "string", - "description": "Two- or four-digit expiration year in `YY` or `YYYY` format.", - "writeOnly": true, - "pattern": "^[0-9]{2}([0-9]{2})?$", - "example": "2030" - }, - "expiry_month": { - "type": "string", - "description": "Two-digit expiration month, from `01` through `12`.", - "writeOnly": true, - "minLength": 2, - "maxLength": 2, - "pattern": "^(0[1-9]|1[0-2])$", - "example": "12" + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateReaderTerminateError" + } + }, + "application/problem+json": { + "example": { + "detail": "Unauthorized", + "status": 401, + "title": "Unauthorized", + "type": "https://developer.sumup.com/problem/unauthorized" + }, + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "Unauthorized" }, - "cvv": { - "type": "string", - "description": "Three or four-digit card verification value (security code) of the payment card.", - "writeOnly": true, - "maxLength": 4, - "minLength": 3, - "example": "123" + "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 is not found" }, - "zip_code": { - "type": "string", - "description": "Required five-digit ZIP code. Applicable only to merchant users in the USA.", - "writeOnly": true, - "maxLength": 5, - "minLength": 5, - "example": "12345" + "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": [ + { + "apiKey": [] }, - "type": { - "$ref": "#/components/schemas/CardType" + { + "oauth2": [ + "readers.write" + ] } + ], + "summary": "Terminate a Reader Checkout", + "tags": [ + "Readers" + ], + "x-codegen": { + "method_name": "terminate_checkout" }, - "required": [ - "name", - "number", - "expiry_month", - "expiry_year", - "cvv", - "type" + "x-permissions": [ + "readers.checkouts.delete" + ], + "x-scopes": [ + "readers.write" ] - }, - "CardResponse": { - "title": "Card Response", - "type": "object", - "description": "Details of the payment card.", - "properties": { - "last_4_digits": { - "type": "string", - "description": "Last 4 digits of the payment card number.", - "readOnly": true, - "minLength": 4, - "maxLength": 4, - "example": "3456" + } + }, + "/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" + } }, - "type": { - "$ref": "#/components/schemas/CardType" + { + "description": "The unique identifier of the Reader", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "in": "path", + "name": "reader_id", + "required": true, + "schema": { + "type": "string" + } }, - "payment_account_reference": { - "type": "string", - "description": "Payment Account Reference (PAR) defined by [EMVCo](https://www.emvco.com/emv-technologies/payment-tokenisation/). It links a card's primary account number (PAN) with its affiliated payment tokens, allowing transactions made with the physical card and tokenized versions of that card, such as digital wallets, to be correlated when PAR is available.\n\nThis reference cannot be used to initiate a payment and is separate from the saved payment instrument `token` used to process checkouts. Returned only when available for the card; integrations must handle its absence.", - "example": "5665ABCDEFGHIJKLMNOPQRSTUVWXY" + { + "description": "The unique identifier of the Checkout", + "example": "74ecff66-1655-43ed-8ce3-193f49fa602f", + "in": "path", + "name": "checkout_id", + "required": true, + "schema": { + "type": "string" + } } - } - }, - "Device": { - "title": "Device", - "description": "Details of the device used to create the transaction.", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Device name.", - "example": "m0xx" - }, - "system_name": { - "type": "string", - "description": "Device OS.", - "example": "Android" + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetReaderCheckoutResponse" + } + } + }, + "description": "The Checkout got successfully retrieved for the given reader." }, - "model": { - "type": "string", - "description": "Device model.", - "example": "GT-I9300" + "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" }, - "system_version": { - "type": "string", - "description": "Device OS version.", - "example": "4.3" + "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": [] }, - "uuid": { - "type": "string", - "description": "Device UUID.", - "example": "3ae2a6b7-fb0d-3b50-adbf-cb7e2db30cd2" + { + "oauth2": [ + "readers.read" + ] + } + ], + "summary": "Get a Reader Checkout", + "tags": [ + "Readers" + ], + "x-codegen": { + "method_name": "get_checkout" + }, + "x-permissions": [ + "readers.checkouts.view" + ], + "x-scopes": [ + "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 + } + } + } } } - }, - "ElvCardAccount": { - "title": "ELV Card Account", - "description": "Details of the ELV card account associated with the transaction.", + } + } + }, + "components": { + "schemas": { + "AddressLegacy": { + "title": "Address Legacy", "type": "object", + "description": "Profile's personal address information.", "properties": { - "sort_code": { + "city": { "type": "string", - "description": "ELV card sort code.", - "example": "87096214" + "description": "City name from the address.", + "example": "Berlin" }, - "last_4_digits": { + "country": { "type": "string", - "description": "ELV card account number last 4 digits.", - "example": "5674" + "description": "Two letter country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).", + "example": "DE" }, - "sequence_no": { - "type": "integer", - "description": "ELV card sequence number.", - "example": 1 + "line_1": { + "type": "string", + "description": "First line of the address with details of the street name and number.", + "example": "Sample street" }, - "iban": { + "line_2": { "type": "string", - "description": "ELV IBAN.", - "example": "DE60870962140012345674" + "description": "Second line of the address with details of the building, unit, apartment, and floor numbers.", + "example": "ap. 5" + }, + "postal_code": { + "type": "string", + "description": "Postal code from the address.", + "example": "10115" + }, + "state": { + "type": "string", + "description": "State name or abbreviation from the address.", + "example": "Berlin" } } }, - "HostedCheckout": { - "title": "Hosted Checkout", + "Card": { + "title": "Card", "type": "object", - "description": "Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.", + "description": "__Required when payment type is `card`.__ Details of the payment card.", "properties": { - "enabled": { - "type": "boolean", - "description": "Whether the checkout should include a SumUp-hosted payment page.", - "example": true - } + "name": { + "type": "string", + "description": "Name of the cardholder as it appears on the payment card.", + "writeOnly": true, + "example": "FIRSTNAME LASTNAME" + }, + "number": { + "type": "string", + "description": "Number of the payment card (without spaces).", + "writeOnly": true, + "example": "1234567890123456" + }, + "expiry_year": { + "type": "string", + "description": "Two- or four-digit expiration year in `YY` or `YYYY` format.", + "writeOnly": true, + "pattern": "^[0-9]{2}([0-9]{2})?$", + "example": "2030" + }, + "expiry_month": { + "type": "string", + "description": "Two-digit expiration month, from `01` through `12`.", + "writeOnly": true, + "minLength": 2, + "maxLength": 2, + "pattern": "^(0[1-9]|1[0-2])$", + "example": "12" + }, + "cvv": { + "type": "string", + "description": "Three or four-digit card verification value (security code) of the payment card.", + "writeOnly": true, + "maxLength": 4, + "minLength": 3, + "example": "123" + }, + "zip_code": { + "type": "string", + "description": "Required five-digit ZIP code. Applicable only to merchant users in the USA.", + "writeOnly": true, + "maxLength": 5, + "minLength": 5, + "example": "12345" + }, + "type": { + "$ref": "#/components/schemas/CardType" + } + }, + "required": [ + "name", + "number", + "expiry_month", + "expiry_year", + "cvv", + "type" + ] + }, + "CardResponse": { + "title": "Card Response", + "type": "object", + "description": "Details of the payment card.", + "properties": { + "last_4_digits": { + "type": "string", + "description": "Last 4 digits of the payment card number.", + "readOnly": true, + "minLength": 4, + "maxLength": 4, + "example": "3456" + }, + "type": { + "$ref": "#/components/schemas/CardType" + }, + "payment_account_reference": { + "type": "string", + "description": "Payment Account Reference (PAR) defined by [EMVCo](https://www.emvco.com/emv-technologies/payment-tokenisation/). It links a card's primary account number (PAN) with its affiliated payment tokens, allowing transactions made with the physical card and tokenized versions of that card, such as digital wallets, to be correlated when PAR is available.\n\nThis reference cannot be used to initiate a payment and is separate from the saved payment instrument `token` used to process checkouts. Returned only when available for the card; integrations must handle its absence.", + "example": "5665ABCDEFGHIJKLMNOPQRSTUVWXY" + } + } + }, + "Device": { + "title": "Device", + "description": "Details of the device used to create the transaction.", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Device name.", + "example": "m0xx" + }, + "system_name": { + "type": "string", + "description": "Device OS.", + "example": "Android" + }, + "model": { + "type": "string", + "description": "Device model.", + "example": "GT-I9300" + }, + "system_version": { + "type": "string", + "description": "Device OS version.", + "example": "4.3" + }, + "uuid": { + "type": "string", + "description": "Device UUID.", + "example": "3ae2a6b7-fb0d-3b50-adbf-cb7e2db30cd2" + } + } + }, + "ElvCardAccount": { + "title": "ELV Card Account", + "description": "Details of the ELV card account associated with the transaction.", + "type": "object", + "properties": { + "sort_code": { + "type": "string", + "description": "ELV card sort code.", + "example": "87096214" + }, + "last_4_digits": { + "type": "string", + "description": "ELV card account number last 4 digits.", + "example": "5674" + }, + "sequence_no": { + "type": "integer", + "description": "ELV card sequence number.", + "example": 1 + }, + "iban": { + "type": "string", + "description": "ELV IBAN.", + "example": "DE60870962140012345674" + } + } + }, + "HostedCheckout": { + "title": "Hosted Checkout", + "type": "object", + "description": "Hosted Checkout configuration. Enable it to receive a SumUp-hosted payment page URL in the checkout response.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the checkout should include a SumUp-hosted payment page.", + "example": true + } }, "required": [ "enabled" @@ -7750,2511 +8240,4051 @@ "maxLength": 255, "example": "423.378.593-47" }, - "address": { - "$ref": "#/components/schemas/AddressLegacy" + "address": { + "$ref": "#/components/schemas/AddressLegacy" + } + } + }, + "Product": { + "title": "Product", + "type": "object", + "description": "Product details associated with a transaction.", + "properties": { + "name": { + "type": "string", + "description": "Product name.", + "example": "Purchase reader for merchant with code ME3FCAVF" + }, + "price_label": { + "type": "string", + "description": "Human-readable label for the product price.", + "example": "EUR 100.00" + }, + "price": { + "type": "number", + "format": "decimal", + "description": "Product price.", + "example": 100 + }, + "vat_rate": { + "type": "number", + "format": "decimal", + "description": "VAT rate as a decimal fraction, for example `0.19` for 19%.", + "example": 0.19 + }, + "single_vat_amount": { + "type": "number", + "format": "decimal", + "description": "VAT amount for a single product.", + "example": 19 + }, + "price_with_vat": { + "type": "number", + "format": "decimal", + "description": "Product price including VAT.", + "example": 119 + }, + "vat_amount": { + "type": "number", + "format": "decimal", + "description": "Total VAT amount for the product quantity.", + "example": 19 + }, + "quantity": { + "type": "integer", + "description": "Product quantity.", + "example": 1 + }, + "total_price": { + "type": "number", + "format": "decimal", + "description": "Total price calculated as the product price multiplied by the quantity.", + "example": 100 + }, + "total_with_vat": { + "type": "number", + "format": "decimal", + "description": "Total product price including VAT.", + "example": 119 + } + } + }, + "Receipt": { + "type": "object", + "title": "Receipt", + "description": "Structured receipt details for a transaction. The transaction's `amount`, `vat_amount`, and `tip_amount`, as well as event amounts, are returned as decimal strings in major currency units, for example `\"10.10\"` for EUR 10.10.", + "properties": { + "transaction_data": { + "$ref": "#/components/schemas/ReceiptTransaction" + }, + "merchant_data": { + "$ref": "#/components/schemas/ReceiptMerchantData" + }, + "emv_data": { + "type": "object", + "description": "EMV-specific metadata returned for card-present payments.", + "example": {} + }, + "acquirer_data": { + "type": "object", + "description": "Acquirer-specific metadata related to the card authorization.", + "example": { + "authorization_code": "053201", + "return_code": "00" + }, + "properties": { + "tid": { + "type": "string", + "description": "Identifier of the terminal used for the authorization.", + "example": "12345678" + }, + "authorization_code": { + "type": "string", + "description": "Authorization code returned by the acquirer.", + "example": "053201" + }, + "return_code": { + "type": "string", + "description": "Return code reported by the acquirer.", + "example": "00" + }, + "local_time": { + "type": "string", + "description": "Local timestamp of the card authorization.", + "example": "2020-02-29T11:56:56+01:00" + } + } + } + } + }, + "ReceiptEvent": { + "title": "Receipt Event", + "description": "Transaction event details as rendered on the receipt.", + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/TransactionEventID" + }, + "transaction_id": { + "$ref": "#/components/schemas/TransactionID" + }, + "type": { + "$ref": "#/components/schemas/TransactionEventType" + }, + "status": { + "$ref": "#/components/schemas/TransactionEventStatus" + }, + "amount": { + "type": "string", + "format": "double", + "description": "Amount associated with the transaction event, in major units.", + "example": "10.10" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of when the transaction event occurred.", + "example": "2020-05-25T10:49:42.784Z" + }, + "receipt_no": { + "type": "string", + "description": "Receipt number associated with the event.", + "example": "123456" + } + } + }, + "ReceiptCard": { + "title": "Receipt Card", + "description": "Payment card details displayed on the receipt.", + "type": "object", + "properties": { + "last_4_digits": { + "type": "string", + "description": "Last four digits of the payment card number.", + "example": "3456" + }, + "type": { + "type": "string", + "description": "Issuing card network of the payment card.", + "example": "VISA" + } + } + }, + "ReceiptReader": { + "title": "Receipt Reader", + "description": "Card reader details displayed on the receipt.", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique identifier of the physical card reader.", + "example": "U1DT3NA00-CN" + }, + "type": { + "type": "string", + "description": "Model of the physical card reader.", + "example": "solo" + } + } + }, + "ReceiptMerchantData": { + "title": "Receipt Merchant Data", + "type": "object", + "description": "Merchant details displayed on a transaction receipt.", + "properties": { + "merchant_profile": { + "type": "object", + "description": "Merchant profile details displayed on the receipt.", + "properties": { + "merchant_code": { + "type": "string", + "description": "Short unique identifier for the merchant.", + "example": "MH4H92C7" + }, + "business_name": { + "type": "string", + "description": "Business name of the merchant.", + "example": "Coffee House" + }, + "company_registration_number": { + "type": "string", + "description": "Company registration number of the merchant.", + "example": "HRB 123456" + }, + "vat_id": { + "type": "string", + "description": "VAT identification number of the merchant.", + "example": "DE123456789" + }, + "website": { + "type": "string", + "description": "Website of the merchant.", + "example": "https://example.com" + }, + "email": { + "type": "string", + "description": "Email address of the merchant.", + "example": "merchant@example.com" + }, + "language": { + "type": "string", + "description": "Language configured for the merchant profile.", + "example": "de" + }, + "address": { + "type": "object", + "description": "Business address of the merchant.", + "properties": { + "address_line1": { + "type": "string", + "description": "First line of the merchant address.", + "example": "Sample street 1" + }, + "address_line2": { + "type": "string", + "description": "Second line of the merchant address.", + "example": "Floor 2" + }, + "city": { + "type": "string", + "description": "City of the merchant address.", + "example": "Berlin" + }, + "country": { + "type": "string", + "description": "Two-letter ISO 3166-1 alpha-2 country code of the merchant address.", + "example": "DE" + }, + "country_en_name": { + "type": "string", + "description": "English name of the country in the merchant address.", + "example": "Germany" + }, + "country_native_name": { + "type": "string", + "description": "Localized name of the country in the merchant address.", + "example": "Deutschland" + }, + "region_name": { + "type": "string", + "description": "Region or state of the merchant address.", + "example": "Berlin" + }, + "post_code": { + "type": "string", + "description": "Postal code of the merchant address.", + "example": "10115" + }, + "landline": { + "type": "string", + "description": "Landline phone number of the merchant.", + "example": "+493012345678" + } + } + } + } + }, + "locale": { + "type": "string", + "description": "Locale used for rendering localized receipt fields.", + "example": "de-DE" + } + } + }, + "ReceiptTransaction": { + "title": "Receipt Transaction", + "type": "object", + "description": "Transaction details displayed on a receipt.", + "example": { + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "merchant_code": "MH4H92C7", + "amount": "10.10", + "vat_amount": "6.00", + "tip_amount": "3.00", + "currency": "EUR", + "timestamp": "2020-02-29T10:56:56.876Z", + "status": "SUCCESSFUL", + "payment_type": "ECOM", + "entry_mode": "CUSTOMER_ENTRY", + "installments_count": 1, + "process_as": "CREDIT" + }, + "properties": { + "transaction_code": { + "type": "string", + "description": "Transaction code returned after processing the transaction.", + "example": "TEENSK4W2K" + }, + "transaction_id": { + "$ref": "#/components/schemas/TransactionID" + }, + "merchant_code": { + "type": "string", + "description": "Short unique identifier for the merchant.", + "example": "MH4H92C7" + }, + "amount": { + "type": "string", + "description": "Total transaction amount, in major units.", + "example": "10.10" + }, + "vat_amount": { + "type": "string", + "description": "VAT included in the transaction amount, in major units.", + "example": "6.00" + }, + "tip_amount": { + "type": "string", + "description": "Tip included in the transaction amount, in major units.", + "example": "3.00" + }, + "currency": { + "type": "string", + "description": "Three-letter ISO 4217 currency code of the transaction.", + "example": "EUR" + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of when the transaction was created.", + "example": "2020-02-29T10:56:56.876Z" + }, + "status": { + "type": "string", + "description": "Current processing status of the transaction.", + "example": "SUCCESSFUL" + }, + "payment_type": { + "type": "string", + "description": "Payment type used for the transaction.", + "example": "ECOM" + }, + "entry_mode": { + "type": "string", + "description": "Entry mode of the payment details.", + "example": "CUSTOMER_ENTRY" + }, + "verification_method": { + "type": "string", + "description": "Cardholder verification method.", + "example": "none" + }, + "card_reader": { + "$ref": "#/components/schemas/ReceiptReader" + }, + "card": { + "$ref": "#/components/schemas/ReceiptCard" + }, + "installments_count": { + "type": "integer", + "description": "Number of installments.", + "example": 1 + }, + "process_as": { + "type": "string", + "description": "Whether the transaction was processed as credit or debit.", + "enum": [ + "CREDIT", + "DEBIT" + ], + "example": "CREDIT" + }, + "products": { + "type": "array", + "description": "Products associated with the transaction.", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Product name.", + "example": "Coffee" + }, + "description": { + "type": "string", + "description": "Product description.", + "example": "Cappuccino" + }, + "price": { + "type": "string", + "format": "double", + "description": "Product price.", + "example": "150.0" + }, + "vat_rate": { + "type": "string", + "format": "double", + "description": "VAT rate.", + "example": "0.0" + }, + "single_vat_amount": { + "type": "string", + "format": "double", + "description": "VAT amount for a single product.", + "example": "0.0" + }, + "price_with_vat": { + "type": "string", + "format": "double", + "description": "Product price including VAT.", + "example": "150.0" + }, + "vat_amount": { + "type": "string", + "format": "double", + "description": "Total VAT amount for the product quantity.", + "example": "0.0" + }, + "quantity": { + "type": "integer", + "format": "int64", + "description": "Product quantity.", + "example": 1 + }, + "total_price": { + "type": "string", + "format": "double", + "description": "Total price calculated as the product price multiplied by the quantity.", + "example": "150.0" + }, + "total_with_vat": { + "type": "string", + "format": "double", + "description": "Total product price including VAT.", + "example": "150.0" + } + } + } + }, + "vat_rates": { + "type": "array", + "description": "VAT breakdown for the transaction.", + "items": { + "type": "object", + "properties": { + "gross": { + "type": "number", + "format": "float", + "description": "Gross amount to which the VAT rate applies.", + "example": 10.1 + }, + "net": { + "type": "number", + "format": "float", + "description": "Net amount to which the VAT rate applies.", + "example": 8.49 + }, + "rate": { + "type": "number", + "format": "float", + "description": "VAT rate applied to the transaction amount.", + "example": 0.19 + }, + "vat": { + "type": "number", + "format": "float", + "description": "VAT amount included in the gross amount.", + "example": 1.61 + } + } + } + }, + "events": { + "type": "array", + "description": "Transaction events displayed on the receipt.", + "items": { + "$ref": "#/components/schemas/ReceiptEvent" + } + }, + "receipt_no": { + "type": "string", + "description": "Receipt number associated with the transaction.", + "example": "123456" + } + } + }, + "TransactionEvent": { + "title": "Transaction Event", + "type": "object", + "description": "Detailed information about a transaction event.", + "properties": { + "id": { + "$ref": "#/components/schemas/TransactionEventID" + }, + "event_type": { + "$ref": "#/components/schemas/TransactionEventType" + }, + "status": { + "$ref": "#/components/schemas/TransactionEventStatus" + }, + "amount": { + "type": "number", + "format": "decimal", + "description": "Amount of the event in major units of the associated transaction's currency.", + "example": 58.8 + }, + "due_date": { + "type": "string", + "format": "date", + "description": "Date when the transaction event is due to occur.", + "example": "2020-05-25" + }, + "date": { + "type": "string", + "format": "date", + "description": "Date when the transaction event occurred.", + "example": "2020-05-25" + }, + "installment_number": { + "type": "integer", + "description": "Consecutive number of the installment that is paid. Applicable only to payout events, i.e. `event_type = PAYOUT`.", + "example": 1 + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "Date and time of the transaction event.", + "example": "2020-05-25T10:49:42.784Z" + } + } + }, + "TransactionBase": { + "title": "Transaction Base", + "type": "object", + "description": "Core details shared by transaction resources.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the transaction.", + "example": "6b425463-3e1b-431d-83fa-1e51c2925e99" + }, + "transaction_code": { + "type": "string", + "description": "SumUp transaction code, for example `TEENSK4W2K`. Use it to look up the transaction with the `transaction_code` query parameter. This is separate from the transaction's `id` and the card issuer's `auth_code`.", + "example": "TEENSK4W2K" + }, + "amount": { + "type": "number", + "format": "float", + "description": "Total amount of the transaction in major units of `currency`, for example `10.1` for EUR 10.10.", + "example": 10.1 + }, + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "timestamp": { + "type": "string", + "example": "2020-02-29T10:56:56.876Z", + "format": "date-time", + "description": "The timestamp of when the transaction was created." + }, + "status": { + "$ref": "#/components/schemas/TransactionStatus" + }, + "payment_type": { + "$ref": "#/components/schemas/PaymentType" + }, + "installments_count": { + "type": "integer", + "description": "Number of installments for a deferred payment.", + "minimum": 1, + "example": 1 + } + } + }, + "TransactionCheckoutInfo": { + "title": "Transaction Checkout Info", + "description": "Checkout-specific fields associated with a transaction.", + "type": "object", + "properties": { + "merchant_code": { + "type": "string", + "description": "Unique code of the registered merchant to whom the payment is made.", + "example": "MH4H92C7" + }, + "vat_amount": { + "type": "number", + "format": "float", + "description": "VAT included in the total transaction amount, in major units of the transaction's currency.", + "example": 6 + }, + "tip_amount": { + "type": "number", + "format": "float", + "description": "Tip included in the total transaction amount, in major units of the transaction's currency.", + "example": 3 + }, + "entry_mode": { + "$ref": "#/components/schemas/EntryMode" + }, + "auth_code": { + "type": "string", + "description": "Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.", + "example": "053201" + } + } + }, + "TransactionMixinHistory": { + "title": "Transaction Mixin History", + "description": "Additional transaction fields used by history and detailed views.", + "type": "object", + "properties": { + "product_summary": { + "type": "string", + "description": "Short description of the payment. The value is taken from the `description` property of the related checkout resource.", + "example": "Purchase" + }, + "payouts_total": { + "type": "integer", + "description": "Total number of payouts to the registered user specified in the `user` property.", + "example": 1 + }, + "payouts_received": { + "type": "integer", + "description": "Number of payouts that are made to the registered user specified in the `user` property.", + "example": 1 + }, + "payout_plan": { + "type": "string", + "description": "Payout plan of the registered user at the time when the transaction was made.", + "enum": [ + "SINGLE_PAYMENT", + "TRUE_INSTALLMENT", + "ACCELERATED_INSTALLMENT" + ], + "example": "SINGLE_PAYMENT" + } + } + }, + "TransactionHistory": { + "title": "Transaction History", + "description": "Transaction entry returned in history listing responses.", + "allOf": [ + { + "$ref": "#/components/schemas/TransactionBase" + }, + { + "$ref": "#/components/schemas/TransactionMixinHistory" + }, + { + "type": "object", + "properties": { + "transaction_id": { + "$ref": "#/components/schemas/TransactionID" + }, + "client_transaction_id": { + "type": "string", + "description": "Client-supplied identifier of the transaction.", + "example": "urn:sumup:pos:sale:MNKKNGST:1D4E3B2D-111D-48D7-9AF0-832DAEF63DD7;2" + }, + "user": { + "type": "string", + "format": "email", + "description": "Email address of the registered user (merchant) to whom the payment is made.", + "example": "merchant@example.com" + }, + "type": { + "type": "string", + "description": "Type of the transaction for the registered user specified in the `user` property.", + "enum": [ + "PAYMENT", + "REFUND", + "CHARGE_BACK" + ], + "example": "PAYMENT" + }, + "card_type": { + "$ref": "#/components/schemas/CardType" + }, + "payout_date": { + "type": "string", + "format": "date", + "description": "Payout date (if paid out at once).", + "example": "2019-08-28" + }, + "payout_type": { + "type": "string", + "description": "Payout type.", + "enum": [ + "BANK_ACCOUNT", + "PREPAID_CARD" + ], + "example": "BANK_ACCOUNT" + }, + "refunded_amount": { + "type": "number", + "format": "decimal", + "description": "Total amount refunded for this transaction, in major units of the transaction's currency.", + "example": 0 + } + } + } + ] + }, + "PaymentType": { + "title": "Payment Type", + "type": "string", + "description": "Payment category recorded on a transaction, for example `POS` for a point-of-sale card payment, `ECOM` for an online card payment, or `RECURRING` for a recurring card payment. These reporting values are separate from the lowercase `payment_type` values used to process checkouts.", + "enum": [ + "CASH", + "POS", + "ECOM", + "RECURRING", + "BITCOIN", + "BALANCE", + "MOTO", + "BOLETO", + "DIRECT_DEBIT", + "APM", + "UNKNOWN" + ], + "example": "ECOM" + }, + "EntryMode": { + "title": "Entry Mode", + "type": "string", + "description": "How the payment details were captured, for example `CHIP` or `CONTACTLESS` for card-present payments and `CUSTOMER_ENTRY` for card details entered by the payer. For wallet and alternative payment methods, this can identify the method, such as `APPLE_PAY` or `BLIK`.", + "enum": [ + "BOLETO", + "SOFORT", + "IDEAL", + "BANCONTACT", + "EPS", + "MYBANK", + "SATISPAY", + "BLIK", + "P24", + "GIROPAY", + "PIX", + "QR_CODE_PIX", + "APPLE_PAY", + "GOOGLE_PAY", + "PAYPAL", + "TWINT", + "NONE", + "CHIP", + "MANUAL_ENTRY", + "CUSTOMER_ENTRY", + "MAGSTRIPE_FALLBACK", + "MAGSTRIPE", + "DIRECT_DEBIT", + "CONTACTLESS", + "MOTO", + "CONTACTLESS_MAGSTRIPE", + "N/A" + ], + "example": "CUSTOMER_ENTRY" + }, + "CardType": { + "title": "Card Type", + "type": "string", + "description": "Issuing card network of the payment card used for the transaction.", + "enum": [ + "ALELO", + "AMEX", + "BANCOMAT", + "CONECS", + "CUP", + "DINERS", + "DISCOVER", + "EFTPOS", + "ELO", + "ELV", + "GIROCARD", + "HIPERCARD", + "INTERAC", + "JCB", + "MAESTRO", + "MASTERCARD", + "PLUXEE", + "SUMUP", + "SWILE", + "TICKET", + "VISA", + "VISA_ELECTRON", + "VISA_VPAY", + "VPAY", + "VR", + "UNKNOWN" + ], + "example": "VISA" + }, + "TransactionFull": { + "title": "Transaction Full", + "description": "Full transaction resource with checkout, payout, and event details.", + "allOf": [ + { + "$ref": "#/components/schemas/TransactionBase" + }, + { + "$ref": "#/components/schemas/TransactionCheckoutInfo" + }, + { + "$ref": "#/components/schemas/TransactionMixinHistory" + }, + { + "type": "object", + "properties": { + "foreign_transaction_id": { + "type": "string", + "description": "External transaction identifier supplied by the client.", + "example": "J13253253x1" + }, + "client_transaction_id": { + "type": "string", + "description": "Client-supplied identifier of the transaction.", + "example": "urn:sumup:pos:sale:MNKKNGST:1D4E3B2D-111D-48D7-9AF0-832DAEF63DD7;2" + }, + "username": { + "type": "string", + "format": "email", + "description": "Email address of the registered user (merchant) to whom the payment is made.", + "example": "merchant@example.com" + }, + "fee_amount": { + "type": "number", + "format": "decimal", + "description": "Total SumUp transaction fee in major units of the transaction's currency.", + "example": 8 + }, + "lat": { + "$ref": "#/components/schemas/Lat" + }, + "lon": { + "$ref": "#/components/schemas/Lon" + }, + "horizontal_accuracy": { + "$ref": "#/components/schemas/HorizontalAccuracy" + }, + "merchant_id": { + "type": "integer", + "format": "int64", + "description": "Internal SumUp identifier of the merchant.", + "example": 136902 + }, + "device_info": { + "$ref": "#/components/schemas/Device" + }, + "simple_payment_type": { + "type": "string", + "description": "Simple name of the payment type.", + "enum": [ + "CASH", + "CC_SIGNATURE", + "ELV", + "ELV_WITHOUT_SIGNATURE", + "CC_CUSTOMER_ENTERED", + "MANUAL_ENTRY", + "EMV", + "RECURRING", + "BALANCE", + "MOTO", + "BOLETO", + "APM", + "BITCOIN", + "CARD" + ], + "example": "CARD" + }, + "verification_method": { + "type": "string", + "description": "Verification method used for the transaction.", + "enum": [ + "none", + "signature", + "offline PIN", + "online PIN", + "offline PIN + signature", + "na" + ], + "example": "none" + }, + "card": { + "$ref": "#/components/schemas/CardResponse" + }, + "elv_account": { + "$ref": "#/components/schemas/ElvCardAccount" + }, + "local_time": { + "type": "string", + "format": "date-time", + "description": "Local timestamp of when the transaction was created.", + "example": "2020-02-29T11:56:56+01:00" + }, + "payout_date": { + "type": "string", + "format": "date", + "description": "The date of the payout.", + "example": "2019-08-28" + }, + "payout_type": { + "type": "string", + "description": "Payout type for the transaction.", + "enum": [ + "BANK_ACCOUNT", + "PREPAID_CARD" + ], + "example": "BANK_ACCOUNT" + }, + "process_as": { + "type": "string", + "description": "Whether the transaction was processed as credit or debit.", + "enum": [ + "CREDIT", + "DEBIT" + ], + "example": "CREDIT" + }, + "products": { + "type": "array", + "description": "List of products from the merchant's catalogue for which the transaction serves as a payment.", + "items": { + "$ref": "#/components/schemas/Product" + } + }, + "vat_rates": { + "type": "array", + "description": "List of VAT rates applicable to the transaction.", + "items": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "format": "decimal", + "description": "VAT rate.", + "example": 0.045 + }, + "net": { + "type": "number", + "format": "decimal", + "description": "NET amount of products having this VAT rate applied.", + "example": 1.36 + }, + "vat": { + "type": "number", + "format": "decimal", + "description": "VAT amount of this rate applied.", + "example": 0.06 + }, + "gross": { + "type": "number", + "format": "decimal", + "description": "Gross amount of products having this VAT rate applied.", + "example": 1.42 + } + } + } + }, + "transaction_events": { + "type": "array", + "description": "Detailed list of events related to the transaction.", + "items": { + "$ref": "#/components/schemas/TransactionEvent" + } + }, + "simple_status": { + "type": "string", + "description": "High-level status of the transaction from the merchant's perspective.\n\n- `PENDING`: The payment has been initiated and is still being processed. A final outcome is not available yet.\n- `SUCCESSFUL`: The payment was completed successfully.\n- `PAID_OUT`: The payment was completed successfully and the funds have already been included in a payout to the merchant.\n- `FAILED`: The payment did not complete successfully.\n- `CANCELLED`: The payment was cancelled or reversed and is no longer payable or payable to the merchant.\n- `CANCEL_FAILED`: An attempt to cancel or reverse the payment was not completed successfully.\n- `REFUNDED`: The payment was refunded in full or in part.\n- `REFUND_FAILED`: An attempt to refund the payment was not completed successfully.\n- `CHARGEBACK`: The payment was subject to a chargeback.\n- `NON_COLLECTION`: The amount could not be collected from the merchant after a chargeback or related adjustment.", + "enum": [ + "SUCCESSFUL", + "PAID_OUT", + "CANCEL_FAILED", + "CANCELLED", + "CHARGEBACK", + "FAILED", + "REFUND_FAILED", + "REFUNDED", + "NON_COLLECTION", + "PENDING" + ], + "example": "SUCCESSFUL" + }, + "links": { + "type": "array", + "description": "List of hyperlinks for accessing related resources.", + "items": { + "$ref": "#/components/schemas/Link" + } + }, + "events": { + "type": "array", + "description": "Compact list of events related to the transaction.", + "items": { + "$ref": "#/components/schemas/Event" + } + }, + "location": { + "type": "object", + "description": "Details of the payment location as received from the payment terminal.", + "properties": { + "lat": { + "$ref": "#/components/schemas/Lat" + }, + "lon": { + "$ref": "#/components/schemas/Lon" + }, + "horizontal_accuracy": { + "$ref": "#/components/schemas/HorizontalAccuracy" + } + } + }, + "tax_enabled": { + "type": "boolean", + "description": "Indicates whether tax deduction is enabled for the transaction.", + "example": true + } + } + } + ] + }, + "Currency": { + "title": "Currency", + "type": "string", + "description": "Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the amount.", + "enum": [ + "BRL", + "CHF", + "CLP", + "COP", + "CZK", + "DKK", + "EUR", + "GBP", + "HRK", + "HUF", + "NOK", + "PLN", + "RON", + "SEK", + "USD" + ], + "example": "EUR" + }, + "TransactionStatus": { + "title": "Transaction Status", + "type": "string", + "description": "Current status of the transaction.\n\n- `PENDING`: The transaction has been created but its final outcome is not known yet.\n- `SUCCESSFUL`: The transaction completed successfully.\n- `CANCELLED`: The transaction was cancelled or otherwise reversed before completion.\n- `FAILED`: The transaction attempt did not complete successfully.\n- `REFUNDED`: The transaction was refunded in full or in part.", + "enum": [ + "SUCCESSFUL", + "CANCELLED", + "FAILED", + "PENDING", + "REFUNDED" + ], + "example": "SUCCESSFUL" + }, + "TransactionEventType": { + "title": "Transaction Event Type", + "type": "string", + "description": "Financial event associated with a transaction.\n\n- `PAYOUT`: Funds from the transaction being prepared for or included in a merchant payout. Check the event status to determine whether they have been paid out.\n- `REFUND`: Money returned to the payer.\n- `CHARGE_BACK`: A reversal of the payment following a chargeback.\n- `PAYOUT_DEDUCTION`: An amount deducted from a merchant payout, for example to cover a refund or chargeback.", + "enum": [ + "PAYOUT", + "CHARGE_BACK", + "REFUND", + "PAYOUT_DEDUCTION" + ], + "example": "REFUND" + }, + "TransactionEventStatus": { + "title": "Transaction Event Status", + "type": "string", + "description": "Status of the transaction event.\n\nNot every value is used for every event type.\n\n- `PENDING`: The event has been created but is not final yet. Used for events that are still being processed and whose final outcome is not known yet.\n- `SCHEDULED`: The event is planned for a future payout cycle but has not been executed yet. This applies to payout events before money is actually sent out.\n- `RECONCILED`: The underlying payment has been matched with settlement data and is ready to continue through payout processing, but the funds have not been paid out yet. This applies to payout events.\n- `PAID_OUT`: The payout event has been completed and the funds were included in a merchant payout.\n- `REFUNDED`: A refund event has been accepted and recorded in the refund flow. This is the status returned for refund events once the transaction amount is being or has been returned to the payer.\n- `SUCCESSFUL`: The event completed successfully. Use this as the generic terminal success status for event types that do not expose a more specific business outcome such as `PAID_OUT` or `REFUNDED`.\n- `FAILED`: The event could not be completed. Typical examples are a payout that could not be executed or an event that was rejected during processing.", + "enum": [ + "FAILED", + "PAID_OUT", + "PENDING", + "RECONCILED", + "REFUNDED", + "SCHEDULED", + "SUCCESSFUL" + ], + "example": "SUCCESSFUL" + }, + "TransactionEventID": { + "title": "Transaction Event ID", + "type": "integer", + "format": "int64", + "description": "Numeric identifier of a transaction event. Use it as `tx_event_id` when requesting receipt details for a specific event. This is separate from the transaction ID and the transaction history pagination references.", + "example": 9567461191 + }, + "HorizontalAccuracy": { + "title": "Horizontal Accuracy", + "type": "number", + "format": "float", + "description": "Indication of the precision of the geographical position received from the payment terminal.", + "example": 5 + }, + "Lat": { + "title": "Latitude", + "type": "number", + "format": "float", + "description": "Latitude value from the coordinates of the payment location (as received from the payment terminal reader).", + "minimum": -90, + "maximum": 90, + "example": 52.520008 + }, + "Lon": { + "title": "Longitude", + "type": "number", + "format": "float", + "description": "Longitude value from the coordinates of the payment location (as received from the payment terminal reader).", + "minimum": -180, + "maximum": 180, + "example": 13.404954 + }, + "TransactionID": { + "title": "Transaction ID", + "type": "string", + "description": "Unique identifier of the transaction.", + "example": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + }, + "Affiliate": { + "properties": { + "app_id": { + "example": "com.example.app", + "type": "string" + }, + "key": { + "example": "123e4567-e89b-12d3-a456-426614174000", + "type": "string" } - } + }, + "required": [ + "app_id", + "key" + ], + "type": "object" }, - "Product": { - "title": "Product", - "type": "object", - "description": "Product details associated with a transaction.", + "Amount": { "properties": { - "name": { - "type": "string", - "description": "Product name.", - "example": "Purchase reader for merchant with code ME3FCAVF" - }, - "price_label": { - "type": "string", - "description": "Human-readable label for the product price.", - "example": "EUR 100.00" - }, - "price": { - "type": "number", - "format": "decimal", - "description": "Product price.", - "example": 100 - }, - "vat_rate": { - "type": "number", - "format": "decimal", - "description": "VAT rate as a decimal fraction, for example `0.19` for 19%.", - "example": 0.19 - }, - "single_vat_amount": { - "type": "number", - "format": "decimal", - "description": "VAT amount for a single product.", - "example": 19 - }, - "price_with_vat": { - "type": "number", - "format": "decimal", - "description": "Product price including VAT.", - "example": 119 - }, - "vat_amount": { - "type": "number", - "format": "decimal", - "description": "Total VAT amount for the product quantity.", - "example": 19 - }, - "quantity": { - "type": "integer", - "description": "Product quantity.", - "example": 1 - }, - "total_price": { - "type": "number", - "format": "decimal", - "description": "Total price calculated as the product price multiplied by the quantity.", - "example": 100 + "currency": { + "description": "Currency ISO 4217 code", + "example": "MXN", + "type": "string" }, - "total_with_vat": { - "type": "number", - "format": "decimal", - "description": "Total product price including VAT.", - "example": 119 + "value": { + "description": "Amount in minor units (e.g. cents).", + "example": 1000, + "type": "integer" } - } + }, + "required": [ + "currency", + "value" + ], + "type": "object" }, - "Receipt": { - "type": "object", - "title": "Receipt", - "description": "Structured receipt details for a transaction. The transaction's `amount`, `vat_amount`, and `tip_amount`, as well as event amounts, are returned as decimal strings in major currency units, for example `\"10.10\"` for EUR 10.10.", + "ReaderID": { + "type": "string", + "description": "Unique identifier of the reader that the payment is initiated on.", + "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", + "minLength": 30, + "maxLength": 30 + }, + "ReaderPaymentRequestParams": { "properties": { - "transaction_data": { - "$ref": "#/components/schemas/ReceiptTransaction" + "affiliate": { + "allOf": [ + { + "description": "Optional caller-supplied context about the integration initiating the payment.", + "type": "object" + }, + { + "$ref": "#/components/schemas/Affiliate" + } + ] }, - "merchant_data": { - "$ref": "#/components/schemas/ReceiptMerchantData" + "client_transaction_id": { + "description": "Caller-supplied correlation identifier, used as the idempotency key.", + "example": "19e12390-72cf-4f9f-80b5-b0c8a67fa43f", + "type": "string" }, - "emv_data": { - "type": "object", - "description": "EMV-specific metadata returned for card-present payments.", - "example": {} + "tip_amount": { + "description": "Portion of total_amount that is a tip, in minor units.", + "example": 200, + "type": "integer" }, - "acquirer_data": { - "type": "object", - "description": "Acquirer-specific metadata related to the card authorization.", - "example": { - "authorization_code": "053201", - "return_code": "00" - }, - "properties": { - "tid": { - "type": "string", - "description": "Identifier of the terminal used for the authorization.", - "example": "12345678" - }, - "authorization_code": { - "type": "string", - "description": "Authorization code returned by the acquirer.", - "example": "053201" - }, - "return_code": { - "type": "string", - "description": "Return code reported by the acquirer.", - "example": "00" + "total_amount": { + "allOf": [ + { + "description": "Amount charged on the reader, including any tip. The amount is represented as an integer value altogether with the currency and the minor unit. For example, MXN 10.00 is represented as value 1000 with minor unit of 2.", + "example": { + "currency": "MXN", + "value": 1000 + } }, - "local_time": { - "type": "string", - "description": "Local timestamp of the card authorization.", - "example": "2020-02-29T11:56:56+01:00" + { + "$ref": "#/components/schemas/Amount" } - } + ] } - } + }, + "required": [ + "total_amount", + "client_transaction_id" + ], + "type": "object" }, - "ReceiptEvent": { - "title": "Receipt Event", - "description": "Transaction event details as rendered on the receipt.", + "ReaderPaymentResponse": { + "properties": { + "data": { + "$ref": "#/components/schemas/ReaderPaymentResponseData" + } + }, + "type": "object" + }, + "ReaderPaymentResponseData": { + "properties": { + "client_transaction_id": { + "description": "Caller-supplied correlation identifier that was provided in the request.", + "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "type": "string" + }, + "transaction_code": { + "description": "Transaction code returned by the acquirer/processing entity after processing the transaction.", + "example": "TEENSK4W2K", + "type": "string" + } + }, + "type": "object" + }, + "MembershipStatus": { + "type": "string", + "description": "The status of the membership.", + "enum": [ + "accepted", + "pending", + "expired", + "disabled", + "unknown" + ] + }, + "ResourceType": { + "type": "string", + "description": "The type of the membership resource.\nPossible values are:\n* `merchant` - merchant account(s)\n* `organization` - organization(s)", + "example": "merchant" + }, + "Membership": { + "title": "Membership", "type": "object", + "description": "A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.", + "required": [ + "id", + "resource_id", + "type", + "roles", + "permissions", + "created_at", + "updated_at", + "status", + "resource" + ], "properties": { "id": { - "$ref": "#/components/schemas/TransactionEventID" + "type": "string", + "description": "ID of the membership.", + "example": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" }, - "transaction_id": { - "$ref": "#/components/schemas/TransactionID" + "resource_id": { + "type": "string", + "description": "ID of the resource the membership is in.", + "example": "M2DDT39A" }, "type": { - "$ref": "#/components/schemas/TransactionEventType" + "$ref": "#/components/schemas/ResourceType" + }, + "roles": { + "type": "array", + "description": "User's roles.", + "example": [ + "role_admin" + ], + "items": { + "type": "string" + } }, - "status": { - "$ref": "#/components/schemas/TransactionEventStatus" + "permissions": { + "type": "array", + "description": "User's permissions.", + "deprecated": true, + "x-deprecation-notice": "Permissions include only legacy permissions, please use roles instead. Member access is based on their roles within a given resource and the permissions these roles grant.", + "items": { + "type": "string" + }, + "example": [ + "members_read", + "members_write", + "create_moto_payments", + "full_transaction_history_view", + "refund_transactions", + "create_referral", + "developer_settings_edit", + "developer_settings_access" + ] }, - "amount": { + "created_at": { "type": "string", - "format": "double", - "description": "Amount associated with the transaction event, in major units.", - "example": "10.10" + "description": "The timestamp of when the membership was created.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" }, - "timestamp": { + "updated_at": { "type": "string", + "description": "The timestamp of when the membership was last updated.", "format": "date-time", - "description": "The timestamp of when the transaction event occurred.", - "example": "2020-05-25T10:49:42.784Z" + "example": "2023-01-20T15:16:17Z" }, - "receipt_no": { - "type": "string", - "description": "Receipt number associated with the event.", - "example": "123456" - } - } - }, - "ReceiptCard": { - "title": "Receipt Card", - "description": "Payment card details displayed on the receipt.", - "type": "object", - "properties": { - "last_4_digits": { - "type": "string", - "description": "Last four digits of the payment card number.", - "example": "3456" + "invite": { + "$ref": "#/components/schemas/Invite" }, - "type": { - "type": "string", - "description": "Issuing card network of the payment card.", - "example": "VISA" - } - } - }, - "ReceiptReader": { - "title": "Receipt Reader", - "description": "Card reader details displayed on the receipt.", - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique identifier of the physical card reader.", - "example": "U1DT3NA00-CN" + "status": { + "$ref": "#/components/schemas/MembershipStatus" }, - "type": { - "type": "string", - "description": "Model of the physical card reader.", - "example": "solo" - } - } - }, - "ReceiptMerchantData": { - "title": "Receipt Merchant Data", - "type": "object", - "description": "Merchant details displayed on a transaction receipt.", - "properties": { - "merchant_profile": { - "type": "object", - "description": "Merchant profile details displayed on the receipt.", - "properties": { - "merchant_code": { - "type": "string", - "description": "Short unique identifier for the merchant.", - "example": "MH4H92C7" - }, - "business_name": { - "type": "string", - "description": "Business name of the merchant.", - "example": "Coffee House" - }, - "company_registration_number": { - "type": "string", - "description": "Company registration number of the merchant.", - "example": "HRB 123456" - }, - "vat_id": { - "type": "string", - "description": "VAT identification number of the merchant.", - "example": "DE123456789" - }, - "website": { - "type": "string", - "description": "Website of the merchant.", - "example": "https://example.com" - }, - "email": { - "type": "string", - "description": "Email address of the merchant.", - "example": "merchant@example.com" - }, - "language": { - "type": "string", - "description": "Language configured for the merchant profile.", - "example": "de" - }, - "address": { - "type": "object", - "description": "Business address of the merchant.", - "properties": { - "address_line1": { - "type": "string", - "description": "First line of the merchant address.", - "example": "Sample street 1" - }, - "address_line2": { - "type": "string", - "description": "Second line of the merchant address.", - "example": "Floor 2" - }, - "city": { - "type": "string", - "description": "City of the merchant address.", - "example": "Berlin" - }, - "country": { - "type": "string", - "description": "Two-letter ISO 3166-1 alpha-2 country code of the merchant address.", - "example": "DE" - }, - "country_en_name": { - "type": "string", - "description": "English name of the country in the merchant address.", - "example": "Germany" - }, - "country_native_name": { - "type": "string", - "description": "Localized name of the country in the merchant address.", - "example": "Deutschland" - }, - "region_name": { - "type": "string", - "description": "Region or state of the merchant address.", - "example": "Berlin" - }, - "post_code": { - "type": "string", - "description": "Postal code of the merchant address.", - "example": "10115" - }, - "landline": { - "type": "string", - "description": "Landline phone number of the merchant.", - "example": "+493012345678" - } - } - } - } + "metadata": { + "$ref": "#/components/schemas/Metadata" }, - "locale": { - "type": "string", - "description": "Locale used for rendering localized receipt fields.", - "example": "de-DE" + "attributes": { + "$ref": "#/components/schemas/Attributes" + }, + "resource": { + "$ref": "#/components/schemas/MembershipResource" } } }, - "ReceiptTransaction": { - "title": "Receipt Transaction", + "MembershipResource": { + "title": "Resource", "type": "object", - "description": "Transaction details displayed on a receipt.", - "example": { - "transaction_code": "TEENSK4W2K", - "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", - "merchant_code": "MH4H92C7", - "amount": "10.10", - "vat_amount": "6.00", - "tip_amount": "3.00", - "currency": "EUR", - "timestamp": "2020-02-29T10:56:56.876Z", - "status": "SUCCESSFUL", - "payment_type": "ECOM", - "entry_mode": "CUSTOMER_ENTRY", - "installments_count": 1, - "process_as": "CREDIT" - }, + "description": "Information about the resource the membership is in.", + "required": [ + "id", + "type", + "name", + "created_at", + "updated_at" + ], "properties": { - "transaction_code": { - "type": "string", - "description": "Transaction code returned after processing the transaction.", - "example": "TEENSK4W2K" - }, - "transaction_id": { - "$ref": "#/components/schemas/TransactionID" - }, - "merchant_code": { + "id": { "type": "string", - "description": "Short unique identifier for the merchant.", - "example": "MH4H92C7" + "description": "ID of the resource the membership is in.", + "example": "M2DDT39A" }, - "amount": { - "type": "string", - "description": "Total transaction amount, in major units.", - "example": "10.10" + "type": { + "$ref": "#/components/schemas/ResourceType" }, - "vat_amount": { + "name": { "type": "string", - "description": "VAT included in the transaction amount, in major units.", - "example": "6.00" + "description": "Display name of the resource.", + "example": "Acme Corp" }, - "tip_amount": { + "logo": { "type": "string", - "description": "Tip included in the transaction amount, in major units.", - "example": "3.00" + "description": "Logo fo the resource.", + "format": "uri", + "maxLength": 256, + "example": "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png" }, - "currency": { + "created_at": { "type": "string", - "description": "Three-letter ISO 4217 currency code of the transaction.", - "example": "EUR" + "description": "The timestamp of when the membership resource was created.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" }, - "timestamp": { + "updated_at": { "type": "string", + "description": "The timestamp of when the membership resource was last updated.", "format": "date-time", - "description": "The timestamp of when the transaction was created.", - "example": "2020-02-29T10:56:56.876Z" + "example": "2023-01-20T15:16:17Z" }, - "status": { + "attributes": { + "$ref": "#/components/schemas/Attributes" + } + } + }, + "Member": { + "title": "Member", + "type": "object", + "description": "A member is user within specific resource identified by resource id, resource type, and associated roles.", + "required": [ + "id", + "roles", + "permissions", + "created_at", + "updated_at", + "status" + ], + "properties": { + "id": { "type": "string", - "description": "Current processing status of the transaction.", - "example": "SUCCESSFUL" + "description": "ID of the member.", + "example": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" }, - "payment_type": { - "type": "string", - "description": "Payment type used for the transaction.", - "example": "ECOM" + "roles": { + "type": "array", + "description": "User's roles.", + "example": [ + "role_admin" + ], + "items": { + "type": "string" + } }, - "entry_mode": { - "type": "string", - "description": "Entry mode of the payment details.", - "example": "CUSTOMER_ENTRY" + "permissions": { + "type": "array", + "description": "User's permissions.", + "deprecated": true, + "x-deprecation-notice": "Permissions include only legacy permissions, please use roles instead. Member access is based on roles within a given resource and the permissions these roles grant.", + "items": { + "type": "string" + }, + "example": [ + "members_read", + "members_write", + "create_moto_payments", + "full_transaction_history_view", + "refund_transactions", + "create_referral", + "developer_settings_edit", + "developer_settings_access" + ] }, - "verification_method": { + "created_at": { "type": "string", - "description": "Cardholder verification method.", - "example": "none" + "description": "The timestamp of when the member was created.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" }, - "card_reader": { - "$ref": "#/components/schemas/ReceiptReader" + "updated_at": { + "type": "string", + "description": "The timestamp of when the member was last updated.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" }, - "card": { - "$ref": "#/components/schemas/ReceiptCard" + "user": { + "$ref": "#/components/schemas/MembershipUser" }, - "installments_count": { - "type": "integer", - "description": "Number of installments.", - "example": 1 + "invite": { + "$ref": "#/components/schemas/Invite" }, - "process_as": { - "type": "string", - "description": "Whether the transaction was processed as credit or debit.", - "enum": [ - "CREDIT", - "DEBIT" - ], - "example": "CREDIT" + "status": { + "$ref": "#/components/schemas/MembershipStatus" }, - "products": { - "type": "array", - "description": "Products associated with the transaction.", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Product name.", - "example": "Coffee" - }, - "description": { - "type": "string", - "description": "Product description.", - "example": "Cappuccino" - }, - "price": { - "type": "string", - "format": "double", - "description": "Product price.", - "example": "150.0" - }, - "vat_rate": { - "type": "string", - "format": "double", - "description": "VAT rate.", - "example": "0.0" - }, - "single_vat_amount": { - "type": "string", - "format": "double", - "description": "VAT amount for a single product.", - "example": "0.0" - }, - "price_with_vat": { - "type": "string", - "format": "double", - "description": "Product price including VAT.", - "example": "150.0" - }, - "vat_amount": { - "type": "string", - "format": "double", - "description": "Total VAT amount for the product quantity.", - "example": "0.0" - }, - "quantity": { - "type": "integer", - "format": "int64", - "description": "Product quantity.", - "example": 1 - }, - "total_price": { - "type": "string", - "format": "double", - "description": "Total price calculated as the product price multiplied by the quantity.", - "example": "150.0" - }, - "total_with_vat": { - "type": "string", - "format": "double", - "description": "Total product price including VAT.", - "example": "150.0" - } - } - } + "metadata": { + "$ref": "#/components/schemas/Metadata" }, - "vat_rates": { - "type": "array", - "description": "VAT breakdown for the transaction.", - "items": { - "type": "object", - "properties": { - "gross": { - "type": "number", - "format": "float", - "description": "Gross amount to which the VAT rate applies.", - "example": 10.1 - }, - "net": { - "type": "number", - "format": "float", - "description": "Net amount to which the VAT rate applies.", - "example": 8.49 - }, - "rate": { - "type": "number", - "format": "float", - "description": "VAT rate applied to the transaction amount.", - "example": 0.19 - }, - "vat": { - "type": "number", - "format": "float", - "description": "VAT amount included in the gross amount.", - "example": 1.61 - } - } - } + "attributes": { + "$ref": "#/components/schemas/Attributes" + } + }, + "example": { + "id": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", + "roles": [ + "role_admin", + "role_owner" + ], + "permissions": [ + "members_read", + "members_write", + "create_moto_payments", + "full_transaction_history_view", + "refund_transactions", + "create_referral", + "developer_settings_edit", + "developer_settings_access" + ], + "created_at": "2023-01-20T15:16:17Z", + "updated_at": "2023-02-20T15:16:17Z", + "user": { + "id": "44ca0f5b-813b-46e1-aee7-e6242010662e", + "email": "example@sumup.com", + "mfa_on_login_enabled": true, + "virtual_user": false, + "service_account_user": false }, - "events": { - "type": "array", - "description": "Transaction events displayed on the receipt.", - "items": { - "$ref": "#/components/schemas/ReceiptEvent" - } + "status": "accepted" + } + }, + "Invite": { + "title": "Invite", + "type": "object", + "description": "Pending invitation for membership.", + "required": [ + "email", + "expires_at" + ], + "properties": { + "email": { + "type": "string", + "description": "Email address of the invited user.", + "format": "email", + "example": "boaty.mcboatface@sumup.com" }, - "receipt_no": { + "expires_at": { "type": "string", - "description": "Receipt number associated with the transaction.", - "example": "123456" + "format": "date-time", + "example": "2023-01-20T15:16:17Z" } } }, - "TransactionEvent": { - "title": "Transaction Event", + "MembershipUser": { "type": "object", - "description": "Detailed information about a transaction event.", + "description": "Information about the user associated with the membership.", + "required": [ + "id", + "type", + "email", + "mfa_on_login_enabled", + "virtual_user", + "service_account_user" + ], "properties": { "id": { - "$ref": "#/components/schemas/TransactionEventID" + "type": "string", + "description": "Identifier for the End-User (also called Subject).", + "example": "44ca0f5b-813b-46e1-aee7-e6242010662e" }, - "event_type": { - "$ref": "#/components/schemas/TransactionEventType" + "type": { + "$ref": "#/components/schemas/UserType" }, - "status": { - "$ref": "#/components/schemas/TransactionEventStatus" + "email": { + "type": "string", + "example": "example@sumup.com", + "description": "End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, for unique identification use ID instead." }, - "amount": { - "type": "number", - "format": "decimal", - "description": "Amount of the event in major units of the associated transaction's currency.", - "example": 58.8 + "mfa_on_login_enabled": { + "type": "boolean", + "example": true, + "description": "True if the user has enabled MFA on login." }, - "due_date": { - "type": "string", - "format": "date", - "description": "Date when the transaction event is due to occur.", - "example": "2020-05-25" + "virtual_user": { + "type": "boolean", + "deprecated": true, + "x-deprecation-notice": "Rely on `type` instead.", + "example": false, + "description": "True if the user is a virtual user (operator)." }, - "date": { + "service_account_user": { + "type": "boolean", + "deprecated": true, + "x-deprecation-notice": "Rely on `type` instead.", + "example": false, + "description": "True if the user is a service account." + }, + "disabled_at": { "type": "string", - "format": "date", - "description": "Date when the transaction event occurred.", - "example": "2020-05-25" + "format": "date-time", + "description": "Time when the user has been disabled. Applies only to virtual users (`virtual_user: true`)." }, - "installment_number": { - "type": "integer", - "description": "Consecutive number of the installment that is paid. Applicable only to payout events, i.e. `event_type = PAYOUT`.", - "example": 1 + "nickname": { + "type": "string", + "example": "Test User", + "description": "User's nickname. Used for display purposes only." }, - "timestamp": { + "picture": { "type": "string", - "format": "date-time", - "description": "Date and time of the transaction event.", - "example": "2020-05-25T10:49:42.784Z" + "format": "uri", + "example": "https://usercontent.sumup.com/44ca0f5b-813b-46e1-aee7-e6242010662e.png", + "description": "URL of the End-User's profile picture. This URL refers to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image." + }, + "classic": { + "$ref": "#/components/schemas/MembershipUserClassic" } } }, - "TransactionBase": { - "title": "Transaction Base", + "MembershipUserClassic": { "type": "object", - "description": "Core details shared by transaction resources.", + "description": "Classic identifiers of the user.", + "deprecated": true, + "required": [ + "user_id" + ], + "properties": { + "user_id": { + "type": "integer", + "minimum": 0, + "maximum": 2147483647 + } + } + }, + "Role": { + "title": "Role", + "type": "object", + "description": "A custom role that can be used to assign set of permissions to members.", + "required": [ + "id", + "name", + "permissions", + "is_predefined", + "created_at", + "updated_at" + ], "properties": { "id": { "type": "string", - "description": "Unique identifier of the transaction.", - "example": "6b425463-3e1b-431d-83fa-1e51c2925e99" + "description": "Unique identifier of the role.", + "example": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" }, - "transaction_code": { + "name": { "type": "string", - "description": "SumUp transaction code, for example `TEENSK4W2K`. Use it to look up the transaction with the `transaction_code` query parameter. This is separate from the transaction's `id` and the card issuer's `auth_code`.", - "example": "TEENSK4W2K" + "example": "Senior Shop Manager II", + "description": "User-defined name of the role." }, - "amount": { - "type": "number", - "format": "float", - "description": "Total amount of the transaction in major units of `currency`, for example `10.1` for EUR 10.10.", - "example": 10.1 + "description": { + "type": "string", + "example": "Manges the shop and the employees.", + "description": "User-defined description of the role." }, - "currency": { - "$ref": "#/components/schemas/Currency" + "permissions": { + "type": "array", + "description": "List of permission granted by this role.", + "maxItems": 100, + "items": { + "type": "string" + }, + "example": [] }, - "timestamp": { - "type": "string", - "example": "2020-02-29T10:56:56.876Z", - "format": "date-time", - "description": "The timestamp of when the transaction was created." + "is_predefined": { + "type": "boolean", + "example": true, + "description": "True if the role is provided by SumUp." }, - "status": { - "$ref": "#/components/schemas/TransactionStatus" + "metadata": { + "$ref": "#/components/schemas/Metadata" }, - "payment_type": { - "$ref": "#/components/schemas/PaymentType" + "created_at": { + "type": "string", + "description": "The timestamp of when the role was created.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" }, - "installments_count": { - "type": "integer", - "description": "Number of installments for a deferred payment.", - "minimum": 1, - "example": 1 + "updated_at": { + "type": "string", + "description": "The timestamp of when the role was last updated.", + "format": "date-time", + "example": "2023-01-20T15:16:17Z" } } }, - "TransactionCheckoutInfo": { - "title": "Transaction Checkout Info", - "description": "Checkout-specific fields associated with a transaction.", + "Metadata": { + "description": "Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.", + "type": "object", + "maxProperties": 64, + "example": {}, + "additionalProperties": true + }, + "Attributes": { + "description": "Object attributes that are modifiable only by SumUp applications.\n", + "type": "object", + "example": {}, + "additionalProperties": true + }, + "UserType": { + "type": "string", + "description": "Type of the user account.", + "enum": [ + "user", + "managed_user", + "service_account", + "system_account" + ], + "example": "user" + }, + "Address": { + "externalDocs": { + "description": "Address documentation", + "url": "https://developer.sumup.com/tools/glossary/address" + }, + "description": "An address somewhere in the world. The address fields used depend on the country conventions. For example, in Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses is `state`, whereas in Chile it's `region`.\nWhether an address is valid or not depends on whether the locally required fields are present. Fields not supported in a country will be ignored.", "type": "object", + "required": [ + "country" + ], "properties": { - "merchant_code": { + "street_address": { + "type": "array", + "maxItems": 2, + "items": { + "type": "string", + "description": "The first line of the address.", + "maxLength": 100 + }, + "example": [ + "Paul-Linke-Ufer 39-40", + "2. Hinterhof" + ] + }, + "post_code": { + "type": "string", + "description": "The postal code (aka. zip code) of the address.\n", + "maxLength": 10, + "example": "10999" + }, + "country": { + "allOf": [ + { + "description": "The ISO3166-1 Alpha-2 code of the address country.\n", + "example": "DE" + }, + { + "$ref": "#/components/schemas/CountryCode" + } + ] + }, + "city": { + "type": "string", + "description": "The city of the address.\n", + "maxLength": 60, + "example": "Berlin" + }, + "province": { + "type": "string", + "description": "The province where the address is located. This may not be relevant in some countries.\n", + "maxLength": 60, + "example": "Berlin" + }, + "region": { + "type": "string", + "description": "The region where the address is located. This may not be relevant in some countries.\n", + "maxLength": 60, + "example": "Baden Wuerttemberg" + }, + "county": { + "type": "string", + "description": "A county is a geographic region of a country used for administrative or other purposes in some nations. Used in countries such as Ireland, Romania, etc.\n", + "maxLength": 60, + "example": "Dublin County" + }, + "autonomous_community": { "type": "string", - "description": "Unique code of the registered merchant to whom the payment is made.", - "example": "MH4H92C7" + "description": "In Spain, an autonomous community is the first sub-national level of political and administrative division.\n", + "maxLength": 60, + "example": "Catalonia" }, - "vat_amount": { - "type": "number", - "format": "float", - "description": "VAT included in the total transaction amount, in major units of the transaction's currency.", - "example": 6 + "post_town": { + "type": "string", + "description": "A post town is a required part of all postal addresses in the United Kingdom and Ireland, and a basic unit of the postal delivery system.\n", + "maxLength": 60, + "example": "London" }, - "tip_amount": { - "type": "number", - "format": "float", - "description": "Tip included in the total transaction amount, in major units of the transaction's currency.", - "example": 3 + "state": { + "type": "string", + "description": "Most often, a country has a single state, with various administrative divisions. The term \"state\" is sometimes used to refer to the federated polities that make up the federation. Used in countries such as the United States and Brazil.\n", + "maxLength": 60, + "example": "California" }, - "entry_mode": { - "$ref": "#/components/schemas/EntryMode" + "neighborhood": { + "type": "string", + "description": "Locality level of the address. Used in countries such as Brazil or Chile.\n", + "maxLength": 60, + "example": "Copacabana" }, - "auth_code": { + "commune": { "type": "string", - "description": "Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.", - "example": "053201" - } - } - }, - "TransactionMixinHistory": { - "title": "Transaction Mixin History", - "description": "Additional transaction fields used by history and detailed views.", - "type": "object", - "properties": { - "product_summary": { + "description": "In many countries, terms cognate with \"commune\" are used, referring to the community living in the area and the common interest. Used in countries such as Chile.\n", + "maxLength": 60, + "example": "Providencia" + }, + "department": { "type": "string", - "description": "Short description of the payment. The value is taken from the `description` property of the related checkout resource.", - "example": "Purchase" + "description": "A department (French: département, Spanish: departamento) is an administrative or political division in several countries. Used in countries such as Colombia.\n", + "maxLength": 60, + "example": "Antioquia" }, - "payouts_total": { - "type": "integer", - "description": "Total number of payouts to the registered user specified in the `user` property.", - "example": 1 + "municipality": { + "type": "string", + "description": "A municipality is usually a single administrative division having corporate status and powers of self-government or jurisdiction as granted by national and regional laws to which it is subordinate. Used in countries such as Colombia.\n", + "maxLength": 60, + "example": "Medellín" }, - "payouts_received": { - "type": "integer", - "description": "Number of payouts that are made to the registered user specified in the `user` property.", - "example": 1 + "district": { + "type": "string", + "description": "A district is a type of administrative division that in some countries is managed by the local government. Used in countries such as Portugal.\n", + "maxLength": 60, + "example": "Lisbon District" }, - "payout_plan": { + "zip_code": { "type": "string", - "description": "Payout plan of the registered user at the time when the transaction was made.", - "enum": [ - "SINGLE_PAYMENT", - "TRUE_INSTALLMENT", - "ACCELERATED_INSTALLMENT" - ], - "example": "SINGLE_PAYMENT" + "description": "A US system of postal codes used by the United States Postal Service (USPS).\n", + "maxLength": 10, + "example": "94103" + }, + "eircode": { + "type": "string", + "description": "A postal address in Ireland.\n", + "maxLength": 10, + "example": "D02 X285" } + }, + "example": { + "street_address": [ + "Paul-Linke-Ufer 39-40", + "2. Hinterhof" + ], + "post_code": "10999", + "city": "Berlin", + "country": "DE" } }, - "TransactionHistory": { - "title": "Transaction History", - "description": "Transaction entry returned in history listing responses.", - "allOf": [ - { - "$ref": "#/components/schemas/TransactionBase" - }, - { - "$ref": "#/components/schemas/TransactionMixinHistory" - }, + "CountryCode": { + "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\ncountry code. This definition users `oneOf` with a two-character string\ntype to allow for support of future countries in client code.", + "type": "string", + "minLength": 2, + "maxLength": 2, + "pattern": "^[A-Z]{2}$", + "example": "BR" + }, + "PersonalIdentifiers": { + "type": "array", + "description": "A list of country-specific personal identifiers.", + "items": { + "$ref": "#/components/schemas/PersonalIdentifier" + }, + "maxItems": 32, + "example": [ { - "type": "object", - "properties": { - "transaction_id": { - "$ref": "#/components/schemas/TransactionID" - }, - "client_transaction_id": { - "type": "string", - "description": "Client-supplied identifier of the transaction.", - "example": "urn:sumup:pos:sale:MNKKNGST:1D4E3B2D-111D-48D7-9AF0-832DAEF63DD7;2" - }, - "user": { - "type": "string", - "format": "email", - "description": "Email address of the registered user (merchant) to whom the payment is made.", - "example": "merchant@example.com" - }, - "type": { - "type": "string", - "description": "Type of the transaction for the registered user specified in the `user` property.", - "enum": [ - "PAYMENT", - "REFUND", - "CHARGE_BACK" - ], - "example": "PAYMENT" - }, - "card_type": { - "$ref": "#/components/schemas/CardType" - }, - "payout_date": { - "type": "string", - "format": "date", - "description": "Payout date (if paid out at once).", - "example": "2019-08-28" - }, - "payout_type": { - "type": "string", - "description": "Payout type.", - "enum": [ - "BANK_ACCOUNT", - "PREPAID_CARD" - ], - "example": "BANK_ACCOUNT" - }, - "refunded_amount": { - "type": "number", - "format": "decimal", - "description": "Total amount refunded for this transaction, in major units of the transaction's currency.", - "example": 0 - } - } + "ref": "br.cpf", + "value": "847.060.136-90" } ] }, - "PaymentType": { - "title": "Payment Type", - "type": "string", - "description": "Payment category recorded on a transaction, for example `POS` for a point-of-sale card payment, `ECOM` for an online card payment, or `RECURRING` for a recurring card payment. These reporting values are separate from the lowercase `payment_type` values used to process checkouts.", - "enum": [ - "CASH", - "POS", - "ECOM", - "RECURRING", - "BITCOIN", - "BALANCE", - "MOTO", - "BOLETO", - "DIRECT_DEBIT", - "APM", - "UNKNOWN" - ], - "example": "ECOM" - }, - "EntryMode": { - "title": "Entry Mode", - "type": "string", - "description": "How the payment details were captured, for example `CHIP` or `CONTACTLESS` for card-present payments and `CUSTOMER_ENTRY` for card details entered by the payer. For wallet and alternative payment methods, this can identify the method, such as `APPLE_PAY` or `BLIK`.", - "enum": [ - "BOLETO", - "SOFORT", - "IDEAL", - "BANCONTACT", - "EPS", - "MYBANK", - "SATISPAY", - "BLIK", - "P24", - "GIROPAY", - "PIX", - "QR_CODE_PIX", - "APPLE_PAY", - "GOOGLE_PAY", - "PAYPAL", - "TWINT", - "NONE", - "CHIP", - "MANUAL_ENTRY", - "CUSTOMER_ENTRY", - "MAGSTRIPE_FALLBACK", - "MAGSTRIPE", - "DIRECT_DEBIT", - "CONTACTLESS", - "MOTO", - "CONTACTLESS_MAGSTRIPE", - "N/A" + "PersonalIdentifier": { + "type": "object", + "required": [ + "ref", + "value" ], - "example": "CUSTOMER_ENTRY" + "properties": { + "ref": { + "type": "string", + "description": "The unique reference for the personal identifier type.", + "example": "br.cpf", + "maxLength": 32 + }, + "value": { + "type": "string", + "description": "The personal identifier value.", + "example": "847.060.136-90", + "maxLength": 128 + } + }, + "example": { + "ref": "br.cpf", + "value": "847.060.136-90" + } }, - "CardType": { - "title": "Card Type", - "type": "string", - "description": "Issuing card network of the payment card used for the transaction.", - "enum": [ - "ALELO", - "AMEX", - "BANCOMAT", - "CONECS", - "CUP", - "DINERS", - "DISCOVER", - "EFTPOS", - "ELO", - "ELV", - "GIROCARD", - "HIPERCARD", - "INTERAC", - "JCB", - "MAESTRO", - "MASTERCARD", - "PLUXEE", - "SUMUP", - "SWILE", - "TICKET", - "VISA", - "VISA_ELECTRON", - "VISA_VPAY", - "VPAY", - "VR", - "UNKNOWN" + "ListPersonsResponseBody": { + "type": "object", + "required": [ + "items" ], - "example": "VISA" + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } }, - "TransactionFull": { - "title": "Transaction Full", - "description": "Full transaction resource with checkout, payout, and event details.", + "Merchant": { + "title": "Merchant", + "externalDocs": { + "description": "Merchant documentation", + "url": "https://developer.sumup.com/tools/glossary/merchant" + }, "allOf": [ - { - "$ref": "#/components/schemas/TransactionBase" - }, - { - "$ref": "#/components/schemas/TransactionCheckoutInfo" - }, - { - "$ref": "#/components/schemas/TransactionMixinHistory" - }, { "type": "object", + "required": [ + "merchant_code", + "country", + "default_currency", + "default_locale" + ], "properties": { - "foreign_transaction_id": { - "type": "string", - "description": "External transaction identifier supplied by the client.", - "example": "J13253253x1" - }, - "client_transaction_id": { - "type": "string", - "description": "Client-supplied identifier of the transaction.", - "example": "urn:sumup:pos:sale:MNKKNGST:1D4E3B2D-111D-48D7-9AF0-832DAEF63DD7;2" - }, - "username": { - "type": "string", - "format": "email", - "description": "Email address of the registered user (merchant) to whom the payment is made.", - "example": "merchant@example.com" - }, - "fee_amount": { - "type": "number", - "format": "decimal", - "description": "Total SumUp transaction fee in major units of the transaction's currency.", - "example": 8 - }, - "lat": { - "$ref": "#/components/schemas/Lat" - }, - "lon": { - "$ref": "#/components/schemas/Lon" - }, - "horizontal_accuracy": { - "$ref": "#/components/schemas/HorizontalAccuracy" - }, - "merchant_id": { - "type": "integer", - "format": "int64", - "description": "Internal SumUp identifier of the merchant.", - "example": 136902 - }, - "device_info": { - "$ref": "#/components/schemas/Device" - }, - "simple_payment_type": { - "type": "string", - "description": "Simple name of the payment type.", - "enum": [ - "CASH", - "CC_SIGNATURE", - "ELV", - "ELV_WITHOUT_SIGNATURE", - "CC_CUSTOMER_ENTERED", - "MANUAL_ENTRY", - "EMV", - "RECURRING", - "BALANCE", - "MOTO", - "BOLETO", - "APM", - "BITCOIN", - "CARD" - ], - "example": "CARD" - }, - "verification_method": { - "type": "string", - "description": "Verification method used for the transaction.", - "enum": [ - "none", - "signature", - "offline PIN", - "online PIN", - "offline PIN + signature", - "na" - ], - "example": "none" - }, - "card": { - "$ref": "#/components/schemas/CardResponse" - }, - "elv_account": { - "$ref": "#/components/schemas/ElvCardAccount" - }, - "local_time": { - "type": "string", - "format": "date-time", - "description": "Local timestamp of when the transaction was created.", - "example": "2020-02-29T11:56:56+01:00" - }, - "payout_date": { + "merchant_code": { "type": "string", - "format": "date", - "description": "The date of the payout.", - "example": "2019-08-28" + "readOnly": true, + "description": "Short unique identifier for the merchant.", + "example": "MK01A8C2" }, - "payout_type": { + "organization_id": { "type": "string", - "description": "Payout type for the transaction.", - "enum": [ - "BANK_ACCOUNT", - "PREPAID_CARD" - ], - "example": "BANK_ACCOUNT" + "description": "ID of the organization the merchant belongs to (if any).", + "example": "G0UZPVAX" }, - "process_as": { + "business_type": { "type": "string", - "description": "Whether the transaction was processed as credit or debit.", - "enum": [ - "CREDIT", - "DEBIT" - ], - "example": "CREDIT" + "description": "The business type.\n* `sole_trader`: The business is run by an self-employed individual.\n* `company`: The business is run as a company with one or more shareholders\n* `partnership`: The business is run as a company with two or more shareholders that can be also other legal entities\n* `non_profit`: The business is run as a nonprofit organization that operates for public or social benefit\n* `government_entity`: The business is state owned and operated\n" }, - "products": { - "type": "array", - "description": "List of products from the merchant's catalogue for which the transaction serves as a payment.", - "items": { - "$ref": "#/components/schemas/Product" - } + "company": { + "$ref": "#/components/schemas/Company" }, - "vat_rates": { - "type": "array", - "description": "List of VAT rates applicable to the transaction.", - "items": { - "type": "object", - "properties": { - "rate": { - "type": "number", - "format": "decimal", - "description": "VAT rate.", - "example": 0.045 - }, - "net": { - "type": "number", - "format": "decimal", - "description": "NET amount of products having this VAT rate applied.", - "example": 1.36 - }, - "vat": { - "type": "number", - "format": "decimal", - "description": "VAT amount of this rate applied.", - "example": 0.06 - }, - "gross": { - "type": "number", - "format": "decimal", - "description": "Gross amount of products having this VAT rate applied.", - "example": 1.42 - } - } - } + "country": { + "$ref": "#/components/schemas/CountryCode" }, - "transaction_events": { - "type": "array", - "description": "Detailed list of events related to the transaction.", - "items": { - "$ref": "#/components/schemas/TransactionEvent" - } + "business_profile": { + "$ref": "#/components/schemas/BusinessProfile" }, - "simple_status": { + "avatar": { "type": "string", - "description": "High-level status of the transaction from the merchant's perspective.\n\n- `PENDING`: The payment has been initiated and is still being processed. A final outcome is not available yet.\n- `SUCCESSFUL`: The payment was completed successfully.\n- `PAID_OUT`: The payment was completed successfully and the funds have already been included in a payout to the merchant.\n- `FAILED`: The payment did not complete successfully.\n- `CANCELLED`: The payment was cancelled or reversed and is no longer payable or payable to the merchant.\n- `CANCEL_FAILED`: An attempt to cancel or reverse the payment was not completed successfully.\n- `REFUNDED`: The payment was refunded in full or in part.\n- `REFUND_FAILED`: An attempt to refund the payment was not completed successfully.\n- `CHARGEBACK`: The payment was subject to a chargeback.\n- `NON_COLLECTION`: The amount could not be collected from the merchant after a chargeback or related adjustment.", - "enum": [ - "SUCCESSFUL", - "PAID_OUT", - "CANCEL_FAILED", - "CANCELLED", - "CHARGEBACK", - "FAILED", - "REFUND_FAILED", - "REFUNDED", - "NON_COLLECTION", - "PENDING" - ], - "example": "SUCCESSFUL" - }, - "links": { - "type": "array", - "description": "List of hyperlinks for accessing related resources.", - "items": { - "$ref": "#/components/schemas/Link" - } + "format": "uri", + "description": "A user-facing small-format logo for use in dashboards and other user-facing applications. For customer-facing branding see `merchant.business_profile.branding`.\n" }, - "events": { - "type": "array", - "description": "Compact list of events related to the transaction.", - "items": { - "$ref": "#/components/schemas/Event" - } + "alias": { + "type": "string", + "description": "A user-facing name of the merchant account for use in dashboards and other user-facing applications. For customer-facing business name see `merchant.business_profile`.\n" }, - "location": { - "type": "object", - "description": "Details of the payment location as received from the payment terminal.", - "properties": { - "lat": { - "$ref": "#/components/schemas/Lat" - }, - "lon": { - "$ref": "#/components/schemas/Lon" - }, - "horizontal_accuracy": { - "$ref": "#/components/schemas/HorizontalAccuracy" - } - } + "default_currency": { + "type": "string", + "readOnly": true, + "description": "Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217) representing the default currency for the account.\n", + "example": "EUR", + "minLength": 3, + "maxLength": 3 }, - "tax_enabled": { + "default_locale": { + "type": "string", + "description": "Merchant's default locale, represented as a BCP47 [RFC5646](https://datatracker.ietf.org/doc/html/rfc5646) language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1](https://www.iso.org/iso-639-language-code) language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1](https://www.iso.org/iso-3166-country-codes.html) country code in uppercase, separated by a dash. For example, en-US or fr-CA.\nIn multilingual countries this is the merchant's preferred locale out of those, that are officially spoken in the country. In a countries with a single official language this will match the official language.", + "example": "de-DE", + "minLength": 2, + "maxLength": 5 + }, + "sandbox": { "type": "boolean", - "description": "Indicates whether tax deduction is enabled for the transaction.", - "example": true + "description": "True if the merchant is a sandbox for testing.", + "example": false + }, + "meta": { + "$ref": "#/components/schemas/Meta" + }, + "classic": { + "$ref": "#/components/schemas/ClassicMerchantIdentifiers" + }, + "version": { + "$ref": "#/components/schemas/Version" + }, + "change_status": { + "$ref": "#/components/schemas/ChangeStatus" } } + }, + { + "$ref": "#/components/schemas/Timestamps" } ] }, - "Currency": { - "title": "Currency", - "type": "string", - "description": "Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the amount.", - "enum": [ - "BRL", - "CHF", - "CLP", - "COP", - "CZK", - "DKK", - "EUR", - "GBP", - "HRK", - "HUF", - "NOK", - "PLN", - "RON", - "SEK", - "USD" - ], - "example": "EUR" + "Meta": { + "type": "object", + "additionalProperties": { + "type": "string", + "maxLength": 256 + }, + "description": "A set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.\n\n**Warning**: Updating Meta will overwrite the existing data. Make sure to always include the complete JSON object.", + "example": {} }, - "TransactionStatus": { - "title": "Transaction Status", - "type": "string", - "description": "Current status of the transaction.\n\n- `PENDING`: The transaction has been created but its final outcome is not known yet.\n- `SUCCESSFUL`: The transaction completed successfully.\n- `CANCELLED`: The transaction was cancelled or otherwise reversed before completion.\n- `FAILED`: The transaction attempt did not complete successfully.\n- `REFUNDED`: The transaction was refunded in full or in part.", - "enum": [ - "SUCCESSFUL", - "CANCELLED", - "FAILED", - "PENDING", - "REFUNDED" - ], - "example": "SUCCESSFUL" + "BusinessProfile": { + "type": "object", + "description": "Business information about the merchant. This information will be visible to the merchant's customers.\n", + "properties": { + "name": { + "type": "string", + "description": "The customer-facing business name.", + "minLength": 1, + "maxLength": 150, + "example": "Example Coffee" + }, + "dynamic_descriptor": { + "type": "string", + "minLength": 1, + "maxLength": 30, + "pattern": "^[a-zA-Z0-9 +'_.-]+$", + "description": "The descriptor is the text that your customer sees on their bank account statement.\nThe more recognisable your descriptor is, the less risk you have of receiving disputes (e.g. chargebacks).\n", + "example": "Example Coffee" + }, + "website": { + "type": "string", + "description": "The business's publicly available website.", + "minLength": 1, + "maxLength": 255, + "example": "https://example.com" + }, + "email": { + "type": "string", + "description": "A publicly available email address.", + "minLength": 1, + "maxLength": 255, + "example": "contact@example.com" + }, + "phone_number": { + "$ref": "#/components/schemas/PhoneNumber" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "branding": { + "$ref": "#/components/schemas/Branding" + } + } }, - "TransactionEventType": { - "title": "Transaction Event Type", - "type": "string", - "description": "Financial event associated with a transaction.\n\n- `PAYOUT`: Funds from the transaction being prepared for or included in a merchant payout. Check the event status to determine whether they have been paid out.\n- `REFUND`: Money returned to the payer.\n- `CHARGE_BACK`: A reversal of the payment following a chargeback.\n- `PAYOUT_DEDUCTION`: An amount deducted from a merchant payout, for example to cover a refund or chargeback.", - "enum": [ - "PAYOUT", - "CHARGE_BACK", - "REFUND", - "PAYOUT_DEDUCTION" - ], - "example": "REFUND" + "Person": { + "allOf": [ + { + "$ref": "#/components/schemas/BasePerson" + } + ] }, - "TransactionEventStatus": { - "title": "Transaction Event Status", + "PhoneNumber": { "type": "string", - "description": "Status of the transaction event.\n\nNot every value is used for every event type.\n\n- `PENDING`: The event has been created but is not final yet. Used for events that are still being processed and whose final outcome is not known yet.\n- `SCHEDULED`: The event is planned for a future payout cycle but has not been executed yet. This applies to payout events before money is actually sent out.\n- `RECONCILED`: The underlying payment has been matched with settlement data and is ready to continue through payout processing, but the funds have not been paid out yet. This applies to payout events.\n- `PAID_OUT`: The payout event has been completed and the funds were included in a merchant payout.\n- `REFUNDED`: A refund event has been accepted and recorded in the refund flow. This is the status returned for refund events once the transaction amount is being or has been returned to the payer.\n- `SUCCESSFUL`: The event completed successfully. Use this as the generic terminal success status for event types that do not expose a more specific business outcome such as `PAID_OUT` or `REFUNDED`.\n- `FAILED`: The event could not be completed. Typical examples are a payout that could not be executed or an event that was rejected during processing.", - "enum": [ - "FAILED", - "PAID_OUT", - "PENDING", - "RECONCILED", - "REFUNDED", - "SCHEDULED", - "SUCCESSFUL" - ], - "example": "SUCCESSFUL" - }, - "TransactionEventID": { - "title": "Transaction Event ID", - "type": "integer", - "format": "int64", - "description": "Numeric identifier of a transaction event. Use it as `tx_event_id` when requesting receipt details for a specific event. This is separate from the transaction ID and the transaction history pagination references.", - "example": 9567461191 - }, - "HorizontalAccuracy": { - "title": "Horizontal Accuracy", - "type": "number", - "format": "float", - "description": "Indication of the precision of the geographical position received from the payment terminal.", - "example": 5 - }, - "Lat": { - "title": "Latitude", - "type": "number", - "format": "float", - "description": "Latitude value from the coordinates of the payment location (as received from the payment terminal reader).", - "minimum": -90, - "maximum": 90, - "example": 52.520008 + "description": "A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n", + "example": "+420123456789", + "maxLength": 16 }, - "Lon": { - "title": "Longitude", - "type": "number", - "format": "float", - "description": "Longitude value from the coordinates of the payment location (as received from the payment terminal reader).", - "minimum": -180, - "maximum": 180, - "example": 13.404954 + "Branding": { + "type": "object", + "description": "Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.", + "properties": { + "footer_text": { + "type": "string", + "description": "Footer text rendered on receipts and other customer-facing products.\n", + "minLength": 1, + "maxLength": 500, + "examples": [ + "Thanks for shopping with us." + ] + }, + "icon": { + "type": "string", + "format": "uri", + "description": "An icon for the merchant. Must be square.\n" + }, + "logo": { + "type": "string", + "format": "uri", + "description": "A logo for the merchant that will be used in place of the icon and without the merchant's name next to it if there's sufficient space.\n" + }, + "hero": { + "type": "string", + "format": "uri", + "description": "Data-URL encoded hero image for the merchant business.\n" + }, + "primary_color": { + "type": "string", + "description": "A hex color value representing the primary branding color of this merchant (your brand color).\n", + "examples": [ + "#FF4B3A", + "#0072C6", + "#F68B20" + ] + }, + "primary_color_fg": { + "type": "string", + "description": "A hex color value representing the color of the text displayed on branding color of this merchant.\n", + "examples": [ + "#FF4B3A", + "#0072C6", + "#F68B20" + ] + }, + "secondary_color": { + "type": "string", + "description": "A hex color value representing the secondary branding color of this merchant (accent color used for buttons).\n", + "examples": [ + "#FF4B3A", + "#0072C6", + "#F68B20" + ] + }, + "secondary_color_fg": { + "type": "string", + "description": "A hex color value representing the color of the text displayed on secondary branding color of this merchant.\n", + "examples": [ + "#FF4B3A", + "#0072C6", + "#F68B20" + ] + }, + "background_color": { + "type": "string", + "description": "A hex color value representing the preferred background color of this merchant.\n", + "examples": [ + "#FF4B3A", + "#0072C6", + "#F68B20" + ] + } + } }, - "TransactionID": { - "title": "Transaction ID", + "LegalType": { + "externalDocs": { + "description": "The country SDK documentation for legal types.", + "url": "https://developer.sumup.com/tools/glossary/merchant#legal-types" + }, "type": "string", - "description": "Unique identifier of the transaction.", - "example": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + "description": "The unique legal type reference as defined in the country SDK. We do not rely on IDs as used by other services. Consumers of this API are expected to use the country SDK to map to any other IDs, translation keys, or descriptions.\n", + "minLength": 4, + "maxLength": 64, + "pattern": "^[a-z]{2}\\.[a-z_]+$", + "examples": [ + "de.freiberufler", + "br.ltda", + "gb.partnership", + "bg.private_limited_company" + ] }, - "Affiliate": { - "properties": { - "app_id": { - "example": "com.example.app", - "type": "string" - }, - "key": { - "example": "123e4567-e89b-12d3-a456-426614174000", - "type": "string" - } + "CompanyIdentifiers": { + "type": "array", + "description": "A list of country-specific company identifiers.\n", + "items": { + "$ref": "#/components/schemas/CompanyIdentifier" + } + }, + "CompanyIdentifier": { + "externalDocs": { + "description": "Company identifier documentation", + "url": "https://developer.sumup.com/tools/glossary/merchant#company-identifiers" }, + "type": "object", "required": [ - "app_id", - "key" + "ref", + "value" ], - "type": "object" - }, - "Amount": { "properties": { - "currency": { - "description": "Currency ISO 4217 code", - "example": "MXN", - "type": "string" + "ref": { + "type": "string", + "pattern": "^[a-z]{2}\\.[a-z_]+$", + "description": "The unique reference for the company identifier type as defined in the country SDK.\n", + "examples": [ + "de.gmbh" + ] }, "value": { - "description": "Amount in minor units (e.g. cents).", - "example": 1000, - "type": "integer" + "type": "string", + "minLength": 1, + "maxLength": 100, + "description": "The company identifier value.\n", + "examples": [ + "HRB 123456" + ] } }, + "examples": [ + { + "ref": "de.gmbh", + "value": "HRB 123456" + } + ] + }, + "Ownership": { + "type": "object", "required": [ - "currency", - "value" + "share" ], - "type": "object" + "properties": { + "share": { + "description": "The percent of ownership shares held by the Person expressed in percent mille (1/100000). Only Persons with the relationship `owner` can have ownership.\n", + "type": "integer", + "format": "int32", + "minimum": 25000, + "maximum": 100000, + "example": 50000 + } + } }, - "ReaderID": { + "Version": { "type": "string", - "description": "Unique identifier of the reader that the payment is initiated on.", - "example": "rdr_3MSAFM23CK82VSTT4BN6RWSQ65", - "minLength": 30, - "maxLength": 30 + "description": "The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH` endpoints.\n", + "examples": [ + "chng_01HS0KG3MPVEVWW85E3KNXH55J" + ] }, - "ReaderPaymentRequestParams": { + "ChangeStatus": { + "type": "string", + "readOnly": true, + "description": "Reflects the status of changes submitted through the `PATCH` endpoints for the Merchant or Persons. If some changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status `done`.\nThe status is only returned after write operations or on read endpoints when the `version` query parameter is provided.\n" + }, + "BasePerson": { + "externalDocs": { + "description": "Person documentation", + "url": "https://developer.sumup.com/tools/glossary/merchant#persons" + }, + "type": "object", + "description": "Base schema for a Person associated with a Merchant. This can be a legal representative, business owner (ultimate beneficial owner), or an officer. A legal representative is the Person who registered the Merchant with SumUp. They should always have a `user_id`.\n", + "required": [ + "id" + ], "properties": { - "affiliate": { - "allOf": [ - { - "description": "Optional caller-supplied context about the integration initiating the payment.", - "type": "object" - }, - { - "$ref": "#/components/schemas/Affiliate" - } + "id": { + "type": "string", + "readOnly": true, + "description": "The unique identifier for the Person. This is a [typeid](https://github.com/sumup/typeid).\n", + "examples": [ + "pers_2EGQ057R6C8J791RVCG5NWAEAB" + ] + }, + "user_id": { + "type": "string", + "description": "A corresponding identity user ID for the Person, if they have a user account.\n", + "examples": [ + "ef263f37-8701-4181-9758-acddbb778ee9" ] }, - "client_transaction_id": { - "description": "Caller-supplied correlation identifier, used as the idempotency key.", - "example": "19e12390-72cf-4f9f-80b5-b0c8a67fa43f", - "type": "string" + "birthdate": { + "type": "string", + "format": "date", + "description": "The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\n", + "example": "1980-01-12" + }, + "given_name": { + "type": "string", + "description": "The first name(s) of the individual.", + "example": "Sofia", + "minLength": 1, + "maxLength": 60 + }, + "family_name": { + "type": "string", + "description": "The last name(s) of the individual.", + "example": "Rossi", + "minLength": 1, + "maxLength": 60 + }, + "phone_number": { + "$ref": "#/components/schemas/PhoneNumber" + }, + "relationships": { + "type": "array", + "description": "A list of roles the Person has in the Merchant or towards SumUp. A Merchant must have at least one Person with the relationship `representative`.\n", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "string", + "description": "* `representative`: The Person is the primary contact for SumUp and has full administrative power over the merchant account.\n* `owner`: The Person is a business owner. If this value is set, the `ownership_percent` should be set as well.\n* `officer`: The Person is an officer at the company.\n", + "examples": [ + "representative", + "owner", + "officer" + ] + } + }, + "ownership": { + "$ref": "#/components/schemas/Ownership" + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "identifiers": { + "$ref": "#/components/schemas/PersonalIdentifiers" + }, + "citizenship": { + "$ref": "#/components/schemas/CountryCode" + }, + "nationality": { + "type": [ + "string", + "null" + ], + "pattern": "^[A-Z]{2}$", + "description": "The Person's nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may not conform to this standard.\n" + }, + "country_of_residence": { + "type": [ + "string", + "null" + ], + "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country where the Person resides.\n", + "pattern": "^[A-Z]{2}$" + }, + "version": { + "$ref": "#/components/schemas/Version" + }, + "change_status": { + "$ref": "#/components/schemas/ChangeStatus" + } + } + }, + "Company": { + "externalDocs": { + "description": "Company documentation", + "url": "https://developer.sumup.com/tools/glossary/merchant#company" + }, + "type": "object", + "description": "Information about the company or business. This is legal information that is used for verification.\n", + "properties": { + "name": { + "type": "string", + "description": "The company's legal name.", + "minLength": 1, + "maxLength": 150, + "example": "Gin \u0026 Doughnuts Bar GmbH" + }, + "merchant_category_code": { + "description": "The merchant category code for the account as specified by [ISO18245](https://www.iso.org/standard/33365.html). MCCs are used to classify businesses based on the goods or services they provide.\n", + "type": "string", + "example": "1532", + "pattern": "^[0-9]{4}$" + }, + "legal_type": { + "$ref": "#/components/schemas/LegalType", + "description": "The category identifying the legal structure of the company or legal entity.\n" }, - "tip_amount": { - "description": "Portion of total_amount that is a tip, in minor units.", - "example": 200, - "type": "integer" + "address": { + "$ref": "#/components/schemas/Address", + "description": "The company's primary address." }, - "total_amount": { - "allOf": [ - { - "description": "Amount charged on the reader, including any tip. The amount is represented as an integer value altogether with the currency and the minor unit. For example, MXN 10.00 is represented as value 1000 with minor unit of 2.", - "example": { - "currency": "MXN", - "value": 1000 - } - }, - { - "$ref": "#/components/schemas/Amount" - } + "trading_address": { + "$ref": "#/components/schemas/Address", + "description": "A trading address is where your suppliers, banks or customers send you correspondence to. Trading address can be different to the company's registered address (`address`).\n" + }, + "identifiers": { + "$ref": "#/components/schemas/CompanyIdentifiers" + }, + "phone_number": { + "$ref": "#/components/schemas/PhoneNumber", + "description": "The company's phone number (used for verification) in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n" + }, + "website": { + "description": "HTTP(S) URL of the company's website.\n", + "type": "string", + "minLength": 1, + "maxLength": 255, + "examples": [ + "https://www.sumup.com" ] + }, + "attributes": { + "$ref": "#/components/schemas/Attributes" } - }, + } + }, + "ClassicMerchantIdentifiers": { + "type": "object", "required": [ - "total_amount", - "client_transaction_id" + "id" ], - "type": "object" + "properties": { + "id": { + "type": "integer", + "format": "int64", + "description": "Classic (serial) merchant ID.", + "example": 1234, + "deprecated": true + } + } }, - "ReaderPaymentResponse": { + "Timestamps": { + "type": "object", "properties": { - "data": { - "$ref": "#/components/schemas/ReaderPaymentResponseData" + "created_at": { + "type": "string", + "format": "date-time", + "description": "The date and time when the resource was created. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).\n", + "readOnly": true, + "examples": [ + "2021-08-31T12:00:00Z" + ] + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "The date and time when the resource was last updated. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).\n", + "readOnly": true, + "examples": [ + "2021-08-31T12:00:00Z" + ] } }, - "type": "object" + "required": [ + "created_at", + "updated_at" + ] }, - "ReaderPaymentResponseData": { + "Reader": { + "title": "Reader", + "description": "A physical card reader device that can accept in-person payments.", + "type": "object", "properties": { - "client_transaction_id": { - "description": "Caller-supplied correlation identifier that was provided in the request.", - "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "type": "string" + "id": { + "$ref": "#/components/schemas/ReaderID" }, - "transaction_code": { - "description": "Transaction code returned by the acquirer/processing entity after processing the transaction.", - "example": "TEENSK4W2K", - "type": "string" + "name": { + "$ref": "#/components/schemas/ReaderName" + }, + "status": { + "$ref": "#/components/schemas/ReaderStatus" + }, + "device": { + "$ref": "#/components/schemas/ReaderDevice" + }, + "metadata": { + "$ref": "#/components/schemas/Metadata" + }, + "service_account_id": { + "type": "string", + "format": "uuid", + "x-beta": true, + "description": "Identifier of the system-managed service account associated with this reader.\nPresent only for readers that are already paired.\nThis field is currently in beta and may change." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The timestamp of when the reader was created.", + "example": "2023-01-18T15:16:17Z" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "The timestamp of when the reader was last updated.", + "example": "2023-01-20T15:16:17Z" } }, - "type": "object" + "required": [ + "id", + "name", + "status", + "device", + "created_at", + "updated_at" + ] }, - "MembershipStatus": { + "ReaderName": { "type": "string", - "description": "The status of the membership.", - "enum": [ - "accepted", - "pending", - "expired", - "disabled", - "unknown" - ] + "description": "Custom human-readable, user-defined name for easier identification of the reader.", + "maxLength": 500, + "example": "Frontdesk" }, - "ResourceType": { + "ReaderStatus": { "type": "string", - "description": "The type of the membership resource.\nPossible values are:\n* `merchant` - merchant account(s)\n* `organization` - organization(s)", - "example": "merchant" + "example": "paired", + "enum": [ + "unknown", + "processing", + "paired", + "expired" + ], + "description": "The status of the reader object gives information about the current state of the reader.\n\nPossible values:\n\n- `unknown` - The reader status is unknown.\n- `processing` - The reader is created and waits for the physical device to confirm the pairing.\n- `paired` - The reader is paired with a merchant account and can be used with SumUp APIs.\n- `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated." }, - "Membership": { - "title": "Membership", + "ReaderDevice": { "type": "object", - "description": "A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.", - "required": [ - "id", - "resource_id", - "type", - "roles", - "permissions", - "created_at", - "updated_at", - "status", - "resource" - ], + "description": "Information about the underlying physical device.", "properties": { - "id": { + "identifier": { "type": "string", - "description": "ID of the membership.", - "example": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" + "description": "A unique identifier of the physical device (e.g. serial number).", + "example": "U1DT3NA00-CN" }, - "resource_id": { + "model": { "type": "string", - "description": "ID of the resource the membership is in.", - "example": "M2DDT39A" - }, - "type": { - "$ref": "#/components/schemas/ResourceType" - }, - "roles": { - "type": "array", - "description": "User's roles.", - "example": [ - "role_admin" + "description": "Identifier of the model of the device.", + "enum": [ + "solo", + "virtual-solo" ], - "items": { - "type": "string" - } - }, - "permissions": { - "type": "array", - "description": "User's permissions.", - "deprecated": true, - "x-deprecation-notice": "Permissions include only legacy permissions, please use roles instead. Member access is based on their roles within a given resource and the permissions these roles grant.", - "items": { - "type": "string" - }, - "example": [ - "members_read", - "members_write", - "create_moto_payments", - "full_transaction_history_view", - "refund_transactions", - "create_referral", - "developer_settings_edit", - "developer_settings_access" - ] - }, - "created_at": { + "example": "solo" + } + }, + "required": [ + "identifier", + "model" + ] + }, + "ReaderPairingCode": { + "type": "string", + "description": "The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating the pairing. It is used to link the physical device to the created pairing.", + "example": "4WLFDSBF", + "minLength": 8, + "maxLength": 9 + }, + "Reference": { + "type": "string", + "description": "The reference to the actual payment used for this sale, e.g. the sumup transaction code.", + "example": "TERTYFQ4G3", + "maxLength": 50 + }, + "Brand": { + "type": "string", + "description": "The brand of the card.\nInput is case-insensitive; the canonical form is lowercase snake_case.\n**VALUES**: [amex, cup, diners, discover, elo, elv, hipercard, jcb, maestro, mastercard, visa, visa_electron,\nvisa_vpay, vr, eftpos, conecs, swile, girocard, interac, sumup, bancomat].", + "maxLength": 20, + "example": "visa" + }, + "ItemTypeV10": { + "type": "string", + "description": "Classifies a sale line. Not a schema subclass.\n\nKnown values: `CATALOG`, `DEPOSIT`, `GIFT_CARD`, `CUSTOM`, `FEE`.\n\n`FEE` lines represent merchant-charged fees on the sale (e.g. shipping, service\ncharge, surcharge, cancellation). They participate in sale totals like any other\nline; type-specific data is carried in `features` (see `Feature` for the\nconventional feature keys).\n\nThis is intentionally an open string, NOT a closed enum: new values are added\nover time as pure data and consumers MUST tolerate unknown values, rendering the\nline from the generic envelope (name, quantity, price, taxes) and reading any\nextra information from `features`.", + "example": "CATALOG" + }, + "Quantity": { + "type": "number", + "format": "double", + "description": "The numerical value representing the quantity in the specified unit.", + "minimum": 0, + "example": 2.15332 + }, + "UnitOfMeasure": { + "type": "object", + "description": "The unit of measure of the item.", + "required": [ + "group_id", + "unit_id", + "unit_ratio" + ], + "properties": { + "group_id": { "type": "string", - "description": "The timestamp of when the membership was created.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "description": "The group of the unit of measure.", + "maxLength": 100, + "example": "weight" }, - "updated_at": { + "unit_id": { "type": "string", - "description": "The timestamp of when the membership was last updated.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" - }, - "invite": { - "$ref": "#/components/schemas/Invite" + "description": "The specific unit of measure within the group.", + "example": "weight.kilogram", + "maxLength": 100 }, - "status": { - "$ref": "#/components/schemas/MembershipStatus" - }, - "metadata": { - "$ref": "#/components/schemas/Metadata" - }, - "attributes": { - "$ref": "#/components/schemas/Attributes" - }, - "resource": { - "$ref": "#/components/schemas/MembershipResource" + "unit_ratio": { + "type": "number", + "format": "double", + "description": "The ratio of the specified unit to the base unit of the group.", + "example": 1.24412 } } }, - "MembershipResource": { - "title": "Resource", + "PositiveAmount": { + "type": "integer", + "format": "int64", + "description": "The value of the amount in minor units of the currency according to the Sale.currency.scale. \n`value` can get large for some currencies and applications. \nUse Long type or a similar data type when parsing `value`.", + "example": 100, + "minimum": 0 + }, + "TaxRate": { + "type": "integer", + "format": "int64", + "minimum": 0, + "description": "The tax rate percentage in minor units (1/100000). For example 19000 = 19%.", + "example": 19000 + }, + "TaxLine": { "type": "object", - "description": "Information about the resource the membership is in.", "required": [ "id", - "type", - "name", - "created_at", - "updated_at" + "net_amount", + "gross_amount", + "tax_amount" ], + "description": "Information about tax together with amounts before and after its application such as:\n - net amount: taxable net amount, scoped by this tax\n - gross amount: amount after applying the tax.", "properties": { "id": { "type": "string", - "description": "ID of the resource the membership is in.", - "example": "M2DDT39A" - }, - "type": { - "$ref": "#/components/schemas/ResourceType" + "description": "Tax ID from the Tax Service (External Id)", + "maxLength": 100, + "example": "b064ed44-66e1-45a1-a963-b783808f0436" }, "name": { "type": "string", - "description": "Display name of the resource.", - "example": "Acme Corp" + "description": "Tax name, e.g. \"MwSt.\"", + "maxLength": 255 }, - "logo": { - "type": "string", - "description": "Logo fo the resource.", - "format": "uri", - "maxLength": 256, - "example": "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png" + "percentage": { + "$ref": "#/components/schemas/TaxRate" }, - "created_at": { + "net_amount": { + "description": "Net amount before applying the tax. \nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] + }, + "gross_amount": { + "description": "Gross amount after applying the tax.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] + }, + "tax_amount": { + "description": "Amount of tax.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] + } + } + }, + "DiscountLevel": { + "type": "string", + "description": "Specifies where discount was applied by user (either merchant or consumer):\n- CART: Applied to the whole cart (calculated and distributed per sale item)\n- ITEM: Applied to specific sale item\n\n*Accepted values:* [\"ITEM\", \"CART\"].", + "example": "CART", + "minLength": 4, + "maxLength": 4 + }, + "DiscountSourceAdHoc": { + "type": "object", + "description": "Discount created ad-hoc on device during checkout.", + "properties": { + "id": { "type": "string", - "description": "The timestamp of when the membership resource was created.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "format": "uuid", + "description": "The unique identifier of the ad-hoc discount.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d" }, - "updated_at": { + "name": { "type": "string", - "description": "The timestamp of when the membership resource was last updated.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "description": "The name of the ad-hoc discount.", + "example": "Happy Hour", + "maxLength": 100 }, - "attributes": { - "$ref": "#/components/schemas/Attributes" + "description": { + "type": "string", + "description": "The description of the ad-hoc discount.", + "example": "Happy Hour from 10 to 12.", + "maxLength": 250 } } }, - "Member": { - "title": "Member", + "DiscountApplicationMode": { + "type": "string", + "description": "Method of applying the discount to the items or cart.", + "enum": [ + "MANUAL", + "AUTOMATIC" + ], + "example": "MANUAL" + }, + "DiscountSourceBasic": { "type": "object", - "description": "A member is user within specific resource identified by resource id, resource type, and associated roles.", + "description": "Preset discount applied manually on the POS.", "required": [ "id", - "roles", - "permissions", - "created_at", - "updated_at", - "status" + "name", + "application_mode" ], "properties": { "id": { "type": "string", - "description": "ID of the member.", - "example": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" + "format": "uuid", + "description": "The unique identifier of the basic discount.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d" }, - "roles": { - "type": "array", - "description": "User's roles.", - "example": [ - "role_admin" - ], - "items": { - "type": "string" - } + "name": { + "type": "string", + "description": "The name of the basic discount.", + "example": "Staff discount", + "maxLength": 100 }, - "permissions": { - "type": "array", - "description": "User's permissions.", - "deprecated": true, - "x-deprecation-notice": "Permissions include only legacy permissions, please use roles instead. Member access is based on roles within a given resource and the permissions these roles grant.", - "items": { - "type": "string" - }, - "example": [ - "members_read", - "members_write", - "create_moto_payments", - "full_transaction_history_view", - "refund_transactions", - "create_referral", - "developer_settings_edit", - "developer_settings_access" - ] + "description": { + "type": [ + "string", + "null" + ], + "description": "The description of the loyalty discount.", + "example": "10% off food for staff members.", + "maxLength": 250 }, - "created_at": { + "application_mode": { + "$ref": "#/components/schemas/DiscountApplicationMode" + } + } + }, + "DiscountClass": { + "type": [ + "string", + "null" + ], + "description": "The method used to target items to discount.\nMust be populated for ITEM level discounts, and must be null for CART level discounts (CART level targets all\nitems, therefore none of these categories apply).\n", + "enum": [ + "ITEM", + "CATEGORY", + "BUNDLE", + "BUY_X_GET_Y", + "MEAL_DEAL" + ], + "example": "ITEM" + }, + "DiscountSourceCoupon": { + "type": "object", + "description": "Discount applied manually when entering a coupon code at checkout.", + "required": [ + "id", + "code", + "name", + "application_mode" + ], + "properties": { + "id": { "type": "string", - "description": "The timestamp of when the member was created.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "format": "uuid", + "description": "The unique identifier of the coupon discount.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d" }, - "updated_at": { + "code": { "type": "string", - "description": "The timestamp of when the member was last updated.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" - }, - "user": { - "$ref": "#/components/schemas/MembershipUser" + "description": "The coupon code.", + "example": "FREE_COFFEE", + "maxLength": 100 }, - "invite": { - "$ref": "#/components/schemas/Invite" + "name": { + "type": "string", + "description": "The name of the coupon discount.", + "example": "Free coffee", + "maxLength": 100 }, - "status": { - "$ref": "#/components/schemas/MembershipStatus" + "description": { + "type": [ + "string", + "null" + ], + "description": "The description of the coupon discount.", + "example": "Free coffee with this coupon.", + "maxLength": 250 }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + "discount_class": { + "$ref": "#/components/schemas/DiscountClass" }, - "attributes": { - "$ref": "#/components/schemas/Attributes" + "application_mode": { + "$ref": "#/components/schemas/DiscountApplicationMode" } - }, - "example": { - "id": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", - "roles": [ - "role_admin", - "role_owner" - ], - "permissions": [ - "members_read", - "members_write", - "create_moto_payments", - "full_transaction_history_view", - "refund_transactions", - "create_referral", - "developer_settings_edit", - "developer_settings_access" - ], - "created_at": "2023-01-20T15:16:17Z", - "updated_at": "2023-02-20T15:16:17Z", - "user": { - "id": "44ca0f5b-813b-46e1-aee7-e6242010662e", - "email": "example@sumup.com", - "mfa_on_login_enabled": true, - "virtual_user": false, - "service_account_user": false - }, - "status": "accepted" } }, - "Invite": { - "title": "Invite", + "DiscountSourceOffer": { "type": "object", - "description": "Pending invitation for membership.", + "description": "Discount applied automatically when cart is updated based on preset promotions.", "required": [ - "email", - "expires_at" + "id", + "name", + "application_mode" ], "properties": { - "email": { + "id": { "type": "string", - "description": "Email address of the invited user.", - "format": "email", - "example": "boaty.mcboatface@sumup.com" + "format": "uuid", + "description": "The unique identifier of the offer discount.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d" }, - "expires_at": { + "name": { "type": "string", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "description": "The name of the offer discount.", + "example": "Breakfast combo deal", + "maxLength": 100 + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "The description of the offer discount.", + "example": "Buy a Croissant, get a coffee for £1", + "maxLength": 250 + }, + "discount_class": { + "$ref": "#/components/schemas/DiscountClass" + }, + "application_mode": { + "$ref": "#/components/schemas/DiscountApplicationMode" } } }, - "MembershipUser": { + "DiscountSourceLoyaltyType": { + "type": "string", + "description": "The type of loyalty discount, either a promotion (e.g. new customer discount) or a reward (free coffee after completing stamp card).", + "enum": [ + "PROMOTION", + "REWARD" + ], + "example": "REWARD" + }, + "DiscountSourceLoyaltySchemeType": { + "type": "string", + "description": "The scheme type of the loyalty program.", + "enum": [ + "STAMPS", + "POINTS" + ], + "example": "POINTS" + }, + "DiscountSourceLoyalty": { "type": "object", - "description": "Information about the user associated with the membership.", + "description": "Discount applied when redeeming a reward from the merchant's loyalty scheme.", "required": [ "id", - "type", - "email", - "mfa_on_login_enabled", - "virtual_user", - "service_account_user" + "name", + "loyalty_type", + "scheme_type", + "application_mode" ], "properties": { "id": { "type": "string", - "description": "Identifier for the End-User (also called Subject).", - "example": "44ca0f5b-813b-46e1-aee7-e6242010662e" + "format": "uuid", + "description": "The unique identifier of the promotion or reward.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d" }, - "type": { - "$ref": "#/components/schemas/UserType" + "loyalty_type": { + "$ref": "#/components/schemas/DiscountSourceLoyaltyType" }, - "email": { + "scheme_type": { + "$ref": "#/components/schemas/DiscountSourceLoyaltySchemeType" + }, + "points": { + "type": [ + "integer", + "null" + ], + "format": "int64", + "minimum": 1, + "description": "The number of points used for this loyalty discount.\nMust be a positive integer if the scheme type is POINTS.\nMust not be populated if the scheme type is STAMPS.\n", + "example": 50 + }, + "name": { "type": "string", - "example": "example@sumup.com", - "description": "End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, for unique identification use ID instead." + "description": "The name of the loyalty discount.", + "example": "Free coffee", + "maxLength": 100 }, - "mfa_on_login_enabled": { - "type": "boolean", - "example": true, - "description": "True if the user has enabled MFA on login." + "description": { + "type": [ + "string", + "null" + ], + "description": "The description of the loyalty discount.", + "example": "Free coffee for 50 points", + "maxLength": 250 }, - "virtual_user": { - "type": "boolean", - "deprecated": true, - "x-deprecation-notice": "Rely on `type` instead.", - "example": false, - "description": "True if the user is a virtual user (operator)." + "discount_class": { + "$ref": "#/components/schemas/DiscountClass" }, - "service_account_user": { - "type": "boolean", - "deprecated": true, - "x-deprecation-notice": "Rely on `type` instead.", - "example": false, - "description": "True if the user is a service account." + "application_mode": { + "$ref": "#/components/schemas/DiscountApplicationMode" + } + } + }, + "DiscountSource": { + "type": "object", + "description": "The source of discount. Exactly one property must be set.", + "properties": { + "ad_hoc": { + "$ref": "#/components/schemas/DiscountSourceAdHoc" }, - "disabled_at": { - "type": "string", - "format": "date-time", - "description": "Time when the user has been disabled. Applies only to virtual users (`virtual_user: true`)." + "basic": { + "$ref": "#/components/schemas/DiscountSourceBasic" }, - "nickname": { - "type": "string", - "example": "Test User", - "description": "User's nickname. Used for display purposes only." + "coupon": { + "$ref": "#/components/schemas/DiscountSourceCoupon" }, - "picture": { - "type": "string", - "format": "uri", - "example": "https://usercontent.sumup.com/44ca0f5b-813b-46e1-aee7-e6242010662e.png", - "description": "URL of the End-User's profile picture. This URL refers to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image." + "offer": { + "$ref": "#/components/schemas/DiscountSourceOffer" }, - "classic": { - "$ref": "#/components/schemas/MembershipUserClassic" + "loyalty": { + "$ref": "#/components/schemas/DiscountSourceLoyalty" } } }, - "MembershipUserClassic": { + "DiscountValue": { "type": "object", - "description": "Classic identifiers of the user.", - "deprecated": true, - "required": [ - "user_id" - ], + "description": "The value type of the discount, either a percentage based or absolute monetary value.\n\nIt is required that only one of the following is set:\n- absolute\n- percentage.", "properties": { - "user_id": { + "absolute": { + "description": "The absolute value in minor units of the currency according to the Sale.currency.scale.\nExample: 10000 = 10.00\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "percentage": { "type": "integer", + "format": "int64", "minimum": 0, - "maximum": 2147483647 + "description": "The percentage in minor units (1/100000).\n\nExamples:\n- 10% -\u003e 0.10 (decimal) = 10000 (minor units)\n- 15.5% -\u003e 0.155 (decimal) = 15500 (minor units)\n- 0.001% -\u003e 0.00001 (decimal) = 1 (minor units)\n", + "example": 10000 } } }, - "Role": { - "title": "Role", + "DiscountLine": { "type": "object", - "description": "A custom role that can be used to assign set of permissions to members.", + "description": "Object representing information about single discount line.", "required": [ - "id", - "name", - "permissions", - "is_predefined", - "created_at", - "updated_at" + "level", + "source", + "value", + "net_amount", + "gross_amount", + "tax_amount" ], "properties": { "id": { "type": "string", - "description": "Unique identifier of the role.", - "example": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - }, - "name": { - "type": "string", - "example": "Senior Shop Manager II", - "description": "User-defined name of the role." + "description": "An id used to associate a discount line with a specific discount.\nSince we can apply multiple discounts (e.g. 2x 10% whole cart off) \nwe need to be able to identify which discount line belongs to which cart discount.\nRecommended to use UUID identifiers.", + "example": "075b0b5c-a1f4-46da-9aca-92fb6dd5905d", + "maxLength": 100 }, "description": { "type": "string", - "example": "Manges the shop and the employees.", - "description": "User-defined description of the role." + "description": "A description or reason of the discount.", + "example": "Happy Hour", + "maxLength": 250 }, - "permissions": { - "type": "array", - "description": "List of permission granted by this role.", - "maxItems": 100, - "items": { - "type": "string" - }, - "example": [] + "level": { + "$ref": "#/components/schemas/DiscountLevel" }, - "is_predefined": { - "type": "boolean", - "example": true, - "description": "True if the role is provided by SumUp." + "source": { + "$ref": "#/components/schemas/DiscountSource" }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + "value": { + "$ref": "#/components/schemas/DiscountValue" }, - "created_at": { - "type": "string", - "description": "The timestamp of when the role was created.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "net_amount": { + "description": "The net amount of the discount.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] }, - "updated_at": { - "type": "string", - "description": "The timestamp of when the role was last updated.", - "format": "date-time", - "example": "2023-01-20T15:16:17Z" + "gross_amount": { + "description": "The gross amount of the discount.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "tax_amount": { + "description": "The tax amount of the discount.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] } } }, - "Metadata": { - "description": "Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.", - "type": "object", - "maxProperties": 64, - "example": {}, - "additionalProperties": true - }, - "Attributes": { - "description": "Object attributes that are modifiable only by SumUp applications.\n", - "type": "object", - "example": {}, - "additionalProperties": true - }, - "UserType": { - "type": "string", - "description": "Type of the user account.", - "enum": [ - "user", - "managed_user", - "service_account", - "system_account" - ], - "example": "user" - }, - "Address": { - "externalDocs": { - "description": "Address documentation", - "url": "https://developer.sumup.com/tools/glossary/address" - }, - "description": "An address somewhere in the world. The address fields used depend on the country conventions. For example, in Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses is `state`, whereas in Chile it's `region`.\nWhether an address is valid or not depends on whether the locally required fields are present. Fields not supported in a country will be ignored.", + "LineItemPriceV10": { "type": "object", + "description": "Pricing for a single line, valid for every item type.\n\nMerges the standard amounts (with tax breakdown) and the final amounts (after\ndiscounts/modifiers).\n\nTotals and tax amounts can be negative for return-like operations (for example\na deposit with `operation_type` = `RETURN`).", "required": [ - "country" + "unit_amount", + "total_net_amount", + "total_gross_amount", + "taxes", + "total_net_amount_final", + "total_gross_amount_final", + "taxes_final" ], "properties": { - "street_address": { - "type": "array", - "maxItems": 2, - "items": { - "type": "string", - "description": "The first line of the address.", - "maxLength": 100 - }, - "example": [ - "Paul-Linke-Ufer 39-40", - "2. Hinterhof" - ] + "unit_amount": { + "description": "The price of a single unit. If the tax_mode is GROSS it includes taxes,\notherwise no tax is included. It does NOT include discounts.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ], + "example": 300 }, - "post_code": { - "type": "string", - "description": "The postal code (aka. zip code) of the address.\n", - "maxLength": 10, - "example": "10999" + "total_net_amount": { + "description": "The net amount (including modifiers if applied). It does NOT include discounts.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 252 }, - "country": { + "total_gross_amount": { + "description": "The gross amount (including modifiers if applied). It does NOT include discounts.", "allOf": [ { - "description": "The ISO3166-1 Alpha-2 code of the address country.\n", - "example": "DE" - }, + "$ref": "#/components/schemas/Amount" + } + ], + "example": 300 + }, + "taxes": { + "type": "array", + "minItems": 1, + "maxItems": 1000, + "description": "Taxes applied on top of the net amount resulting in the gross amount.", + "items": { + "$ref": "#/components/schemas/TaxLine" + }, + "example": [ { - "$ref": "#/components/schemas/CountryCode" + "id": "tax-vat-19", + "net_amount": 252, + "gross_amount": 300, + "tax_amount": 48 } ] }, - "city": { - "type": "string", - "description": "The city of the address.\n", - "maxLength": 60, - "example": "Berlin" - }, - "province": { - "type": "string", - "description": "The province where the address is located. This may not be relevant in some countries.\n", - "maxLength": 60, - "example": "Berlin" - }, - "region": { - "type": "string", - "description": "The region where the address is located. This may not be relevant in some countries.\n", - "maxLength": 60, - "example": "Baden Wuerttemberg" - }, - "county": { - "type": "string", - "description": "A county is a geographic region of a country used for administrative or other purposes in some nations. Used in countries such as Ireland, Romania, etc.\n", - "maxLength": 60, - "example": "Dublin County" - }, - "autonomous_community": { - "type": "string", - "description": "In Spain, an autonomous community is the first sub-national level of political and administrative division.\n", - "maxLength": 60, - "example": "Catalonia" - }, - "post_town": { - "type": "string", - "description": "A post town is a required part of all postal addresses in the United Kingdom and Ireland, and a basic unit of the postal delivery system.\n", - "maxLength": 60, - "example": "London" - }, - "state": { - "type": "string", - "description": "Most often, a country has a single state, with various administrative divisions. The term \"state\" is sometimes used to refer to the federated polities that make up the federation. Used in countries such as the United States and Brazil.\n", - "maxLength": 60, - "example": "California" - }, - "neighborhood": { - "type": "string", - "description": "Locality level of the address. Used in countries such as Brazil or Chile.\n", - "maxLength": 60, - "example": "Copacabana" - }, - "commune": { - "type": "string", - "description": "In many countries, terms cognate with \"commune\" are used, referring to the community living in the area and the common interest. Used in countries such as Chile.\n", - "maxLength": 60, - "example": "Providencia" + "discounts": { + "type": "array", + "maxItems": 1000, + "description": "Discounts applied. Discount amounts do not affect `total_net_amount` /\n`total_gross_amount`; they are reflected in the `*_final` amounts.\n", + "items": { + "$ref": "#/components/schemas/DiscountLine" + }, + "example": [] }, - "department": { - "type": "string", - "description": "A department (French: département, Spanish: departamento) is an administrative or political division in several countries. Used in countries such as Colombia.\n", - "maxLength": 60, - "example": "Antioquia" + "total_net_amount_final": { + "description": "The final net amount including discounts and modifiers. Equals `total_net_amount` if no discounts apply.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 210 }, - "municipality": { - "type": "string", - "description": "A municipality is usually a single administrative division having corporate status and powers of self-government or jurisdiction as granted by national and regional laws to which it is subordinate. Used in countries such as Colombia.\n", - "maxLength": 60, - "example": "Medellín" + "total_gross_amount_final": { + "description": "The final gross amount including discounts, modifiers and taxes. Equals `total_gross_amount` if no discounts apply.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 250 }, - "district": { + "taxes_final": { + "type": "array", + "minItems": 1, + "maxItems": 1000, + "description": "Taxes applied on top of `total_net_amount_final` resulting in `total_gross_amount_final`. Equals `taxes` if no discounts apply.", + "items": { + "$ref": "#/components/schemas/TaxLine" + }, + "example": [ + { + "id": "tax-vat-19", + "net_amount": 210, + "gross_amount": 250, + "tax_amount": 40 + } + ] + } + } + }, + "CategoryV10": { + "type": "object", + "description": "A category a line belongs to.", + "required": [ + "id", + "name" + ], + "properties": { + "id": { "type": "string", - "description": "A district is a type of administrative division that in some countries is managed by the local government. Used in countries such as Portugal.\n", - "maxLength": 60, - "example": "Lisbon District" + "maxLength": 100, + "description": "The category id. Usually a UUID, but not always (legacy cases).", + "example": "b064ed44-66e1-45a1-a963-b783808f0436" }, - "zip_code": { + "name": { "type": "string", - "description": "A US system of postal codes used by the United States Postal Service (USPS).\n", - "maxLength": 10, - "example": "94103" + "maxLength": 30, + "description": "The category name.", + "example": "Food" + } + } + }, + "PriceAmounts": { + "description": "Base price information for items including unit amount and totals.", + "type": "object", + "required": [ + "unit_amount", + "total_net_amount", + "total_gross_amount" + ], + "properties": { + "unit_amount": { + "description": "The price of a single unit.\nIf the tax_mode is GROSS, it includes taxes, otherwise no tax included.\nIt doesn't include discounts.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] }, - "eircode": { - "type": "string", - "description": "A postal address in Ireland.\n", - "maxLength": 10, - "example": "D02 X285" + "total_net_amount": { + "description": "The net amount (including modifiers if applied). It does NOT include discounts.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] + }, + "total_gross_amount": { + "description": "The gross amount (including modifiers if applied). It does NOT include discounts.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] } - }, - "example": { - "street_address": [ - "Paul-Linke-Ufer 39-40", - "2. Hinterhof" - ], - "post_code": "10999", - "city": "Berlin", - "country": "DE" } }, - "CountryCode": { - "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\ncountry code. This definition users `oneOf` with a two-character string\ntype to allow for support of future countries in client code.", - "type": "string", - "minLength": 2, - "maxLength": 2, - "pattern": "^[A-Z]{2}$", - "example": "BR" + "PositivePriceAmounts": { + "description": "Price information for items with positive amounts only.", + "allOf": [ + { + "$ref": "#/components/schemas/PriceAmounts" + }, + { + "type": "object", + "properties": { + "total_net_amount": { + "$ref": "#/components/schemas/PositiveAmount" + }, + "total_gross_amount": { + "$ref": "#/components/schemas/PositiveAmount" + } + } + } + ] }, - "PersonalIdentifiers": { - "type": "array", - "description": "A list of country-specific personal identifiers.", - "items": { - "$ref": "#/components/schemas/PersonalIdentifier" - }, - "maxItems": 32, - "example": [ + "PositiveTaxLine": { + "description": "Tax line with positive amounts only.\nInformation about tax together with amounts before and after its application such as:\n - net amount: taxable net amount, scoped by this tax\n - gross amount: amount after applying the tax\nThe numbers here can't be negative.", + "allOf": [ { - "ref": "br.cpf", - "value": "847.060.136-90" + "$ref": "#/components/schemas/TaxLine" + }, + { + "type": "object", + "properties": { + "net_amount": { + "description": "Net amount before applying the tax. \nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "gross_amount": { + "description": "Gross amount after applying the tax.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "tax_amount": { + "description": "Amount of tax.\nThe value of the amount in minor units of the currency according to the Sale.currency.scale.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + } + } } ] }, - "PersonalIdentifier": { + "PositivePriceWithTaxes": { + "description": "Price information with positive amounts and detailed tax breakdown.", + "allOf": [ + { + "$ref": "#/components/schemas/PositivePriceAmounts" + }, + { + "type": "object", + "required": [ + "taxes" + ], + "properties": { + "taxes": { + "type": "array", + "minItems": 1, + "maxItems": 1000, + "description": "Taxes applied on top of net amount resulting in gross amount.", + "items": { + "$ref": "#/components/schemas/PositiveTaxLine" + } + } + } + } + ] + }, + "FinalPriceAmounts": { + "description": "Final price amounts after all calculations and adjustments.", "type": "object", "required": [ - "ref", - "value" + "total_net_amount_final", + "total_gross_amount_final", + "taxes_final" ], "properties": { - "ref": { - "type": "string", - "description": "The unique reference for the personal identifier type.", - "example": "br.cpf", - "maxLength": 32 + "discounts": { + "type": "array", + "maxItems": 1000, + "description": "Discounts applied.\n\nImportant: \nDiscount amounts shouldn't take effect on net and gross amounts.\n\nDiscount money amounts depend on where discount was applied:\n - for item level discount: whole discount money amount is applied\n - for cart level discount: only part of the whole amount is applied \n (discount money value is split on each line item)\n", + "items": { + "$ref": "#/components/schemas/DiscountLine" + } }, - "value": { - "type": "string", - "description": "The personal identifier value.", - "example": "847.060.136-90", - "maxLength": 128 + "total_net_amount_final": { + "description": "The final net amount includes discounts and modifiers. It does NOT include taxes. If no discounts are applied, it should be equal to total_net_amount.", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "total_gross_amount_final": { + "description": "The final gross amount includes discounts, modifiers, and taxes. If no discounts are applied, it should be equal to total_gross_amount.", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ] + }, + "taxes_final": { + "type": "array", + "minItems": 1, + "maxItems": 1000, + "description": "Taxes applied on top of `total_net_amount_final` amount resulting in `total_gross_amount_final` amount.\nIf no discounts are applied, it should be equal to `taxes`.\n", + "items": { + "$ref": "#/components/schemas/PositiveTaxLine" + } } - }, - "example": { - "ref": "br.cpf", - "value": "847.060.136-90" } }, - "ListPersonsResponseBody": { + "ModifierSet": { "type": "object", + "description": "Modifier set attached to an item.", "required": [ - "items" + "id", + "name" ], "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Person" - } + "id": { + "type": "string", + "maxLength": 100, + "description": "The id of the modifier set that modifier belongs to.", + "example": "b064ed44-66e1-45a1-a963-b783808f0436" + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 150, + "description": "The name of the modifier set that the modifier belongs to.", + "example": "Burger Toppings" } } }, - "Merchant": { - "title": "Merchant", - "externalDocs": { - "description": "Merchant documentation", - "url": "https://developer.sumup.com/tools/glossary/merchant" - }, + "ModifierItem": { + "type": "object", + "description": "Modifiers are reported under line items and can be build from Item Catalog objects.\nModifiers has to be attached to an item and can't be sold and refunded alone.", "allOf": [ { - "type": "object", - "required": [ - "merchant_code", - "country", - "default_currency", - "default_locale" - ], - "properties": { - "merchant_code": { - "type": "string", - "readOnly": true, - "description": "Short unique identifier for the merchant.", - "example": "MK01A8C2" - }, - "organization_id": { - "type": "string", - "description": "ID of the organization the merchant belongs to (if any).", - "example": "G0UZPVAX" - }, - "business_type": { - "type": "string", - "description": "The business type.\n* `sole_trader`: The business is run by an self-employed individual.\n* `company`: The business is run as a company with one or more shareholders\n* `partnership`: The business is run as a company with two or more shareholders that can be also other legal entities\n* `non_profit`: The business is run as a nonprofit organization that operates for public or social benefit\n* `government_entity`: The business is state owned and operated\n" - }, - "company": { - "$ref": "#/components/schemas/Company" - }, - "country": { - "$ref": "#/components/schemas/CountryCode" - }, - "business_profile": { - "$ref": "#/components/schemas/BusinessProfile" - }, - "avatar": { - "type": "string", - "format": "uri", - "description": "A user-facing small-format logo for use in dashboards and other user-facing applications. For customer-facing branding see `merchant.business_profile.branding`.\n" - }, - "alias": { - "type": "string", - "description": "A user-facing name of the merchant account for use in dashboards and other user-facing applications. For customer-facing business name see `merchant.business_profile`.\n" - }, - "default_currency": { - "type": "string", - "readOnly": true, - "description": "Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217) representing the default currency for the account.\n", - "example": "EUR", - "minLength": 3, - "maxLength": 3 - }, - "default_locale": { + "$ref": "#/components/schemas/PositivePriceWithTaxes" + }, + { + "$ref": "#/components/schemas/FinalPriceAmounts" + }, + { + "type": "object", + "required": [ + "id", + "name", + "set", + "quantity" + ], + "properties": { + "id": { "type": "string", - "description": "Merchant's default locale, represented as a BCP47 [RFC5646](https://datatracker.ietf.org/doc/html/rfc5646) language tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1](https://www.iso.org/iso-639-language-code) language code in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1](https://www.iso.org/iso-3166-country-codes.html) country code in uppercase, separated by a dash. For example, en-US or fr-CA.\nIn multilingual countries this is the merchant's preferred locale out of those, that are officially spoken in the country. In a countries with a single official language this will match the official language.", - "example": "de-DE", - "minLength": 2, - "maxLength": 5 - }, - "sandbox": { - "type": "boolean", - "description": "True if the merchant is a sandbox for testing.", - "example": false - }, - "meta": { - "$ref": "#/components/schemas/Meta" + "maxLength": 100, + "description": "Modifier id, coming from the Item Catalog", + "example": "b064ed44-66e1-45a1-a963-b783808f0436" }, - "classic": { - "$ref": "#/components/schemas/ClassicMerchantIdentifiers" + "name": { + "type": "string", + "description": "Modifier name, coming from the Item Catalog", + "example": "Extra Cheese", + "maxLength": 150 }, - "version": { - "$ref": "#/components/schemas/Version" + "set": { + "$ref": "#/components/schemas/ModifierSet" }, - "change_status": { - "$ref": "#/components/schemas/ChangeStatus" + "quantity": { + "$ref": "#/components/schemas/Quantity" } } - }, - { - "$ref": "#/components/schemas/Timestamps" } ] }, - "Meta": { - "type": "object", - "additionalProperties": { - "type": "string", - "maxLength": 256 - }, - "description": "A set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.\n\n**Warning**: Updating Meta will overwrite the existing data. Make sure to always include the complete JSON object.", - "example": {} - }, - "BusinessProfile": { + "ItemReferencesV10": { "type": "object", - "description": "Business information about the merchant. This information will be visible to the merchant's customers.\n", + "description": "Outward identifiers and links for a line, kept in one place rather than scattered\nper item type.", "properties": { - "name": { - "type": "string", - "description": "The customer-facing business name.", - "minLength": 1, - "maxLength": 150, - "example": "Example Coffee" - }, - "dynamic_descriptor": { + "catalog_source": { "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^[a-zA-Z0-9 +'_.-]+$", - "description": "The descriptor is the text that your customer sees on their bank account statement.\nThe more recognisable your descriptor is, the less risk you have of receiving disputes (e.g. chargebacks).\n", - "example": "Example Coffee" + "description": "The source of the catalog the line originates from.", + "enum": [ + "SUMUP", + "EXTERNAL" + ], + "default": "SUMUP", + "example": "SUMUP" }, - "website": { + "catalog_reference": { "type": "string", - "description": "The business's publicly available website.", - "minLength": 1, + "description": "Reference to the backing catalog entity (item variant, deposit, ...),\ntypically a URN such as\n`urn:sumup:pos:variant:${MERCHANT_CODE}:${ITEM_ID}:${VARIANT_ID}` or\n`urn:sumup:pos:deposit:${MERCHANT_CODE}:${DEPOSIT_ID}`.\nEmpty for ad-hoc / manual lines. Type-agnostic on purpose: a new item type\nbacked by a catalog entity reuses this field instead of adding its own.", "maxLength": 255, - "example": "https://example.com" + "example": "urn:sumup:pos:variant:MCGLE7VC:9736e947-6f1f-487f-846a-c5954fb06a5a:7fff192f-ce29-4673-890f-2d68ba557946" }, - "email": { + "external_id": { "type": "string", - "description": "A publicly available email address.", - "minLength": 1, - "maxLength": 255, - "example": "contact@example.com" - }, - "phone_number": { - "$ref": "#/components/schemas/PhoneNumber" - }, - "address": { - "$ref": "#/components/schemas/Address" + "description": "An external reference id connecting this line to another system.", + "maxLength": 250, + "example": "POS-LINE-001" }, - "branding": { - "$ref": "#/components/schemas/Branding" + "sku": { + "type": "string", + "description": "Stock keeping unit, enriched from the Catalog when available.", + "maxLength": 100, + "example": "COFFEE-LARGE" } } }, - "Person": { - "allOf": [ - { - "$ref": "#/components/schemas/BasePerson" - } - ] - }, - "PhoneNumber": { + "FeatureValueTypeV10": { "type": "string", - "description": "A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n", - "example": "+420123456789", - "maxLength": 16 + "description": "The data type of a feature value. The wire `value` is always a string and is parsed\naccording to this type.", + "enum": [ + "TEXT", + "INTEGER", + "DECIMAL", + "DATE", + "BOOLEAN" + ], + "example": "TEXT" }, - "Branding": { + "FeatureV10": { "type": "object", - "description": "Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.", + "description": "A named, typed characteristic of a line. New item types add data here instead of\na typed sub-object per type.\n\nExamples by item type (illustrative, not exhaustive):\n - DEPOSIT: `operation_type` = \"SALE\", `linked_line_id` = \"line-1\"\n - GIFT_CARD: `gift_card_reference` = \"GCMINGXPC5\"\n - CATALOG: `variant_name` = \"Large\", `item_id` / `variant_id` (TEXT),\n `reporting_category_id` = \"cat-...\"\n - FEE: `fee_type` = \"SHIPPING\" (required); optional `fee_id`,\n `value_absolute` or `value_percentage`, and per-type metadata\n features such as `delivery_name` / `tracking_reference` (shipping),\n `card_type` / `scheme` (surcharge), or `policy_id` (cancellation)\n - (future) SUBSCRIPTION: `billing_period` = \"P1M\", `renews_at` = \"2026-07-02\"\n\nConventional `FEE` feature keys:\n - `fee_type` (TEXT, required): `SHIPPING`, `SURCHARGE`, `SERVICE_CHARGE`, or\n `CANCELLATION`\n - `fee_id` (TEXT, optional): identifier of the fee definition\n - `value_absolute` (INTEGER, optional): configured absolute value in minor units\n of the sale currency (the charged amount is on `price`)\n - `value_percentage` (INTEGER, optional): configured percentage in minor units\n (1/100000; e.g. 10000 = 10%)\n - Per-type metadata (optional, TEXT unless noted): `delivery_name`,\n `tracking_reference` (shipping); `card_type`, `scheme` (surcharge);\n `policy_id` (cancellation)", + "required": [ + "name", + "value_type", + "value" + ], "properties": { - "footer_text": { + "name": { "type": "string", - "description": "Footer text rendered on receipts and other customer-facing products.\n", - "minLength": 1, - "maxLength": 500, - "examples": [ - "Thanks for shopping with us." - ] + "description": "The feature name/key.", + "maxLength": 100, + "example": "operation_type" }, - "icon": { - "type": "string", - "format": "uri", - "description": "An icon for the merchant. Must be square.\n" + "value_type": { + "$ref": "#/components/schemas/FeatureValueTypeV10" }, - "logo": { + "value": { "type": "string", - "format": "uri", - "description": "A logo for the merchant that will be used in place of the icon and without the merchant's name next to it if there's sufficient space.\n" - }, - "hero": { + "description": "The feature value in canonical string form, to be parsed per `value_type`\n(e.g. INTEGER -\u003e \"3\", DECIMAL -\u003e \"1.50\", DATE -\u003e \"2026-07-02\",\nBOOLEAN -\u003e \"true\"). Carrying it as a string keeps the wire format stable as\nnew feature names and value types are introduced.", + "maxLength": 1000, + "example": "SALE" + } + } + }, + "SaleLineItemV10": { + "type": "object", + "description": "A single line of a sale.\n\nThe envelope (id, type, name, quantity, unit_of_measure, price) is stable and\ntype-agnostic: any consumer can render and total a line from these fields alone.\nType-specific data is in `features`. There is no per-type object and no discriminator,\nso a new item type does not change this schema.", + "required": [ + "id", + "type", + "name", + "quantity", + "unit_of_measure", + "price" + ], + "properties": { + "id": { "type": "string", - "format": "uri", - "description": "Data-URL encoded hero image for the merchant business.\n" + "description": "Stable identifier of the line within the sale. Used for linking (e.g. deposits).", + "maxLength": 100, + "example": "line-1" }, - "primary_color": { + "type": { + "$ref": "#/components/schemas/ItemTypeV10" + }, + "name": { "type": "string", - "description": "A hex color value representing the primary branding color of this merchant (your brand color).\n", - "examples": [ - "#FF4B3A", - "#0072C6", - "#F68B20" - ] + "description": "Display name of the line.", + "maxLength": 250, + "example": "Cappuccino" }, - "primary_color_fg": { + "quantity": { + "$ref": "#/components/schemas/Quantity" + }, + "unit_of_measure": { + "$ref": "#/components/schemas/UnitOfMeasure" + }, + "service_type": { "type": "string", - "description": "A hex color value representing the color of the text displayed on branding color of this merchant.\n", - "examples": [ - "#FF4B3A", - "#0072C6", - "#F68B20" - ] + "description": "The type of service for this line.", + "enum": [ + "IN_HOUSE", + "TAKE_AWAY" + ], + "example": "IN_HOUSE" }, - "secondary_color": { + "note": { "type": "string", - "description": "A hex color value representing the secondary branding color of this merchant (accent color used for buttons).\n", - "examples": [ - "#FF4B3A", - "#0072C6", - "#F68B20" + "maxLength": 300, + "description": "Optional free-text note attached to the line, visible on receipts.", + "example": "extra hot" + }, + "price": { + "$ref": "#/components/schemas/LineItemPriceV10" + }, + "categories": { + "type": "array", + "description": "Categories the line belongs to. A shared optional structure available to any\nline; not a per-type field.\n", + "maxItems": 1000, + "items": { + "$ref": "#/components/schemas/CategoryV10" + }, + "example": [ + { + "id": "cat-hot-drinks", + "name": "Hot Drinks" + } ] }, - "secondary_color_fg": { - "type": "string", - "description": "A hex color value representing the color of the text displayed on secondary branding color of this merchant.\n", - "examples": [ - "#FF4B3A", - "#0072C6", - "#F68B20" + "modifiers": { + "type": "array", + "description": "Modifiers customise a line (e.g. \"oat milk\" on a cappuccino). A shared\noptional structure available to any line; not a per-type field.\n", + "maxItems": 50, + "items": { + "$ref": "#/components/schemas/ModifierItem" + }, + "example": [] + }, + "references": { + "$ref": "#/components/schemas/ItemReferencesV10" + }, + "features": { + "type": "array", + "description": "Named, typed, type-specific data. New item types add their data here as\nfeatures instead of new schema variants. See `Feature` for per-type examples.\n", + "maxItems": 100, + "items": { + "$ref": "#/components/schemas/FeatureV10" + }, + "example": [ + { + "name": "variant_name", + "value_type": "TEXT", + "value": "Large" + } ] + } + } + }, + "SalePriceV10": { + "type": "object", + "description": "Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`.\n\nLine-level breakdown (unit price, line discounts, per-line taxes) lives on\n`items[].price`. This object holds the rolled-up totals and cart-level\nadjustments that consumers use for receipts and payment reconciliation.", + "required": [ + "net_amount", + "gross_amount", + "taxes" + ], + "properties": { + "net_amount": { + "description": "Final net total for the sale: sum of `items[].price.total_net_amount_final`\nafter cart-level discounts (tips excluded).\nIn minor units according to `Sale.currency.scale`.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 777 }, - "background_color": { - "type": "string", - "description": "A hex color value representing the preferred background color of this merchant.\n", - "examples": [ - "#FF4B3A", - "#0072C6", - "#F68B20" + "gross_amount": { + "description": "Final gross total for the sale: sum of `items[].price.total_gross_amount_final`\nafter cart-level discounts (tips excluded).\nSame value as search `total_amount`, in minor units according to `Sale.currency.scale`.\nPayment amounts include tips and can therefore differ from this gross total.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 925 + }, + "cart_discounts": { + "type": "array", + "maxItems": 1000, + "description": "Discounts applied at cart level. Item-level discounts remain on\n`items[].price.discounts`.", + "items": { + "$ref": "#/components/schemas/DiscountLine" + }, + "example": [] + }, + "taxes": { + "type": "array", + "minItems": 1, + "maxItems": 1000, + "description": "Tax lines aggregated across the sale (after cart-level discounts).\nPer-line tax detail remains on `items[].price.taxes` / `taxes_final`.", + "items": { + "$ref": "#/components/schemas/TaxLine" + }, + "example": [ + { + "id": "tax-vat-19", + "net_amount": 777, + "gross_amount": 925, + "tax_amount": 148 + } ] } } }, - "LegalType": { - "externalDocs": { - "description": "The country SDK documentation for legal types.", - "url": "https://developer.sumup.com/tools/glossary/merchant#legal-types" - }, + "TaxMode": { "type": "string", - "description": "The unique legal type reference as defined in the country SDK. We do not rely on IDs as used by other services. Consumers of this API are expected to use the country SDK to map to any other IDs, translation keys, or descriptions.\n", - "minLength": 4, - "maxLength": 64, - "pattern": "^[a-z]{2}\\.[a-z_]+$", - "examples": [ - "de.freiberufler", - "br.ltda", - "gb.partnership", - "bg.private_limited_company" + "description": "The tax mode used by merchant for displaying prices and calculating taxes:\n- NO_TAX: The prices don't contain any taxes, merchant don't report taxes\n- GROSS: The prices used by merchant already include taxes (common in EU), the tax is calculated from the gross price\n- NET: The prices used by merchant don't include taxes (common in US), the tax is calculated from the net price\nSince tax values can be different for the same net price depending if the tax\nwas calculated from gross or net price, this info is necessary to be able to reconcile tax calculations.\n", + "enum": [ + "NO_TAX", + "GROSS", + "NET" + ], + "example": "NO_TAX" + }, + "SalesChannel": { + "type": "string", + "description": "The sale_channel is field that indicates the channel through\nwhich the sale was made. For example, if the sale was made in the merchant app,\nthe sale_channel could be POS. If the sale was made on a kiosk, the\nsale_channel is KIOSK.\n\n*Accepted values:* [\"POS\", \"KIOSK\", \"ONLINE_STORE\", \"SOLO\", \"ORDER_AND_PAY\", \"INVOICE\", \"BOOKINGS\", \"ORDER_AGGREGATOR\", \"SUBSCRIPTIONS\", \"UNKNOWN\"].", + "example": "POS" + }, + "SaleSource": { + "type": "object", + "description": "Information about the source of the sale.", + "properties": { + "channel": { + "$ref": "#/components/schemas/SalesChannel" + }, + "sub_channel": { + "type": "string", + "description": "The sub_channel is an optional field that can be used to provide more\ninformation about the sale_channel. For example, if the sale_channel is\nONLINE_PAYMENTS, the sub_channel could be \"WIX\" or \"QR_CODE\" or \"WOOCOMMERCE\".\n", + "example": "QR_CODE", + "maxLength": 50 + }, + "external_id": { + "type": "string", + "description": "An external reference ID for connecting orders/sales between products", + "example": "123456", + "maxLength": 250 + }, + "external_sub_channel_id": { + "type": "string", + "description": "An external reference ID for the sub-channel.\nFor example, when channel is BOOKINGS and sub_channel is POS,\nthis can hold the OMS order ID while external_id holds the appointment ID.\n", + "example": "9736e947-6f1f-487f-846a-c5954fb06a5a", + "maxLength": 250 + } + }, + "required": [ + "channel" ] }, - "CompanyIdentifiers": { - "type": "array", - "description": "A list of country-specific company identifiers.\n", - "items": { - "$ref": "#/components/schemas/CompanyIdentifier" - } + "PublicPaymentMethod": { + "type": "string", + "description": "Payment method on public sales read API v1.0.\nDigital wallets are first-class methods. Gift card payments use `gift_card`, not `apm`.\nInput is case-insensitive; the canonical form is lowercase snake_case.\n**VALUES**: [card, cash, apm, external, apple_pay, google_pay, whatsapp_pay, gift_card].", + "example": "card", + "maxLength": 20 + }, + "PublicApmType": { + "type": "string", + "description": "Alternative payment method type when `method` is `apm`.\nGift card is not an APM on this API.\nInput is case-insensitive; the canonical form is lowercase snake_case.\n**VALUES**: [qr_code_pix, sepa_dd, paypal, sumup_pay, twint, iris].", + "maxLength": 20 }, - "CompanyIdentifier": { - "externalDocs": { - "description": "Company identifier documentation", - "url": "https://developer.sumup.com/tools/glossary/merchant#company-identifiers" - }, + "PublicCardV10": { "type": "object", + "description": "Card brand, credit/debit processing type, and last four digits.", "required": [ - "ref", - "value" + "brand", + "type", + "last_4_digits" ], "properties": { - "ref": { + "brand": { + "$ref": "#/components/schemas/Brand" + }, + "type": { "type": "string", - "pattern": "^[a-z]{2}\\.[a-z_]+$", - "description": "The unique reference for the company identifier type as defined in the country SDK.\n", - "examples": [ - "de.gmbh" - ] + "description": "Credit or debit processing choice, not brand or funding.\n`unknown` when unavailable; prepaid/voucher are not processing types.", + "enum": [ + "credit", + "debit", + "unknown" + ], + "example": "debit" }, - "value": { + "last_4_digits": { "type": "string", - "minLength": 1, - "maxLength": 100, - "description": "The company identifier value.\n", - "examples": [ - "HRB 123456" - ] + "description": "The last 4 digits of the card used for the payment.", + "example": "1234", + "pattern": "^\\d{4}$", + "minLength": 4, + "maxLength": 4 } - }, - "examples": [ - { - "ref": "de.gmbh", - "value": "HRB 123456" + } + }, + "PublicGiftCardPayment": { + "type": "object", + "description": "Gift card used for this payment. Present when `method` is `gift_card` and the gift card\nid is known.\nGift card IDs use the format \"GC\" followed by 9 alphanumeric characters\n(e.g. GCZ3NTMB1V).", + "properties": { + "id": { + "type": "string", + "description": "Gift card identifier. Format \"GC\" followed by 9 alphanumeric characters\n(e.g. GCZ3NTMB1V).", + "example": "GCZ3NTMB1V" } + }, + "required": [ + "id" ] }, - "Ownership": { + "PublicPaymentV10": { + "title": "PublicPayment", "type": "object", + "description": "Payment on a closed sale, for bookkeeping and reconciliation.\n\nAcquirer/processing cost is not on this object. Merchant-charged fees (shipping, service\ncharge, etc.) appear as `type: \"FEE\"` item lines in `Sale.items`.", "required": [ - "share" + "method", + "reference", + "type", + "amount", + "status", + "processed_at" ], "properties": { - "share": { - "description": "The percent of ownership shares held by the Person expressed in percent mille (1/100000). Only Persons with the relationship `owner` can have ownership.\n", - "type": "integer", - "format": "int32", - "minimum": 25000, - "maximum": 100000, - "example": 50000 + "method": { + "$ref": "#/components/schemas/PublicPaymentMethod" + }, + "reference": { + "$ref": "#/components/schemas/Reference" + }, + "type": { + "type": "string", + "default": "purchase", + "description": "Payment operation type.\nThis is distinct from the payment instrument in `method`.\nInput is case-insensitive; the canonical form is lowercase snake_case.\n**VALUES**: [purchase, unreferenced_refund]\nDefaults to \"purchase\" if unspecified. Either a normal purchase or an unreferenced refund for negative\nsales like deposit returns.\n", + "example": "purchase" + }, + "amount": { + "description": "The amount of the payment including tips.\nThe value of the amount in minor units of `Sale.currency`.\n", + "allOf": [ + { + "$ref": "#/components/schemas/PositiveAmount" + } + ], + "example": 975 + }, + "status": { + "type": "string", + "description": "The status of the payment.", + "enum": [ + "FAILED", + "SUCCESSFUL", + "CANCELED" + ], + "example": "SUCCESSFUL" + }, + "apm_type": { + "$ref": "#/components/schemas/PublicApmType" + }, + "card": { + "$ref": "#/components/schemas/PublicCardV10" + }, + "gift_card": { + "$ref": "#/components/schemas/PublicGiftCardPayment" + }, + "processed_at": { + "type": "string", + "format": "date-time", + "description": "UTC date-time when SumUp recorded this payment’s exposed `status` (successful, failed,\nor canceled). Server processed time when available; otherwise the payment provider’s\ntransaction time. Not the device clock.", + "example": "2017-07-21T17:32:28+01:00" } } }, - "Version": { - "type": "string", - "description": "The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH` endpoints.\n", - "examples": [ - "chng_01HS0KG3MPVEVWW85E3KNXH55J" - ] - }, - "ChangeStatus": { + "SaleStateV10": { "type": "string", - "readOnly": true, - "description": "Reflects the status of changes submitted through the `PATCH` endpoints for the Merchant or Persons. If some changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status `done`.\nThe status is only returned after write operations or on read endpoints when the `version` query parameter is provided.\n" + "description": "Lifecycle state of the sale.\nNon-finalised sales are never returned; only fully-paid sales.", + "enum": [ + "CLOSED" + ], + "example": "CLOSED" }, - "BasePerson": { - "externalDocs": { - "description": "Person documentation", - "url": "https://developer.sumup.com/tools/glossary/merchant#persons" - }, + "Sale": { + "title": "Sale", "type": "object", - "description": "Base schema for a Person associated with a Merchant. This can be a legal representative, business owner (ultimate beneficial owner), or an officer. A legal representative is the Person who registered the Merchant with SumUp. They should always have a `user_id`.\n", + "description": "Core model of the Sales API. Returned by `GET /sales` and `GET /sales/{sale_id}`.\n\nNon-finalised sales are never returned; only fully-paid sales.\n\nItem lines are `SaleLineItem`. Merchant fees appear as `type: \"FEE\"` lines; extra fee data\nis in `features`.", "required": [ - "id" + "id", + "currency", + "items", + "price", + "tax_mode", + "source", + "created_at", + "closed_at", + "state", + "payments" ], "properties": { "id": { "type": "string", - "readOnly": true, - "description": "The unique identifier for the Person. This is a [typeid](https://github.com/sumup/typeid).\n", - "examples": [ - "pers_2EGQ057R6C8J791RVCG5NWAEAB" - ] + "description": "The ID of the sale.", + "example": "dbe3178d-4b83-5024-9b26-9b8e1b280514" }, "user_id": { "type": "string", - "description": "A corresponding identity user ID for the Person, if they have a user account.\n", - "examples": [ - "ef263f37-8701-4181-9758-acddbb778ee9" - ] - }, - "birthdate": { - "type": "string", - "format": "date", - "description": "The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\n", - "example": "1980-01-12" + "format": "uuid", + "description": "Identity UUID of the cashier who processed the sale. Omitted when the cashier\nidentity is unknown.", + "example": "d6f51684-519b-454c-bdb3-deeb05f52b92" }, - "given_name": { - "type": "string", - "description": "The first name(s) of the individual.", - "example": "James Herrald", - "minLength": 1, - "maxLength": 60 + "currency": { + "$ref": "#/components/schemas/Currency" }, - "family_name": { + "name": { "type": "string", - "description": "The last name(s) of the individual.", - "example": "Bond", - "minLength": 1, - "maxLength": 60 + "maxLength": 160, + "description": "Human-readable name of the sale (not unique, not the sale id).", + "example": "Order 1234" }, - "middle_name": { + "note": { "type": "string", - "description": "Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used.\n", - "example": "Maria Sophie", - "minLength": 1, - "maxLength": 60 - }, - "phone_number": { - "$ref": "#/components/schemas/PhoneNumber", - "description": "The (mobile) phone number of the individual (used for verification) in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n" + "maxLength": 300, + "description": "Optional note attached to the sale, visible on receipts and the UI.", + "example": "Please deliver to the back door." }, - "relationships": { + "items": { "type": "array", - "description": "A list of roles the Person has in the Merchant or towards SumUp. A Merchant must have at least one Person with the relationship `representative`.\n", "minItems": 1, - "maxItems": 1, + "maxItems": 1000, + "description": "The lines sold in this sale, in the order they were added to the cart.\nIncludes merchant fees (`type: \"FEE\"`) when present; fee details are in `features`.\n", "items": { - "type": "string", - "description": "* `representative`: The Person is the primary contact for SumUp and has full administrative power over the merchant account.\n* `owner`: The Person is a business owner. If this value is set, the `ownership_percent` should be set as well.\n* `officer`: The Person is an officer at the company.\n", - "examples": [ - "representative", - "owner", - "officer" - ] + "$ref": "#/components/schemas/SaleLineItemV10" } }, - "ownership": { - "$ref": "#/components/schemas/Ownership", - "description": "Details about the ownership relationship between the Person and the Merchant. This is only set if the Person has a relationship of type `owner`.\n" + "price": { + "$ref": "#/components/schemas/SalePriceV10" }, - "address": { - "$ref": "#/components/schemas/Address", - "description": "The address of the individual." + "tax_mode": { + "$ref": "#/components/schemas/TaxMode" }, - "identifiers": { - "$ref": "#/components/schemas/PersonalIdentifiers" + "source": { + "$ref": "#/components/schemas/SaleSource" }, - "citizenship": { - "$ref": "#/components/schemas/CountryCode", - "description": "The Alpha-2 ISO code of the country where the Person is a citizen.\n" + "payments": { + "type": "array", + "maxItems": 1000, + "description": "Payments on this sale, in the order they were recorded.\n", + "items": { + "$ref": "#/components/schemas/PublicPaymentV10" + }, + "example": [ + { + "method": "card", + "reference": "TERTYFQ4G3", + "type": "purchase", + "amount": 975, + "status": "SUCCESSFUL", + "processed_at": "2026-06-02T10:20:00Z" + } + ] }, - "nationality": { - "type": [ - "string", - "null" - ], - "pattern": "^[A-Z]{2}$", - "description": "The Person's nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may not conform to this standard.\n" + "created_at": { + "type": "string", + "format": "date-time", + "description": "Instant when the sale was created.", + "example": "2026-06-02T10:15:00Z" }, - "country_of_residence": { - "type": [ - "string", - "null" - ], - "description": "An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country where the Person resides.\n", - "pattern": "^[A-Z]{2}$" + "closed_at": { + "type": "string", + "format": "date-time", + "description": "Instant when the sale was closed. Always present: non-finalised sales are never returned.", + "example": "2026-06-02T10:20:00Z" }, - "version": { - "$ref": "#/components/schemas/Version" + "state": { + "$ref": "#/components/schemas/SaleStateV10" + } + } + }, + "SalePage": { + "title": "SalePage", + "type": "object", + "description": "Paginated list of `Sale` objects. Results are ordered **newest first** by the newest\nactivity recorded for each sale. See `ListSalesV10`.", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Sale" + } }, - "change_status": { - "$ref": "#/components/schemas/ChangeStatus" + "pagination_token": { + "description": "Pagination token for subsequent requests. Should only be set by clients if they have\nreceived a token in the previous response, and this request is an immediate follow-up\nrequest to that response to load the subsequent page. Clients should treat this as an\nopaque token and should not attempt to parse it in any way.", + "type": "string", + "example": "66bcbtzelrubzeuzruzgu76678trncH" } } }, - "Company": { - "externalDocs": { - "description": "Company documentation", - "url": "https://developer.sumup.com/tools/glossary/merchant#company" - }, + "ProblemV10": { "type": "object", - "description": "Information about the company or business. This is legal information that is used for verification.\n", + "description": "A RFC 9457 problem details object.\n\nAdditional properties specific to the problem type may be present.\n", + "required": [ + "type" + ], + "additionalProperties": true, "properties": { - "name": { + "type": { "type": "string", - "description": "The company's legal name.", - "minLength": 1, - "maxLength": 150, - "example": "Gin \u0026 Doughnuts Bar GmbH" + "format": "uri", + "description": "A URI reference that identifies the problem type.", + "example": "https://developer.sumup.com/problem/not-found" }, - "merchant_category_code": { - "description": "The merchant category code for the account as specified by [ISO18245](https://www.iso.org/standard/33365.html). MCCs are used to classify businesses based on the goods or services they provide.\n", + "title": { "type": "string", - "example": "1532", - "pattern": "^[0-9]{4}$" - }, - "legal_type": { - "$ref": "#/components/schemas/LegalType", - "description": "The category identifying the legal structure of the company or legal entity.\n" - }, - "address": { - "$ref": "#/components/schemas/Address", - "description": "The company's primary address." - }, - "trading_address": { - "$ref": "#/components/schemas/Address", - "description": "A trading address is where your suppliers, banks or customers send you correspondence to. Trading address can be different to the company's registered address (`address`).\n" - }, - "identifiers": { - "$ref": "#/components/schemas/CompanyIdentifiers" - }, - "phone_number": { - "$ref": "#/components/schemas/PhoneNumber", - "description": "The company's phone number (used for verification) in [E.164](https://en.wikipedia.org/wiki/E.164) format.\n" + "description": "A short, human-readable summary of the problem type.", + "example": "Requested resource couldn't be found." }, - "website": { - "description": "HTTP(S) URL of the company's website.\n", - "type": "string", - "minLength": 1, - "maxLength": 255, - "examples": [ - "https://www.sumup.com" - ] + "status": { + "type": "integer", + "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", + "example": 404 }, - "attributes": { - "$ref": "#/components/schemas/Attributes" + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem.", + "example": "The requested resource doesn't exist or does not belong to you." + }, + "instance": { + "type": "string", + "format": "uri", + "description": "A URI reference that identifies the specific occurrence of the problem." } } }, - "ClassicMerchantIdentifiers": { - "type": "object", - "required": [ - "id" + "PaymentStatusFilterV10": { + "type": "string", + "description": "Payment outcome filter value. Multi-select uses **OR** within this field; combined with\nother filters using **AND**.\nOnly fully-paid closed sales are exposed. Refunded original sales remain searchable as\n`PAID`; refunds are separate negative sales, not a `REFUNDED` sale-search outcome.", + "enum": [ + "PAID", + "CHARGED_BACK" ], - "properties": { - "id": { - "type": "integer", - "format": "int64", - "description": "Classic (serial) merchant ID.", - "example": 1234, - "deprecated": true - } - } + "example": "PAID" }, - "Timestamps": { + "SalesChannelFilterV10": { + "type": "string", + "description": "Sale channel filter value. Multi-select uses **OR** within this field.", + "enum": [ + "POS", + "ONLINE_PAYMENTS", + "KIOSK", + "ONLINE_STORE", + "SOLO", + "ORDER_AND_PAY", + "INVOICE", + "BOOKINGS", + "ORDER_AGGREGATOR", + "SUBSCRIPTIONS", + "UNKNOWN" + ], + "example": "POS" + }, + "SaleSearchRequest": { + "title": "SaleSearchRequest", "type": "object", + "description": "Filter and pagination criteria for `POST /sales/search`. Filters from different categories\nstack with **logical AND**; multiple values in one array field stack with **logical OR**.\nResults cover the merchant’s **last two years** of sales (narrow further with `start_date` /\n`end_date`). Results are sorted **newest first** by sale close date.", "properties": { - "created_at": { + "start_date": { "type": "string", "format": "date-time", - "description": "The date and time when the resource was created. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).\n", - "readOnly": true, - "examples": [ - "2021-08-31T12:00:00Z" - ] + "description": "Sale created **on or after** this instant (inclusive).", + "example": "2026-06-01T00:00:00Z" }, - "updated_at": { + "end_date": { "type": "string", "format": "date-time", - "description": "The date and time when the resource was last updated. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).\n", - "readOnly": true, - "examples": [ - "2021-08-31T12:00:00Z" + "description": "Sale created **on or before** this instant (inclusive).", + "example": "2026-06-02T23:59:59Z" + }, + "sale_statuses": { + "type": "array", + "description": "Filters rows by sale lifecycle (`state`). Multiple values match any of them (**OR**).\nUses the same values as `Sale.state`. Non-finalised sales are never returned; only\nfully-paid sales.", + "items": { + "$ref": "#/components/schemas/SaleStateV10" + }, + "example": [ + "CLOSED" + ] + }, + "payment_statuses": { + "type": "array", + "description": "Filters rows by payment outcome. Multiple values match any of them (**OR**). The search\nrow does not echo this value.", + "items": { + "$ref": "#/components/schemas/PaymentStatusFilterV10" + }, + "example": [ + "PAID" + ] + }, + "sales_channels": { + "type": "array", + "description": "Sales channel filter. Multiple values match any of them (**OR**).", + "items": { + "$ref": "#/components/schemas/SalesChannelFilterV10" + }, + "example": [ + "POS" ] + }, + "pagination_token": { + "type": "string", + "description": "Opaque pagination token from a previous search response. Not interchangeable with tokens\nfrom `GET /sales`.", + "example": "66bcbtzelrubzeuzruzgu76678trncH" + }, + "pagination_limit": { + "type": "integer", + "minimum": 1, + "maximum": 25, + "default": 10, + "description": "Maximum number of results per page.", + "example": 10 } - }, - "required": [ - "created_at", - "updated_at" - ] + } }, - "Reader": { - "title": "Reader", - "description": "A physical card reader device that can accept in-person payments.", + "SaleSearchItem": { + "title": "SaleSearchItem", "type": "object", + "description": "Summary row for a sale in search results. Use `GET /sales/{sale_id}` for the full `Sale`.", + "required": [ + "id", + "state", + "tax_mode", + "currency", + "total_amount", + "created_at", + "closed_at" + ], "properties": { "id": { - "$ref": "#/components/schemas/ReaderID" + "type": "string", + "description": "Sale identifier.", + "example": "dbe3178d-4b83-5024-9b26-9b8e1b280514" }, - "name": { - "$ref": "#/components/schemas/ReaderName" + "user_id": { + "type": "string", + "format": "uuid", + "description": "Identity UUID of the cashier who processed the sale. Omitted when the cashier\nidentity is unknown.", + "example": "d6f51684-519b-454c-bdb3-deeb05f52b92" }, - "status": { - "$ref": "#/components/schemas/ReaderStatus" + "state": { + "$ref": "#/components/schemas/SaleStateV10" }, - "device": { - "$ref": "#/components/schemas/ReaderDevice" + "name": { + "type": "string", + "description": "Display name of the sale when set; otherwise a concatenation of item names with\nquantities. Omitted when neither is available.", + "example": "Order 1234" }, - "metadata": { - "$ref": "#/components/schemas/Metadata" + "tax_mode": { + "description": "Checkout tax mode for the sale. Same values as `Sale.tax_mode`.", + "allOf": [ + { + "$ref": "#/components/schemas/TaxMode" + } + ] }, - "service_account_id": { - "type": "string", - "format": "uuid", - "x-beta": true, - "description": "Identifier of the system-managed service account associated with this reader.\nPresent only for readers that are already paired.\nThis field is currently in beta and may change." + "currency": { + "$ref": "#/components/schemas/Currency" + }, + "total_amount": { + "description": "Final sale gross total after discounts and taxes, excluding tips.\nSame value as `Sale.price.gross_amount`, in minor units according to `currency.scale`.\nPayment amounts include tips and can therefore differ from this total.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ], + "example": 1250 }, "created_at": { "type": "string", "format": "date-time", - "description": "The timestamp of when the reader was created.", - "example": "2023-01-18T15:16:17Z" + "description": "Instant when the sale was created.", + "example": "2026-06-01T14:30:00Z" }, - "updated_at": { + "closed_at": { "type": "string", "format": "date-time", - "description": "The timestamp of when the reader was last updated.", - "example": "2023-01-20T15:16:17Z" + "description": "Instant when the sale was closed. Always present: non-finalised sales are never returned.", + "example": "2026-06-01T14:35:00Z" } - }, - "required": [ - "id", - "name", - "status", - "device", - "created_at", - "updated_at" - ] - }, - "ReaderName": { - "type": "string", - "description": "Custom human-readable, user-defined name for easier identification of the reader.", - "maxLength": 500, - "example": "Frontdesk" - }, - "ReaderStatus": { - "type": "string", - "example": "paired", - "enum": [ - "unknown", - "processing", - "paired", - "expired" - ], - "description": "The status of the reader object gives information about the current state of the reader.\n\nPossible values:\n\n- `unknown` - The reader status is unknown.\n- `processing` - The reader is created and waits for the physical device to confirm the pairing.\n- `paired` - The reader is paired with a merchant account and can be used with SumUp APIs.\n- `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated." + } }, - "ReaderDevice": { + "SaleSearchResponse": { + "title": "SaleSearchResponse", "type": "object", - "description": "Information about the underlying physical device.", + "description": "Search hits and an optional pagination token. Results are ordered **newest first** by sale close date.", + "required": [ + "items" + ], "properties": { - "identifier": { - "type": "string", - "description": "A unique identifier of the physical device (e.g. serial number).", - "example": "U1DT3NA00-CN" + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SaleSearchItem" + }, + "example": [ + { + "id": "dbe3178d-4b83-5024-9b26-9b8e1b280514", + "state": "CLOSED", + "tax_mode": "GROSS", + "currency": { + "code": "EUR", + "scale": 2 + }, + "name": "Order 1234", + "total_amount": 1250, + "created_at": "2026-06-01T14:30:00Z", + "closed_at": "2026-06-01T14:35:00Z" + } + ] }, - "model": { + "pagination_token": { + "description": "Opaque token for the next page of search results.", "type": "string", - "description": "Identifier of the model of the device.", - "enum": [ - "solo", - "virtual-solo" - ], - "example": "solo" + "example": "66bcbtzelrubzeuzruzgu76678trncH" } - }, - "required": [ - "identifier", - "model" - ] - }, - "ReaderPairingCode": { - "type": "string", - "description": "The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating the pairing. It is used to link the physical device to the created pairing.", - "example": "4WLFDSBF", - "minLength": 8, - "maxLength": 9 + } }, "UpdateReaderSettingsError": { "description": "Details of a failed reader settings request.", @@ -11337,7 +13367,21 @@ "description": "A sample checkout", "hosted_checkout": { "enabled": true - } + }, + "redirect_url": "https://example.com/orders/123/complete" + } + }, + "Tokenization": { + "summary": "Save a customer card", + "description": "Create a checkout to collect consent and save a card through the Payment Widget.", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT" } } } @@ -11394,9 +13438,6 @@ "description": "Optional amount for partial refunds.", "content": { "application/json": { - "example": { - "amount": 5 - }, "schema": { "type": "object", "description": "Optional amount for partial refunds of transactions.", @@ -11408,6 +13449,18 @@ "example": 5 } } + }, + "examples": { + "FullRefund": { + "summary": "Full refund", + "value": {} + }, + "PartialRefund": { + "summary": "Partial refund", + "value": { + "amount": 24.42 + } + } } } } @@ -11549,6 +13602,22 @@ "hosted_checkout_url": "https://checkout.sumup.com/pay/8f9316a3-cda9-42a9-9771-54d534315676", "transactions": [] } + }, + "Tokenization": { + "summary": "Checkout for saving a card", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT", + "id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7", + "status": "PENDING", + "date": "2026-10-30T12:00:00+00:00", + "transactions": [] + } } } } @@ -11610,17 +13679,65 @@ "schema": { "$ref": "#/components/schemas/CheckoutSuccess" }, - "example": { - "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", - "amount": 10.1, - "currency": "EUR", - "merchant_code": "MH4H92C7", - "description": "Purchase", - "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", - "status": "PENDING", - "date": "2020-02-29T10:56:56+00:00", - "transaction_code": "TEENSK4W2K", - "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + "examples": { + "Checkout": { + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 10.1, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PENDING", + "date": "2020-02-29T10:56:56+00:00", + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4" + } + }, + "PaidCheckout": { + "summary": "Paid checkout with a transaction to refund", + "value": { + "checkout_reference": "f00a8f74-b05d-4605-bd73-2a901bae5802", + "amount": 42.42, + "currency": "EUR", + "merchant_code": "MH4H92C7", + "description": "Purchase", + "id": "4e425463-3e1b-431d-83fa-1e51c2925e99", + "status": "PAID", + "date": "2020-02-29T10:56:56+00:00", + "transaction_code": "TEENSK4W2K", + "transaction_id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transactions": [ + { + "id": "410fc44a-5956-44e1-b5cc-19c6f8d727a4", + "transaction_code": "TEENSK4W2K", + "amount": 42.42, + "currency": "EUR", + "status": "SUCCESSFUL", + "timestamp": "2026-10-30T12:00:00+00:00" + } + ] + } + }, + "TokenizedCheckout": { + "summary": "Checkout with a saved card", + "value": { + "checkout_reference": "save-card-123", + "amount": 1, + "currency": "EUR", + "merchant_code": "MCXXXXXX", + "description": "Save a card for future payments", + "customer_id": "831ff8d4cd5958ab5670", + "purpose": "SETUP_RECURRING_PAYMENT", + "id": "7164c99b-13cb-42a1-8ba1-3c2c46a29de7", + "status": "PAID", + "date": "2026-10-30T12:00:00+00:00", + "transactions": [], + "payment_instrument": { + "token": "6878cb7f-6515-47bf-bdd9-1408d270fdce" + } + } + } } } } From 1c0f0d6e57b1125bcbe6772e765000483ddc2ce4 Mon Sep 17 00:00:00 2001 From: "sumup-release-bot[bot]" <241716704+sumup-release-bot[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 10:48:27 +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/SalesAsyncClient.java | 272 +++++++++++++++++ .../com/sumup/sdk/clients/SalesClient.java | 268 +++++++++++++++++ .../java/com/sumup/sdk/models/BasePerson.java | 61 ++-- .../com/sumup/sdk/models/CategoryV10.java | 61 ++++ .../sdk/models/DiscountApplicationMode.java | 54 ++++ .../com/sumup/sdk/models/DiscountClass.java | 60 ++++ .../com/sumup/sdk/models/DiscountLine.java | 186 ++++++++++++ .../com/sumup/sdk/models/DiscountSource.java | 103 +++++++ .../sumup/sdk/models/DiscountSourceAdHoc.java | 73 +++++ .../sumup/sdk/models/DiscountSourceBasic.java | 94 ++++++ .../sdk/models/DiscountSourceCoupon.java | 132 +++++++++ .../sdk/models/DiscountSourceLoyalty.java | 172 +++++++++++ .../DiscountSourceLoyaltySchemeType.java | 56 ++++ .../sdk/models/DiscountSourceLoyaltyType.java | 58 ++++ .../sumup/sdk/models/DiscountSourceOffer.java | 116 ++++++++ .../com/sumup/sdk/models/DiscountValue.java | 71 +++++ .../java/com/sumup/sdk/models/FeatureV10.java | 105 +++++++ .../sumup/sdk/models/FeatureValueTypeV10.java | 60 ++++ .../sumup/sdk/models/FinalPriceAmounts.java | 117 ++++++++ .../sumup/sdk/models/ItemReferencesV10.java | 101 +++++++ .../ItemReferencesV10CatalogSource.java | 56 ++++ .../sumup/sdk/models/LineItemPriceV10.java | 188 ++++++++++++ .../LineItemPriceV10TotalGrossAmount.java | 61 ++++ ...LineItemPriceV10TotalGrossAmountFinal.java | 64 ++++ .../LineItemPriceV10TotalNetAmount.java | 61 ++++ .../LineItemPriceV10TotalNetAmountFinal.java | 64 ++++ .../com/sumup/sdk/models/ModifierItem.java | 184 ++++++++++++ .../com/sumup/sdk/models/ModifierSet.java | 61 ++++ .../sdk/models/PaymentStatusFilterV10.java | 59 ++++ .../java/com/sumup/sdk/models/Person.java | 61 ++-- .../sdk/models/PositivePriceAmounts.java | 94 ++++++ .../sdk/models/PositivePriceWithTaxes.java | 45 +++ .../com/sumup/sdk/models/PositiveTaxLine.java | 142 +++++++++ .../com/sumup/sdk/models/PriceAmounts.java | 85 ++++++ .../models/PriceAmountsTotalGrossAmount.java | 61 ++++ .../models/PriceAmountsTotalNetAmount.java | 61 ++++ .../java/com/sumup/sdk/models/ProblemV10.java | 155 ++++++++++ .../com/sumup/sdk/models/PublicCardV10.java | 90 ++++++ .../sumup/sdk/models/PublicCardV10Type.java | 58 ++++ .../sdk/models/PublicGiftCardPayment.java | 51 ++++ .../sumup/sdk/models/PublicPaymentV10.java | 217 ++++++++++++++ .../sdk/models/PublicPaymentV10Status.java | 55 ++++ src/main/java/com/sumup/sdk/models/Sale.java | 279 ++++++++++++++++++ .../com/sumup/sdk/models/SaleLineItemV10.java | 266 +++++++++++++++++ .../models/SaleLineItemV10ServiceType.java | 56 ++++ .../java/com/sumup/sdk/models/SalePage.java | 70 +++++ .../com/sumup/sdk/models/SalePriceV10.java | 119 ++++++++ .../sdk/models/SalePriceV10GrossAmount.java | 66 +++++ .../sdk/models/SalePriceV10NetAmount.java | 64 ++++ .../com/sumup/sdk/models/SaleSearchItem.java | 195 ++++++++++++ .../sdk/models/SaleSearchItemTotalAmount.java | 65 ++++ .../sumup/sdk/models/SaleSearchRequest.java | 161 ++++++++++ .../sumup/sdk/models/SaleSearchResponse.java | 62 ++++ .../java/com/sumup/sdk/models/SaleSource.java | 113 +++++++ .../com/sumup/sdk/models/SaleStateV10.java | 52 ++++ .../sdk/models/SalesChannelFilterV10.java | 68 +++++ .../java/com/sumup/sdk/models/TaxLine.java | 141 +++++++++ .../sumup/sdk/models/TaxLineGrossAmount.java | 64 ++++ .../sumup/sdk/models/TaxLineNetAmount.java | 64 ++++ .../sumup/sdk/models/TaxLineTaxAmount.java | 64 ++++ .../java/com/sumup/sdk/models/TaxMode.java | 61 ++++ .../com/sumup/sdk/models/UnitOfMeasure.java | 78 +++++ 64 files changed, 6249 insertions(+), 76 deletions(-) create mode 100644 src/main/java/com/sumup/sdk/clients/SalesAsyncClient.java create mode 100644 src/main/java/com/sumup/sdk/clients/SalesClient.java create mode 100644 src/main/java/com/sumup/sdk/models/CategoryV10.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountApplicationMode.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountClass.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountLine.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSource.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceAdHoc.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceBasic.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceCoupon.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceLoyalty.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltySchemeType.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltyType.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountSourceOffer.java create mode 100644 src/main/java/com/sumup/sdk/models/DiscountValue.java create mode 100644 src/main/java/com/sumup/sdk/models/FeatureV10.java create mode 100644 src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java create mode 100644 src/main/java/com/sumup/sdk/models/FinalPriceAmounts.java create mode 100644 src/main/java/com/sumup/sdk/models/ItemReferencesV10.java create mode 100644 src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java create mode 100644 src/main/java/com/sumup/sdk/models/LineItemPriceV10.java create mode 100644 src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmountFinal.java create mode 100644 src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmountFinal.java create mode 100644 src/main/java/com/sumup/sdk/models/ModifierItem.java create mode 100644 src/main/java/com/sumup/sdk/models/ModifierSet.java create mode 100644 src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java create mode 100644 src/main/java/com/sumup/sdk/models/PositivePriceAmounts.java create mode 100644 src/main/java/com/sumup/sdk/models/PositivePriceWithTaxes.java create mode 100644 src/main/java/com/sumup/sdk/models/PositiveTaxLine.java create mode 100644 src/main/java/com/sumup/sdk/models/PriceAmounts.java create mode 100644 src/main/java/com/sumup/sdk/models/PriceAmountsTotalGrossAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/PriceAmountsTotalNetAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/ProblemV10.java create mode 100644 src/main/java/com/sumup/sdk/models/PublicCardV10.java create mode 100644 src/main/java/com/sumup/sdk/models/PublicCardV10Type.java create mode 100644 src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java create mode 100644 src/main/java/com/sumup/sdk/models/PublicPaymentV10.java create mode 100644 src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java create mode 100644 src/main/java/com/sumup/sdk/models/Sale.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleLineItemV10.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java create mode 100644 src/main/java/com/sumup/sdk/models/SalePage.java create mode 100644 src/main/java/com/sumup/sdk/models/SalePriceV10.java create mode 100644 src/main/java/com/sumup/sdk/models/SalePriceV10GrossAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/SalePriceV10NetAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleSearchItem.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleSearchItemTotalAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleSearchRequest.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleSearchResponse.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleSource.java create mode 100644 src/main/java/com/sumup/sdk/models/SaleStateV10.java create mode 100644 src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java create mode 100644 src/main/java/com/sumup/sdk/models/TaxLine.java create mode 100644 src/main/java/com/sumup/sdk/models/TaxLineGrossAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/TaxLineNetAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/TaxLineTaxAmount.java create mode 100644 src/main/java/com/sumup/sdk/models/TaxMode.java create mode 100644 src/main/java/com/sumup/sdk/models/UnitOfMeasure.java diff --git a/src/main/java/com/sumup/sdk/SumUpAsyncClient.java b/src/main/java/com/sumup/sdk/SumUpAsyncClient.java index c657a5d..ccff8e3 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.SalesAsyncClient; import com.sumup.sdk.clients.TokensAsyncClient; import com.sumup.sdk.clients.TransactionsAsyncClient; import com.sumup.sdk.core.ApiClient; @@ -32,6 +33,7 @@ public final class SumUpAsyncClient { private final ReadersAsyncClient readers; private final ReceiptsAsyncClient receipts; private final RolesAsyncClient roles; + private final SalesAsyncClient sales; private final TokensAsyncClient tokens; private final TransactionsAsyncClient transactions; @@ -73,6 +75,7 @@ private SumUpAsyncClient(ApiClient apiClient) { this.readers = new ReadersAsyncClient(this.apiClient); this.receipts = new ReceiptsAsyncClient(this.apiClient); this.roles = new RolesAsyncClient(this.apiClient); + this.sales = new SalesAsyncClient(this.apiClient); this.tokens = new TokensAsyncClient(this.apiClient); this.transactions = new TransactionsAsyncClient(this.apiClient); } @@ -217,6 +220,15 @@ public RolesAsyncClient roles() { return roles; } + /** + * Returns the SalesAsyncClient client for the "Sales" API group. + * + * @return Client for the associated API group. + */ + public SalesAsyncClient sales() { + return sales; + } + /** * Returns the TokensAsyncClient client for the "Tokens" API group. * diff --git a/src/main/java/com/sumup/sdk/SumUpClient.java b/src/main/java/com/sumup/sdk/SumUpClient.java index b3d9e0a..9474d2b 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.SalesClient; import com.sumup.sdk.clients.TokensClient; import com.sumup.sdk.clients.TransactionsClient; import com.sumup.sdk.core.ApiClient; @@ -32,6 +33,7 @@ public final class SumUpClient { private final ReadersClient readers; private final ReceiptsClient receipts; private final RolesClient roles; + private final SalesClient sales; private final TokensClient tokens; private final TransactionsClient transactions; @@ -73,6 +75,7 @@ private SumUpClient(ApiClient apiClient) { this.readers = new ReadersClient(this.apiClient); this.receipts = new ReceiptsClient(this.apiClient); this.roles = new RolesClient(this.apiClient); + this.sales = new SalesClient(this.apiClient); this.tokens = new TokensClient(this.apiClient); this.transactions = new TransactionsClient(this.apiClient); } @@ -217,6 +220,15 @@ public RolesClient roles() { return roles; } + /** + * Returns the SalesClient client for the "Sales" API group. + * + * @return Client for the associated API group. + */ + public SalesClient sales() { + return sales; + } + /** * Returns the TokensClient client for the "Tokens" API group. * diff --git a/src/main/java/com/sumup/sdk/clients/SalesAsyncClient.java b/src/main/java/com/sumup/sdk/clients/SalesAsyncClient.java new file mode 100644 index 0000000..9d30c27 --- /dev/null +++ b/src/main/java/com/sumup/sdk/clients/SalesAsyncClient.java @@ -0,0 +1,272 @@ +// 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.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.CompletableFuture; + +/** + * Client for the "Sales" API group. + * + *

Operations related to reading sales data. + */ +public final class SalesAsyncClient { + private final ApiClient apiClient; + + /** + * Creates a new SalesAsyncClient instance backed by the provided ApiClient. + * + * @param apiClient Configured API client used to send HTTP requests. + */ + public SalesAsyncClient(ApiClient apiClient) { + this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); + } + + /** + * Gets a sale + * + *

Returns `Sale` for `sale_id`, including item lines and `payments[]`. Non-finalised sales are + * never returned; only fully-paid sales. + * + *

Operation ID: GetSaleV10 + * + * @param merchantCode The merchant code. + * @param saleId The sale ID. + *

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

Returns `Sale` for `sale_id`, including item lines and `payments[]`. Non-finalised sales are + * never returned; only fully-paid sales. + * + *

Operation ID: GetSaleV10 + * + * @param merchantCode The merchant code. + * @param saleId The sale ID. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.Sale parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture getSaleV10( + String merchantCode, String saleId, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(saleId, "saleId"); + String path = "/v1.0/merchants/{merchant_code}/sales/{sale_id}"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{sale_id}", ApiClient.urlEncode(ApiClient.parameterValue(saleId))); + + return this.apiClient.sendAsync( + HttpMethod.GET, + path, + null, + null, + null, + new TypeReference() {}, + requestOptions); + } + + /** + * Lists sales + * + *

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * @return CompletableFuture resolved with com.sumup.sdk.models.SalePage parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture listSalesV10(String merchantCode) + throws ApiException { + return listSalesV10(merchantCode, null); + } + + /** + * Lists sales + * + *

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + * @param listSalesV10 Optional query parameters for this request. + *

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

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + * @param listSalesV10 Optional query parameters for this request. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.SalePage parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture listSalesV10( + String merchantCode, ListSalesV10QueryParams listSalesV10, RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v1.0/merchants/{merchant_code}/sales"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + Map queryParams = new LinkedHashMap<>(); + if (listSalesV10 != null) { + queryParams.putAll(listSalesV10.toMap()); + } + + return this.apiClient.sendAsync( + HttpMethod.GET, + path, + queryParams, + null, + null, + new TypeReference() {}, + requestOptions); + } + + /** + * Searches sales + * + *

Returns a paginated list of `SaleSearchItem` rows matching filter criteria. Results are + * sorted **newest first** by **sale close date**. Filters from different categories stack with + * **logical AND**; multiple values in one array field stack with **logical OR**. Results cover + * the merchant’s **last two years** of sales (narrow further with `start_date` / `end_date`). + * Pagination tokens are not interchangeable with `GET /sales`. + * + *

Operation ID: SearchSalesV10 + * + * @param merchantCode The merchant code. + * @param request Request body payload. + *

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

Returns a paginated list of `SaleSearchItem` rows matching filter criteria. Results are + * sorted **newest first** by **sale close date**. Filters from different categories stack with + * **logical AND**; multiple values in one array field stack with **logical OR**. Results cover + * the merchant’s **last two years** of sales (narrow further with `start_date` / `end_date`). + * Pagination tokens are not interchangeable with `GET /sales`. + * + *

Operation ID: SearchSalesV10 + * + * @param merchantCode The merchant code. + * @param request Request body payload. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return CompletableFuture resolved with com.sumup.sdk.models.SaleSearchResponse parsed + * response. + * @throws ApiException if the SumUp API returns an error. + */ + public CompletableFuture searchSalesV10( + String merchantCode, + com.sumup.sdk.models.SaleSearchRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(request, "request"); + String path = "/v1.0/merchants/{merchant_code}/sales/search"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + + return this.apiClient.sendAsync( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + + /** Optional query parameters for this request. */ + public static final class ListSalesV10QueryParams { + private final Map values = new LinkedHashMap<>(); + + /** + * Sets the pagination_limit query parameter. + * + * @param value Maximum number of results per page. + * @return This ListSalesV10QueryParams instance. + */ + public ListSalesV10QueryParams paginationLimit(Long value) { + this.values.put("pagination_limit", Objects.requireNonNull(value, "paginationLimit")); + return this; + } + + /** + * Sets the pagination_token query parameter. + * + * @param value Pagination token for subsequent requests. Should only be set by clients if they + * have received a token in the previous response, and this request is an immediate + * follow-up request to that response to load the subsequent page. Clients should treat this + * as an opaque token and should not attempt to parse it in any way. + * @return This ListSalesV10QueryParams instance. + */ + public ListSalesV10QueryParams paginationToken(String value) { + this.values.put("pagination_token", Objects.requireNonNull(value, "paginationToken")); + return this; + } + + /** + * Converts query parameters to a map understood by ApiClient. + * + * @return Collected query parameters keyed by API name. + */ + Map toMap() { + return values; + } + } +} diff --git a/src/main/java/com/sumup/sdk/clients/SalesClient.java b/src/main/java/com/sumup/sdk/clients/SalesClient.java new file mode 100644 index 0000000..ce1eb45 --- /dev/null +++ b/src/main/java/com/sumup/sdk/clients/SalesClient.java @@ -0,0 +1,268 @@ +// 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.LinkedHashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Client for the "Sales" API group. + * + *

Operations related to reading sales data. + */ +public final class SalesClient { + private final ApiClient apiClient; + + /** + * Creates a new SalesClient instance backed by the provided ApiClient. + * + * @param apiClient Configured API client used to send HTTP requests. + */ + public SalesClient(ApiClient apiClient) { + this.apiClient = Objects.requireNonNull(apiClient, "apiClient"); + } + + /** + * Gets a sale + * + *

Returns `Sale` for `sale_id`, including item lines and `payments[]`. Non-finalised sales are + * never returned; only fully-paid sales. + * + *

Operation ID: GetSaleV10 + * + * @param merchantCode The merchant code. + * @param saleId The sale ID. + *

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

Returns `Sale` for `sale_id`, including item lines and `payments[]`. Non-finalised sales are + * never returned; only fully-paid sales. + * + *

Operation ID: GetSaleV10 + * + * @param merchantCode The merchant code. + * @param saleId The sale ID. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.Sale parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.Sale getSaleV10( + String merchantCode, String saleId, RequestOptions requestOptions) throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(saleId, "saleId"); + String path = "/v1.0/merchants/{merchant_code}/sales/{sale_id}"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + path = path.replace("{sale_id}", ApiClient.urlEncode(ApiClient.parameterValue(saleId))); + + return this.apiClient.send( + HttpMethod.GET, + path, + null, + null, + null, + new TypeReference() {}, + requestOptions); + } + + /** + * Lists sales + * + *

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + *

Call the overload that accepts optional parameter objects or RequestOptions to customize + * headers, authorization, query values, or timeouts. + * @return com.sumup.sdk.models.SalePage parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.SalePage listSalesV10(String merchantCode) throws ApiException { + return listSalesV10(merchantCode, null); + } + + /** + * Lists sales + * + *

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + * @param listSalesV10 Optional query parameters for this request. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.SalePage parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.SalePage listSalesV10( + String merchantCode, ListSalesV10QueryParams listSalesV10) throws ApiException { + return listSalesV10(merchantCode, listSalesV10, null); + } + + /** + * Lists sales + * + *

Returns a paginated list of `Sale` objects. Results are sorted **newest first** by the + * **newest event** recorded for each sale. Pagination tokens follow that order. Covers the + * merchant’s **last two years** of sales. Non-finalised sales are never returned; only fully-paid + * sales. Use `POST /sales/search` for filtered queries. + * + *

Operation ID: ListSalesV10 + * + * @param merchantCode The merchant code. + * @param listSalesV10 Optional query parameters for this request. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.SalePage parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.SalePage listSalesV10( + String merchantCode, ListSalesV10QueryParams listSalesV10, RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + String path = "/v1.0/merchants/{merchant_code}/sales"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + Map queryParams = new LinkedHashMap<>(); + if (listSalesV10 != null) { + queryParams.putAll(listSalesV10.toMap()); + } + + return this.apiClient.send( + HttpMethod.GET, + path, + queryParams, + null, + null, + new TypeReference() {}, + requestOptions); + } + + /** + * Searches sales + * + *

Returns a paginated list of `SaleSearchItem` rows matching filter criteria. Results are + * sorted **newest first** by **sale close date**. Filters from different categories stack with + * **logical AND**; multiple values in one array field stack with **logical OR**. Results cover + * the merchant’s **last two years** of sales (narrow further with `start_date` / `end_date`). + * Pagination tokens are not interchangeable with `GET /sales`. + * + *

Operation ID: SearchSalesV10 + * + * @param merchantCode The merchant code. + * @param request Request body payload. + *

Call the overload that accepts RequestOptions to customize headers, authorization, or + * request timeout. + * @return com.sumup.sdk.models.SaleSearchResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.SaleSearchResponse searchSalesV10( + String merchantCode, com.sumup.sdk.models.SaleSearchRequest request) throws ApiException { + return searchSalesV10(merchantCode, request, null); + } + + /** + * Searches sales + * + *

Returns a paginated list of `SaleSearchItem` rows matching filter criteria. Results are + * sorted **newest first** by **sale close date**. Filters from different categories stack with + * **logical AND**; multiple values in one array field stack with **logical OR**. Results cover + * the merchant’s **last two years** of sales (narrow further with `start_date` / `end_date`). + * Pagination tokens are not interchangeable with `GET /sales`. + * + *

Operation ID: SearchSalesV10 + * + * @param merchantCode The merchant code. + * @param request Request body payload. + * @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass + * {@code null} to use client defaults. + * @return com.sumup.sdk.models.SaleSearchResponse parsed response. + * @throws ApiException if the SumUp API returns an error. + */ + public com.sumup.sdk.models.SaleSearchResponse searchSalesV10( + String merchantCode, + com.sumup.sdk.models.SaleSearchRequest request, + RequestOptions requestOptions) + throws ApiException { + Objects.requireNonNull(merchantCode, "merchantCode"); + Objects.requireNonNull(request, "request"); + String path = "/v1.0/merchants/{merchant_code}/sales/search"; + path = + path.replace( + "{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode))); + + return this.apiClient.send( + HttpMethod.POST, + path, + null, + null, + request, + new TypeReference() {}, + requestOptions); + } + + /** Optional query parameters for this request. */ + public static final class ListSalesV10QueryParams { + private final Map values = new LinkedHashMap<>(); + + /** + * Sets the pagination_limit query parameter. + * + * @param value Maximum number of results per page. + * @return This ListSalesV10QueryParams instance. + */ + public ListSalesV10QueryParams paginationLimit(Long value) { + this.values.put("pagination_limit", Objects.requireNonNull(value, "paginationLimit")); + return this; + } + + /** + * Sets the pagination_token query parameter. + * + * @param value Pagination token for subsequent requests. Should only be set by clients if they + * have received a token in the previous response, and this request is an immediate + * follow-up request to that response to load the subsequent page. Clients should treat this + * as an opaque token and should not attempt to parse it in any way. + * @return This ListSalesV10QueryParams instance. + */ + public ListSalesV10QueryParams paginationToken(String value) { + this.values.put("pagination_token", Objects.requireNonNull(value, "paginationToken")); + return this; + } + + /** + * Converts query parameters to a map understood by ApiClient. + * + * @return Collected query parameters keyed by API name. + */ + Map toMap() { + return values; + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/BasePerson.java b/src/main/java/com/sumup/sdk/models/BasePerson.java index 2e7eb02..b4a6cb7 100644 --- a/src/main/java/com/sumup/sdk/models/BasePerson.java +++ b/src/main/java/com/sumup/sdk/models/BasePerson.java @@ -7,7 +7,13 @@ * registered the Merchant with SumUp. They should always have a `user_id`. */ public record BasePerson( - /** The address of the individual. */ + /** + * An address somewhere in the world. The address fields used depend on the country conventions. + * For example, in Great Britain, `city` is `post_town`. In the United States, the top-level + * administrative unit used in addresses is `state`, whereas in Chile it's `region`. Whether an + * address is valid or not depends on whether the locally required fields are present. Fields + * not supported in a country will be ignored. + */ com.sumup.sdk.models.Address address, /** @@ -24,7 +30,11 @@ public record BasePerson( */ String changeStatus, - /** The Alpha-2 ISO code of the country where the Person is a citizen. */ + /** + * An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. This + * definition users `oneOf` with a two-character string type to allow for support of future + * countries in client code. + */ String citizenship, /** @@ -47,30 +57,15 @@ public record BasePerson( /** A list of country-specific personal identifiers. */ com.sumup.sdk.models.PersonalIdentifiers identifiers, - /** - * Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle - * names; all can be present, with the names being separated by space characters. Also note that - * in some cultures, middle names are not used. - */ - String middleName, - /** * The Person's nationality. May be an [ISO3166-1 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may * not conform to this standard. */ String nationality, - - /** - * Details about the ownership relationship between the Person and the Merchant. This is only - * set if the Person has a relationship of type `owner`. - */ com.sumup.sdk.models.Ownership ownership, - /** - * The (mobile) phone number of the individual (used for verification) in - * [E.164](https://en.wikipedia.org/wiki/E.164) format. - */ + /** A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. */ String phoneNumber, /** @@ -105,7 +100,6 @@ public static final class Builder { private String familyName; private String givenName; private com.sumup.sdk.models.PersonalIdentifiers identifiers; - private String middleName; private String nationality; private com.sumup.sdk.models.Ownership ownership; private String phoneNumber; @@ -118,7 +112,11 @@ private Builder() {} /** * Sets the value for {@code address}. * - * @param address The address of the individual. + * @param address An address somewhere in the world. The address fields used depend on the + * country conventions. For example, in Great Britain, `city` is `post_town`. In the United + * States, the top-level administrative unit used in addresses is `state`, whereas in Chile + * it's `region`. Whether an address is valid or not depends on whether the locally required + * fields are present. Fields not supported in a country will be ignored. * @return This builder instance. */ public Builder address(com.sumup.sdk.models.Address address) { @@ -141,7 +139,9 @@ public Builder birthdate(java.time.LocalDate birthdate) { /** * Sets the value for {@code citizenship}. * - * @param citizenship The Alpha-2 ISO code of the country where the Person is a citizen. + * @param citizenship An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * country code. This definition users `oneOf` with a two-character string type to allow for + * support of future countries in client code. * @return This builder instance. */ public Builder citizenship(String citizenship) { @@ -195,19 +195,6 @@ public Builder identifiers(com.sumup.sdk.models.PersonalIdentifiers identifiers) return this; } - /** - * Sets the value for {@code middleName}. - * - * @param middleName Middle name(s) of the End-User. Note that in some cultures, people can have - * multiple middle names; all can be present, with the names being separated by space - * characters. Also note that in some cultures, middle names are not used. - * @return This builder instance. - */ - public Builder middleName(String middleName) { - this.middleName = middleName; - return this; - } - /** * Sets the value for {@code nationality}. * @@ -224,8 +211,7 @@ public Builder nationality(String nationality) { /** * Sets the value for {@code ownership}. * - * @param ownership Details about the ownership relationship between the Person and the - * Merchant. This is only set if the Person has a relationship of type `owner`. + * @param ownership Value for the ownership field. * @return This builder instance. */ public Builder ownership(com.sumup.sdk.models.Ownership ownership) { @@ -236,7 +222,7 @@ public Builder ownership(com.sumup.sdk.models.Ownership ownership) { /** * Sets the value for {@code phoneNumber}. * - * @param phoneNumber The (mobile) phone number of the individual (used for verification) in + * @param phoneNumber A publicly available phone number in * [E.164](https://en.wikipedia.org/wiki/E.164) format. * @return This builder instance. */ @@ -296,7 +282,6 @@ public BasePerson build() { givenName, null, identifiers, - middleName, nationality, ownership, phoneNumber, diff --git a/src/main/java/com/sumup/sdk/models/CategoryV10.java b/src/main/java/com/sumup/sdk/models/CategoryV10.java new file mode 100644 index 0000000..e5590ea --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/CategoryV10.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** A category a line belongs to. */ +public record CategoryV10( + /** The category id. Usually a UUID, but not always (legacy cases). */ + String id, + + /** The category name. */ + String name) { + /** + * Creates a builder for CategoryV10. + * + * @return Builder that constructs immutable CategoryV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CategoryV10 instances. */ + public static final class Builder { + private String id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code id}. + * + * @param id The category id. Usually a UUID, but not always (legacy cases). + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The category name. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable CategoryV10 instance. + * + * @return Immutable CategoryV10. + */ + public CategoryV10 build() { + return new CategoryV10( + Objects.requireNonNull(id, "id"), Objects.requireNonNull(name, "name")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountApplicationMode.java b/src/main/java/com/sumup/sdk/models/DiscountApplicationMode.java new file mode 100644 index 0000000..95fb0b2 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountApplicationMode.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; + +/** Method of applying the discount to the items or cart. */ +public final class DiscountApplicationMode { + public static final DiscountApplicationMode MANUAL = new DiscountApplicationMode("MANUAL"); + public static final DiscountApplicationMode AUTOMATIC = new DiscountApplicationMode("AUTOMATIC"); + + private final String value; + + private DiscountApplicationMode(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a DiscountApplicationMode 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 DiscountApplicationMode of(String value) { + return new DiscountApplicationMode(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static DiscountApplicationMode fromValue(String value) { + return value == null ? null : new DiscountApplicationMode(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof DiscountApplicationMode that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountClass.java b/src/main/java/com/sumup/sdk/models/DiscountClass.java new file mode 100644 index 0000000..5ff2f20 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountClass.java @@ -0,0 +1,60 @@ +// 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 method used to target items to discount. Must be populated for ITEM level discounts, and must + * be null for CART level discounts (CART level targets all items, therefore none of these + * categories apply). + */ +public final class DiscountClass { + public static final DiscountClass ITEM = new DiscountClass("ITEM"); + public static final DiscountClass CATEGORY = new DiscountClass("CATEGORY"); + public static final DiscountClass BUNDLE = new DiscountClass("BUNDLE"); + public static final DiscountClass BUY_X_GET_Y = new DiscountClass("BUY_X_GET_Y"); + public static final DiscountClass MEAL_DEAL = new DiscountClass("MEAL_DEAL"); + + private final String value; + + private DiscountClass(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a DiscountClass 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 DiscountClass of(String value) { + return new DiscountClass(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static DiscountClass fromValue(String value) { + return value == null ? null : new DiscountClass(value); + } + + @Override + public boolean equals(Object other) { + return this == other || (other instanceof DiscountClass that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountLine.java b/src/main/java/com/sumup/sdk/models/DiscountLine.java new file mode 100644 index 0000000..2a589b9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountLine.java @@ -0,0 +1,186 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Object representing information about single discount line. */ +public record DiscountLine( + /** A description or reason of the discount. */ + String description, + + /** + * The gross amount of the discount. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + Long grossAmount, + + /** + * An id used to associate a discount line with a specific discount. Since we can apply multiple + * discounts (e.g. 2x 10% whole cart off) we need to be able to identify which discount line + * belongs to which cart discount. Recommended to use UUID identifiers. + */ + String id, + + /** + * Specifies where discount was applied by user (either merchant or consumer): - CART: Applied + * to the whole cart (calculated and distributed per sale item) - ITEM: Applied to specific sale + * item *Accepted values:* ["ITEM", "CART"]. + */ + String level, + + /** + * The net amount of the discount. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + Long netAmount, + + /** The source of discount. Exactly one property must be set. */ + com.sumup.sdk.models.DiscountSource source, + + /** + * The tax amount of the discount. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + Long taxAmount, + + /** + * The value type of the discount, either a percentage based or absolute monetary value. It is + * required that only one of the following is set: - absolute - percentage. + */ + com.sumup.sdk.models.DiscountValue value) { + /** + * Creates a builder for DiscountLine. + * + * @return Builder that constructs immutable DiscountLine instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountLine instances. */ + public static final class Builder { + private String description; + private Long grossAmount; + private String id; + private String level; + private Long netAmount; + private com.sumup.sdk.models.DiscountSource source; + private Long taxAmount; + private com.sumup.sdk.models.DiscountValue value; + + private Builder() {} + + /** + * Sets the value for {@code description}. + * + * @param description A description or reason of the discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code grossAmount}. + * + * @param grossAmount The gross amount of the discount. The value of the amount in minor units + * of the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder grossAmount(Long grossAmount) { + this.grossAmount = grossAmount; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id An id used to associate a discount line with a specific discount. Since we can + * apply multiple discounts (e.g. 2x 10% whole cart off) we need to be able to identify + * which discount line belongs to which cart discount. Recommended to use UUID identifiers. + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code level}. + * + * @param level Specifies where discount was applied by user (either merchant or consumer): - + * CART: Applied to the whole cart (calculated and distributed per sale item) - ITEM: + * Applied to specific sale item *Accepted values:* ["ITEM", "CART"]. + * @return This builder instance. + */ + public Builder level(String level) { + this.level = level; + return this; + } + + /** + * Sets the value for {@code netAmount}. + * + * @param netAmount The net amount of the discount. The value of the amount in minor units of + * the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder netAmount(Long netAmount) { + this.netAmount = netAmount; + return this; + } + + /** + * Sets the value for {@code source}. + * + * @param source The source of discount. Exactly one property must be set. + * @return This builder instance. + */ + public Builder source(com.sumup.sdk.models.DiscountSource source) { + this.source = source; + return this; + } + + /** + * Sets the value for {@code taxAmount}. + * + * @param taxAmount The tax amount of the discount. The value of the amount in minor units of + * the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder taxAmount(Long taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value The value type of the discount, either a percentage based or absolute monetary + * value. It is required that only one of the following is set: - absolute - percentage. + * @return This builder instance. + */ + public Builder value(com.sumup.sdk.models.DiscountValue value) { + this.value = value; + return this; + } + + /** + * Builds an immutable DiscountLine instance. + * + * @return Immutable DiscountLine. + */ + public DiscountLine build() { + return new DiscountLine( + description, + Objects.requireNonNull(grossAmount, "grossAmount"), + id, + Objects.requireNonNull(level, "level"), + Objects.requireNonNull(netAmount, "netAmount"), + Objects.requireNonNull(source, "source"), + Objects.requireNonNull(taxAmount, "taxAmount"), + Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSource.java b/src/main/java/com/sumup/sdk/models/DiscountSource.java new file mode 100644 index 0000000..852c982 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSource.java @@ -0,0 +1,103 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** The source of discount. Exactly one property must be set. */ +public record DiscountSource( + /** Discount created ad-hoc on device during checkout. */ + com.sumup.sdk.models.DiscountSourceAdHoc adHoc, + + /** Preset discount applied manually on the POS. */ + com.sumup.sdk.models.DiscountSourceBasic basic, + + /** Discount applied manually when entering a coupon code at checkout. */ + com.sumup.sdk.models.DiscountSourceCoupon coupon, + + /** Discount applied when redeeming a reward from the merchant's loyalty scheme. */ + com.sumup.sdk.models.DiscountSourceLoyalty loyalty, + + /** Discount applied automatically when cart is updated based on preset promotions. */ + com.sumup.sdk.models.DiscountSourceOffer offer) { + /** + * Creates a builder for DiscountSource. + * + * @return Builder that constructs immutable DiscountSource instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSource instances. */ + public static final class Builder { + private com.sumup.sdk.models.DiscountSourceAdHoc adHoc; + private com.sumup.sdk.models.DiscountSourceBasic basic; + private com.sumup.sdk.models.DiscountSourceCoupon coupon; + private com.sumup.sdk.models.DiscountSourceLoyalty loyalty; + private com.sumup.sdk.models.DiscountSourceOffer offer; + + private Builder() {} + + /** + * Sets the value for {@code adHoc}. + * + * @param adHoc Discount created ad-hoc on device during checkout. + * @return This builder instance. + */ + public Builder adHoc(com.sumup.sdk.models.DiscountSourceAdHoc adHoc) { + this.adHoc = adHoc; + return this; + } + + /** + * Sets the value for {@code basic}. + * + * @param basic Preset discount applied manually on the POS. + * @return This builder instance. + */ + public Builder basic(com.sumup.sdk.models.DiscountSourceBasic basic) { + this.basic = basic; + return this; + } + + /** + * Sets the value for {@code coupon}. + * + * @param coupon Discount applied manually when entering a coupon code at checkout. + * @return This builder instance. + */ + public Builder coupon(com.sumup.sdk.models.DiscountSourceCoupon coupon) { + this.coupon = coupon; + return this; + } + + /** + * Sets the value for {@code loyalty}. + * + * @param loyalty Discount applied when redeeming a reward from the merchant's loyalty scheme. + * @return This builder instance. + */ + public Builder loyalty(com.sumup.sdk.models.DiscountSourceLoyalty loyalty) { + this.loyalty = loyalty; + return this; + } + + /** + * Sets the value for {@code offer}. + * + * @param offer Discount applied automatically when cart is updated based on preset promotions. + * @return This builder instance. + */ + public Builder offer(com.sumup.sdk.models.DiscountSourceOffer offer) { + this.offer = offer; + return this; + } + + /** + * Builds an immutable DiscountSource instance. + * + * @return Immutable DiscountSource. + */ + public DiscountSource build() { + return new DiscountSource(adHoc, basic, coupon, loyalty, offer); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceAdHoc.java b/src/main/java/com/sumup/sdk/models/DiscountSourceAdHoc.java new file mode 100644 index 0000000..b2eaea0 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceAdHoc.java @@ -0,0 +1,73 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** Discount created ad-hoc on device during checkout. */ +public record DiscountSourceAdHoc( + /** The description of the ad-hoc discount. */ + String description, + + /** The unique identifier of the ad-hoc discount. */ + java.util.UUID id, + + /** The name of the ad-hoc discount. */ + String name) { + /** + * Creates a builder for DiscountSourceAdHoc. + * + * @return Builder that constructs immutable DiscountSourceAdHoc instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSourceAdHoc instances. */ + public static final class Builder { + private String description; + private java.util.UUID id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code description}. + * + * @param description The description of the ad-hoc discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The unique identifier of the ad-hoc discount. + * @return This builder instance. + */ + public Builder id(java.util.UUID id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the ad-hoc discount. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable DiscountSourceAdHoc instance. + * + * @return Immutable DiscountSourceAdHoc. + */ + public DiscountSourceAdHoc build() { + return new DiscountSourceAdHoc(description, id, name); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceBasic.java b/src/main/java/com/sumup/sdk/models/DiscountSourceBasic.java new file mode 100644 index 0000000..87402d9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceBasic.java @@ -0,0 +1,94 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Preset discount applied manually on the POS. */ +public record DiscountSourceBasic( + /** Method of applying the discount to the items or cart. */ + com.sumup.sdk.models.DiscountApplicationMode applicationMode, + + /** The description of the loyalty discount. */ + String description, + + /** The unique identifier of the basic discount. */ + java.util.UUID id, + + /** The name of the basic discount. */ + String name) { + /** + * Creates a builder for DiscountSourceBasic. + * + * @return Builder that constructs immutable DiscountSourceBasic instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSourceBasic instances. */ + public static final class Builder { + private com.sumup.sdk.models.DiscountApplicationMode applicationMode; + private String description; + private java.util.UUID id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code applicationMode}. + * + * @param applicationMode Method of applying the discount to the items or cart. + * @return This builder instance. + */ + public Builder applicationMode(com.sumup.sdk.models.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + + /** + * Sets the value for {@code description}. + * + * @param description The description of the loyalty discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The unique identifier of the basic discount. + * @return This builder instance. + */ + public Builder id(java.util.UUID id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the basic discount. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable DiscountSourceBasic instance. + * + * @return Immutable DiscountSourceBasic. + */ + public DiscountSourceBasic build() { + return new DiscountSourceBasic( + Objects.requireNonNull(applicationMode, "applicationMode"), + description, + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(name, "name")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceCoupon.java b/src/main/java/com/sumup/sdk/models/DiscountSourceCoupon.java new file mode 100644 index 0000000..734c20e --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceCoupon.java @@ -0,0 +1,132 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Discount applied manually when entering a coupon code at checkout. */ +public record DiscountSourceCoupon( + /** Method of applying the discount to the items or cart. */ + com.sumup.sdk.models.DiscountApplicationMode applicationMode, + + /** The coupon code. */ + String code, + + /** The description of the coupon discount. */ + String description, + + /** + * The method used to target items to discount. Must be populated for ITEM level discounts, and + * must be null for CART level discounts (CART level targets all items, therefore none of these + * categories apply). + */ + com.sumup.sdk.models.DiscountClass discountClass, + + /** The unique identifier of the coupon discount. */ + java.util.UUID id, + + /** The name of the coupon discount. */ + String name) { + /** + * Creates a builder for DiscountSourceCoupon. + * + * @return Builder that constructs immutable DiscountSourceCoupon instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSourceCoupon instances. */ + public static final class Builder { + private com.sumup.sdk.models.DiscountApplicationMode applicationMode; + private String code; + private String description; + private com.sumup.sdk.models.DiscountClass discountClass; + private java.util.UUID id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code applicationMode}. + * + * @param applicationMode Method of applying the discount to the items or cart. + * @return This builder instance. + */ + public Builder applicationMode(com.sumup.sdk.models.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + + /** + * Sets the value for {@code code}. + * + * @param code The coupon code. + * @return This builder instance. + */ + public Builder code(String code) { + this.code = code; + return this; + } + + /** + * Sets the value for {@code description}. + * + * @param description The description of the coupon discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code discountClass}. + * + * @param discountClass The method used to target items to discount. Must be populated for ITEM + * level discounts, and must be null for CART level discounts (CART level targets all items, + * therefore none of these categories apply). + * @return This builder instance. + */ + public Builder discountClass(com.sumup.sdk.models.DiscountClass discountClass) { + this.discountClass = discountClass; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The unique identifier of the coupon discount. + * @return This builder instance. + */ + public Builder id(java.util.UUID id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the coupon discount. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable DiscountSourceCoupon instance. + * + * @return Immutable DiscountSourceCoupon. + */ + public DiscountSourceCoupon build() { + return new DiscountSourceCoupon( + Objects.requireNonNull(applicationMode, "applicationMode"), + Objects.requireNonNull(code, "code"), + description, + discountClass, + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(name, "name")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceLoyalty.java b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyalty.java new file mode 100644 index 0000000..9e16d7f --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyalty.java @@ -0,0 +1,172 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Discount applied when redeeming a reward from the merchant's loyalty scheme. */ +public record DiscountSourceLoyalty( + /** Method of applying the discount to the items or cart. */ + com.sumup.sdk.models.DiscountApplicationMode applicationMode, + + /** The description of the loyalty discount. */ + String description, + + /** + * The method used to target items to discount. Must be populated for ITEM level discounts, and + * must be null for CART level discounts (CART level targets all items, therefore none of these + * categories apply). + */ + com.sumup.sdk.models.DiscountClass discountClass, + + /** The unique identifier of the promotion or reward. */ + java.util.UUID id, + + /** + * The type of loyalty discount, either a promotion (e.g. new customer discount) or a reward + * (free coffee after completing stamp card). + */ + com.sumup.sdk.models.DiscountSourceLoyaltyType loyaltyType, + + /** The name of the loyalty discount. */ + String name, + + /** + * The number of points used for this loyalty discount. Must be a positive integer if the scheme + * type is POINTS. Must not be populated if the scheme type is STAMPS. + */ + Long points, + + /** The scheme type of the loyalty program. */ + com.sumup.sdk.models.DiscountSourceLoyaltySchemeType schemeType) { + /** + * Creates a builder for DiscountSourceLoyalty. + * + * @return Builder that constructs immutable DiscountSourceLoyalty instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSourceLoyalty instances. */ + public static final class Builder { + private com.sumup.sdk.models.DiscountApplicationMode applicationMode; + private String description; + private com.sumup.sdk.models.DiscountClass discountClass; + private java.util.UUID id; + private com.sumup.sdk.models.DiscountSourceLoyaltyType loyaltyType; + private String name; + private Long points; + private com.sumup.sdk.models.DiscountSourceLoyaltySchemeType schemeType; + + private Builder() {} + + /** + * Sets the value for {@code applicationMode}. + * + * @param applicationMode Method of applying the discount to the items or cart. + * @return This builder instance. + */ + public Builder applicationMode(com.sumup.sdk.models.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + + /** + * Sets the value for {@code description}. + * + * @param description The description of the loyalty discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code discountClass}. + * + * @param discountClass The method used to target items to discount. Must be populated for ITEM + * level discounts, and must be null for CART level discounts (CART level targets all items, + * therefore none of these categories apply). + * @return This builder instance. + */ + public Builder discountClass(com.sumup.sdk.models.DiscountClass discountClass) { + this.discountClass = discountClass; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The unique identifier of the promotion or reward. + * @return This builder instance. + */ + public Builder id(java.util.UUID id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code loyaltyType}. + * + * @param loyaltyType The type of loyalty discount, either a promotion (e.g. new customer + * discount) or a reward (free coffee after completing stamp card). + * @return This builder instance. + */ + public Builder loyaltyType(com.sumup.sdk.models.DiscountSourceLoyaltyType loyaltyType) { + this.loyaltyType = loyaltyType; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the loyalty discount. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code points}. + * + * @param points The number of points used for this loyalty discount. Must be a positive integer + * if the scheme type is POINTS. Must not be populated if the scheme type is STAMPS. + * @return This builder instance. + */ + public Builder points(Long points) { + this.points = points; + return this; + } + + /** + * Sets the value for {@code schemeType}. + * + * @param schemeType The scheme type of the loyalty program. + * @return This builder instance. + */ + public Builder schemeType(com.sumup.sdk.models.DiscountSourceLoyaltySchemeType schemeType) { + this.schemeType = schemeType; + return this; + } + + /** + * Builds an immutable DiscountSourceLoyalty instance. + * + * @return Immutable DiscountSourceLoyalty. + */ + public DiscountSourceLoyalty build() { + return new DiscountSourceLoyalty( + Objects.requireNonNull(applicationMode, "applicationMode"), + description, + discountClass, + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(loyaltyType, "loyaltyType"), + Objects.requireNonNull(name, "name"), + points, + Objects.requireNonNull(schemeType, "schemeType")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltySchemeType.java b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltySchemeType.java new file mode 100644 index 0000000..eae65bd --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltySchemeType.java @@ -0,0 +1,56 @@ +// 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 scheme type of the loyalty program. */ +public final class DiscountSourceLoyaltySchemeType { + public static final DiscountSourceLoyaltySchemeType STAMPS = + new DiscountSourceLoyaltySchemeType("STAMPS"); + public static final DiscountSourceLoyaltySchemeType POINTS = + new DiscountSourceLoyaltySchemeType("POINTS"); + + private final String value; + + private DiscountSourceLoyaltySchemeType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a DiscountSourceLoyaltySchemeType 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 DiscountSourceLoyaltySchemeType of(String value) { + return new DiscountSourceLoyaltySchemeType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static DiscountSourceLoyaltySchemeType fromValue(String value) { + return value == null ? null : new DiscountSourceLoyaltySchemeType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof DiscountSourceLoyaltySchemeType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltyType.java b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltyType.java new file mode 100644 index 0000000..a569ba1 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceLoyaltyType.java @@ -0,0 +1,58 @@ +// 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 type of loyalty discount, either a promotion (e.g. new customer discount) or a reward (free + * coffee after completing stamp card). + */ +public final class DiscountSourceLoyaltyType { + public static final DiscountSourceLoyaltyType PROMOTION = + new DiscountSourceLoyaltyType("PROMOTION"); + public static final DiscountSourceLoyaltyType REWARD = new DiscountSourceLoyaltyType("REWARD"); + + private final String value; + + private DiscountSourceLoyaltyType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a DiscountSourceLoyaltyType 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 DiscountSourceLoyaltyType of(String value) { + return new DiscountSourceLoyaltyType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static DiscountSourceLoyaltyType fromValue(String value) { + return value == null ? null : new DiscountSourceLoyaltyType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof DiscountSourceLoyaltyType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountSourceOffer.java b/src/main/java/com/sumup/sdk/models/DiscountSourceOffer.java new file mode 100644 index 0000000..c957821 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountSourceOffer.java @@ -0,0 +1,116 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Discount applied automatically when cart is updated based on preset promotions. */ +public record DiscountSourceOffer( + /** Method of applying the discount to the items or cart. */ + com.sumup.sdk.models.DiscountApplicationMode applicationMode, + + /** The description of the offer discount. */ + String description, + + /** + * The method used to target items to discount. Must be populated for ITEM level discounts, and + * must be null for CART level discounts (CART level targets all items, therefore none of these + * categories apply). + */ + com.sumup.sdk.models.DiscountClass discountClass, + + /** The unique identifier of the offer discount. */ + java.util.UUID id, + + /** The name of the offer discount. */ + String name) { + /** + * Creates a builder for DiscountSourceOffer. + * + * @return Builder that constructs immutable DiscountSourceOffer instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountSourceOffer instances. */ + public static final class Builder { + private com.sumup.sdk.models.DiscountApplicationMode applicationMode; + private String description; + private com.sumup.sdk.models.DiscountClass discountClass; + private java.util.UUID id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code applicationMode}. + * + * @param applicationMode Method of applying the discount to the items or cart. + * @return This builder instance. + */ + public Builder applicationMode(com.sumup.sdk.models.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + + /** + * Sets the value for {@code description}. + * + * @param description The description of the offer discount. + * @return This builder instance. + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Sets the value for {@code discountClass}. + * + * @param discountClass The method used to target items to discount. Must be populated for ITEM + * level discounts, and must be null for CART level discounts (CART level targets all items, + * therefore none of these categories apply). + * @return This builder instance. + */ + public Builder discountClass(com.sumup.sdk.models.DiscountClass discountClass) { + this.discountClass = discountClass; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The unique identifier of the offer discount. + * @return This builder instance. + */ + public Builder id(java.util.UUID id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the offer discount. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable DiscountSourceOffer instance. + * + * @return Immutable DiscountSourceOffer. + */ + public DiscountSourceOffer build() { + return new DiscountSourceOffer( + Objects.requireNonNull(applicationMode, "applicationMode"), + description, + discountClass, + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(name, "name")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/DiscountValue.java b/src/main/java/com/sumup/sdk/models/DiscountValue.java new file mode 100644 index 0000000..f12de67 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/DiscountValue.java @@ -0,0 +1,71 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** + * The value type of the discount, either a percentage based or absolute monetary value. It is + * required that only one of the following is set: - absolute - percentage. + */ +public record DiscountValue( + /** + * The absolute value in minor units of the currency according to the Sale.currency.scale. + * Example: 10000 = 10.00 + */ + Long absolute, + + /** + * The percentage in minor units (1/100000). Examples: - 10% -> 0.10 (decimal) = 10000 (minor + * units) - 15.5% -> 0.155 (decimal) = 15500 (minor units) - 0.001% -> 0.00001 (decimal) = 1 + * (minor units) + */ + Long percentage) { + /** + * Creates a builder for DiscountValue. + * + * @return Builder that constructs immutable DiscountValue instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DiscountValue instances. */ + public static final class Builder { + private Long absolute; + private Long percentage; + + private Builder() {} + + /** + * Sets the value for {@code absolute}. + * + * @param absolute The absolute value in minor units of the currency according to the + * Sale.currency.scale. Example: 10000 = 10.00 + * @return This builder instance. + */ + public Builder absolute(Long absolute) { + this.absolute = absolute; + return this; + } + + /** + * Sets the value for {@code percentage}. + * + * @param percentage The percentage in minor units (1/100000). Examples: - 10% -> 0.10 (decimal) + * = 10000 (minor units) - 15.5% -> 0.155 (decimal) = 15500 (minor units) - 0.001% -> + * 0.00001 (decimal) = 1 (minor units) + * @return This builder instance. + */ + public Builder percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * Builds an immutable DiscountValue instance. + * + * @return Immutable DiscountValue. + */ + public DiscountValue build() { + return new DiscountValue(absolute, percentage); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/FeatureV10.java b/src/main/java/com/sumup/sdk/models/FeatureV10.java new file mode 100644 index 0000000..31b2669 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/FeatureV10.java @@ -0,0 +1,105 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * A named, typed characteristic of a line. New item types add data here instead of a typed + * sub-object per type. Examples by item type (illustrative, not exhaustive): - DEPOSIT: + * `operation_type` = "SALE", `linked_line_id` = "line-1" - GIFT_CARD: `gift_card_reference` = + * "GCMINGXPC5" - CATALOG: `variant_name` = "Large", `item_id` / `variant_id` (TEXT), + * `reporting_category_id` = "cat-..." - FEE: `fee_type` = "SHIPPING" (required); optional `fee_id`, + * `value_absolute` or `value_percentage`, and per-type metadata features such as `delivery_name` / + * `tracking_reference` (shipping), `card_type` / `scheme` (surcharge), or `policy_id` + * (cancellation) - (future) SUBSCRIPTION: `billing_period` = "P1M", `renews_at` = "2026-07-02" + * Conventional `FEE` feature keys: - `fee_type` (TEXT, required): `SHIPPING`, `SURCHARGE`, + * `SERVICE_CHARGE`, or `CANCELLATION` - `fee_id` (TEXT, optional): identifier of the fee definition + * - `value_absolute` (INTEGER, optional): configured absolute value in minor units of the sale + * currency (the charged amount is on `price`) - `value_percentage` (INTEGER, optional): configured + * percentage in minor units (1/100000; e.g. 10000 = 10%) - Per-type metadata (optional, TEXT unless + * noted): `delivery_name`, `tracking_reference` (shipping); `card_type`, `scheme` (surcharge); + * `policy_id` (cancellation) + */ +public record FeatureV10( + /** The feature name/key. */ + String name, + + /** + * The feature value in canonical string form, to be parsed per `value_type` (e.g. INTEGER -> + * "3", DECIMAL -> "1.50", DATE -> "2026-07-02", BOOLEAN -> "true"). Carrying it as a string + * keeps the wire format stable as new feature names and value types are introduced. + */ + String value, + + /** + * The data type of a feature value. The wire `value` is always a string and is parsed according + * to this type. + */ + com.sumup.sdk.models.FeatureValueTypeV10 valueType) { + /** + * Creates a builder for FeatureV10. + * + * @return Builder that constructs immutable FeatureV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for FeatureV10 instances. */ + public static final class Builder { + private String name; + private String value; + private com.sumup.sdk.models.FeatureValueTypeV10 valueType; + + private Builder() {} + + /** + * Sets the value for {@code name}. + * + * @param name The feature name/key. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value The feature value in canonical string form, to be parsed per `value_type` (e.g. + * INTEGER -> "3", DECIMAL -> "1.50", DATE -> "2026-07-02", BOOLEAN -> "true"). Carrying it + * as a string keeps the wire format stable as new feature names and value types are + * introduced. + * @return This builder instance. + */ + public Builder value(String value) { + this.value = value; + return this; + } + + /** + * Sets the value for {@code valueType}. + * + * @param valueType The data type of a feature value. The wire `value` is always a string and is + * parsed according to this type. + * @return This builder instance. + */ + public Builder valueType(com.sumup.sdk.models.FeatureValueTypeV10 valueType) { + this.valueType = valueType; + return this; + } + + /** + * Builds an immutable FeatureV10 instance. + * + * @return Immutable FeatureV10. + */ + public FeatureV10 build() { + return new FeatureV10( + Objects.requireNonNull(name, "name"), + Objects.requireNonNull(value, "value"), + Objects.requireNonNull(valueType, "valueType")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java b/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java new file mode 100644 index 0000000..5701681 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java @@ -0,0 +1,60 @@ +// 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 data type of a feature value. The wire `value` is always a string and is parsed according to + * this type. + */ +public final class FeatureValueTypeV10 { + public static final FeatureValueTypeV10 TEXT = new FeatureValueTypeV10("TEXT"); + public static final FeatureValueTypeV10 INTEGER = new FeatureValueTypeV10("INTEGER"); + public static final FeatureValueTypeV10 DECIMAL = new FeatureValueTypeV10("DECIMAL"); + public static final FeatureValueTypeV10 DATE = new FeatureValueTypeV10("DATE"); + public static final FeatureValueTypeV10 BOOLEAN = new FeatureValueTypeV10("BOOLEAN"); + + private final String value; + + private FeatureValueTypeV10(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a FeatureValueTypeV10 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 FeatureValueTypeV10 of(String value) { + return new FeatureValueTypeV10(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static FeatureValueTypeV10 fromValue(String value) { + return value == null ? null : new FeatureValueTypeV10(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof FeatureValueTypeV10 that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/FinalPriceAmounts.java b/src/main/java/com/sumup/sdk/models/FinalPriceAmounts.java new file mode 100644 index 0000000..07d4413 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/FinalPriceAmounts.java @@ -0,0 +1,117 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Final price amounts after all calculations and adjustments. */ +public record FinalPriceAmounts( + /** + * Discounts applied. Important: Discount amounts shouldn't take effect on net and gross + * amounts. Discount money amounts depend on where discount was applied: - for item level + * discount: whole discount money amount is applied - for cart level discount: only part of the + * whole amount is applied (discount money value is split on each line item) + */ + java.util.List discounts, + + /** + * Taxes applied on top of `total_net_amount_final` amount resulting in + * `total_gross_amount_final` amount. If no discounts are applied, it should be equal to + * `taxes`. + */ + java.util.List taxesFinal, + + /** + * The final gross amount includes discounts, modifiers, and taxes. If no discounts are applied, + * it should be equal to total_gross_amount. + */ + Long totalGrossAmountFinal, + + /** + * The final net amount includes discounts and modifiers. It does NOT include taxes. If no + * discounts are applied, it should be equal to total_net_amount. + */ + Long totalNetAmountFinal) { + /** + * Creates a builder for FinalPriceAmounts. + * + * @return Builder that constructs immutable FinalPriceAmounts instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for FinalPriceAmounts instances. */ + public static final class Builder { + private java.util.List discounts; + private java.util.List taxesFinal; + private Long totalGrossAmountFinal; + private Long totalNetAmountFinal; + + private Builder() {} + + /** + * Sets the value for {@code discounts}. + * + * @param discounts Discounts applied. Important: Discount amounts shouldn't take effect on net + * and gross amounts. Discount money amounts depend on where discount was applied: - for + * item level discount: whole discount money amount is applied - for cart level discount: + * only part of the whole amount is applied (discount money value is split on each line + * item) + * @return This builder instance. + */ + public Builder discounts(java.util.List discounts) { + this.discounts = discounts; + return this; + } + + /** + * Sets the value for {@code taxesFinal}. + * + * @param taxesFinal Taxes applied on top of `total_net_amount_final` amount resulting in + * `total_gross_amount_final` amount. If no discounts are applied, it should be equal to + * `taxes`. + * @return This builder instance. + */ + public Builder taxesFinal(java.util.List taxesFinal) { + this.taxesFinal = taxesFinal; + return this; + } + + /** + * Sets the value for {@code totalGrossAmountFinal}. + * + * @param totalGrossAmountFinal The final gross amount includes discounts, modifiers, and taxes. + * If no discounts are applied, it should be equal to total_gross_amount. + * @return This builder instance. + */ + public Builder totalGrossAmountFinal(Long totalGrossAmountFinal) { + this.totalGrossAmountFinal = totalGrossAmountFinal; + return this; + } + + /** + * Sets the value for {@code totalNetAmountFinal}. + * + * @param totalNetAmountFinal The final net amount includes discounts and modifiers. It does NOT + * include taxes. If no discounts are applied, it should be equal to total_net_amount. + * @return This builder instance. + */ + public Builder totalNetAmountFinal(Long totalNetAmountFinal) { + this.totalNetAmountFinal = totalNetAmountFinal; + return this; + } + + /** + * Builds an immutable FinalPriceAmounts instance. + * + * @return Immutable FinalPriceAmounts. + */ + public FinalPriceAmounts build() { + return new FinalPriceAmounts( + discounts, + Objects.requireNonNull(taxesFinal, "taxesFinal"), + Objects.requireNonNull(totalGrossAmountFinal, "totalGrossAmountFinal"), + Objects.requireNonNull(totalNetAmountFinal, "totalNetAmountFinal")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ItemReferencesV10.java b/src/main/java/com/sumup/sdk/models/ItemReferencesV10.java new file mode 100644 index 0000000..007b1df --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ItemReferencesV10.java @@ -0,0 +1,101 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** + * Outward identifiers and links for a line, kept in one place rather than scattered per item type. + */ +public record ItemReferencesV10( + /** + * Reference to the backing catalog entity (item variant, deposit, ...), typically a URN such as + * `urn:sumup:pos:variant:${MERCHANT_CODE}:${ITEM_ID}:${VARIANT_ID}` or + * `urn:sumup:pos:deposit:${MERCHANT_CODE}:${DEPOSIT_ID}`. Empty for ad-hoc / manual lines. + * Type-agnostic on purpose: a new item type backed by a catalog entity reuses this field + * instead of adding its own. + */ + String catalogReference, + + /** The source of the catalog the line originates from. */ + com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource, + + /** An external reference id connecting this line to another system. */ + String externalId, + + /** Stock keeping unit, enriched from the Catalog when available. */ + String sku) { + /** + * Creates a builder for ItemReferencesV10. + * + * @return Builder that constructs immutable ItemReferencesV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ItemReferencesV10 instances. */ + public static final class Builder { + private String catalogReference; + private com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource; + private String externalId; + private String sku; + + private Builder() {} + + /** + * Sets the value for {@code catalogReference}. + * + * @param catalogReference Reference to the backing catalog entity (item variant, deposit, ...), + * typically a URN such as `urn:sumup:pos:variant:${MERCHANT_CODE}:${ITEM_ID}:${VARIANT_ID}` + * or `urn:sumup:pos:deposit:${MERCHANT_CODE}:${DEPOSIT_ID}`. Empty for ad-hoc / manual + * lines. Type-agnostic on purpose: a new item type backed by a catalog entity reuses this + * field instead of adding its own. + * @return This builder instance. + */ + public Builder catalogReference(String catalogReference) { + this.catalogReference = catalogReference; + return this; + } + + /** + * Sets the value for {@code catalogSource}. + * + * @param catalogSource The source of the catalog the line originates from. + * @return This builder instance. + */ + public Builder catalogSource( + com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource) { + this.catalogSource = catalogSource; + return this; + } + + /** + * Sets the value for {@code externalId}. + * + * @param externalId An external reference id connecting this line to another system. + * @return This builder instance. + */ + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Sets the value for {@code sku}. + * + * @param sku Stock keeping unit, enriched from the Catalog when available. + * @return This builder instance. + */ + public Builder sku(String sku) { + this.sku = sku; + return this; + } + + /** + * Builds an immutable ItemReferencesV10 instance. + * + * @return Immutable ItemReferencesV10. + */ + public ItemReferencesV10 build() { + return new ItemReferencesV10(catalogReference, catalogSource, externalId, sku); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java b/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java new file mode 100644 index 0000000..dda2012 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java @@ -0,0 +1,56 @@ +// 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 source of the catalog the line originates from. */ +public final class ItemReferencesV10CatalogSource { + public static final ItemReferencesV10CatalogSource SUMUP = + new ItemReferencesV10CatalogSource("SUMUP"); + public static final ItemReferencesV10CatalogSource EXTERNAL = + new ItemReferencesV10CatalogSource("EXTERNAL"); + + private final String value; + + private ItemReferencesV10CatalogSource(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a ItemReferencesV10CatalogSource 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 ItemReferencesV10CatalogSource of(String value) { + return new ItemReferencesV10CatalogSource(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static ItemReferencesV10CatalogSource fromValue(String value) { + return value == null ? null : new ItemReferencesV10CatalogSource(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof ItemReferencesV10CatalogSource that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10.java b/src/main/java/com/sumup/sdk/models/LineItemPriceV10.java new file mode 100644 index 0000000..c53c25e --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/LineItemPriceV10.java @@ -0,0 +1,188 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Pricing for a single line, valid for every item type. Merges the standard amounts (with tax + * breakdown) and the final amounts (after discounts/modifiers). Totals and tax amounts can be + * negative for return-like operations (for example a deposit with `operation_type` = `RETURN`). + */ +public record LineItemPriceV10( + /** + * Discounts applied. Discount amounts do not affect `total_net_amount` / `total_gross_amount`; + * they are reflected in the `*_final` amounts. + */ + java.util.List discounts, + + /** Taxes applied on top of the net amount resulting in the gross amount. */ + java.util.List taxes, + + /** + * Taxes applied on top of `total_net_amount_final` resulting in `total_gross_amount_final`. + * Equals `taxes` if no discounts apply. + */ + java.util.List taxesFinal, + + /** The gross amount (including modifiers if applied). It does NOT include discounts. */ + com.sumup.sdk.models.LineItemPriceV10TotalGrossAmount totalGrossAmount, + + /** + * The final gross amount including discounts, modifiers and taxes. Equals `total_gross_amount` + * if no discounts apply. + */ + com.sumup.sdk.models.LineItemPriceV10TotalGrossAmountFinal totalGrossAmountFinal, + + /** The net amount (including modifiers if applied). It does NOT include discounts. */ + com.sumup.sdk.models.LineItemPriceV10TotalNetAmount totalNetAmount, + + /** + * The final net amount including discounts and modifiers. Equals `total_net_amount` if no + * discounts apply. + */ + com.sumup.sdk.models.LineItemPriceV10TotalNetAmountFinal totalNetAmountFinal, + + /** + * The price of a single unit. If the tax_mode is GROSS it includes taxes, otherwise no tax is + * included. It does NOT include discounts. + */ + Long unitAmount) { + /** + * Creates a builder for LineItemPriceV10. + * + * @return Builder that constructs immutable LineItemPriceV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for LineItemPriceV10 instances. */ + public static final class Builder { + private java.util.List discounts; + private java.util.List taxes; + private java.util.List taxesFinal; + private com.sumup.sdk.models.LineItemPriceV10TotalGrossAmount totalGrossAmount; + private com.sumup.sdk.models.LineItemPriceV10TotalGrossAmountFinal totalGrossAmountFinal; + private com.sumup.sdk.models.LineItemPriceV10TotalNetAmount totalNetAmount; + private com.sumup.sdk.models.LineItemPriceV10TotalNetAmountFinal totalNetAmountFinal; + private Long unitAmount; + + private Builder() {} + + /** + * Sets the value for {@code discounts}. + * + * @param discounts Discounts applied. Discount amounts do not affect `total_net_amount` / + * `total_gross_amount`; they are reflected in the `*_final` amounts. + * @return This builder instance. + */ + public Builder discounts(java.util.List discounts) { + this.discounts = discounts; + return this; + } + + /** + * Sets the value for {@code taxes}. + * + * @param taxes Taxes applied on top of the net amount resulting in the gross amount. + * @return This builder instance. + */ + public Builder taxes(java.util.List taxes) { + this.taxes = taxes; + return this; + } + + /** + * Sets the value for {@code taxesFinal}. + * + * @param taxesFinal Taxes applied on top of `total_net_amount_final` resulting in + * `total_gross_amount_final`. Equals `taxes` if no discounts apply. + * @return This builder instance. + */ + public Builder taxesFinal(java.util.List taxesFinal) { + this.taxesFinal = taxesFinal; + return this; + } + + /** + * Sets the value for {@code totalGrossAmount}. + * + * @param totalGrossAmount The gross amount (including modifiers if applied). It does NOT + * include discounts. + * @return This builder instance. + */ + public Builder totalGrossAmount( + com.sumup.sdk.models.LineItemPriceV10TotalGrossAmount totalGrossAmount) { + this.totalGrossAmount = totalGrossAmount; + return this; + } + + /** + * Sets the value for {@code totalGrossAmountFinal}. + * + * @param totalGrossAmountFinal The final gross amount including discounts, modifiers and taxes. + * Equals `total_gross_amount` if no discounts apply. + * @return This builder instance. + */ + public Builder totalGrossAmountFinal( + com.sumup.sdk.models.LineItemPriceV10TotalGrossAmountFinal totalGrossAmountFinal) { + this.totalGrossAmountFinal = totalGrossAmountFinal; + return this; + } + + /** + * Sets the value for {@code totalNetAmount}. + * + * @param totalNetAmount The net amount (including modifiers if applied). It does NOT include + * discounts. + * @return This builder instance. + */ + public Builder totalNetAmount( + com.sumup.sdk.models.LineItemPriceV10TotalNetAmount totalNetAmount) { + this.totalNetAmount = totalNetAmount; + return this; + } + + /** + * Sets the value for {@code totalNetAmountFinal}. + * + * @param totalNetAmountFinal The final net amount including discounts and modifiers. Equals + * `total_net_amount` if no discounts apply. + * @return This builder instance. + */ + public Builder totalNetAmountFinal( + com.sumup.sdk.models.LineItemPriceV10TotalNetAmountFinal totalNetAmountFinal) { + this.totalNetAmountFinal = totalNetAmountFinal; + return this; + } + + /** + * Sets the value for {@code unitAmount}. + * + * @param unitAmount The price of a single unit. If the tax_mode is GROSS it includes taxes, + * otherwise no tax is included. It does NOT include discounts. + * @return This builder instance. + */ + public Builder unitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Builds an immutable LineItemPriceV10 instance. + * + * @return Immutable LineItemPriceV10. + */ + public LineItemPriceV10 build() { + return new LineItemPriceV10( + discounts, + Objects.requireNonNull(taxes, "taxes"), + Objects.requireNonNull(taxesFinal, "taxesFinal"), + Objects.requireNonNull(totalGrossAmount, "totalGrossAmount"), + Objects.requireNonNull(totalGrossAmountFinal, "totalGrossAmountFinal"), + Objects.requireNonNull(totalNetAmount, "totalNetAmount"), + Objects.requireNonNull(totalNetAmountFinal, "totalNetAmountFinal"), + Objects.requireNonNull(unitAmount, "unitAmount")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmount.java b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmount.java new file mode 100644 index 0000000..5457dfe --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmount.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The gross amount (including modifiers if applied). It does NOT include discounts. */ +public record LineItemPriceV10TotalGrossAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for LineItemPriceV10TotalGrossAmount. + * + * @return Builder that constructs immutable LineItemPriceV10TotalGrossAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for LineItemPriceV10TotalGrossAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable LineItemPriceV10TotalGrossAmount instance. + * + * @return Immutable LineItemPriceV10TotalGrossAmount. + */ + public LineItemPriceV10TotalGrossAmount build() { + return new LineItemPriceV10TotalGrossAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmountFinal.java b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmountFinal.java new file mode 100644 index 0000000..3ef8604 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalGrossAmountFinal.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * The final gross amount including discounts, modifiers and taxes. Equals `total_gross_amount` if + * no discounts apply. + */ +public record LineItemPriceV10TotalGrossAmountFinal( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for LineItemPriceV10TotalGrossAmountFinal. + * + * @return Builder that constructs immutable LineItemPriceV10TotalGrossAmountFinal instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for LineItemPriceV10TotalGrossAmountFinal instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable LineItemPriceV10TotalGrossAmountFinal instance. + * + * @return Immutable LineItemPriceV10TotalGrossAmountFinal. + */ + public LineItemPriceV10TotalGrossAmountFinal build() { + return new LineItemPriceV10TotalGrossAmountFinal( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmount.java b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmount.java new file mode 100644 index 0000000..eca5993 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmount.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The net amount (including modifiers if applied). It does NOT include discounts. */ +public record LineItemPriceV10TotalNetAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for LineItemPriceV10TotalNetAmount. + * + * @return Builder that constructs immutable LineItemPriceV10TotalNetAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for LineItemPriceV10TotalNetAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable LineItemPriceV10TotalNetAmount instance. + * + * @return Immutable LineItemPriceV10TotalNetAmount. + */ + public LineItemPriceV10TotalNetAmount build() { + return new LineItemPriceV10TotalNetAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmountFinal.java b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmountFinal.java new file mode 100644 index 0000000..2612d07 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/LineItemPriceV10TotalNetAmountFinal.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * The final net amount including discounts and modifiers. Equals `total_net_amount` if no discounts + * apply. + */ +public record LineItemPriceV10TotalNetAmountFinal( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for LineItemPriceV10TotalNetAmountFinal. + * + * @return Builder that constructs immutable LineItemPriceV10TotalNetAmountFinal instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for LineItemPriceV10TotalNetAmountFinal instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable LineItemPriceV10TotalNetAmountFinal instance. + * + * @return Immutable LineItemPriceV10TotalNetAmountFinal. + */ + public LineItemPriceV10TotalNetAmountFinal build() { + return new LineItemPriceV10TotalNetAmountFinal( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ModifierItem.java b/src/main/java/com/sumup/sdk/models/ModifierItem.java new file mode 100644 index 0000000..54a4d7f --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ModifierItem.java @@ -0,0 +1,184 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Modifiers are reported under line items and can be build from Item Catalog objects. Modifiers has + * to be attached to an item and can't be sold and refunded alone. + */ +public record ModifierItem( + /** + * Discounts applied. Important: Discount amounts shouldn't take effect on net and gross + * amounts. Discount money amounts depend on where discount was applied: - for item level + * discount: whole discount money amount is applied - for cart level discount: only part of the + * whole amount is applied (discount money value is split on each line item) + */ + java.util.List discounts, + + /** Modifier id, coming from the Item Catalog */ + String id, + + /** Modifier name, coming from the Item Catalog */ + String name, + + /** The numerical value representing the quantity in the specified unit. */ + Double quantity, + + /** Modifier set attached to an item. */ + com.sumup.sdk.models.ModifierSet set, + + /** + * Taxes applied on top of `total_net_amount_final` amount resulting in + * `total_gross_amount_final` amount. If no discounts are applied, it should be equal to + * `taxes`. + */ + java.util.List taxesFinal, + + /** + * The final gross amount includes discounts, modifiers, and taxes. If no discounts are applied, + * it should be equal to total_gross_amount. + */ + Long totalGrossAmountFinal, + + /** + * The final net amount includes discounts and modifiers. It does NOT include taxes. If no + * discounts are applied, it should be equal to total_net_amount. + */ + Long totalNetAmountFinal) { + /** + * Creates a builder for ModifierItem. + * + * @return Builder that constructs immutable ModifierItem instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ModifierItem instances. */ + public static final class Builder { + private java.util.List discounts; + private String id; + private String name; + private Double quantity; + private com.sumup.sdk.models.ModifierSet set; + private java.util.List taxesFinal; + private Long totalGrossAmountFinal; + private Long totalNetAmountFinal; + + private Builder() {} + + /** + * Sets the value for {@code discounts}. + * + * @param discounts Discounts applied. Important: Discount amounts shouldn't take effect on net + * and gross amounts. Discount money amounts depend on where discount was applied: - for + * item level discount: whole discount money amount is applied - for cart level discount: + * only part of the whole amount is applied (discount money value is split on each line + * item) + * @return This builder instance. + */ + public Builder discounts(java.util.List discounts) { + this.discounts = discounts; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id Modifier id, coming from the Item Catalog + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Modifier name, coming from the Item Catalog + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code quantity}. + * + * @param quantity The numerical value representing the quantity in the specified unit. + * @return This builder instance. + */ + public Builder quantity(Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Sets the value for {@code set}. + * + * @param set Modifier set attached to an item. + * @return This builder instance. + */ + public Builder set(com.sumup.sdk.models.ModifierSet set) { + this.set = set; + return this; + } + + /** + * Sets the value for {@code taxesFinal}. + * + * @param taxesFinal Taxes applied on top of `total_net_amount_final` amount resulting in + * `total_gross_amount_final` amount. If no discounts are applied, it should be equal to + * `taxes`. + * @return This builder instance. + */ + public Builder taxesFinal(java.util.List taxesFinal) { + this.taxesFinal = taxesFinal; + return this; + } + + /** + * Sets the value for {@code totalGrossAmountFinal}. + * + * @param totalGrossAmountFinal The final gross amount includes discounts, modifiers, and taxes. + * If no discounts are applied, it should be equal to total_gross_amount. + * @return This builder instance. + */ + public Builder totalGrossAmountFinal(Long totalGrossAmountFinal) { + this.totalGrossAmountFinal = totalGrossAmountFinal; + return this; + } + + /** + * Sets the value for {@code totalNetAmountFinal}. + * + * @param totalNetAmountFinal The final net amount includes discounts and modifiers. It does NOT + * include taxes. If no discounts are applied, it should be equal to total_net_amount. + * @return This builder instance. + */ + public Builder totalNetAmountFinal(Long totalNetAmountFinal) { + this.totalNetAmountFinal = totalNetAmountFinal; + return this; + } + + /** + * Builds an immutable ModifierItem instance. + * + * @return Immutable ModifierItem. + */ + public ModifierItem build() { + return new ModifierItem( + discounts, + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(name, "name"), + Objects.requireNonNull(quantity, "quantity"), + Objects.requireNonNull(set, "set"), + Objects.requireNonNull(taxesFinal, "taxesFinal"), + Objects.requireNonNull(totalGrossAmountFinal, "totalGrossAmountFinal"), + Objects.requireNonNull(totalNetAmountFinal, "totalNetAmountFinal")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ModifierSet.java b/src/main/java/com/sumup/sdk/models/ModifierSet.java new file mode 100644 index 0000000..98346db --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ModifierSet.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Modifier set attached to an item. */ +public record ModifierSet( + /** The id of the modifier set that modifier belongs to. */ + String id, + + /** The name of the modifier set that the modifier belongs to. */ + String name) { + /** + * Creates a builder for ModifierSet. + * + * @return Builder that constructs immutable ModifierSet instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ModifierSet instances. */ + public static final class Builder { + private String id; + private String name; + + private Builder() {} + + /** + * Sets the value for {@code id}. + * + * @param id The id of the modifier set that modifier belongs to. + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name The name of the modifier set that the modifier belongs to. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Builds an immutable ModifierSet instance. + * + * @return Immutable ModifierSet. + */ + public ModifierSet build() { + return new ModifierSet( + Objects.requireNonNull(id, "id"), Objects.requireNonNull(name, "name")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java b/src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java new file mode 100644 index 0000000..1bc8072 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java @@ -0,0 +1,59 @@ +// 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; + +/** + * Payment outcome filter value. Multi-select uses **OR** within this field; combined with other + * filters using **AND**. Only fully-paid closed sales are exposed. Refunded original sales remain + * searchable as `PAID`; refunds are separate negative sales, not a `REFUNDED` sale-search outcome. + */ +public final class PaymentStatusFilterV10 { + public static final PaymentStatusFilterV10 PAID = new PaymentStatusFilterV10("PAID"); + public static final PaymentStatusFilterV10 CHARGED_BACK = + new PaymentStatusFilterV10("CHARGED_BACK"); + + private final String value; + + private PaymentStatusFilterV10(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a PaymentStatusFilterV10 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 PaymentStatusFilterV10 of(String value) { + return new PaymentStatusFilterV10(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static PaymentStatusFilterV10 fromValue(String value) { + return value == null ? null : new PaymentStatusFilterV10(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof PaymentStatusFilterV10 that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/Person.java b/src/main/java/com/sumup/sdk/models/Person.java index 7e3c404..53be35f 100644 --- a/src/main/java/com/sumup/sdk/models/Person.java +++ b/src/main/java/com/sumup/sdk/models/Person.java @@ -2,7 +2,13 @@ package com.sumup.sdk.models; public record Person( - /** The address of the individual. */ + /** + * An address somewhere in the world. The address fields used depend on the country conventions. + * For example, in Great Britain, `city` is `post_town`. In the United States, the top-level + * administrative unit used in addresses is `state`, whereas in Chile it's `region`. Whether an + * address is valid or not depends on whether the locally required fields are present. Fields + * not supported in a country will be ignored. + */ com.sumup.sdk.models.Address address, /** @@ -19,7 +25,11 @@ public record Person( */ String changeStatus, - /** The Alpha-2 ISO code of the country where the Person is a citizen. */ + /** + * An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. This + * definition users `oneOf` with a two-character string type to allow for support of future + * countries in client code. + */ String citizenship, /** @@ -42,30 +52,15 @@ public record Person( /** A list of country-specific personal identifiers. */ com.sumup.sdk.models.PersonalIdentifiers identifiers, - /** - * Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle - * names; all can be present, with the names being separated by space characters. Also note that - * in some cultures, middle names are not used. - */ - String middleName, - /** * The Person's nationality. May be an [ISO3166-1 * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code, but legacy data may * not conform to this standard. */ String nationality, - - /** - * Details about the ownership relationship between the Person and the Merchant. This is only - * set if the Person has a relationship of type `owner`. - */ com.sumup.sdk.models.Ownership ownership, - /** - * The (mobile) phone number of the individual (used for verification) in - * [E.164](https://en.wikipedia.org/wiki/E.164) format. - */ + /** A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. */ String phoneNumber, /** @@ -100,7 +95,6 @@ public static final class Builder { private String familyName; private String givenName; private com.sumup.sdk.models.PersonalIdentifiers identifiers; - private String middleName; private String nationality; private com.sumup.sdk.models.Ownership ownership; private String phoneNumber; @@ -113,7 +107,11 @@ private Builder() {} /** * Sets the value for {@code address}. * - * @param address The address of the individual. + * @param address An address somewhere in the world. The address fields used depend on the + * country conventions. For example, in Great Britain, `city` is `post_town`. In the United + * States, the top-level administrative unit used in addresses is `state`, whereas in Chile + * it's `region`. Whether an address is valid or not depends on whether the locally required + * fields are present. Fields not supported in a country will be ignored. * @return This builder instance. */ public Builder address(com.sumup.sdk.models.Address address) { @@ -136,7 +134,9 @@ public Builder birthdate(java.time.LocalDate birthdate) { /** * Sets the value for {@code citizenship}. * - * @param citizenship The Alpha-2 ISO code of the country where the Person is a citizen. + * @param citizenship An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * country code. This definition users `oneOf` with a two-character string type to allow for + * support of future countries in client code. * @return This builder instance. */ public Builder citizenship(String citizenship) { @@ -190,19 +190,6 @@ public Builder identifiers(com.sumup.sdk.models.PersonalIdentifiers identifiers) return this; } - /** - * Sets the value for {@code middleName}. - * - * @param middleName Middle name(s) of the End-User. Note that in some cultures, people can have - * multiple middle names; all can be present, with the names being separated by space - * characters. Also note that in some cultures, middle names are not used. - * @return This builder instance. - */ - public Builder middleName(String middleName) { - this.middleName = middleName; - return this; - } - /** * Sets the value for {@code nationality}. * @@ -219,8 +206,7 @@ public Builder nationality(String nationality) { /** * Sets the value for {@code ownership}. * - * @param ownership Details about the ownership relationship between the Person and the - * Merchant. This is only set if the Person has a relationship of type `owner`. + * @param ownership Value for the ownership field. * @return This builder instance. */ public Builder ownership(com.sumup.sdk.models.Ownership ownership) { @@ -231,7 +217,7 @@ public Builder ownership(com.sumup.sdk.models.Ownership ownership) { /** * Sets the value for {@code phoneNumber}. * - * @param phoneNumber The (mobile) phone number of the individual (used for verification) in + * @param phoneNumber A publicly available phone number in * [E.164](https://en.wikipedia.org/wiki/E.164) format. * @return This builder instance. */ @@ -291,7 +277,6 @@ public Person build() { givenName, null, identifiers, - middleName, nationality, ownership, phoneNumber, diff --git a/src/main/java/com/sumup/sdk/models/PositivePriceAmounts.java b/src/main/java/com/sumup/sdk/models/PositivePriceAmounts.java new file mode 100644 index 0000000..fd134d1 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PositivePriceAmounts.java @@ -0,0 +1,94 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Price information for items with positive amounts only. */ +public record PositivePriceAmounts( + /** + * The value of the amount in minor units of the currency according to the Sale.currency.scale. + * `value` can get large for some currencies and applications. Use Long type or a similar data + * type when parsing `value`. + */ + Long totalGrossAmount, + + /** + * The value of the amount in minor units of the currency according to the Sale.currency.scale. + * `value` can get large for some currencies and applications. Use Long type or a similar data + * type when parsing `value`. + */ + Long totalNetAmount, + + /** + * The price of a single unit. If the tax_mode is GROSS, it includes taxes, otherwise no tax + * included. It doesn't include discounts. + */ + Long unitAmount) { + /** + * Creates a builder for PositivePriceAmounts. + * + * @return Builder that constructs immutable PositivePriceAmounts instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PositivePriceAmounts instances. */ + public static final class Builder { + private Long totalGrossAmount; + private Long totalNetAmount; + private Long unitAmount; + + private Builder() {} + + /** + * Sets the value for {@code totalGrossAmount}. + * + * @param totalGrossAmount The value of the amount in minor units of the currency according to + * the Sale.currency.scale. `value` can get large for some currencies and applications. Use + * Long type or a similar data type when parsing `value`. + * @return This builder instance. + */ + public Builder totalGrossAmount(Long totalGrossAmount) { + this.totalGrossAmount = totalGrossAmount; + return this; + } + + /** + * Sets the value for {@code totalNetAmount}. + * + * @param totalNetAmount The value of the amount in minor units of the currency according to the + * Sale.currency.scale. `value` can get large for some currencies and applications. Use Long + * type or a similar data type when parsing `value`. + * @return This builder instance. + */ + public Builder totalNetAmount(Long totalNetAmount) { + this.totalNetAmount = totalNetAmount; + return this; + } + + /** + * Sets the value for {@code unitAmount}. + * + * @param unitAmount The price of a single unit. If the tax_mode is GROSS, it includes taxes, + * otherwise no tax included. It doesn't include discounts. + * @return This builder instance. + */ + public Builder unitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Builds an immutable PositivePriceAmounts instance. + * + * @return Immutable PositivePriceAmounts. + */ + public PositivePriceAmounts build() { + return new PositivePriceAmounts( + Objects.requireNonNull(totalGrossAmount, "totalGrossAmount"), + Objects.requireNonNull(totalNetAmount, "totalNetAmount"), + Objects.requireNonNull(unitAmount, "unitAmount")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PositivePriceWithTaxes.java b/src/main/java/com/sumup/sdk/models/PositivePriceWithTaxes.java new file mode 100644 index 0000000..2410fed --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PositivePriceWithTaxes.java @@ -0,0 +1,45 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Price information with positive amounts and detailed tax breakdown. */ +public record PositivePriceWithTaxes( + /** Taxes applied on top of net amount resulting in gross amount. */ + java.util.List taxes) { + /** + * Creates a builder for PositivePriceWithTaxes. + * + * @return Builder that constructs immutable PositivePriceWithTaxes instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PositivePriceWithTaxes instances. */ + public static final class Builder { + private java.util.List taxes; + + private Builder() {} + + /** + * Sets the value for {@code taxes}. + * + * @param taxes Taxes applied on top of net amount resulting in gross amount. + * @return This builder instance. + */ + public Builder taxes(java.util.List taxes) { + this.taxes = taxes; + return this; + } + + /** + * Builds an immutable PositivePriceWithTaxes instance. + * + * @return Immutable PositivePriceWithTaxes. + */ + public PositivePriceWithTaxes build() { + return new PositivePriceWithTaxes(Objects.requireNonNull(taxes, "taxes")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PositiveTaxLine.java b/src/main/java/com/sumup/sdk/models/PositiveTaxLine.java new file mode 100644 index 0000000..3242ccc --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PositiveTaxLine.java @@ -0,0 +1,142 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Tax line with positive amounts only. Information about tax together with amounts before and after + * its application such as: - net amount: taxable net amount, scoped by this tax - gross amount: + * amount after applying the tax The numbers here can't be negative. + */ +public record PositiveTaxLine( + /** + * Gross amount after applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + Long grossAmount, + + /** Tax ID from the Tax Service (External Id) */ + String id, + + /** Tax name, e.g. "MwSt." */ + String name, + + /** + * Net amount before applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + Long netAmount, + + /** The tax rate percentage in minor units (1/100000). For example 19000 = 19%. */ + Long percentage, + + /** + * Amount of tax. The value of the amount in minor units of the currency according to the + * Sale.currency.scale. + */ + Long taxAmount) { + /** + * Creates a builder for PositiveTaxLine. + * + * @return Builder that constructs immutable PositiveTaxLine instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PositiveTaxLine instances. */ + public static final class Builder { + private Long grossAmount; + private String id; + private String name; + private Long netAmount; + private Long percentage; + private Long taxAmount; + + private Builder() {} + + /** + * Sets the value for {@code grossAmount}. + * + * @param grossAmount Gross amount after applying the tax. The value of the amount in minor + * units of the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder grossAmount(Long grossAmount) { + this.grossAmount = grossAmount; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id Tax ID from the Tax Service (External Id) + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Tax name, e.g. "MwSt." + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code netAmount}. + * + * @param netAmount Net amount before applying the tax. The value of the amount in minor units + * of the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder netAmount(Long netAmount) { + this.netAmount = netAmount; + return this; + } + + /** + * Sets the value for {@code percentage}. + * + * @param percentage The tax rate percentage in minor units (1/100000). For example 19000 = 19%. + * @return This builder instance. + */ + public Builder percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * Sets the value for {@code taxAmount}. + * + * @param taxAmount Amount of tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder taxAmount(Long taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Builds an immutable PositiveTaxLine instance. + * + * @return Immutable PositiveTaxLine. + */ + public PositiveTaxLine build() { + return new PositiveTaxLine( + Objects.requireNonNull(grossAmount, "grossAmount"), + Objects.requireNonNull(id, "id"), + name, + Objects.requireNonNull(netAmount, "netAmount"), + percentage, + Objects.requireNonNull(taxAmount, "taxAmount")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PriceAmounts.java b/src/main/java/com/sumup/sdk/models/PriceAmounts.java new file mode 100644 index 0000000..48c3eae --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PriceAmounts.java @@ -0,0 +1,85 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Base price information for items including unit amount and totals. */ +public record PriceAmounts( + /** The gross amount (including modifiers if applied). It does NOT include discounts. */ + com.sumup.sdk.models.PriceAmountsTotalGrossAmount totalGrossAmount, + + /** The net amount (including modifiers if applied). It does NOT include discounts. */ + com.sumup.sdk.models.PriceAmountsTotalNetAmount totalNetAmount, + + /** + * The price of a single unit. If the tax_mode is GROSS, it includes taxes, otherwise no tax + * included. It doesn't include discounts. + */ + Long unitAmount) { + /** + * Creates a builder for PriceAmounts. + * + * @return Builder that constructs immutable PriceAmounts instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PriceAmounts instances. */ + public static final class Builder { + private com.sumup.sdk.models.PriceAmountsTotalGrossAmount totalGrossAmount; + private com.sumup.sdk.models.PriceAmountsTotalNetAmount totalNetAmount; + private Long unitAmount; + + private Builder() {} + + /** + * Sets the value for {@code totalGrossAmount}. + * + * @param totalGrossAmount The gross amount (including modifiers if applied). It does NOT + * include discounts. + * @return This builder instance. + */ + public Builder totalGrossAmount( + com.sumup.sdk.models.PriceAmountsTotalGrossAmount totalGrossAmount) { + this.totalGrossAmount = totalGrossAmount; + return this; + } + + /** + * Sets the value for {@code totalNetAmount}. + * + * @param totalNetAmount The net amount (including modifiers if applied). It does NOT include + * discounts. + * @return This builder instance. + */ + public Builder totalNetAmount(com.sumup.sdk.models.PriceAmountsTotalNetAmount totalNetAmount) { + this.totalNetAmount = totalNetAmount; + return this; + } + + /** + * Sets the value for {@code unitAmount}. + * + * @param unitAmount The price of a single unit. If the tax_mode is GROSS, it includes taxes, + * otherwise no tax included. It doesn't include discounts. + * @return This builder instance. + */ + public Builder unitAmount(Long unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Builds an immutable PriceAmounts instance. + * + * @return Immutable PriceAmounts. + */ + public PriceAmounts build() { + return new PriceAmounts( + Objects.requireNonNull(totalGrossAmount, "totalGrossAmount"), + Objects.requireNonNull(totalNetAmount, "totalNetAmount"), + Objects.requireNonNull(unitAmount, "unitAmount")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PriceAmountsTotalGrossAmount.java b/src/main/java/com/sumup/sdk/models/PriceAmountsTotalGrossAmount.java new file mode 100644 index 0000000..aea00e9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PriceAmountsTotalGrossAmount.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The gross amount (including modifiers if applied). It does NOT include discounts. */ +public record PriceAmountsTotalGrossAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for PriceAmountsTotalGrossAmount. + * + * @return Builder that constructs immutable PriceAmountsTotalGrossAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PriceAmountsTotalGrossAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable PriceAmountsTotalGrossAmount instance. + * + * @return Immutable PriceAmountsTotalGrossAmount. + */ + public PriceAmountsTotalGrossAmount build() { + return new PriceAmountsTotalGrossAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PriceAmountsTotalNetAmount.java b/src/main/java/com/sumup/sdk/models/PriceAmountsTotalNetAmount.java new file mode 100644 index 0000000..a17ffd3 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PriceAmountsTotalNetAmount.java @@ -0,0 +1,61 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The net amount (including modifiers if applied). It does NOT include discounts. */ +public record PriceAmountsTotalNetAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for PriceAmountsTotalNetAmount. + * + * @return Builder that constructs immutable PriceAmountsTotalNetAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PriceAmountsTotalNetAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable PriceAmountsTotalNetAmount instance. + * + * @return Immutable PriceAmountsTotalNetAmount. + */ + public PriceAmountsTotalNetAmount build() { + return new PriceAmountsTotalNetAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/ProblemV10.java b/src/main/java/com/sumup/sdk/models/ProblemV10.java new file mode 100644 index 0000000..b4cf17a --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/ProblemV10.java @@ -0,0 +1,155 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; +import java.util.Objects; + +/** + * A RFC 9457 problem details object. Additional properties specific to the problem type may be + * present. + */ +@JsonDeserialize(builder = ProblemV10.Builder.class) +public record ProblemV10( + /** A human-readable explanation specific to this occurrence of the problem. */ + String detail, + + /** A URI reference that identifies the specific occurrence of the problem. */ + String instance, + + /** The HTTP status code generated by the origin server for this occurrence of the problem. */ + Long status, + + /** A short, human-readable summary of the problem type. */ + String title, + + /** A URI reference that identifies the problem type. */ + String type, + + /** Additional fields not described by the fixed schema properties. */ + java.util.Map additionalProperties) { + public ProblemV10 { + additionalProperties = + additionalProperties == null + ? java.util.Map.of() + : java.util.Collections.unmodifiableMap( + new java.util.LinkedHashMap<>(additionalProperties)); + } + + @JsonAnyGetter + public java.util.Map additionalProperties() { + return additionalProperties; + } + + /** + * Creates a builder for ProblemV10. + * + * @return Builder that constructs immutable ProblemV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ProblemV10 instances. */ + @JsonPOJOBuilder(withPrefix = "") + public static final class Builder { + private String detail; + private String instance; + private Long status; + private String title; + private String type; + private java.util.Map additionalProperties = new java.util.LinkedHashMap<>(); + + private Builder() {} + + /** + * Sets the value for {@code detail}. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + * @return This builder instance. + */ + public Builder detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Sets the value for {@code instance}. + * + * @param instance A URI reference that identifies the specific occurrence of the problem. + * @return This builder instance. + */ + public Builder instance(String instance) { + this.instance = instance; + return this; + } + + /** + * Sets the value for {@code status}. + * + * @param status The HTTP status code generated by the origin server for this occurrence of the + * problem. + * @return This builder instance. + */ + public Builder status(Long status) { + this.status = status; + return this; + } + + /** + * Sets the value for {@code title}. + * + * @param title A short, human-readable summary of the problem type. + * @return This builder instance. + */ + public Builder title(String title) { + this.title = title; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type A URI reference that identifies the problem type. + * @return This builder instance. + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Sets the value for {@code additionalProperties}. + * + * @param additionalProperties Additional fields not described by the fixed schema properties. + * @return This builder instance. + */ + public Builder additionalProperties(java.util.Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + public Builder additionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + + /** + * Builds an immutable ProblemV10 instance. + * + * @return Immutable ProblemV10. + */ + public ProblemV10 build() { + return new ProblemV10( + detail, + instance, + status, + title, + Objects.requireNonNull(type, "type"), + additionalProperties); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicCardV10.java b/src/main/java/com/sumup/sdk/models/PublicCardV10.java new file mode 100644 index 0000000..854c260 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PublicCardV10.java @@ -0,0 +1,90 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Card brand, credit/debit processing type, and last four digits. */ +public record PublicCardV10( + /** + * The brand of the card. Input is case-insensitive; the canonical form is lowercase snake_case. + * **VALUES**: [amex, cup, diners, discover, elo, elv, hipercard, jcb, maestro, mastercard, + * visa, visa_electron, visa_vpay, vr, eftpos, conecs, swile, girocard, interac, sumup, + * bancomat]. + */ + String brand, + + /** The last 4 digits of the card used for the payment. */ + String last4Digits, + + /** + * Credit or debit processing choice, not brand or funding. `unknown` when unavailable; + * prepaid/voucher are not processing types. + */ + com.sumup.sdk.models.PublicCardV10Type type) { + /** + * Creates a builder for PublicCardV10. + * + * @return Builder that constructs immutable PublicCardV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PublicCardV10 instances. */ + public static final class Builder { + private String brand; + private String last4Digits; + private com.sumup.sdk.models.PublicCardV10Type type; + + private Builder() {} + + /** + * Sets the value for {@code brand}. + * + * @param brand The brand of the card. Input is case-insensitive; the canonical form is + * lowercase snake_case. **VALUES**: [amex, cup, diners, discover, elo, elv, hipercard, jcb, + * maestro, mastercard, visa, visa_electron, visa_vpay, vr, eftpos, conecs, swile, girocard, + * interac, sumup, bancomat]. + * @return This builder instance. + */ + public Builder brand(String brand) { + this.brand = brand; + return this; + } + + /** + * Sets the value for {@code last4Digits}. + * + * @param last4Digits The last 4 digits of the card used for the payment. + * @return This builder instance. + */ + public Builder last4Digits(String last4Digits) { + this.last4Digits = last4Digits; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Credit or debit processing choice, not brand or funding. `unknown` when + * unavailable; prepaid/voucher are not processing types. + * @return This builder instance. + */ + public Builder type(com.sumup.sdk.models.PublicCardV10Type type) { + this.type = type; + return this; + } + + /** + * Builds an immutable PublicCardV10 instance. + * + * @return Immutable PublicCardV10. + */ + public PublicCardV10 build() { + return new PublicCardV10( + Objects.requireNonNull(brand, "brand"), + Objects.requireNonNull(last4Digits, "last4Digits"), + Objects.requireNonNull(type, "type")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicCardV10Type.java b/src/main/java/com/sumup/sdk/models/PublicCardV10Type.java new file mode 100644 index 0000000..38683ac --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PublicCardV10Type.java @@ -0,0 +1,58 @@ +// 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; + +/** + * Credit or debit processing choice, not brand or funding. `unknown` when unavailable; + * prepaid/voucher are not processing types. + */ +public final class PublicCardV10Type { + public static final PublicCardV10Type CREDIT = new PublicCardV10Type("credit"); + public static final PublicCardV10Type DEBIT = new PublicCardV10Type("debit"); + public static final PublicCardV10Type UNKNOWN = new PublicCardV10Type("unknown"); + + private final String value; + + private PublicCardV10Type(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a PublicCardV10Type 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 PublicCardV10Type of(String value) { + return new PublicCardV10Type(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static PublicCardV10Type fromValue(String value) { + return value == null ? null : new PublicCardV10Type(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof PublicCardV10Type that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java b/src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java new file mode 100644 index 0000000..84754e6 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java @@ -0,0 +1,51 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Gift card used for this payment. Present when `method` is `gift_card` and the gift card id is + * known. Gift card IDs use the format "GC" followed by 9 alphanumeric characters (e.g. GCZ3NTMB1V). + */ +public record PublicGiftCardPayment( + /** + * Gift card identifier. Format "GC" followed by 9 alphanumeric characters (e.g. GCZ3NTMB1V). + */ + String id) { + /** + * Creates a builder for PublicGiftCardPayment. + * + * @return Builder that constructs immutable PublicGiftCardPayment instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PublicGiftCardPayment instances. */ + public static final class Builder { + private String id; + + private Builder() {} + + /** + * Sets the value for {@code id}. + * + * @param id Gift card identifier. Format "GC" followed by 9 alphanumeric characters (e.g. + * GCZ3NTMB1V). + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Builds an immutable PublicGiftCardPayment instance. + * + * @return Immutable PublicGiftCardPayment. + */ + public PublicGiftCardPayment build() { + return new PublicGiftCardPayment(Objects.requireNonNull(id, "id")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicPaymentV10.java b/src/main/java/com/sumup/sdk/models/PublicPaymentV10.java new file mode 100644 index 0000000..4d2ff5b --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PublicPaymentV10.java @@ -0,0 +1,217 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Payment on a closed sale, for bookkeeping and reconciliation. Acquirer/processing cost is not on + * this object. Merchant-charged fees (shipping, service charge, etc.) appear as `type: "FEE"` item + * lines in `Sale.items`. + */ +public record PublicPaymentV10( + /** + * The amount of the payment including tips. The value of the amount in minor units of + * `Sale.currency`. + */ + Long amount, + + /** + * Alternative payment method type when `method` is `apm`. Gift card is not an APM on this API. + * Input is case-insensitive; the canonical form is lowercase snake_case. **VALUES**: + * [qr_code_pix, sepa_dd, paypal, sumup_pay, twint, iris]. + */ + String apmType, + + /** Card brand, credit/debit processing type, and last four digits. */ + com.sumup.sdk.models.PublicCardV10 card, + + /** + * Gift card used for this payment. Present when `method` is `gift_card` and the gift card id is + * known. Gift card IDs use the format "GC" followed by 9 alphanumeric characters (e.g. + * GCZ3NTMB1V). + */ + com.sumup.sdk.models.PublicGiftCardPayment giftCard, + + /** + * Payment method on public sales read API v1.0. Digital wallets are first-class methods. Gift + * card payments use `gift_card`, not `apm`. Input is case-insensitive; the canonical form is + * lowercase snake_case. **VALUES**: [card, cash, apm, external, apple_pay, google_pay, + * whatsapp_pay, gift_card]. + */ + String method, + + /** + * UTC date-time when SumUp recorded this payment’s exposed `status` (successful, failed, or + * canceled). Server processed time when available; otherwise the payment provider’s transaction + * time. Not the device clock. + */ + java.time.OffsetDateTime processedAt, + + /** The reference to the actual payment used for this sale, e.g. the sumup transaction code. */ + String reference, + + /** The status of the payment. */ + com.sumup.sdk.models.PublicPaymentV10Status status, + + /** + * Payment operation type. This is distinct from the payment instrument in `method`. Input is + * case-insensitive; the canonical form is lowercase snake_case. **VALUES**: [purchase, + * unreferenced_refund] Defaults to "purchase" if unspecified. Either a normal purchase or an + * unreferenced refund for negative sales like deposit returns. + */ + String type) { + /** + * Creates a builder for PublicPaymentV10. + * + * @return Builder that constructs immutable PublicPaymentV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for PublicPaymentV10 instances. */ + public static final class Builder { + private Long amount; + private String apmType; + private com.sumup.sdk.models.PublicCardV10 card; + private com.sumup.sdk.models.PublicGiftCardPayment giftCard; + private String method; + private java.time.OffsetDateTime processedAt; + private String reference; + private com.sumup.sdk.models.PublicPaymentV10Status status; + private String type; + + private Builder() {} + + /** + * Sets the value for {@code amount}. + * + * @param amount The amount of the payment including tips. The value of the amount in minor + * units of `Sale.currency`. + * @return This builder instance. + */ + public Builder amount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Sets the value for {@code apmType}. + * + * @param apmType Alternative payment method type when `method` is `apm`. Gift card is not an + * APM on this API. Input is case-insensitive; the canonical form is lowercase snake_case. + * **VALUES**: [qr_code_pix, sepa_dd, paypal, sumup_pay, twint, iris]. + * @return This builder instance. + */ + public Builder apmType(String apmType) { + this.apmType = apmType; + return this; + } + + /** + * Sets the value for {@code card}. + * + * @param card Card brand, credit/debit processing type, and last four digits. + * @return This builder instance. + */ + public Builder card(com.sumup.sdk.models.PublicCardV10 card) { + this.card = card; + return this; + } + + /** + * Sets the value for {@code giftCard}. + * + * @param giftCard Gift card used for this payment. Present when `method` is `gift_card` and the + * gift card id is known. Gift card IDs use the format "GC" followed by 9 alphanumeric + * characters (e.g. GCZ3NTMB1V). + * @return This builder instance. + */ + public Builder giftCard(com.sumup.sdk.models.PublicGiftCardPayment giftCard) { + this.giftCard = giftCard; + return this; + } + + /** + * Sets the value for {@code method}. + * + * @param method Payment method on public sales read API v1.0. Digital wallets are first-class + * methods. Gift card payments use `gift_card`, not `apm`. Input is case-insensitive; the + * canonical form is lowercase snake_case. **VALUES**: [card, cash, apm, external, + * apple_pay, google_pay, whatsapp_pay, gift_card]. + * @return This builder instance. + */ + public Builder method(String method) { + this.method = method; + return this; + } + + /** + * Sets the value for {@code processedAt}. + * + * @param processedAt UTC date-time when SumUp recorded this payment’s exposed `status` + * (successful, failed, or canceled). Server processed time when available; otherwise the + * payment provider’s transaction time. Not the device clock. + * @return This builder instance. + */ + public Builder processedAt(java.time.OffsetDateTime processedAt) { + this.processedAt = processedAt; + return this; + } + + /** + * Sets the value for {@code reference}. + * + * @param reference The reference to the actual payment used for this sale, e.g. the sumup + * transaction code. + * @return This builder instance. + */ + public Builder reference(String reference) { + this.reference = reference; + return this; + } + + /** + * Sets the value for {@code status}. + * + * @param status The status of the payment. + * @return This builder instance. + */ + public Builder status(com.sumup.sdk.models.PublicPaymentV10Status status) { + this.status = status; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Payment operation type. This is distinct from the payment instrument in `method`. + * Input is case-insensitive; the canonical form is lowercase snake_case. **VALUES**: + * [purchase, unreferenced_refund] Defaults to "purchase" if unspecified. Either a normal + * purchase or an unreferenced refund for negative sales like deposit returns. + * @return This builder instance. + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Builds an immutable PublicPaymentV10 instance. + * + * @return Immutable PublicPaymentV10. + */ + public PublicPaymentV10 build() { + return new PublicPaymentV10( + Objects.requireNonNull(amount, "amount"), + apmType, + card, + giftCard, + Objects.requireNonNull(method, "method"), + Objects.requireNonNull(processedAt, "processedAt"), + Objects.requireNonNull(reference, "reference"), + Objects.requireNonNull(status, "status"), + Objects.requireNonNull(type, "type")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java b/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java new file mode 100644 index 0000000..576699d --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.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; + +/** The status of the payment. */ +public final class PublicPaymentV10Status { + public static final PublicPaymentV10Status FAILED = new PublicPaymentV10Status("FAILED"); + public static final PublicPaymentV10Status SUCCESSFUL = new PublicPaymentV10Status("SUCCESSFUL"); + public static final PublicPaymentV10Status CANCELED = new PublicPaymentV10Status("CANCELED"); + + private final String value; + + private PublicPaymentV10Status(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a PublicPaymentV10Status 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 PublicPaymentV10Status of(String value) { + return new PublicPaymentV10Status(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static PublicPaymentV10Status fromValue(String value) { + return value == null ? null : new PublicPaymentV10Status(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof PublicPaymentV10Status that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/Sale.java b/src/main/java/com/sumup/sdk/models/Sale.java new file mode 100644 index 0000000..19e9c6a --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/Sale.java @@ -0,0 +1,279 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Core model of the Sales API. Returned by `GET /sales` and `GET /sales/{sale_id}`. Non-finalised + * sales are never returned; only fully-paid sales. Item lines are `SaleLineItem`. Merchant fees + * appear as `type: "FEE"` lines; extra fee data is in `features`. + */ +public record Sale( + /** Instant when the sale was closed. Always present: non-finalised sales are never returned. */ + java.time.OffsetDateTime closedAt, + + /** Instant when the sale was created. */ + java.time.OffsetDateTime createdAt, + + /** + * Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the amount. + */ + com.sumup.sdk.models.Currency currency, + + /** The ID of the sale. */ + String id, + + /** + * The lines sold in this sale, in the order they were added to the cart. Includes merchant fees + * (`type: "FEE"`) when present; fee details are in `features`. + */ + java.util.List items, + + /** Human-readable name of the sale (not unique, not the sale id). */ + String name, + + /** Optional note attached to the sale, visible on receipts and the UI. */ + String note, + + /** Payments on this sale, in the order they were recorded. */ + java.util.List payments, + + /** + * Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`. Line-level + * breakdown (unit price, line discounts, per-line taxes) lives on `items[].price`. This object + * holds the rolled-up totals and cart-level adjustments that consumers use for receipts and + * payment reconciliation. + */ + com.sumup.sdk.models.SalePriceV10 price, + + /** Information about the source of the sale. */ + com.sumup.sdk.models.SaleSource source, + + /** + * Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. + */ + com.sumup.sdk.models.SaleStateV10 state, + + /** + * The tax mode used by merchant for displaying prices and calculating taxes: - NO_TAX: The + * prices don't contain any taxes, merchant don't report taxes - GROSS: The prices used by + * merchant already include taxes (common in EU), the tax is calculated from the gross price - + * NET: The prices used by merchant don't include taxes (common in US), the tax is calculated + * from the net price Since tax values can be different for the same net price depending if the + * tax was calculated from gross or net price, this info is necessary to be able to reconcile + * tax calculations. + */ + com.sumup.sdk.models.TaxMode taxMode, + + /** + * Identity UUID of the cashier who processed the sale. Omitted when the cashier identity is + * unknown. + */ + java.util.UUID userId) { + /** + * Creates a builder for Sale. + * + * @return Builder that constructs immutable Sale instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for Sale instances. */ + public static final class Builder { + private java.time.OffsetDateTime closedAt; + private java.time.OffsetDateTime createdAt; + private com.sumup.sdk.models.Currency currency; + private String id; + private java.util.List items; + private String name; + private String note; + private java.util.List payments; + private com.sumup.sdk.models.SalePriceV10 price; + private com.sumup.sdk.models.SaleSource source; + private com.sumup.sdk.models.SaleStateV10 state; + private com.sumup.sdk.models.TaxMode taxMode; + private java.util.UUID userId; + + private Builder() {} + + /** + * Sets the value for {@code closedAt}. + * + * @param closedAt Instant when the sale was closed. Always present: non-finalised sales are + * never returned. + * @return This builder instance. + */ + public Builder closedAt(java.time.OffsetDateTime closedAt) { + this.closedAt = closedAt; + return this; + } + + /** + * Sets the value for {@code createdAt}. + * + * @param createdAt Instant when the sale was created. + * @return This builder instance. + */ + public Builder createdAt(java.time.OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Sets the value for {@code currency}. + * + * @param currency Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code + * of the amount. + * @return This builder instance. + */ + public Builder currency(com.sumup.sdk.models.Currency currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id The ID of the sale. + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code items}. + * + * @param items The lines sold in this sale, in the order they were added to the cart. Includes + * merchant fees (`type: "FEE"`) when present; fee details are in `features`. + * @return This builder instance. + */ + public Builder items(java.util.List items) { + this.items = items; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Human-readable name of the sale (not unique, not the sale id). + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code note}. + * + * @param note Optional note attached to the sale, visible on receipts and the UI. + * @return This builder instance. + */ + public Builder note(String note) { + this.note = note; + return this; + } + + /** + * Sets the value for {@code payments}. + * + * @param payments Payments on this sale, in the order they were recorded. + * @return This builder instance. + */ + public Builder payments(java.util.List payments) { + this.payments = payments; + return this; + } + + /** + * Sets the value for {@code price}. + * + * @param price Sale-level pricing aggregate, parallel to `LineItemPrice` on each + * `SaleLineItem`. Line-level breakdown (unit price, line discounts, per-line taxes) lives + * on `items[].price`. This object holds the rolled-up totals and cart-level adjustments + * that consumers use for receipts and payment reconciliation. + * @return This builder instance. + */ + public Builder price(com.sumup.sdk.models.SalePriceV10 price) { + this.price = price; + return this; + } + + /** + * Sets the value for {@code source}. + * + * @param source Information about the source of the sale. + * @return This builder instance. + */ + public Builder source(com.sumup.sdk.models.SaleSource source) { + this.source = source; + return this; + } + + /** + * Sets the value for {@code state}. + * + * @param state Lifecycle state of the sale. Non-finalised sales are never returned; only + * fully-paid sales. + * @return This builder instance. + */ + public Builder state(com.sumup.sdk.models.SaleStateV10 state) { + this.state = state; + return this; + } + + /** + * Sets the value for {@code taxMode}. + * + * @param taxMode The tax mode used by merchant for displaying prices and calculating taxes: - + * NO_TAX: The prices don't contain any taxes, merchant don't report taxes - GROSS: The + * prices used by merchant already include taxes (common in EU), the tax is calculated from + * the gross price - NET: The prices used by merchant don't include taxes (common in US), + * the tax is calculated from the net price Since tax values can be different for the same + * net price depending if the tax was calculated from gross or net price, this info is + * necessary to be able to reconcile tax calculations. + * @return This builder instance. + */ + public Builder taxMode(com.sumup.sdk.models.TaxMode taxMode) { + this.taxMode = taxMode; + return this; + } + + /** + * Sets the value for {@code userId}. + * + * @param userId Identity UUID of the cashier who processed the sale. Omitted when the cashier + * identity is unknown. + * @return This builder instance. + */ + public Builder userId(java.util.UUID userId) { + this.userId = userId; + return this; + } + + /** + * Builds an immutable Sale instance. + * + * @return Immutable Sale. + */ + public Sale build() { + return new Sale( + Objects.requireNonNull(closedAt, "closedAt"), + Objects.requireNonNull(createdAt, "createdAt"), + Objects.requireNonNull(currency, "currency"), + Objects.requireNonNull(id, "id"), + Objects.requireNonNull(items, "items"), + name, + note, + Objects.requireNonNull(payments, "payments"), + Objects.requireNonNull(price, "price"), + Objects.requireNonNull(source, "source"), + Objects.requireNonNull(state, "state"), + Objects.requireNonNull(taxMode, "taxMode"), + userId); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleLineItemV10.java b/src/main/java/com/sumup/sdk/models/SaleLineItemV10.java new file mode 100644 index 0000000..3890c04 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleLineItemV10.java @@ -0,0 +1,266 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * A single line of a sale. The envelope (id, type, name, quantity, unit_of_measure, price) is + * stable and type-agnostic: any consumer can render and total a line from these fields alone. + * Type-specific data is in `features`. There is no per-type object and no discriminator, so a new + * item type does not change this schema. + */ +public record SaleLineItemV10( + /** + * Categories the line belongs to. A shared optional structure available to any line; not a + * per-type field. + */ + java.util.List categories, + + /** + * Named, typed, type-specific data. New item types add their data here as features instead of + * new schema variants. See `Feature` for per-type examples. + */ + java.util.List features, + + /** Stable identifier of the line within the sale. Used for linking (e.g. deposits). */ + String id, + + /** + * Modifiers customise a line (e.g. "oat milk" on a cappuccino). A shared optional structure + * available to any line; not a per-type field. + */ + java.util.List modifiers, + + /** Display name of the line. */ + String name, + + /** Optional free-text note attached to the line, visible on receipts. */ + String note, + + /** + * Pricing for a single line, valid for every item type. Merges the standard amounts (with tax + * breakdown) and the final amounts (after discounts/modifiers). Totals and tax amounts can be + * negative for return-like operations (for example a deposit with `operation_type` = `RETURN`). + */ + com.sumup.sdk.models.LineItemPriceV10 price, + + /** The numerical value representing the quantity in the specified unit. */ + Double quantity, + + /** + * Outward identifiers and links for a line, kept in one place rather than scattered per item + * type. + */ + com.sumup.sdk.models.ItemReferencesV10 references, + + /** The type of service for this line. */ + com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType, + + /** + * Classifies a sale line. Not a schema subclass. Known values: `CATALOG`, `DEPOSIT`, + * `GIFT_CARD`, `CUSTOM`, `FEE`. `FEE` lines represent merchant-charged fees on the sale (e.g. + * shipping, service charge, surcharge, cancellation). They participate in sale totals like any + * other line; type-specific data is carried in `features` (see `Feature` for the conventional + * feature keys). This is intentionally an open string, NOT a closed enum: new values are added + * over time as pure data and consumers MUST tolerate unknown values, rendering the line from + * the generic envelope (name, quantity, price, taxes) and reading any extra information from + * `features`. + */ + String type, + + /** The unit of measure of the item. */ + com.sumup.sdk.models.UnitOfMeasure unitOfMeasure) { + /** + * Creates a builder for SaleLineItemV10. + * + * @return Builder that constructs immutable SaleLineItemV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleLineItemV10 instances. */ + public static final class Builder { + private java.util.List categories; + private java.util.List features; + private String id; + private java.util.List modifiers; + private String name; + private String note; + private com.sumup.sdk.models.LineItemPriceV10 price; + private Double quantity; + private com.sumup.sdk.models.ItemReferencesV10 references; + private com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType; + private String type; + private com.sumup.sdk.models.UnitOfMeasure unitOfMeasure; + + private Builder() {} + + /** + * Sets the value for {@code categories}. + * + * @param categories Categories the line belongs to. A shared optional structure available to + * any line; not a per-type field. + * @return This builder instance. + */ + public Builder categories(java.util.List categories) { + this.categories = categories; + return this; + } + + /** + * Sets the value for {@code features}. + * + * @param features Named, typed, type-specific data. New item types add their data here as + * features instead of new schema variants. See `Feature` for per-type examples. + * @return This builder instance. + */ + public Builder features(java.util.List features) { + this.features = features; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id Stable identifier of the line within the sale. Used for linking (e.g. deposits). + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code modifiers}. + * + * @param modifiers Modifiers customise a line (e.g. "oat milk" on a cappuccino). A shared + * optional structure available to any line; not a per-type field. + * @return This builder instance. + */ + public Builder modifiers(java.util.List modifiers) { + this.modifiers = modifiers; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Display name of the line. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code note}. + * + * @param note Optional free-text note attached to the line, visible on receipts. + * @return This builder instance. + */ + public Builder note(String note) { + this.note = note; + return this; + } + + /** + * Sets the value for {@code price}. + * + * @param price Pricing for a single line, valid for every item type. Merges the standard + * amounts (with tax breakdown) and the final amounts (after discounts/modifiers). Totals + * and tax amounts can be negative for return-like operations (for example a deposit with + * `operation_type` = `RETURN`). + * @return This builder instance. + */ + public Builder price(com.sumup.sdk.models.LineItemPriceV10 price) { + this.price = price; + return this; + } + + /** + * Sets the value for {@code quantity}. + * + * @param quantity The numerical value representing the quantity in the specified unit. + * @return This builder instance. + */ + public Builder quantity(Double quantity) { + this.quantity = quantity; + return this; + } + + /** + * Sets the value for {@code references}. + * + * @param references Outward identifiers and links for a line, kept in one place rather than + * scattered per item type. + * @return This builder instance. + */ + public Builder references(com.sumup.sdk.models.ItemReferencesV10 references) { + this.references = references; + return this; + } + + /** + * Sets the value for {@code serviceType}. + * + * @param serviceType The type of service for this line. + * @return This builder instance. + */ + public Builder serviceType(com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType) { + this.serviceType = serviceType; + return this; + } + + /** + * Sets the value for {@code type}. + * + * @param type Classifies a sale line. Not a schema subclass. Known values: `CATALOG`, + * `DEPOSIT`, `GIFT_CARD`, `CUSTOM`, `FEE`. `FEE` lines represent merchant-charged fees on + * the sale (e.g. shipping, service charge, surcharge, cancellation). They participate in + * sale totals like any other line; type-specific data is carried in `features` (see + * `Feature` for the conventional feature keys). This is intentionally an open string, NOT a + * closed enum: new values are added over time as pure data and consumers MUST tolerate + * unknown values, rendering the line from the generic envelope (name, quantity, price, + * taxes) and reading any extra information from `features`. + * @return This builder instance. + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Sets the value for {@code unitOfMeasure}. + * + * @param unitOfMeasure The unit of measure of the item. + * @return This builder instance. + */ + public Builder unitOfMeasure(com.sumup.sdk.models.UnitOfMeasure unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } + + /** + * Builds an immutable SaleLineItemV10 instance. + * + * @return Immutable SaleLineItemV10. + */ + public SaleLineItemV10 build() { + return new SaleLineItemV10( + categories, + features, + Objects.requireNonNull(id, "id"), + modifiers, + Objects.requireNonNull(name, "name"), + note, + Objects.requireNonNull(price, "price"), + Objects.requireNonNull(quantity, "quantity"), + references, + serviceType, + Objects.requireNonNull(type, "type"), + Objects.requireNonNull(unitOfMeasure, "unitOfMeasure")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java b/src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java new file mode 100644 index 0000000..34143d5 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java @@ -0,0 +1,56 @@ +// 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 type of service for this line. */ +public final class SaleLineItemV10ServiceType { + public static final SaleLineItemV10ServiceType IN_HOUSE = + new SaleLineItemV10ServiceType("IN_HOUSE"); + public static final SaleLineItemV10ServiceType TAKE_AWAY = + new SaleLineItemV10ServiceType("TAKE_AWAY"); + + private final String value; + + private SaleLineItemV10ServiceType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SaleLineItemV10ServiceType 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 SaleLineItemV10ServiceType of(String value) { + return new SaleLineItemV10ServiceType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SaleLineItemV10ServiceType fromValue(String value) { + return value == null ? null : new SaleLineItemV10ServiceType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SaleLineItemV10ServiceType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/SalePage.java b/src/main/java/com/sumup/sdk/models/SalePage.java new file mode 100644 index 0000000..3efe2fa --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalePage.java @@ -0,0 +1,70 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Paginated list of `Sale` objects. Results are ordered **newest first** by the newest activity + * recorded for each sale. See `ListSalesV10`. + */ +public record SalePage( + java.util.List items, + + /** + * Pagination token for subsequent requests. Should only be set by clients if they have received + * a token in the previous response, and this request is an immediate follow-up request to that + * response to load the subsequent page. Clients should treat this as an opaque token and should + * not attempt to parse it in any way. + */ + String paginationToken) { + /** + * Creates a builder for SalePage. + * + * @return Builder that constructs immutable SalePage instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SalePage instances. */ + public static final class Builder { + private java.util.List items; + private String paginationToken; + + private Builder() {} + + /** + * Sets the value for {@code items}. + * + * @param items Value for the items field. + * @return This builder instance. + */ + public Builder items(java.util.List items) { + this.items = items; + return this; + } + + /** + * Sets the value for {@code paginationToken}. + * + * @param paginationToken Pagination token for subsequent requests. Should only be set by + * clients if they have received a token in the previous response, and this request is an + * immediate follow-up request to that response to load the subsequent page. Clients should + * treat this as an opaque token and should not attempt to parse it in any way. + * @return This builder instance. + */ + public Builder paginationToken(String paginationToken) { + this.paginationToken = paginationToken; + return this; + } + + /** + * Builds an immutable SalePage instance. + * + * @return Immutable SalePage. + */ + public SalePage build() { + return new SalePage(Objects.requireNonNull(items, "items"), paginationToken); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SalePriceV10.java b/src/main/java/com/sumup/sdk/models/SalePriceV10.java new file mode 100644 index 0000000..b574915 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalePriceV10.java @@ -0,0 +1,119 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`. Line-level + * breakdown (unit price, line discounts, per-line taxes) lives on `items[].price`. This object + * holds the rolled-up totals and cart-level adjustments that consumers use for receipts and payment + * reconciliation. + */ +public record SalePriceV10( + /** + * Discounts applied at cart level. Item-level discounts remain on `items[].price.discounts`. + */ + java.util.List cartDiscounts, + + /** + * Final gross total for the sale: sum of `items[].price.total_gross_amount_final` after + * cart-level discounts (tips excluded). Same value as search `total_amount`, in minor units + * according to `Sale.currency.scale`. Payment amounts include tips and can therefore differ + * from this gross total. + */ + com.sumup.sdk.models.SalePriceV10GrossAmount grossAmount, + + /** + * Final net total for the sale: sum of `items[].price.total_net_amount_final` after cart-level + * discounts (tips excluded). In minor units according to `Sale.currency.scale`. + */ + com.sumup.sdk.models.SalePriceV10NetAmount netAmount, + + /** + * Tax lines aggregated across the sale (after cart-level discounts). Per-line tax detail + * remains on `items[].price.taxes` / `taxes_final`. + */ + java.util.List taxes) { + /** + * Creates a builder for SalePriceV10. + * + * @return Builder that constructs immutable SalePriceV10 instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SalePriceV10 instances. */ + public static final class Builder { + private java.util.List cartDiscounts; + private com.sumup.sdk.models.SalePriceV10GrossAmount grossAmount; + private com.sumup.sdk.models.SalePriceV10NetAmount netAmount; + private java.util.List taxes; + + private Builder() {} + + /** + * Sets the value for {@code cartDiscounts}. + * + * @param cartDiscounts Discounts applied at cart level. Item-level discounts remain on + * `items[].price.discounts`. + * @return This builder instance. + */ + public Builder cartDiscounts(java.util.List cartDiscounts) { + this.cartDiscounts = cartDiscounts; + return this; + } + + /** + * Sets the value for {@code grossAmount}. + * + * @param grossAmount Final gross total for the sale: sum of + * `items[].price.total_gross_amount_final` after cart-level discounts (tips excluded). Same + * value as search `total_amount`, in minor units according to `Sale.currency.scale`. + * Payment amounts include tips and can therefore differ from this gross total. + * @return This builder instance. + */ + public Builder grossAmount(com.sumup.sdk.models.SalePriceV10GrossAmount grossAmount) { + this.grossAmount = grossAmount; + return this; + } + + /** + * Sets the value for {@code netAmount}. + * + * @param netAmount Final net total for the sale: sum of `items[].price.total_net_amount_final` + * after cart-level discounts (tips excluded). In minor units according to + * `Sale.currency.scale`. + * @return This builder instance. + */ + public Builder netAmount(com.sumup.sdk.models.SalePriceV10NetAmount netAmount) { + this.netAmount = netAmount; + return this; + } + + /** + * Sets the value for {@code taxes}. + * + * @param taxes Tax lines aggregated across the sale (after cart-level discounts). Per-line tax + * detail remains on `items[].price.taxes` / `taxes_final`. + * @return This builder instance. + */ + public Builder taxes(java.util.List taxes) { + this.taxes = taxes; + return this; + } + + /** + * Builds an immutable SalePriceV10 instance. + * + * @return Immutable SalePriceV10. + */ + public SalePriceV10 build() { + return new SalePriceV10( + cartDiscounts, + Objects.requireNonNull(grossAmount, "grossAmount"), + Objects.requireNonNull(netAmount, "netAmount"), + Objects.requireNonNull(taxes, "taxes")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SalePriceV10GrossAmount.java b/src/main/java/com/sumup/sdk/models/SalePriceV10GrossAmount.java new file mode 100644 index 0000000..e67cb79 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalePriceV10GrossAmount.java @@ -0,0 +1,66 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Final gross total for the sale: sum of `items[].price.total_gross_amount_final` after cart-level + * discounts (tips excluded). Same value as search `total_amount`, in minor units according to + * `Sale.currency.scale`. Payment amounts include tips and can therefore differ from this gross + * total. + */ +public record SalePriceV10GrossAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for SalePriceV10GrossAmount. + * + * @return Builder that constructs immutable SalePriceV10GrossAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SalePriceV10GrossAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable SalePriceV10GrossAmount instance. + * + * @return Immutable SalePriceV10GrossAmount. + */ + public SalePriceV10GrossAmount build() { + return new SalePriceV10GrossAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SalePriceV10NetAmount.java b/src/main/java/com/sumup/sdk/models/SalePriceV10NetAmount.java new file mode 100644 index 0000000..8bf0578 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalePriceV10NetAmount.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Final net total for the sale: sum of `items[].price.total_net_amount_final` after cart-level + * discounts (tips excluded). In minor units according to `Sale.currency.scale`. + */ +public record SalePriceV10NetAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for SalePriceV10NetAmount. + * + * @return Builder that constructs immutable SalePriceV10NetAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SalePriceV10NetAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable SalePriceV10NetAmount instance. + * + * @return Immutable SalePriceV10NetAmount. + */ + public SalePriceV10NetAmount build() { + return new SalePriceV10NetAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchItem.java b/src/main/java/com/sumup/sdk/models/SaleSearchItem.java new file mode 100644 index 0000000..3bfa007 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleSearchItem.java @@ -0,0 +1,195 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Summary row for a sale in search results. Use `GET /sales/{sale_id}` for the full `Sale`. */ +public record SaleSearchItem( + /** Instant when the sale was closed. Always present: non-finalised sales are never returned. */ + java.time.OffsetDateTime closedAt, + + /** Instant when the sale was created. */ + java.time.OffsetDateTime createdAt, + + /** + * Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the amount. + */ + com.sumup.sdk.models.Currency currency, + + /** Sale identifier. */ + String id, + + /** + * Display name of the sale when set; otherwise a concatenation of item names with quantities. + * Omitted when neither is available. + */ + String name, + + /** + * Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. + */ + com.sumup.sdk.models.SaleStateV10 state, + + /** Checkout tax mode for the sale. Same values as `Sale.tax_mode`. */ + com.sumup.sdk.models.TaxMode taxMode, + + /** + * Final sale gross total after discounts and taxes, excluding tips. Same value as + * `Sale.price.gross_amount`, in minor units according to `currency.scale`. Payment amounts + * include tips and can therefore differ from this total. + */ + com.sumup.sdk.models.SaleSearchItemTotalAmount totalAmount, + + /** + * Identity UUID of the cashier who processed the sale. Omitted when the cashier identity is + * unknown. + */ + java.util.UUID userId) { + /** + * Creates a builder for SaleSearchItem. + * + * @return Builder that constructs immutable SaleSearchItem instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleSearchItem instances. */ + public static final class Builder { + private java.time.OffsetDateTime closedAt; + private java.time.OffsetDateTime createdAt; + private com.sumup.sdk.models.Currency currency; + private String id; + private String name; + private com.sumup.sdk.models.SaleStateV10 state; + private com.sumup.sdk.models.TaxMode taxMode; + private com.sumup.sdk.models.SaleSearchItemTotalAmount totalAmount; + private java.util.UUID userId; + + private Builder() {} + + /** + * Sets the value for {@code closedAt}. + * + * @param closedAt Instant when the sale was closed. Always present: non-finalised sales are + * never returned. + * @return This builder instance. + */ + public Builder closedAt(java.time.OffsetDateTime closedAt) { + this.closedAt = closedAt; + return this; + } + + /** + * Sets the value for {@code createdAt}. + * + * @param createdAt Instant when the sale was created. + * @return This builder instance. + */ + public Builder createdAt(java.time.OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Sets the value for {@code currency}. + * + * @param currency Three-letter [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code + * of the amount. + * @return This builder instance. + */ + public Builder currency(com.sumup.sdk.models.Currency currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id Sale identifier. + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Display name of the sale when set; otherwise a concatenation of item names with + * quantities. Omitted when neither is available. + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code state}. + * + * @param state Lifecycle state of the sale. Non-finalised sales are never returned; only + * fully-paid sales. + * @return This builder instance. + */ + public Builder state(com.sumup.sdk.models.SaleStateV10 state) { + this.state = state; + return this; + } + + /** + * Sets the value for {@code taxMode}. + * + * @param taxMode Checkout tax mode for the sale. Same values as `Sale.tax_mode`. + * @return This builder instance. + */ + public Builder taxMode(com.sumup.sdk.models.TaxMode taxMode) { + this.taxMode = taxMode; + return this; + } + + /** + * Sets the value for {@code totalAmount}. + * + * @param totalAmount Final sale gross total after discounts and taxes, excluding tips. Same + * value as `Sale.price.gross_amount`, in minor units according to `currency.scale`. Payment + * amounts include tips and can therefore differ from this total. + * @return This builder instance. + */ + public Builder totalAmount(com.sumup.sdk.models.SaleSearchItemTotalAmount totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + /** + * Sets the value for {@code userId}. + * + * @param userId Identity UUID of the cashier who processed the sale. Omitted when the cashier + * identity is unknown. + * @return This builder instance. + */ + public Builder userId(java.util.UUID userId) { + this.userId = userId; + return this; + } + + /** + * Builds an immutable SaleSearchItem instance. + * + * @return Immutable SaleSearchItem. + */ + public SaleSearchItem build() { + return new SaleSearchItem( + Objects.requireNonNull(closedAt, "closedAt"), + Objects.requireNonNull(createdAt, "createdAt"), + Objects.requireNonNull(currency, "currency"), + Objects.requireNonNull(id, "id"), + name, + Objects.requireNonNull(state, "state"), + Objects.requireNonNull(taxMode, "taxMode"), + Objects.requireNonNull(totalAmount, "totalAmount"), + userId); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchItemTotalAmount.java b/src/main/java/com/sumup/sdk/models/SaleSearchItemTotalAmount.java new file mode 100644 index 0000000..2fdab12 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleSearchItemTotalAmount.java @@ -0,0 +1,65 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Final sale gross total after discounts and taxes, excluding tips. Same value as + * `Sale.price.gross_amount`, in minor units according to `currency.scale`. Payment amounts include + * tips and can therefore differ from this total. + */ +public record SaleSearchItemTotalAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for SaleSearchItemTotalAmount. + * + * @return Builder that constructs immutable SaleSearchItemTotalAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleSearchItemTotalAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable SaleSearchItemTotalAmount instance. + * + * @return Immutable SaleSearchItemTotalAmount. + */ + public SaleSearchItemTotalAmount build() { + return new SaleSearchItemTotalAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java b/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java new file mode 100644 index 0000000..a194755 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java @@ -0,0 +1,161 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +/** + * Filter and pagination criteria for `POST /sales/search`. Filters from different categories stack + * with **logical AND**; multiple values in one array field stack with **logical OR**. Results cover + * the merchant’s **last two years** of sales (narrow further with `start_date` / `end_date`). + * Results are sorted **newest first** by sale close date. + */ +public record SaleSearchRequest( + /** Sale created **on or before** this instant (inclusive). */ + java.time.OffsetDateTime endDate, + + /** Maximum number of results per page. */ + Long paginationLimit, + + /** + * Opaque pagination token from a previous search response. Not interchangeable with tokens from + * `GET /sales`. + */ + String paginationToken, + + /** + * Filters rows by payment outcome. Multiple values match any of them (**OR**). The search row + * does not echo this value. + */ + java.util.List paymentStatuses, + + /** + * Filters rows by sale lifecycle (`state`). Multiple values match any of them (**OR**). Uses + * the same values as `Sale.state`. Non-finalised sales are never returned; only fully-paid + * sales. + */ + java.util.List saleStatuses, + + /** Sales channel filter. Multiple values match any of them (**OR**). */ + java.util.List salesChannels, + + /** Sale created **on or after** this instant (inclusive). */ + java.time.OffsetDateTime startDate) { + /** + * Creates a builder for SaleSearchRequest. + * + * @return Builder that constructs immutable SaleSearchRequest instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleSearchRequest instances. */ + public static final class Builder { + private java.time.OffsetDateTime endDate; + private Long paginationLimit; + private String paginationToken; + private java.util.List paymentStatuses; + private java.util.List saleStatuses; + private java.util.List salesChannels; + private java.time.OffsetDateTime startDate; + + private Builder() {} + + /** + * Sets the value for {@code endDate}. + * + * @param endDate Sale created **on or before** this instant (inclusive). + * @return This builder instance. + */ + public Builder endDate(java.time.OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Sets the value for {@code paginationLimit}. + * + * @param paginationLimit Maximum number of results per page. + * @return This builder instance. + */ + public Builder paginationLimit(Long paginationLimit) { + this.paginationLimit = paginationLimit; + return this; + } + + /** + * Sets the value for {@code paginationToken}. + * + * @param paginationToken Opaque pagination token from a previous search response. Not + * interchangeable with tokens from `GET /sales`. + * @return This builder instance. + */ + public Builder paginationToken(String paginationToken) { + this.paginationToken = paginationToken; + return this; + } + + /** + * Sets the value for {@code paymentStatuses}. + * + * @param paymentStatuses Filters rows by payment outcome. Multiple values match any of them + * (**OR**). The search row does not echo this value. + * @return This builder instance. + */ + public Builder paymentStatuses( + java.util.List paymentStatuses) { + this.paymentStatuses = paymentStatuses; + return this; + } + + /** + * Sets the value for {@code saleStatuses}. + * + * @param saleStatuses Filters rows by sale lifecycle (`state`). Multiple values match any of + * them (**OR**). Uses the same values as `Sale.state`. Non-finalised sales are never + * returned; only fully-paid sales. + * @return This builder instance. + */ + public Builder saleStatuses(java.util.List saleStatuses) { + this.saleStatuses = saleStatuses; + return this; + } + + /** + * Sets the value for {@code salesChannels}. + * + * @param salesChannels Sales channel filter. Multiple values match any of them (**OR**). + * @return This builder instance. + */ + public Builder salesChannels( + java.util.List salesChannels) { + this.salesChannels = salesChannels; + return this; + } + + /** + * Sets the value for {@code startDate}. + * + * @param startDate Sale created **on or after** this instant (inclusive). + * @return This builder instance. + */ + public Builder startDate(java.time.OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Builds an immutable SaleSearchRequest instance. + * + * @return Immutable SaleSearchRequest. + */ + public SaleSearchRequest build() { + return new SaleSearchRequest( + endDate, + paginationLimit, + paginationToken, + paymentStatuses, + saleStatuses, + salesChannels, + startDate); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchResponse.java b/src/main/java/com/sumup/sdk/models/SaleSearchResponse.java new file mode 100644 index 0000000..2c01889 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleSearchResponse.java @@ -0,0 +1,62 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Search hits and an optional pagination token. Results are ordered **newest first** by sale close + * date. + */ +public record SaleSearchResponse( + java.util.List items, + + /** Opaque token for the next page of search results. */ + String paginationToken) { + /** + * Creates a builder for SaleSearchResponse. + * + * @return Builder that constructs immutable SaleSearchResponse instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleSearchResponse instances. */ + public static final class Builder { + private java.util.List items; + private String paginationToken; + + private Builder() {} + + /** + * Sets the value for {@code items}. + * + * @param items Value for the items field. + * @return This builder instance. + */ + public Builder items(java.util.List items) { + this.items = items; + return this; + } + + /** + * Sets the value for {@code paginationToken}. + * + * @param paginationToken Opaque token for the next page of search results. + * @return This builder instance. + */ + public Builder paginationToken(String paginationToken) { + this.paginationToken = paginationToken; + return this; + } + + /** + * Builds an immutable SaleSearchResponse instance. + * + * @return Immutable SaleSearchResponse. + */ + public SaleSearchResponse build() { + return new SaleSearchResponse(Objects.requireNonNull(items, "items"), paginationToken); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleSource.java b/src/main/java/com/sumup/sdk/models/SaleSource.java new file mode 100644 index 0000000..afbb46a --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleSource.java @@ -0,0 +1,113 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** Information about the source of the sale. */ +public record SaleSource( + /** + * The sale_channel is field that indicates the channel through which the sale was made. For + * example, if the sale was made in the merchant app, the sale_channel could be POS. If the sale + * was made on a kiosk, the sale_channel is KIOSK. *Accepted values:* ["POS", "KIOSK", + * "ONLINE_STORE", "SOLO", "ORDER_AND_PAY", "INVOICE", "BOOKINGS", "ORDER_AGGREGATOR", + * "SUBSCRIPTIONS", "UNKNOWN"]. + */ + String channel, + + /** An external reference ID for connecting orders/sales between products */ + String externalId, + + /** + * An external reference ID for the sub-channel. For example, when channel is BOOKINGS and + * sub_channel is POS, this can hold the OMS order ID while external_id holds the appointment + * ID. + */ + String externalSubChannelId, + + /** + * The sub_channel is an optional field that can be used to provide more information about the + * sale_channel. For example, if the sale_channel is ONLINE_PAYMENTS, the sub_channel could be + * "WIX" or "QR_CODE" or "WOOCOMMERCE". + */ + String subChannel) { + /** + * Creates a builder for SaleSource. + * + * @return Builder that constructs immutable SaleSource instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for SaleSource instances. */ + public static final class Builder { + private String channel; + private String externalId; + private String externalSubChannelId; + private String subChannel; + + private Builder() {} + + /** + * Sets the value for {@code channel}. + * + * @param channel The sale_channel is field that indicates the channel through which the sale + * was made. For example, if the sale was made in the merchant app, the sale_channel could + * be POS. If the sale was made on a kiosk, the sale_channel is KIOSK. *Accepted values:* + * ["POS", "KIOSK", "ONLINE_STORE", "SOLO", "ORDER_AND_PAY", "INVOICE", "BOOKINGS", + * "ORDER_AGGREGATOR", "SUBSCRIPTIONS", "UNKNOWN"]. + * @return This builder instance. + */ + public Builder channel(String channel) { + this.channel = channel; + return this; + } + + /** + * Sets the value for {@code externalId}. + * + * @param externalId An external reference ID for connecting orders/sales between products + * @return This builder instance. + */ + public Builder externalId(String externalId) { + this.externalId = externalId; + return this; + } + + /** + * Sets the value for {@code externalSubChannelId}. + * + * @param externalSubChannelId An external reference ID for the sub-channel. For example, when + * channel is BOOKINGS and sub_channel is POS, this can hold the OMS order ID while + * external_id holds the appointment ID. + * @return This builder instance. + */ + public Builder externalSubChannelId(String externalSubChannelId) { + this.externalSubChannelId = externalSubChannelId; + return this; + } + + /** + * Sets the value for {@code subChannel}. + * + * @param subChannel The sub_channel is an optional field that can be used to provide more + * information about the sale_channel. For example, if the sale_channel is ONLINE_PAYMENTS, + * the sub_channel could be "WIX" or "QR_CODE" or "WOOCOMMERCE". + * @return This builder instance. + */ + public Builder subChannel(String subChannel) { + this.subChannel = subChannel; + return this; + } + + /** + * Builds an immutable SaleSource instance. + * + * @return Immutable SaleSource. + */ + public SaleSource build() { + return new SaleSource( + Objects.requireNonNull(channel, "channel"), externalId, externalSubChannelId, subChannel); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleStateV10.java b/src/main/java/com/sumup/sdk/models/SaleStateV10.java new file mode 100644 index 0000000..c463c30 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleStateV10.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; + +/** Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. */ +public final class SaleStateV10 { + public static final SaleStateV10 CLOSED = new SaleStateV10("CLOSED"); + + private final String value; + + private SaleStateV10(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SaleStateV10 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 SaleStateV10 of(String value) { + return new SaleStateV10(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SaleStateV10 fromValue(String value) { + return value == null ? null : new SaleStateV10(value); + } + + @Override + public boolean equals(Object other) { + return this == other || (other instanceof SaleStateV10 that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java b/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java new file mode 100644 index 0000000..9ffa8f5 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java @@ -0,0 +1,68 @@ +// 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; + +/** Sale channel filter value. Multi-select uses **OR** within this field. */ +public final class SalesChannelFilterV10 { + public static final SalesChannelFilterV10 POS = new SalesChannelFilterV10("POS"); + public static final SalesChannelFilterV10 ONLINE_PAYMENTS = + new SalesChannelFilterV10("ONLINE_PAYMENTS"); + public static final SalesChannelFilterV10 KIOSK = new SalesChannelFilterV10("KIOSK"); + public static final SalesChannelFilterV10 ONLINE_STORE = + new SalesChannelFilterV10("ONLINE_STORE"); + public static final SalesChannelFilterV10 SOLO = new SalesChannelFilterV10("SOLO"); + public static final SalesChannelFilterV10 ORDER_AND_PAY = + new SalesChannelFilterV10("ORDER_AND_PAY"); + public static final SalesChannelFilterV10 INVOICE = new SalesChannelFilterV10("INVOICE"); + public static final SalesChannelFilterV10 BOOKINGS = new SalesChannelFilterV10("BOOKINGS"); + public static final SalesChannelFilterV10 ORDER_AGGREGATOR = + new SalesChannelFilterV10("ORDER_AGGREGATOR"); + public static final SalesChannelFilterV10 SUBSCRIPTIONS = + new SalesChannelFilterV10("SUBSCRIPTIONS"); + public static final SalesChannelFilterV10 UNKNOWN = new SalesChannelFilterV10("UNKNOWN"); + + private final String value; + + private SalesChannelFilterV10(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SalesChannelFilterV10 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 SalesChannelFilterV10 of(String value) { + return new SalesChannelFilterV10(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SalesChannelFilterV10 fromValue(String value) { + return value == null ? null : new SalesChannelFilterV10(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SalesChannelFilterV10 that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/TaxLine.java b/src/main/java/com/sumup/sdk/models/TaxLine.java new file mode 100644 index 0000000..d208d92 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TaxLine.java @@ -0,0 +1,141 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Information about tax together with amounts before and after its application such as: - net + * amount: taxable net amount, scoped by this tax - gross amount: amount after applying the tax. + */ +public record TaxLine( + /** + * Gross amount after applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + com.sumup.sdk.models.TaxLineGrossAmount grossAmount, + + /** Tax ID from the Tax Service (External Id) */ + String id, + + /** Tax name, e.g. "MwSt." */ + String name, + + /** + * Net amount before applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ + com.sumup.sdk.models.TaxLineNetAmount netAmount, + + /** The tax rate percentage in minor units (1/100000). For example 19000 = 19%. */ + Long percentage, + + /** + * Amount of tax. The value of the amount in minor units of the currency according to the + * Sale.currency.scale. + */ + com.sumup.sdk.models.TaxLineTaxAmount taxAmount) { + /** + * Creates a builder for TaxLine. + * + * @return Builder that constructs immutable TaxLine instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TaxLine instances. */ + public static final class Builder { + private com.sumup.sdk.models.TaxLineGrossAmount grossAmount; + private String id; + private String name; + private com.sumup.sdk.models.TaxLineNetAmount netAmount; + private Long percentage; + private com.sumup.sdk.models.TaxLineTaxAmount taxAmount; + + private Builder() {} + + /** + * Sets the value for {@code grossAmount}. + * + * @param grossAmount Gross amount after applying the tax. The value of the amount in minor + * units of the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder grossAmount(com.sumup.sdk.models.TaxLineGrossAmount grossAmount) { + this.grossAmount = grossAmount; + return this; + } + + /** + * Sets the value for {@code id}. + * + * @param id Tax ID from the Tax Service (External Id) + * @return This builder instance. + */ + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * Sets the value for {@code name}. + * + * @param name Tax name, e.g. "MwSt." + * @return This builder instance. + */ + public Builder name(String name) { + this.name = name; + return this; + } + + /** + * Sets the value for {@code netAmount}. + * + * @param netAmount Net amount before applying the tax. The value of the amount in minor units + * of the currency according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder netAmount(com.sumup.sdk.models.TaxLineNetAmount netAmount) { + this.netAmount = netAmount; + return this; + } + + /** + * Sets the value for {@code percentage}. + * + * @param percentage The tax rate percentage in minor units (1/100000). For example 19000 = 19%. + * @return This builder instance. + */ + public Builder percentage(Long percentage) { + this.percentage = percentage; + return this; + } + + /** + * Sets the value for {@code taxAmount}. + * + * @param taxAmount Amount of tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + * @return This builder instance. + */ + public Builder taxAmount(com.sumup.sdk.models.TaxLineTaxAmount taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Builds an immutable TaxLine instance. + * + * @return Immutable TaxLine. + */ + public TaxLine build() { + return new TaxLine( + Objects.requireNonNull(grossAmount, "grossAmount"), + Objects.requireNonNull(id, "id"), + name, + Objects.requireNonNull(netAmount, "netAmount"), + percentage, + Objects.requireNonNull(taxAmount, "taxAmount")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/TaxLineGrossAmount.java b/src/main/java/com/sumup/sdk/models/TaxLineGrossAmount.java new file mode 100644 index 0000000..343d49c --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TaxLineGrossAmount.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Gross amount after applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ +public record TaxLineGrossAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for TaxLineGrossAmount. + * + * @return Builder that constructs immutable TaxLineGrossAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TaxLineGrossAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable TaxLineGrossAmount instance. + * + * @return Immutable TaxLineGrossAmount. + */ + public TaxLineGrossAmount build() { + return new TaxLineGrossAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/TaxLineNetAmount.java b/src/main/java/com/sumup/sdk/models/TaxLineNetAmount.java new file mode 100644 index 0000000..e35bac7 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TaxLineNetAmount.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Net amount before applying the tax. The value of the amount in minor units of the currency + * according to the Sale.currency.scale. + */ +public record TaxLineNetAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for TaxLineNetAmount. + * + * @return Builder that constructs immutable TaxLineNetAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TaxLineNetAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable TaxLineNetAmount instance. + * + * @return Immutable TaxLineNetAmount. + */ + public TaxLineNetAmount build() { + return new TaxLineNetAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/TaxLineTaxAmount.java b/src/main/java/com/sumup/sdk/models/TaxLineTaxAmount.java new file mode 100644 index 0000000..a696376 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TaxLineTaxAmount.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** + * Amount of tax. The value of the amount in minor units of the currency according to the + * Sale.currency.scale. + */ +public record TaxLineTaxAmount( + /** Currency ISO 4217 code */ + String currency, + + /** Amount in minor units (e.g. cents). */ + Long value) { + /** + * Creates a builder for TaxLineTaxAmount. + * + * @return Builder that constructs immutable TaxLineTaxAmount instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for TaxLineTaxAmount instances. */ + public static final class Builder { + private String currency; + private Long value; + + private Builder() {} + + /** + * Sets the value for {@code currency}. + * + * @param currency Currency ISO 4217 code + * @return This builder instance. + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Sets the value for {@code value}. + * + * @param value Amount in minor units (e.g. cents). + * @return This builder instance. + */ + public Builder value(Long value) { + this.value = value; + return this; + } + + /** + * Builds an immutable TaxLineTaxAmount instance. + * + * @return Immutable TaxLineTaxAmount. + */ + public TaxLineTaxAmount build() { + return new TaxLineTaxAmount( + Objects.requireNonNull(currency, "currency"), Objects.requireNonNull(value, "value")); + } + } +} diff --git a/src/main/java/com/sumup/sdk/models/TaxMode.java b/src/main/java/com/sumup/sdk/models/TaxMode.java new file mode 100644 index 0000000..c1663e9 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/TaxMode.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 tax mode used by merchant for displaying prices and calculating taxes: - NO_TAX: The prices + * don't contain any taxes, merchant don't report taxes - GROSS: The prices used by merchant already + * include taxes (common in EU), the tax is calculated from the gross price - NET: The prices used + * by merchant don't include taxes (common in US), the tax is calculated from the net price Since + * tax values can be different for the same net price depending if the tax was calculated from gross + * or net price, this info is necessary to be able to reconcile tax calculations. + */ +public final class TaxMode { + public static final TaxMode NO_TAX = new TaxMode("NO_TAX"); + public static final TaxMode GROSS = new TaxMode("GROSS"); + public static final TaxMode NET = new TaxMode("NET"); + + private final String value; + + private TaxMode(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a TaxMode 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 TaxMode of(String value) { + return new TaxMode(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static TaxMode fromValue(String value) { + return value == null ? null : new TaxMode(value); + } + + @Override + public boolean equals(Object other) { + return this == other || (other instanceof TaxMode that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/UnitOfMeasure.java b/src/main/java/com/sumup/sdk/models/UnitOfMeasure.java new file mode 100644 index 0000000..58bbf85 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/UnitOfMeasure.java @@ -0,0 +1,78 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import java.util.Objects; + +/** The unit of measure of the item. */ +public record UnitOfMeasure( + /** The group of the unit of measure. */ + String groupId, + + /** The specific unit of measure within the group. */ + String unitId, + + /** The ratio of the specified unit to the base unit of the group. */ + Double unitRatio) { + /** + * Creates a builder for UnitOfMeasure. + * + * @return Builder that constructs immutable UnitOfMeasure instances. + */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for UnitOfMeasure instances. */ + public static final class Builder { + private String groupId; + private String unitId; + private Double unitRatio; + + private Builder() {} + + /** + * Sets the value for {@code groupId}. + * + * @param groupId The group of the unit of measure. + * @return This builder instance. + */ + public Builder groupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Sets the value for {@code unitId}. + * + * @param unitId The specific unit of measure within the group. + * @return This builder instance. + */ + public Builder unitId(String unitId) { + this.unitId = unitId; + return this; + } + + /** + * Sets the value for {@code unitRatio}. + * + * @param unitRatio The ratio of the specified unit to the base unit of the group. + * @return This builder instance. + */ + public Builder unitRatio(Double unitRatio) { + this.unitRatio = unitRatio; + return this; + } + + /** + * Builds an immutable UnitOfMeasure instance. + * + * @return Immutable UnitOfMeasure. + */ + public UnitOfMeasure build() { + return new UnitOfMeasure( + Objects.requireNonNull(groupId, "groupId"), + Objects.requireNonNull(unitId, "unitId"), + Objects.requireNonNull(unitRatio, "unitRatio")); + } + } +}