Types
GumroadApiResponseDeleteOfferCode = object success*: bool message*: string
GumroadApiResponseDeleteProductCustomField = object success*: bool message*: string
GumroadApiResponseOfferCode = object success*: bool offer_code*: GumroadOfferCode
GumroadApiResponseOfferCodes = object success*: bool offer_codes*: seq[GumroadOfferCode]
GumroadApiResponseProduct = object success*: bool product*: GumroadProduct
GumroadApiResponseProducts = object success*: bool products*: seq[GumroadProduct]
GumroadApiResponseProductsCovers = object success*: bool covers*: seq[GumroadProductCover] main_cover_id*: Option[string]
GumroadApiResponseProductsCustomField = object success*: bool custom_field*: GumroadProductCustomField
GumroadApiResponseProductsCustomFields = object success*: bool custom_fields*: seq[GumroadProductCustomField]
GumroadCurrency = enum usd = "usd", ## US Dollar gbp = "gbp", ## British Pound eur = "eur", ## Euro jpy = "jpy", ## Japanese Yen inr = "inr", ## Indian Rupee aud = "aud", ## Australian Dollar cad = "cad", ## Canadian Dollar hkd = "hkd", ## Hong Kong Dollar sgd = "sgd", ## Singapore Dollar twd = "twd", ## Taiwan Dollar nzd = "nzd", ## New Zealand Dollar brl = "brl", ## Brazilian Real zar = "zar", ## South African Rand chf = "chf", ## Swiss Franc ils = "ils", ## Israeli Shekel php = "php", ## Philippine Peso krw = "krw", ## South Korean Won pln = "pln", ## Polish Zloty czk = "czk" ## Czech Koruna
GumroadOfferCode = object id*: string name*: string amount_cents*: Option[int] percent_off*: Option[int] max_purchase_count*: Option[int] universal*: Option[bool] times_used*: Option[int]
GumroadProduct = object custom_permalink*: Option[string] ## Custom URL slug for the product custom_receipt*: Option[string] ## Custom receipt text custom_summary*: Option[string] ## Custom summary text custom_fields*: Option[seq[string]] ## Custom fields for the product customizable_price*: Option[bool] ## Whether the product has a customizable price (Pay-what-you-want) description*: Option[string] ## Description of the product deleted*: bool ## Whether the product has been deleted max_purchase_count*: Option[int] ## Maximum number of purchases allowed for the product name*: string ## Name of the product preview_url*: Option[string] ## URL for previewing the product require_shipping*: bool ## Whether the product requires shipping published*: bool ## Whether the product is published and available for purchase currency*: GumroadCurrency ## Currency code for the product price (e.g., "USD") covers*: seq[GumroadProductCover] ## List of cover images for the product main_cover_id*: Option[string] ## ID of the main cover image for the product bundle_products*: seq[GumroadProductBundleProduct] ## List of products included in a bundle (if the product is a bundle)
GumroadProductBundleProduct = object product_id*: string ## External ID of the included product variant_id*: Option[string] ## External ID of the selected variant, if any
GumroadProductCover = object id*: string ## Unique identifier for the cover url*: string ## Display URL (retina variant for non-GIF images; original URL for GIFs, videos, and oEmbed covers) original_url*: string ## URL of the original uploaded asset thumbnail*: Option[string] ## Thumbnail URL for oEmbed covers; null otherwise filetype*: Option[string] ## File extension; null when no file is attached width*: int ## Display width in pixels height*: int ## Display height in pixels native_width*: int ## Intrinsic width of the source asset in pixels native_height*: int ## Intrinsic height of the source asset in pixels
GumroadProductCustomField = object name*: string required*: string variant*: Option[string]
GumroadProductNew = object case native_type*: GumroadProductType ## Type of the product of productMembership: subscription_duration*: Option[GumroadSubscriptionDuration] ## Duration of the subscription if the product is a subscription else: nil name*: string ## Name of the product description*: Option[HTMLContent] ## Optional, HTML-formatted description of the product price*: int64 ## Price of the product in cents (e.g., 1000 for $10.00) price_currency_type*: GumroadCurrency ## Currency code for the product price (e.g., "USD") customizable_price*: Option[bool] ## Whether the product has a customizable price (Pay-what-you-want) suggested_price_cents*: Option[int64] ## Suggested price in cents for pay-what-you-want products max_purchase_count*: Option[int] ## Maximum number of purchases allowed for the product taxonomy_id*: Option[string] ## Optional taxonomy ID to categorize the product tags*: Option[seq[string]] ## Optional list of tags to associate with the product custom_summary*: Option[string] ## Optional custom summary text for the product rich_content*: Option[seq[ProseMirrorDocument]] ## Optional rich content sections for the product description ## Each section is a ProseMirror document with its own title and description, allowing ## for more complex formatting than a single HTML string.
GumroadProductType = enum productDigital = "digital", productCourse = "course", productEbook = "ebook", productMembership = "membership", productBundle = "bundle", productCoffee = "coffee", productCall = "call", productCommission = "commission"
GumroadSubscriptionDuration = enum durationMonthly = "monthly", durationQuarterly = "quarterly", durationBiannually = "biannually", durationAnnually = "annually", durationEveryTwoYears = "every_two_years"
HTMLContent = string
ProseMirrorDocument = object
Procs
proc deleteOfferCode(client: GumroadClient; productId, offerCodeId: string): Future[ GumroadApiResponseDeleteOfferCode] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Permanently deletes an offer code from a product.
proc deleteProductCover(client: GumroadClient; productId, coverId: string): Future[ GumroadApiResponseProductsCovers] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Deletes a cover from a product.
proc deleteProductCustomField(client: GumroadClient; productId, fieldName: string): Future[ GumroadApiResponseDeleteProductCustomField] {....stackTrace: false, raises: [ Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Permanently deletes a custom field from a product.
proc getOfferCode(client: GumroadClient; productId, offerCodeId: string): Future[ GumroadApiResponseOfferCode] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Retrieves the details of a specific offer code.
proc getOfferCodes(client: GumroadClient; productId: string): Future[ GumroadApiResponseOfferCodes] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Retrieves all offer codes for a product.
proc getProduct(client: GumroadClient; productId: string): Future[GumroadProduct] {. ...stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Retrieves the details of a specific product by its ID.
proc getProductCustomFields(client: GumroadClient; productId: string): Future[ GumroadApiResponseProductsCustomFields] {....stackTrace: false, raises: [ Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Retrieves all custom fields for a product.
proc getProducts(client: GumroadClient): Future[GumroadApiResponseProducts] {. ...stackTrace: false, raises: [Exception, ValueError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError, GumroadClientError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Retrieves a list of products for the authenticated user.
proc isEmpty(res: GumroadApiResponseProducts): bool {....raises: [], tags: [], forbids: [].}
- Checks if the API response contains an empty product.
proc len(res: GumroadApiResponseProducts): int {....raises: [], tags: [], forbids: [].}
- Returns the number of products in the API response.
proc postOfferCode(client: GumroadClient; productId, name: string; amountOff: int; offerType: Option[string] = none(string); maxPurchaseCount: Option[int] = none(int); universal: Option[bool] = none(bool)): Future[ GumroadApiResponseOfferCode] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Creates a new offer code for a product.
proc postProduct(client: GumroadClient; product: GumroadProductNew): Future[ GumroadProduct] {....stackTrace: false, raises: [Exception, ValueError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError, GumroadClientError], tags: [ RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Creates a new product with the specified type.
proc postProductCover(client: GumroadClient; productId, url: string): Future[ GumroadApiResponseProductsCovers] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Adds a cover to a product from a publicly accessible URL.
proc postProductCustomField(client: GumroadClient; productId, name: string; required: bool; variant: Option[string] = none(string)): Future[ GumroadApiResponseProductsCustomField] {....stackTrace: false, raises: [ Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Creates a custom field for a product.
proc putOfferCode(client: GumroadClient; productId, offerCodeId: string; maxPurchaseCount: Option[int]): Future[ GumroadApiResponseOfferCode] {....stackTrace: false, raises: [Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Edits an existing offer code for a product.
proc putProductCustomField(client: GumroadClient; productId, fieldName: string; required: bool; variant, name: Option[string] = none(string)): Future[ GumroadApiResponseProductsCustomField] {....stackTrace: false, raises: [ Exception, ValueError, GumroadClientError, KeyError, HttpRequestError, LibraryError, SslError, OSError, IOError, ProtocolError, JsonParsingError, OpenParserJsonError], tags: [RootEffect, ReadIOEffect, TimeEffect, WriteIOEffect], forbids: [].}
- Updates an existing custom field.