diff --git a/openapi.json b/openapi.json index 64d1f0a..67b9067 100644 --- a/openapi.json +++ b/openapi.json @@ -3526,7 +3526,8 @@ }, "x-scopes": [ "user.profile", - "user.profile_readonly" + "user.profile_readonly", + "members.read" ], "security": [ { @@ -3541,6 +3542,11 @@ "oauth2": [ "user.profile_readonly" ] + }, + { + "oauth2": [ + "members.read" + ] } ], "parameters": [ @@ -3822,7 +3828,7 @@ }, "x-permissions": [ { - "relation": "merchant_read", + "relation": "merchant.read", "object_type": "merchant", "object_id_param": "merchant_code" } @@ -5888,7 +5894,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5898,7 +5904,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5908,7 +5914,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5918,7 +5924,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6005,7 +6011,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6015,7 +6021,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6025,7 +6031,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6035,7 +6041,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6181,7 +6187,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6191,7 +6197,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6201,7 +6207,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6211,7 +6217,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -11742,7 +11748,7 @@ } } }, - "LineItemPriceV10": { + "SaleItemPrice": { "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": [ @@ -11861,7 +11867,7 @@ } } }, - "CategoryV10": { + "SaleItemCategory": { "type": "object", "description": "A category a line belongs to.", "required": [ @@ -12149,7 +12155,7 @@ } ] }, - "ItemReferencesV10": { + "SaleItemReferences": { "type": "object", "description": "Outward identifiers and links for a line, kept in one place rather than scattered\nper item type.", "properties": { @@ -12183,7 +12189,7 @@ } } }, - "FeatureValueTypeV10": { + "SaleItemFeatureValueType": { "type": "string", "description": "The data type of a feature value. The wire `value` is always a string and is parsed\naccording to this type.", "enum": [ @@ -12195,7 +12201,7 @@ ], "example": "TEXT" }, - "FeatureV10": { + "SaleItemFeature": { "type": "object", "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": [ @@ -12211,7 +12217,7 @@ "example": "operation_type" }, "value_type": { - "$ref": "#/components/schemas/FeatureValueTypeV10" + "$ref": "#/components/schemas/SaleItemFeatureValueType" }, "value": { "type": "string", @@ -12221,7 +12227,7 @@ } } }, - "SaleLineItemV10": { + "SaleItem": { "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": [ @@ -12241,7 +12247,7 @@ }, "type": { "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`.", + "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 `SaleItemFeature` 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" }, "name": { @@ -12276,14 +12282,14 @@ "example": "extra hot" }, "price": { - "$ref": "#/components/schemas/LineItemPriceV10" + "$ref": "#/components/schemas/SaleItemPrice" }, "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" + "$ref": "#/components/schemas/SaleItemCategory" }, "example": [ { @@ -12302,14 +12308,14 @@ "example": [] }, "references": { - "$ref": "#/components/schemas/ItemReferencesV10" + "$ref": "#/components/schemas/SaleItemReferences" }, "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", + "description": "Named, typed, type-specific data. New item types add their data here as\nfeatures instead of new schema variants. See `SaleItemFeature` for per-type examples.\n", "maxItems": 100, "items": { - "$ref": "#/components/schemas/FeatureV10" + "$ref": "#/components/schemas/SaleItemFeature" }, "example": [ { @@ -12321,9 +12327,9 @@ } } }, - "SalePriceV10": { + "SaleTotals": { "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.", + "description": "Sale-level pricing aggregate, parallel to `SaleItemPrice` on each `SaleItem`.\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", @@ -12424,7 +12430,7 @@ "channel" ] }, - "PublicCardV10": { + "SalePaymentCard": { "type": "object", "description": "Card brand, credit/debit processing type, and last four digits.", "required": [ @@ -12459,7 +12465,7 @@ } } }, - "PublicGiftCardPayment": { + "SaleGiftCardPayment": { "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": { @@ -12473,8 +12479,8 @@ "id" ] }, - "PublicPaymentV10": { - "title": "PublicPayment", + "SalePayment": { + "title": "SalePayment", "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": [ @@ -12533,10 +12539,10 @@ "maxLength": 20 }, "card": { - "$ref": "#/components/schemas/PublicCardV10" + "$ref": "#/components/schemas/SalePaymentCard" }, "gift_card": { - "$ref": "#/components/schemas/PublicGiftCardPayment" + "$ref": "#/components/schemas/SaleGiftCardPayment" }, "processed_at": { "type": "string", @@ -12546,7 +12552,7 @@ } } }, - "SaleStateV10": { + "SaleLifecycleState": { "type": "string", "description": "Lifecycle state of the sale.\nNon-finalised sales are never returned; only fully-paid sales.", "enum": [ @@ -12557,7 +12563,7 @@ "Sale": { "title": "Sale", "type": "object", - "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`.", + "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 `SaleItem`. Merchant fees appear as `type: \"FEE\"` lines; extra fee data\nis in `features`.", "required": [ "id", "currency", @@ -12603,11 +12609,11 @@ "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": { - "$ref": "#/components/schemas/SaleLineItemV10" + "$ref": "#/components/schemas/SaleItem" } }, "price": { - "$ref": "#/components/schemas/SalePriceV10" + "$ref": "#/components/schemas/SaleTotals" }, "tax_mode": { "$ref": "#/components/schemas/TaxMode" @@ -12620,7 +12626,7 @@ "maxItems": 1000, "description": "Payments on this sale, in the order they were recorded.\n", "items": { - "$ref": "#/components/schemas/PublicPaymentV10" + "$ref": "#/components/schemas/SalePayment" }, "example": [ { @@ -12646,7 +12652,7 @@ "example": "2026-06-02T10:20:00Z" }, "state": { - "$ref": "#/components/schemas/SaleStateV10" + "$ref": "#/components/schemas/SaleLifecycleState" } } }, @@ -12671,43 +12677,7 @@ } } }, - "ProblemV10": { - "type": "object", - "description": "A RFC 9457 problem details object.\n\nAdditional properties specific to the problem type may be present.\n", - "required": [ - "type" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "format": "uri", - "description": "A URI reference that identifies the problem type.", - "example": "https://developer.sumup.com/problem/not-found" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type.", - "example": "Requested resource couldn't be found." - }, - "status": { - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "example": 404 - }, - "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." - } - } - }, - "PaymentStatusFilterV10": { + "SalePaymentStatusFilter": { "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": [ @@ -12716,7 +12686,7 @@ ], "example": "PAID" }, - "SalesChannelFilterV10": { + "SaleChannelFilter": { "type": "string", "description": "Sale channel filter value. Multi-select uses **OR** within this field.", "enum": [ @@ -12755,7 +12725,7 @@ "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" + "$ref": "#/components/schemas/SaleLifecycleState" }, "example": [ "CLOSED" @@ -12765,7 +12735,7 @@ "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" + "$ref": "#/components/schemas/SalePaymentStatusFilter" }, "example": [ "PAID" @@ -12775,7 +12745,7 @@ "type": "array", "description": "Sales channel filter. Multiple values match any of them (**OR**).", "items": { - "$ref": "#/components/schemas/SalesChannelFilterV10" + "$ref": "#/components/schemas/SaleChannelFilter" }, "example": [ "POS" @@ -12822,7 +12792,7 @@ "example": "d6f51684-519b-454c-bdb3-deeb05f52b92" }, "state": { - "$ref": "#/components/schemas/SaleStateV10" + "$ref": "#/components/schemas/SaleLifecycleState" }, "name": { "type": "string", diff --git a/src/Sales/Sales.php b/src/Sales/Sales.php index 0d63b9e..00e115a 100644 --- a/src/Sales/Sales.php +++ b/src/Sales/Sales.php @@ -99,10 +99,10 @@ public function get(string $merchantCode, string $saleId, ?RequestOptions $reque $response = $this->client->send('GET', $path, $payload, $headers, $requestOptions); return ResponseDecoder::decodeOrThrow($response, \SumUp\Types\Sale::class, [ - '401' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '403' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '404' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '412' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '403' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '404' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '412' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], ], 'GET', $path); } @@ -143,10 +143,10 @@ public function list(string $merchantCode, ?SalesListParams $queryParams = null, $response = $this->client->send('GET', $path, $payload, $headers, $requestOptions); return ResponseDecoder::decodeOrThrow($response, \SumUp\Types\SalePage::class, [ - '400' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '401' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '403' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '412' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], + '400' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '403' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '412' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], ], 'GET', $path); } @@ -177,10 +177,10 @@ public function search(string $merchantCode, \SumUp\Types\SaleSearchRequest|arra $response = $this->client->send('POST', $path, $payload, $headers, $requestOptions); return ResponseDecoder::decodeOrThrow($response, \SumUp\Types\SaleSearchResponse::class, [ - '400' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '401' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '403' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], - '412' => ['type' => 'class', 'class' => \SumUp\Types\ProblemV10::class], + '400' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '401' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '403' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], + '412' => ['type' => 'class', 'class' => \SumUp\Types\Problem::class], ], 'POST', $path); } } diff --git a/src/Types/ProblemV10.php b/src/Types/ProblemV10.php deleted file mode 100644 index cba4087..0000000 --- a/src/Types/ProblemV10.php +++ /dev/null @@ -1,50 +0,0 @@ -