{"id":14986680,"url":"https://github.com/mortengregersen/bagbutik","last_synced_at":"2026-02-24T13:04:22.199Z","repository":{"id":39685357,"uuid":"334501474","full_name":"MortenGregersen/Bagbutik","owner":"MortenGregersen","description":"Generated Swift code for the App Store Connect API based on the official OpenAPI spec.","archived":false,"fork":false,"pushed_at":"2026-02-06T22:57:16.000Z","size":8905,"stargazers_count":182,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-07T09:13:21.976Z","etag":null,"topics":["appstoreconnect","appstoreconnectapi","openapi","openapi-spec","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MortenGregersen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["mortengregersen"],"ko_fi":"mortengregersen","buy_me_a_coffee":"mortengregersen"}},"created_at":"2021-01-30T20:08:32.000Z","updated_at":"2026-02-06T22:44:25.000Z","dependencies_parsed_at":"2023-02-14T17:15:24.075Z","dependency_job_id":"110e6b62-d7ff-41e7-99d7-03c7bfb1cfc3","html_url":"https://github.com/MortenGregersen/Bagbutik","commit_stats":{"total_commits":123,"total_committers":4,"mean_commits":30.75,"dds":0.04878048780487809,"last_synced_commit":"cfb24a41559f25231f21b97eeef1d7606e7466b4"},"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"purl":"pkg:github/MortenGregersen/Bagbutik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortenGregersen%2FBagbutik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortenGregersen%2FBagbutik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortenGregersen%2FBagbutik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortenGregersen%2FBagbutik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MortenGregersen","download_url":"https://codeload.github.com/MortenGregersen/Bagbutik/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortenGregersen%2FBagbutik/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29550800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appstoreconnect","appstoreconnectapi","openapi","openapi-spec","swift"],"created_at":"2024-09-24T14:13:19.907Z","updated_at":"2026-02-17T17:00:49.891Z","avatar_url":"https://github.com/MortenGregersen.png","language":"Swift","funding_links":["https://github.com/sponsors/mortengregersen","https://ko-fi.com/mortengregersen","https://buymeacoffee.com/mortengregersen"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cbr /\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/MortenGregersen/Bagbutik/main/Assets/Bagbutik-logo.png\" max-width=\"90%\" alt=\"Bagbutik\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cb\u003eGenerated Swift code for the \u003ca href=\"https://developer.apple.com/documentation/appstoreconnectapi\"\u003eApp Store Connect API\u003c/a\u003e based on the official \u003ca href=\"https://en.wikipedia.org/wiki/OpenAPI_Specification\"\u003eOpenAPI spec\u003c/a\u003e.\u003c/b\u003e\n    \u003cbr /\u003e\u003cbr /\u003e\n    \u003ca href=\"https://swiftpackageindex.com/MortenGregersen/Bagbutik\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FMortenGregersen%2FBagbutik%2Fbadge%3Ftype%3Dswift-versions\" alt=\"Swift versions\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://swiftpackageindex.com/MortenGregersen/Bagbutik\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FMortenGregersen%2FBagbutik%2Fbadge%3Ftype%3Dplatforms\" alt=\"Platforms\" /\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/MortenGregersen/Bagbutik/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/MortenGregersen/Bagbutik/workflows/CI/badge.svg\" alt=\"CI\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://bagbutik.dev\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/MortenGregersen/Bagbutik/gh-pages/badge.svg\" alt=\"Documentation\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/MortenGregersen/Bagbutik\"\u003e\u003cimg src=\"https://codecov.io/gh/MortenGregersen/Bagbutik/branch/main/graph/badge.svg?token=oJZWL49t0G\"/\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://x.com/mortengregersen\"\u003e\u003cimg src=\"https://img.shields.io/badge/%40mortengregersen-black?logo=x\" alt=\"X (Twitter)\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://mastodon.social/@mortengregersen\"\u003e\u003cimg src=\"https://img.shields.io/badge/%40mortengregersen-6364FF?logo=mastodon\u0026logoColor=white\" alt=\"Mastodon\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What is Bagbutik?\n\n**Bag·bu·tik** (noun) **[/ˈb̥a̝w-ˌb̥u-tiːk/](https://ipa-reader.com/?text=ˈb̥a̝w-ˌb̥u-ti%CB%90k\u0026voice=Mads)** - _(Danish) A room behind a store_\n\nBagbutik is two things, a command line tool for generating Swift code, and a library with the generated code for the App Store Connect API. The command line tool decodes the official [OpenAPI spec](https://en.wikipedia.org/wiki/OpenAPI_Specification) for Apple's [App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi).\n\nWhile generating the code, the command line tool also downloads the official documentation from [Apple's Documentation site for the App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi) and applies it to the generated code, so you can get documentation right in Xcode.\n\nThe command line tool is only needed, when Apple publishes a new version of the spec. A [GitHub Action](https://github.com/MortenGregersen/Bagbutik/actions/workflows/check-for-new-spec.yml) automatically checks for new versions of the spec and creates a pull request with the changes.\n\n## How to use Bagbutik\n\nBagbutik uses JSON Web Tokens (JWT) for authorization. You obtain the required keys from your organization's App Store Connect account.\n\n\u003e See [Creating API Keys for App Store Connect API](https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api) for how to create your keys.\n\nHere is a basic example for fetching all bundle IDs for iOS apps including related profiles sorted by seed ID and the bundle ID itself descending.\n\n```swift\nimport Bagbutik_Core\nimport Bagbutik_Provisioning\n\nlet service = BagbutikService(jwt: try .init(\n    keyId: \"P9M252746H\",\n    issuerId: \"82067982-6b3b-4a48-be4f-5b10b373c5f2\",\n    privateKey: \"\"\"\n    -----BEGIN PRIVATE KEY-----\n    MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2\n    OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r\n    1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G\n    -----END PRIVATE KEY-----\n    \"\"\"\n))\nlet response = try await service.request(\n    .listBundleIdsV1(filters: [.platform([.iOS])],\n                     includes: [.profiles],\n                     sorts: [.seedIdDescending, .idDescending])\n)\nprint(response)\n```\n\n## How to get Bagbutik into a project\n\nBagbutik supports [Swift Package Manager](https://www.swift.org/package-manager) and the internal libraries used to generate the code is also managed by it.\n\nThe library of generated code actually consists of multiple libraries, to let the consumer only depend on the endpoints needed.\nSo to get Bagbutik, you need to decide which functionality you need.\n\nIn your `Package.swift` add Bagbutik as a dependency:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/MortenGregersen/Bagbutik\", from: \"18.0.0\"),\n```\n\nThen in `targets` add the libraries needed by your target:\n\n```swift\ntargets: [\n    .target(\n        name: \"Awesome\",\n        dependencies: [\n            .product(name: \"Bagbutik-AppStore\", package: \"Bagbutik\"),\n            .product(name: \"Bagbutik-TestFlight\", package: \"Bagbutik\"),\n```\n\nIf all libraries are needed, the umbrella library `Bagbutik` can be used:\n\n```swift\ntargets: [\n    .target(\n        name: \"Awesome\",\n        dependencies: [\n            .product(name: \"Bagbutik\", package: \"Bagbutik\"),\n```\n\n\u003e Remember to replace the hyphen with an underscore when importing the libraries.\n\u003e\n\u003e When importing `Bagbutik-TestFlight` write: \n```swift\nimport Bagbutik_TestFlight\n```\n\n### `Bagbutik-Core`\n\nThe core library is `Bagbutik-Core` which contains the `BagbutikService`, the `JWT`, protocols and the general generated types like `ErrorResponse` and `PagingInformation`.\n\nAll other libraries depend on `Bagbutik-Core`. This is the only library which is documented on [Bagbutik.dev](https://bagbutik.dev), as the other libraries only contain types which are already [documented by Apple](https://developer.apple.com/documentation/appstoreconnectapi).\n\n### `Bagbutik-Models`\n\nBecause the models from the API are used from many different endpoints, they are all located in `Bagbutik-Models`. All libraries with endpoints depend on `Bagbutik-Models`.\n\n### `Bagbutik-\u003cAPI-Area\u003e`\n\nThe endpoints of all the areas of the App Store Connect API are located in different libraries with a describing name.\n\nRight now there are 9 libraries with endpoints:\n\n* `Bagbutik-AppStore`: Manage all [aspects of your app, App Clips, in-app purchases, and customer reviews in the App Store](https://developer.apple.com/documentation/appstoreconnectapi/app_store).\n* `Bagbutik-GameCenter`: Manage [Game Center data and configurations for your apps](https://developer.apple.com/documentation/appstoreconnectapi/game_center).\n* `Bagbutik-Marketplaces`: Manage [keys, packages, and search for the marketplace distribution of your app](https://developer.apple.com/documentation/appstoreconnectapi/alternative_distribution).\n* `Bagbutik-Provisioning`: Manage the [bundle IDs](https://developer.apple.com/documentation/appstoreconnectapi/bundle_ids), [certificates](https://developer.apple.com/documentation/appstoreconnectapi/certificates), [devices](https://developer.apple.com/documentation/appstoreconnectapi/devices) and [provisioning profiles](https://developer.apple.com/documentation/appstoreconnectapi/profiles) for your app.\n* `Bagbutik-Reporting`: Download your [sales and financial reports](https://developer.apple.com/documentation/appstoreconnectapi/sales_and_finance_reports) and [get power and performance metrics, logs, and signatures](https://developer.apple.com/documentation/appstoreconnectapi/power_and_performance_metrics_and_logs). \n* `Bagbutik-TestFlight`: Manage your [beta testing program, including beta testers and groups, apps, App Clips, and builds](https://developer.apple.com/documentation/appstoreconnectapi/prerelease_versions_and_beta_testers).\n* `Bagbutik-Users`: Manage [users](https://developer.apple.com/documentation/appstoreconnectapi/users) and [email invitations to join](https://developer.apple.com/documentation/appstoreconnectapi/user_invitations) your App Store Connect team.\n* `Bagbutik-Webhooks`: Manage [notifications](https://developer.apple.com/documentation/appstoreconnectapi/webhook-notifications) from App Store about your apps and their statuses.\n* `Bagbutik-XcodeCloud`: Automate [reading Xcode Cloud data, managing workflows, and starting builds](https://developer.apple.com/documentation/appstoreconnectapi/xcode_cloud_workflows_and_builds).\n\n## Manual patches applied to OpenAPI Spec\n\nThe OpenAPI Spec provided by Apple do not always align with the data received from the API. Whenever such mismatches are identified, feedback is submitted to Apple and a patch is applied. Whenever an issue is resolved, the patch is removed again.\n\n### Currently open feedback and applied patches\n\n#### **FB8977648**: The \"BundleIdPlatform\" schema is missing \"UNIVERSAL\" and \"SERVICES\"\n\n* Submitted: January 21st 2021.\n* Updated: October 14th 2022 - the type \"SERVICES\" is also missing.\n* Partly resolved: November 12th 2024 (Spec version 3.7) - \"UNIVERSAL\" added.\n\n**Title:** App Store Connect API is missing the \"UNIVERSAL\" type for the BundleIdPlatform schema\n\n##### Description\n\nIn the OpenAPI spec for the App Store Connect API the \"BundleIdPlatform\" schema is said to only be \"IOS\" or \"MAC_OS\". This is not right as universal apps (iOS and macOS) has a \"UNIVERSAL\" platform.\n\n#### **FB12292035**: ErrorResponse.Errors has required optional \"detail\" and no \"associatedErrors\" in \"meta\"\n\n* Submitted: June 9th 2023.\n\nIn Apple's OpenAPI spec the `detail` property on `ErrorResponse.Errors` is marked as `required`.\nOn 12/1/23 some errors (with status code 409) has been observed, with no `detail`.\n\nIn Apple's OpenAPI spec and documentation the `associatedErrors` is not mentioned in `meta` property (last checked 12/1/23).\nBut it is observed when creating a `ReviewSubmissionItem` with an `AppStoreVersion` fails.\n\n#### **FB16908301**: App Store Connect API Spec is missing list of possible \"PurchaseRequirement\" on AppEvent\n\n* Submitted: March 17th, 2025.\n\nIn the OpenAPI spec (and documentation) for the App Store Connect API the `purchaseRequirement` property on the “AppEvent” schema is a string. As a consumer of the API, we don’t know the possible values of this could be. After doing some research, it looks like there are two options `NO_COST_ASSOCIATED` and `IN_APP_PURCHASE`.\n\n### Closed feedback (removed patches)\n\n* **FB9963088**: The xcodeMetrics schema has no properties or attributes in the OpenAPI spec\n  * Submitted: March 21st 2022.\n  * Resolved: July 12th 2022 (Spec version 2.0).\n\n* **FB10029609**: Required 'links' property missing on included BuildBundle\n  * Submitted: May 27th 2022.\n  * Resolved: At least since May 23rd 2023.\n\n* **FB13071298**: App Store Connect API Spec is missing \"VISION_OS\" type for the Platform schema\n  * Submitted: August 28th 2023.\n  * Resolved: January 25th 2024 (Spec version 3.2).\n\n* **FB13539766**: App Store Connect API Spec is missing \"APP_APPLE_VISION_PRO\" type for the Screenshot Display Type schema\n  * Submitted: January 14th 2024.\n  * Resolved: January 25th 2024 (Spec version 3.2).\n  \n* **FB13540097**: Almost all of the schemas ending in “WithoutIncludesResponse” has wrong \"data\" type\n  * Submitted: January 14th 2024.\n  * Resolved: July 11th 2024 (Spec version 3.5).\n\n* **FB13701181**: App Store Connect API Spec is missing \"DEVELOPER_ID_APPLICATION_G2\" type for the Certificate Type schema\n  * Submitted: March 28th 2024.\n  * Resolved: November 12th 2024 (Spec version 3.7).\n\n* **FB15681740**: App Store Connect API Spec is missing \"APPLE_VISION_PRO\" type for the Device class type schema\n  * Submitted: November 4th 2024.\n  * Resolved: June 10th 2025 (Spec version 4.0).\n\n* **FB17874677**: The \"AgeRatingDeclaration.Attributes\" properties is missing the values \"INFREQUENT_OR_MILD\" and \"FREQUENT_OR_INTENSE\"\n  * Submitted: June 10th 2025.\n  * Resolved: October 9th 2025 (Spec version 4.1).\n\n* **FB17925890**: The \"ageRatingOverride\" property of \"AgeRatingDeclaration.Attributes\" is missing\n  * Submitted: June 11th 2025.\n  * Resolved: October 9th 2025 (Spec version 4.1).\n\n* **FB17932433**: The \"totalNumberOfCodes\" property of \"SubscriptionOfferCode.Attributes\" is missing\n  * Submitted: June 11th 2025.\n  * Resolved: October 9th 2025 (Spec version 4.1).\n  \n* **FB16699896**: App Store Connect API is missing \"XKS\" (Kosovo) for the TerritoryCode enum\n  * Submitted: March 3rd, 2025.\n  * Resolved: December 16th, 2025 (Spec version 4.2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortengregersen%2Fbagbutik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortengregersen%2Fbagbutik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortengregersen%2Fbagbutik/lists"}