Skip to content
Merged
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
136 changes: 53 additions & 83 deletions openapi.json

Large diffs are not rendered by default.

91 changes: 0 additions & 91 deletions src/SumUp/Models/ProblemV10.g.cs

This file was deleted.

12 changes: 6 additions & 6 deletions src/SumUp/Models/Sale.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
using System.Collections.Generic;
/// <summary>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.</summary>
/// <summary>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 SaleItem. Merchant fees appear as type: "FEE" lines; extra fee data is in features.</summary>
public sealed partial class Sale
{
/// <summary>Instant when the sale was closed. Always present: non-finalised sales are never returned.</summary>
Expand All @@ -22,7 +22,7 @@ public sealed partial class Sale
public string Id { get; set; } = default!;
/// <summary>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.</summary>
[JsonPropertyName("items")]
public IEnumerable<SaleLineItemV10> Items { get; set; } = default!;
public IEnumerable<SaleItem> Items { get; set; } = default!;
/// <summary>Human-readable name of the sale (not unique, not the sale id).</summary>
[JsonPropertyName("name")]
public string? Name { get; set; }
Expand All @@ -31,16 +31,16 @@ public sealed partial class Sale
public string? Note { get; set; }
/// <summary>Payments on this sale, in the order they were recorded.</summary>
[JsonPropertyName("payments")]
public IEnumerable<PublicPaymentV10> Payments { get; set; } = default!;
/// <summary>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.</summary>
public IEnumerable<SalePayment> Payments { get; set; } = default!;
/// <summary>Sale-level pricing aggregate, parallel to SaleItemPrice on each SaleItem. 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.</summary>
[JsonPropertyName("price")]
public SalePriceV10 Price { get; set; } = default!;
public SaleTotals Price { get; set; } = default!;
/// <summary>Information about the source of the sale.</summary>
[JsonPropertyName("source")]
public SaleSource Source { get; set; } = default!;
/// <summary>Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales.</summary>
[JsonPropertyName("state")]
public SaleStateV10 State { get; set; }
public SaleLifecycleState State { get; set; }
/// <summary>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.</summary>
[JsonPropertyName("tax_mode")]
public TaxMode TaxMode { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum SalesChannelFilterV10
public enum SaleChannelFilter
{
[EnumMember(Value = "POS")]
Pos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>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).</summary>
public sealed partial class PublicGiftCardPayment
public sealed partial class SaleGiftCardPayment
{
/// <summary>Gift card identifier. Format "GC" followed by 9 alphanumeric characters (e.g. GCZ3NTMB1V).</summary>
[JsonPropertyName("id")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ namespace SumUp;
using System.Text.Json.Serialization;
using System.Collections.Generic;
/// <summary>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.</summary>
public sealed partial class SaleLineItemV10
public sealed partial class SaleItem
{
/// <summary>Categories the line belongs to. A shared optional structure available to any line; not a per-type field.</summary>
[JsonPropertyName("categories")]
public IEnumerable<CategoryV10>? Categories { get; set; }
/// <summary>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.</summary>
public IEnumerable<SaleItemCategory>? Categories { get; set; }
/// <summary>Named, typed, type-specific data. New item types add their data here as features instead of new schema variants. See SaleItemFeature for per-type examples.</summary>
[JsonPropertyName("features")]
public IEnumerable<FeatureV10>? Features { get; set; }
public IEnumerable<SaleItemFeature>? Features { get; set; }
/// <summary>Stable identifier of the line within the sale. Used for linking (e.g. deposits).</summary>
[JsonPropertyName("id")]
public string Id { get; set; } = default!;
Expand All @@ -28,17 +28,17 @@ public sealed partial class SaleLineItemV10
public string? Note { get; set; }
/// <summary>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).</summary>
[JsonPropertyName("price")]
public LineItemPriceV10 Price { get; set; } = default!;
public SaleItemPrice Price { get; set; } = default!;
/// <summary>The numerical value representing the quantity in the specified unit.</summary>
[JsonPropertyName("quantity")]
public double Quantity { get; set; }
/// <summary>Outward identifiers and links for a line, kept in one place rather than scattered per item type.</summary>
[JsonPropertyName("references")]
public ItemReferencesV10? References { get; set; }
public SaleItemReferences? References { get; set; }
/// <summary>The type of service for this line.</summary>
[JsonPropertyName("service_type")]
public SaleLineItemV10ServiceType? ServiceType { get; set; }
/// <summary>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.</summary>
public SaleItemServiceType? ServiceType { get; set; }
/// <summary>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 SaleItemFeature 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.</summary>
[JsonPropertyName("type")]
public string Type { get; set; } = default!;
/// <summary>The unit of measure of the item.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>A category a line belongs to.</summary>
public sealed partial class CategoryV10
public sealed partial class SaleItemCategory
{
/// <summary>The category id. Usually a UUID, but not always (legacy cases).</summary>
[JsonPropertyName("id")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>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)</summary>
public sealed partial class FeatureV10
public sealed partial class SaleItemFeature
{
/// <summary>The feature name/key.</summary>
[JsonPropertyName("name")]
Expand All @@ -15,5 +15,5 @@ public sealed partial class FeatureV10
public string Value { get; set; } = default!;
/// <summary>The data type of a feature value. The wire value is always a string and is parsed according to this type.</summary>
[JsonPropertyName("value_type")]
public FeatureValueTypeV10 ValueType { get; set; }
public SaleItemFeatureValueType ValueType { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum FeatureValueTypeV10
public enum SaleItemFeatureValueType
{
[EnumMember(Value = "TEXT")]
Text,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SumUp;
using System.Text.Json.Serialization;
using System.Collections.Generic;
/// <summary>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).</summary>
public sealed partial class LineItemPriceV10
public sealed partial class SaleItemPrice
{
/// <summary>Discounts applied. Discount amounts do not affect total_net_amount / total_gross_amount; they are reflected in the *_final amounts.</summary>
[JsonPropertyName("discounts")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>Outward identifiers and links for a line, kept in one place rather than scattered per item type.</summary>
public sealed partial class ItemReferencesV10
public sealed partial class SaleItemReferences
{
/// <summary>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.</summary>
[JsonPropertyName("catalog_reference")]
public string? CatalogReference { get; set; }
/// <summary>The source of the catalog the line originates from.</summary>
[JsonPropertyName("catalog_source")]
public ItemReferencesV10CatalogSource? CatalogSource { get; set; }
public SaleItemReferencesCatalogSource? CatalogSource { get; set; }
/// <summary>An external reference id connecting this line to another system.</summary>
[JsonPropertyName("external_id")]
public string? ExternalId { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum ItemReferencesV10CatalogSource
public enum SaleItemReferencesCatalogSource
{
[EnumMember(Value = "SUMUP")]
Sumup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum SaleLineItemV10ServiceType
public enum SaleItemServiceType
{
[EnumMember(Value = "IN_HOUSE")]
InHouse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum SaleStateV10
public enum SaleLifecycleState
{
[EnumMember(Value = "CLOSED")]
Closed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>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.</summary>
public sealed partial class PublicPaymentV10
public sealed partial class SalePayment
{
/// <summary>The amount of the payment including tips. The value of the amount in minor units of Sale.currency.</summary>
[JsonPropertyName("amount")]
Expand All @@ -15,10 +15,10 @@ public sealed partial class PublicPaymentV10
public string? ApmType { get; set; }
/// <summary>Card brand, credit/debit processing type, and last four digits.</summary>
[JsonPropertyName("card")]
public PublicCardV10? Card { get; set; }
public SalePaymentCard? Card { get; set; }
/// <summary>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).</summary>
[JsonPropertyName("gift_card")]
public PublicGiftCardPayment? GiftCard { get; set; }
public SaleGiftCardPayment? GiftCard { get; set; }
/// <summary>Payment method on public sales read API v1.0. Digital wallets are first-class methods. Gift card payments use gift_card, not apm. Values use lowercase snake_case. Known values are card, cash, apm, external, apple_pay, google_pay, whatsapp_pay, and gift_card. Additional values may be returned as new payment methods become available.</summary>
[JsonPropertyName("method")]
public string Method { get; set; } = default!;
Expand All @@ -30,7 +30,7 @@ public sealed partial class PublicPaymentV10
public string Reference { get; set; } = default!;
/// <summary>The status of the payment.</summary>
[JsonPropertyName("status")]
public PublicPaymentV10Status Status { get; set; }
public SalePaymentStatus Status { get; set; }
/// <summary>Payment operation type. This is distinct from the payment instrument in method. Values use lowercase snake_case. Known values are purchase for a normal purchase and unreferenced_refund for negative sales such as deposit returns.</summary>
[JsonPropertyName("type")]
public string Type { get; set; } = default!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace SumUp;

using System.Text.Json.Serialization;
/// <summary>Card brand, credit/debit processing type, and last four digits.</summary>
public sealed partial class PublicCardV10
public sealed partial class SalePaymentCard
{
/// <summary>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].</summary>
[JsonPropertyName("brand")]
Expand All @@ -15,5 +15,5 @@ public sealed partial class PublicCardV10
public string Last4Digits { get; set; } = default!;
/// <summary>Credit or debit processing choice, not brand or funding. unknown when unavailable; prepaid/voucher are not processing types.</summary>
[JsonPropertyName("type")]
public PublicCardV10Type Type { get; set; }
public SalePaymentCardType Type { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SumUp;
using System.Text.Json.Serialization;

[JsonConverter(typeof(EnumMemberJsonConverterFactory))]
public enum PublicCardV10Type
public enum SalePaymentCardType
{
[EnumMember(Value = "credit")]
Credit,
Expand Down
Loading
Loading