Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 113 additions & 51 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
{
"name": "Sales",
"description": "Read a merchant's fully-paid, closed sales, including item lines, taxes, discounts, and payments.\n\nList sales to retrieve full `Sale` objects, or search by date, payment status, and sales channel\nto retrieve summaries. Use a summary's `id` to get the full sale.\n\nAmounts are expressed in minor units according to each sale's `currency.scale`.",
"description": "Read a merchant's fully-paid, closed sales, including item lines, taxes, discounts, and payments.\n\nList sales to retrieve full `Sale` objects, or search by date, payment status, and sales channel\nto retrieve summaries. Use a summary's `id` to get the full sale.\n\nFor integration patterns, authentication, sync, and how the Sales API relates to other SumUp APIs, see the\n[Sales API integrator guide](https://developer.sumup.com/tools/sales-api-guide/).\n\nAmounts are expressed in minor units according to each sale's `currency.scale`.\n\nCurrent limitation: In most countries, sales created via the Invoices product are only included when\nthe transaction happened through SumUp payments. This means invoices paid via cash or bank transfer\nwon’t be listed. Sales made in the UK are an exception to this limitation; all sales will be shown there.",
"x-core-objects": [
{
"$ref": "#/components/schemas/Sale"
Expand Down Expand Up @@ -5036,10 +5036,11 @@
},
"x-scopes": [
"user.profile",
"user.profile_readonly"
"user.profile_readonly",
"merchants.read"
],
"x-permissions": [
"merchant_read"
"merchant.read"
],
"security": [
{
Expand All @@ -5054,6 +5055,11 @@
"oauth2": [
"user.profile_readonly"
]
},
{
"oauth2": [
"merchants.read"
]
}
],
"responses": {
Expand Down Expand Up @@ -5106,7 +5112,8 @@
},
"x-scopes": [
"user.profile",
"user.profile_readonly"
"user.profile_readonly",
"merchants.read"
],
"x-permissions": [
"persons_read"
Expand All @@ -5127,6 +5134,11 @@
"oauth2": [
"user.profile_readonly"
]
},
{
"oauth2": [
"merchants.read"
]
}
],
"responses": {
Expand Down Expand Up @@ -5179,7 +5191,8 @@
},
"x-scopes": [
"user.profile",
"user.profile_readonly"
"user.profile_readonly",
"merchants.read"
],
"x-permissions": [
"persons_read"
Expand All @@ -5200,6 +5213,11 @@
"oauth2": [
"user.profile_readonly"
]
},
{
"oauth2": [
"merchants.read"
]
}
],
"responses": {
Expand Down Expand Up @@ -6400,14 +6418,6 @@
},
"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",
Expand Down Expand Up @@ -6894,18 +6904,8 @@
}
}
],
"requestBody": {
"content": {
"application/json": {}
},
"description": "A checkout initial attributes",
"required": false
},
"responses": {
"202": {
"content": {
"application/json": {}
},
"description": "The Terminate action was successfully dispatched for the given reader."
},
"400": {
Expand Down Expand Up @@ -10387,10 +10387,13 @@
},
"website": {
"type": "string",
"format": "uri",
"description": "The business's publicly available website.",
"minLength": 1,
"maxLength": 255,
"example": "https://example.com"
"examples": [
"https://example.com"
]
},
"email": {
"type": "string",
Expand Down Expand Up @@ -10555,7 +10558,7 @@
"description": "Address documentation",
"url": "https://developer.sumup.com/tools/glossary/merchant#addresses"
},
"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.",
"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.\nThe street can be given either as free-form `street_address` lines or as structured `street_name`, `building_number` and `additional_address_lines`. If both are given, they must agree. At most two street lines are supported in total. Addresses written with structured street fields are returned with both the structured fields and the composed `street_address`. Addresses written with only `street_address` are returned without structured fields.\nLocations don't support the structured street fields yet and reject them.",
"type": "object",
"required": [
"country"
Expand All @@ -10575,6 +10578,34 @@
"2. Hinterhof"
]
},
"street_name": {
"type": "string",
"description": "The name of the street, without the building number. Required when `building_number` or `additional_address_lines` is set. Together with the building number and separator, the composed street line must fit the 100 character database column.\n",
"maxLength": 88,
"example": "Rua Augusta"
},
"building_number": {
"type": "string",
"description": "The building number of the address. It is not necessarily numeric, for example `12a` or `12-14`. Use `S/N` for addresses without a number. Requires `street_name`.\n",
"maxLength": 10,
"examples": [
"1500",
"12a",
"S/N"
]
},
"additional_address_lines": {
"type": "array",
"description": "Further street lines after the street name and building number, for example an apartment. At most one line is supported.\n",
"maxItems": 1,
"items": {
"type": "string",
"maxLength": 100
},
"example": [
"Sala 4"
]
},
"post_code": {
"type": "string",
"description": "The postal code (aka. zip code) of the address.\n",
Expand Down Expand Up @@ -10637,6 +10668,16 @@
"maxLength": 60,
"example": "Berlin"
},
"locality": {
"type": "string",
"description": "A locality represents a suburb or locality as used in postal addresses in Australia.\n",
"maxLength": 60,
"examples": [
"Kensington",
"South Wharf",
"Harrisville"
]
},
"province": {
"type": "string",
"description": "The province where the address is located. This may not be relevant in some countries.\n",
Expand Down Expand Up @@ -10736,6 +10777,36 @@
"state": "SP",
"neighborhood": "Jardim Maria Rosa",
"country": "BR"
},
{
"street_name": "Rua Augusta",
"building_number": "1500",
"additional_address_lines": [
"Sala 4"
],
"street_address": [
"Rua Augusta, 1500",
"Sala 4"
],
"city": "São Paulo",
"post_code": "01304001",
"state": "SP",
"neighborhood": "Consolação",
"country": "BR"
},
{
"street_name": "Waldstraße",
"building_number": "32",
"post_code": "10115",
"city": "Berlin",
"country": "DE"
},
{
"street_name": "Main Street",
"building_number": "32",
"post_town": "London",
"post_code": "SW1A 1AA",
"country": "GB"
}
]
},
Expand Down Expand Up @@ -10827,8 +10898,12 @@
"type": "string",
"maxLength": 256
},
"description": "Object metadata which should only be writable for internal applications, and readable by all clients.\n**Warning**: Updating Attributes will overwrite the existing data. Make sure to always include the complete JSON object.\n",
"example": {}
"description": "Object metadata of a Company or a Person, readable by all clients.\nUpdating Attributes only adds or replaces the keys included in the request. Keys that are not included are left unchanged.\nThe public Merchants API doesn't return the `business_explanation` Company attribute.\n",
"examples": [
{
"nature_and_purpose": "Retail sales of coffee and pastries"
}
]
},
"CompanyIdentifier": {
"externalDocs": {
Expand Down Expand Up @@ -10947,9 +11022,12 @@
},
"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"
"description": "The date of birth of the individual as an ISO 8601 calendar date. Reduced precision is accepted: YYYY-MM-DD, YYYY-MM, or YYYY.\n",
"examples": [
"1980-01-12",
"1980-01",
"1980"
]
},
"given_name": {
"type": "string",
Expand Down Expand Up @@ -11065,6 +11143,9 @@
"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}$"
},
"attributes": {
"$ref": "#/components/schemas/MerchantsAttributes"
},
"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",
Expand Down Expand Up @@ -11147,6 +11228,7 @@
"website": {
"description": "HTTP(S) URL of the company's website.\n",
"type": "string",
"format": "uri",
"minLength": 1,
"maxLength": 255,
"examples": [
Expand Down Expand Up @@ -12951,15 +13033,6 @@
}
}
},
"PaymentMethodNotAllowed": {
"description": "Error returned when the requested payment method is not supported for the merchant (e.g. pix for non-BR merchants).",
"value": {
"errors": {
"detail": "Payment method not allowed for this merchant.",
"type": "PAYMENT_METHOD_NOT_ALLOWED"
}
}
},
"ReaderBusy": {
"description": "Error returned when a checkout was requested in the last 60 seconds.",
"value": {
Expand Down Expand Up @@ -13092,8 +13165,7 @@
"payment_type": {
"description": "Type of the payment. Required for some countries",
"enum": [
"card",
"pix"
"card"
],
"type": "string"
},
Expand Down Expand Up @@ -13699,16 +13771,6 @@
"null"
]
},
"payment_type": {
"default": "card",
"description": "The payment method type for the transaction. Defaults to `card`.\n\nUse `pix` to initiate a Pix QR-code payment flow on the device.\nPix is only supported for Brazilian merchants; other merchants will receive a 422 error.\n",
"enum": [
"card",
"pix"
],
"example": "card",
"type": "string"
},
"return_url": {
"description": "Webhook URL to which the payment result will be sent.\nIt must be a HTTPS url.\n",
"example": "https://www.example.com",
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/sumup/sdk/clients/SalesAsyncClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@
*
* <p>Read a merchant's fully-paid, closed sales, including item lines, taxes, discounts, and
* payments. List sales to retrieve full `Sale` objects, or search by date, payment status, and
* sales channel to retrieve summaries. Use a summary's `id` to get the full sale. Amounts are
* expressed in minor units according to each sale's `currency.scale`.
* sales channel to retrieve summaries. Use a summary's `id` to get the full sale. For integration
* patterns, authentication, sync, and how the Sales API relates to other SumUp APIs, see the [Sales
* API integrator guide](https://developer.sumup.com/tools/sales-api-guide/). Amounts are expressed
* in minor units according to each sale's `currency.scale`. Current limitation: In most countries,
* sales created via the Invoices product are only included when the transaction happened through
* SumUp payments. This means invoices paid via cash or bank transfer won’t be listed. Sales made in
* the UK are an exception to this limitation; all sales will be shown there.
*/
public final class SalesAsyncClient {
private final ApiClient apiClient;
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/sumup/sdk/clients/SalesClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
*
* <p>Read a merchant's fully-paid, closed sales, including item lines, taxes, discounts, and
* payments. List sales to retrieve full `Sale` objects, or search by date, payment status, and
* sales channel to retrieve summaries. Use a summary's `id` to get the full sale. Amounts are
* expressed in minor units according to each sale's `currency.scale`.
* sales channel to retrieve summaries. Use a summary's `id` to get the full sale. For integration
* patterns, authentication, sync, and how the Sales API relates to other SumUp APIs, see the [Sales
* API integrator guide](https://developer.sumup.com/tools/sales-api-guide/). Amounts are expressed
* in minor units according to each sale's `currency.scale`. Current limitation: In most countries,
* sales created via the Invoices product are only included when the transaction happened through
* SumUp payments. This means invoices paid via cash or bank transfer won’t be listed. Sales made in
* the UK are an exception to this limitation; all sales will be shown there.
*/
public final class SalesClient {
private final ApiClient apiClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,14 @@ public CompletableFuture<com.sumup.sdk.models.readers.checkouts.GetReaderCheckou
*
* @param merchantCode Merchant Code
* @param readerId The unique identifier of the Reader
* @param request A checkout initial attributes
* <p>Call the overload that accepts RequestOptions to customize headers, authorization, or
* request timeout.
* @return CompletableFuture completed when the request finishes.
* @throws ApiException if the SumUp API returns an error.
*/
public CompletableFuture<Void> terminate(
String merchantCode, String readerId, java.util.Map<String, Object> request)
public CompletableFuture<Void> terminate(String merchantCode, String readerId)
throws ApiException {
return terminate(merchantCode, readerId, request, null);
return terminate(merchantCode, readerId, null);
}

/**
Expand All @@ -211,18 +209,13 @@ public CompletableFuture<Void> terminate(
*
* @param merchantCode Merchant Code
* @param readerId The unique identifier of the Reader
* @param request A checkout initial attributes
* @param requestOptions Request-specific overrides (headers, authorization, or timeout). Pass
* {@code null} to use client defaults.
* @return CompletableFuture completed when the request finishes.
* @throws ApiException if the SumUp API returns an error.
*/
public CompletableFuture<Void> terminate(
String merchantCode,
String readerId,
java.util.Map<String, Object> request,
RequestOptions requestOptions)
throws ApiException {
String merchantCode, String readerId, RequestOptions requestOptions) throws ApiException {
Objects.requireNonNull(merchantCode, "merchantCode");
Objects.requireNonNull(readerId, "readerId");
String path = "/v0.1/merchants/{merchant_code}/readers/{reader_id}/terminate";
Expand All @@ -231,7 +224,6 @@ public CompletableFuture<Void> terminate(
"{merchant_code}", ApiClient.urlEncode(ApiClient.parameterValue(merchantCode)));
path = path.replace("{reader_id}", ApiClient.urlEncode(ApiClient.parameterValue(readerId)));

return this.apiClient.sendAsync(
HttpMethod.POST, path, null, null, request, null, requestOptions);
return this.apiClient.sendAsync(HttpMethod.POST, path, null, null, null, null, requestOptions);
}
}
Loading
Loading