appstore

package module
v0.0.0-...-9e4d1e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 20 Imported by: 0

README

AppStore Connect API SDK GO (Unofficial)

Build Status Codecov Go Report Card Release License Mentioned in Awesome Go

Description

Unofficial Golang SDK for AppStore Connect API

API documentation

https://developer.apple.com/documentation/appstoreconnectapi/download_finance_reports

https://developer.apple.com/documentation/appstoreconnectapi/download_sales_and_trends_reports

Download

go get -u github.com/kachit/appstore-sdk-go

Usage

package main

import (
    "fmt"
    "time"
    appstore_sdk "github.com/kachit/appstore-sdk-go/v1"
)

func main(){
    cfg := appstore_sdk.NewConfig("Issuer Id", "Key Id", "Vendor No", "path/to/your/private.key")
    client := appstore_sdk.NewClientFromConfig(cfg, nil)
    
    //Build auth token
    err := client.Init()
    if err != nil {
        fmt.Printf("Wrong API client init " + err.Error())
        panic(err)
    }
}
Get sales reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter := appstore_sdk.NewSalesReportsFilter()
filter.SubTypeSummary().Version10().Daily().SetReportDate(date)

result, resp, err := client.SalesReports().GetSalesReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].Provider)
fmt.Println(result.Data[0].ProviderCountry)
fmt.Println(result.Data[0].SKU)
fmt.Println(result.Data[0].Developer)
fmt.Println(result.Data[0].Title)
fmt.Println(result.Data[0].Version)
fmt.Println(result.Data[0].ProductTypeIdentifier)
fmt.Println(result.Data[0].Units.Value())
fmt.Println(result.Data[0].AppleIdentifier.Value())
fmt.Println(result.Data[0].DeveloperProceeds.Value())
fmt.Println(result.Data[0].BeginDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].EndDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].CustomerCurrency)
fmt.Println(result.Data[0].CountryCode)
fmt.Println(result.Data[0].CurrencyOfProceeds)
fmt.Println(result.Data[0].AppleIdentifier.Value())
fmt.Println(result.Data[0].CustomerPrice.Value())
fmt.Println(result.Data[0].PromoCode)
fmt.Println(result.Data[0].ParentIdentifier)
fmt.Println(result.Data[0].Subscription)
fmt.Println(result.Data[0].Period)
fmt.Println(result.Data[0].Category)
fmt.Println(result.Data[0].CMB)
fmt.Println(result.Data[0].Device)
fmt.Println(result.Data[0].SupportedPlatforms)
fmt.Println(result.Data[0].ProceedsReason)
fmt.Println(result.Data[0].PreservedPricing)
fmt.Println(result.Data[0].Client)
fmt.Println(result.Data[0].OrderType)
Get subscriptions reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter := appstore_sdk.NewSubscriptionsReportsFilter()
filter.SubTypeSummary().Version12().Daily().SetReportDate(date)

result, resp, err := client.SalesReports().GetSubscriptionsReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].AppName)
fmt.Println(result.Data[0].AppAppleID.Value())
fmt.Println(result.Data[0].SubscriptionName)
fmt.Println(result.Data[0].SubscriptionAppleID.Value())
fmt.Println(result.Data[0].SubscriptionGroupID.Value())
fmt.Println(result.Data[0].StandardSubscriptionDuration)
fmt.Println(result.Data[0].PromotionalOfferName)
fmt.Println(result.Data[0].PromotionalOfferID)
fmt.Println(result.Data[0].CustomerPrice.Value())
fmt.Println(result.Data[0].CustomerCurrency)
fmt.Println(result.Data[0].DeveloperProceeds.Value())
fmt.Println(result.Data[0].ProceedsCurrency)
fmt.Println(result.Data[0].PreservedPricing)
fmt.Println(result.Data[0].ProceedsReason)
fmt.Println(result.Data[0].Client)
fmt.Println(result.Data[0].Device)
fmt.Println(result.Data[0].State)
fmt.Println(result.Data[0].Country)
fmt.Println(result.Data[0].ActiveStandardPriceSubscriptions.Value())
fmt.Println(result.Data[0].ActiveFreeTrialIntroductoryOfferSubscriptions.Value())
fmt.Println(result.Data[0].ActivePayUpFrontIntroductoryOfferSubscriptions.Value())
fmt.Println(result.Data[0].ActivePayAsYouGoIntroductoryOfferSubscriptions.Value())
fmt.Println(result.Data[0].FreeTrialPromotionalOfferSubscriptions.Value())
fmt.Println(result.Data[0].PayUpFrontPromotionalOfferSubscriptions.Value())
fmt.Println(result.Data[0].PayAsYouGoPromotionalOfferSubscriptions.Value())
fmt.Println(result.Data[0].MarketingOptIns.Value())
fmt.Println(result.Data[0].BillingRetry.Value())
fmt.Println(result.Data[0].GracePeriod.Value())
Get subscriptions events reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter := appstore_sdk.NewSubscriptionsEventsReportsFilter()
filter.SubTypeSummary().Version12().Daily().SetReportDate(date)

result, resp, err := client.SalesReports().GetSubscriptionsEventsReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].EventDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].Event)
fmt.Println(result.Data[0].AppName)
fmt.Println(result.Data[0].AppAppleID.Value())
fmt.Println(result.Data[0].SubscriptionName)
fmt.Println(result.Data[0].SubscriptionAppleID.Value())
fmt.Println(result.Data[0].SubscriptionGroupID.Value())
fmt.Println(result.Data[0].StandardSubscriptionDuration)
fmt.Println(result.Data[0].PromotionalOfferName)
fmt.Println(result.Data[0].PromotionalOfferID)
fmt.Println(result.Data[0].SubscriptionOfferType)
fmt.Println(result.Data[0].SubscriptionOfferDuration)
fmt.Println(result.Data[0].MarketingOptIn)
fmt.Println(result.Data[0].MarketingOptInDuration)
fmt.Println(result.Data[0].PreservedPricing)
fmt.Println(result.Data[0].ProceedsReason)
fmt.Println(result.Data[0].ConsecutivePaidPeriods.Value())
fmt.Println(result.Data[0].OriginalStartDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].Client)
fmt.Println(result.Data[0].Device)
fmt.Println(result.Data[0].State)
fmt.Println(result.Data[0].Country)
fmt.Println(result.Data[0].PreviousSubscriptionName)
fmt.Println(result.Data[0].PreviousSubscriptionAppleID.Value())
fmt.Println(result.Data[0].DaysBeforeCanceling.Value())
fmt.Println(result.Data[0].CancellationReason)
fmt.Println(result.Data[0].DaysCanceled.Value())
fmt.Println(result.Data[0].Quantity.Value())
Get subscribers reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter := appstore_sdk.NewSubscribersReportsFilter()
filter.SubTypeDetailed().Version12().Daily().SetReportDate(date)

result, resp, err := client.SalesReports().GetSubscribersReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].EventDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].AppName)
fmt.Println(result.Data[0].AppAppleID.Value())
fmt.Println(result.Data[0].SubscriptionName)
fmt.Println(result.Data[0].SubscriptionAppleID.Value())
fmt.Println(result.Data[0].SubscriptionGroupID.Value())
fmt.Println(result.Data[0].StandardSubscriptionDuration)
fmt.Println(result.Data[0].PromotionalOfferName)
fmt.Println(result.Data[0].PromotionalOfferID)
fmt.Println(result.Data[0].SubscriptionOfferType)
fmt.Println(result.Data[0].SubscriptionOfferDuration)
fmt.Println(result.Data[0].MarketingOptInDuration)
fmt.Println(result.Data[0].CustomerPrice.Value())
fmt.Println(result.Data[0].CustomerCurrency)
fmt.Println(result.Data[0].DeveloperProceeds.Value())
fmt.Println(result.Data[0].ProceedsCurrency)
fmt.Println(result.Data[0].PreservedPricing)
fmt.Println(result.Data[0].ProceedsReason)
fmt.Println(result.Data[0].Client)
fmt.Println(result.Data[0].Country)
fmt.Println(result.Data[0].SubscriberID.Value())
fmt.Println(result.Data[0].SubscriberIDReset)
fmt.Println(result.Data[0].Refund)
fmt.Println(result.Data[0].PurchaseDate.Value())
fmt.Println(result.Data[0].Units.Value())
Get preorders reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter := appstore_sdk.NewPreOrdersReportsFilter()
filter.SubTypeSummary().Version10().Daily().SetReportDate(date)

result, resp, err := client.SalesReports().GetPreOrdersReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].Provider)
fmt.Println(result.Data[0].ProviderCountry)
fmt.Println(result.Data[0].Title)
fmt.Println(result.Data[0].SKU)
fmt.Println(result.Data[0].Developer)
fmt.Println(result.Data[0].PreOrderStartDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].PreOrderEndDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].Ordered.Value())
fmt.Println(result.Data[0].Canceled.Value())
fmt.Println(result.Data[0].CumulativeOrdered.Value())
fmt.Println(result.Data[0].CumulativeCanceled.Value())
fmt.Println(result.Data[0].StartDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].EndDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].CountryCode)
fmt.Println(result.Data[0].AppleIdentifier.Value())
fmt.Println(result.Data[0].Category)
fmt.Println(result.Data[0].Device)
fmt.Println(result.Data[0].SupportedPlatforms)
fmt.Println(result.Data[0].Client)
fmt.Println(result.Data[0].ProviderCountry)
Get financial reports
ctx := context.Background()
date, _ := time.Parse("2006-01-02", "2020-05-05")
filter :=  appstore_sdk.NewFinancesReportsFilter()
filter.SetReportDate(date).SetRegionCode("US")

result, resp, err := client.FinancesReports().GetFinancialReports(ctx, filter)
if err != nil {
    fmt.Printf("Wrong API request " + err.Error())
    panic(err)
}

//Dump raw response
fmt.Println(resp)

//Dump result
fmt.Println(result.Data[0].StartDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].EndDate.Value().Format(CustomDateFormatDefault))
fmt.Println(result.Data[0].UPC)
fmt.Println(result.Data[0].ISRCIsbn)
fmt.Println(result.Data[0].VendorIdentifier)
fmt.Println(result.Data[0].Quantity.Value())
fmt.Println(result.Data[0].PartnerShare.Value())
fmt.Println(result.Data[0].ExtendedPartnerShare.Value())
fmt.Println(result.Data[0].PartnerShareCurrency)
fmt.Println(result.Data[0].SaleOrReturn)
fmt.Println(result.Data[0].AppleIdentifier.Value())
fmt.Println(result.Data[0].ArtistShowDeveloperAuthor)
fmt.Println(result.Data[0].Title)
fmt.Println(result.Data[0].LabelStudioNetworkDeveloperPublisher)
fmt.Println(result.Data[0].Grid)
fmt.Println(result.Data[0].ProductTypeIdentifier)
fmt.Println(result.Data[0].ISANOtherIdentifier)
fmt.Println(result.Data[0].CountryOfSale)
fmt.Println(result.Data[0].PreOrderFlag)
fmt.Println(result.Data[0].PromoCode)
fmt.Println(result.Data[0].CustomerPrice.Value())
fmt.Println(result.Data[0].CustomerCurrency)

Documentation

Index

Constants

View Source
const AppStoreConnectAPIAudience = "appstoreconnect-v1"

AppStoreConnectAPIAudience const

View Source
const AppStoreConnectAPIHttpIdleConnectionTimeout = 30 * time.Second

AppStoreConnectAPIHttpIdleConnectionTimeout const

View Source
const AppStoreConnectAPIHttpMaxIdleConnection = 10

AppStoreConnectAPIHttpMaxIdleConnection const

View Source
const AppStoreConnectAPIProductionUri = "https://api.appstoreconnect.apple.com"

AppStoreConnectAPIProductionUri const

View Source
const AppStoreConnectAPITokenTtl = 600

AppStoreConnectAPITokenTtl const

View Source
const CustomDateFormatDefault = "2006-01-02"

CustomDateFormatDefault const

View Source
const CustomDateFormatSlash = "01/02/2006"

CustomDateFormatSlash const

View Source
const CustomTimestampFormatDefault = "2006-01-02 15:04:05"

CustomTimestampFormatDefault const

View Source
const ResponseContentTypeGzip = "application/a-gzip"
View Source
const ResponseContentTypeJson = "application/json; charset=utf-8"

Variables

This section is empty.

Functions

func NewCSVReader

func NewCSVReader(in io.Reader) gocsv.CSVReader

NewCSVReader Create new CSV reader for unmarshaler

func NewDefaultHttpClient

func NewDefaultHttpClient() *http.Client

NewDefaultHttpClient create new http client

func NewLineSkipDecoder

func NewLineSkipDecoder(r io.Reader) (gocsv.SimpleDecoder, error)

NewLineSkipDecoder

func UnmarshalCSV

func UnmarshalCSV(in []byte, out interface{}) error

UnmarshalCSV unmarshal raw data to structures

func UnmarshalCSVWithFilterLines

func UnmarshalCSVWithFilterLines(in []byte, out interface{}) error

UnmarshalCSVWithFilterLines unmarshal raw data to structures with filter lines

Types

type AuthToken

type AuthToken struct {
	Token     string
	ExpiresAt int64
}

AuthToken auth token structure

func (*AuthToken) IsNotExpired

func (t *AuthToken) IsNotExpired() bool

IsNotExpired Check token is not expired

func (*AuthToken) IsValid

func (t *AuthToken) IsValid() bool

IsValid Check token is valid

type Client

type Client struct {
	Cfg *Config
	// contains filtered or unexported fields
}

Client common

func NewClientFromConfig

func NewClientFromConfig(cfg *Config, cl *http.Client) *Client

NewClientFromConfig Create new client from config

func (*Client) FinancesReports

func (cl *Client) FinancesReports() *FinancesReportsResource

FinancesReports resource

func (*Client) Init

func (cl *Client) Init() error

Init of client

func (*Client) SalesReports

func (cl *Client) SalesReports() *SalesReportsResource

SalesReports resource

type Config

type Config struct {
	Uri        string
	VendorNo   string
	IssuerId   string
	KeyId      string
	PrivateKey string
	Token      *TokenConfig
}

Config structure

func NewConfig

func NewConfig(issuerId string, keyId string, vendorNo string, pkPathOrContent string) *Config

NewConfig Create new config from credentials

type CustomBoolean

type CustomBoolean struct {
	Boolean bool
}

CustomBoolean Custom boolean type

func (*CustomBoolean) MarshalJSON

func (cb *CustomBoolean) MarshalJSON() ([]byte, error)

MarshalJSON Custom boolean MarshalJSON

func (*CustomBoolean) UnmarshalCSV

func (cb *CustomBoolean) UnmarshalCSV(csv string) error

UnmarshalCSV Custom boolean UnmarshalCSV

func (*CustomBoolean) Value

func (cb *CustomBoolean) Value() bool

Value Custom boolean get value

type CustomDate

type CustomDate struct {
	Date time.Time
}

CustomDate Custom date type

func (*CustomDate) MarshalJSON

func (ct *CustomDate) MarshalJSON() ([]byte, error)

MarshalJSON Custom date MarshalJSON

func (*CustomDate) UnmarshalCSV

func (ct *CustomDate) UnmarshalCSV(csv string) error

UnmarshalCSV Custom date UnmarshalCSV

func (*CustomDate) Value

func (ct *CustomDate) Value() time.Time

Value Custom date get value

type CustomFloat64

type CustomFloat64 struct {
	Float64 float64
}

CustomFloat64 custom float type

func (*CustomFloat64) MarshalJSON

func (cf *CustomFloat64) MarshalJSON() ([]byte, error)

MarshalJSON Custom float MarshalJSON

func (*CustomFloat64) UnmarshalCSV

func (cf *CustomFloat64) UnmarshalCSV(csv string) error

UnmarshalCSV Custom float UnmarshalCSV

func (*CustomFloat64) Value

func (cf *CustomFloat64) Value() float64

Value Custom float get value

type CustomInteger

type CustomInteger struct {
	Integer int
}

CustomInteger custom integer type

func (*CustomInteger) MarshalJSON

func (ci *CustomInteger) MarshalJSON() ([]byte, error)

MarshalJSON Custom integer MarshalJSON

func (*CustomInteger) UnmarshalCSV

func (ci *CustomInteger) UnmarshalCSV(csv string) error

UnmarshalCSV Custom integer UnmarshalCSV

func (*CustomInteger) Value

func (ci *CustomInteger) Value() int

Value Custom integer get value

type CustomTimestamp

type CustomTimestamp struct {
	Timestamp time.Time
}

CustomTimestamp custom timestamp type

func (*CustomTimestamp) MarshalJSON

func (ct *CustomTimestamp) MarshalJSON() ([]byte, error)

MarshalJSON Custom timestamp MarshalJSON

func (*CustomTimestamp) UnmarshalCSV

func (ct *CustomTimestamp) UnmarshalCSV(csv string) error

UnmarshalCSV Custom timestamp UnmarshalCSV

func (*CustomTimestamp) Value

func (ct *CustomTimestamp) Value() time.Time

Value Custom timestamp get value

type Error

type Error struct {
	Id     string       `json:"id"`     //(Required) A machine-readable code indicating the type of error. The code is a hierarchical value with levels of specificity separated by the '.' character. This value is parseable for programmatic error handling in code.
	Status string       `json:"status"` //(Required) The HTTP status code of the error. This status code usually matches the response's status code; however, if the request produces multiple errors, these two codes may differ.
	Code   string       `json:"code"`   //The unique ID of a specific instance of an error, request, and response. Use this ID when providing feedback to or debugging issues with Apple.
	Title  string       `json:"title"`  //(Required) A summary of the error. Do not use this field for programmatic error handling.
	Detail string       `json:"detail"` //(Required) A detailed explanation of the error. Do not use this field for programmatic error handling.
	Source *ErrorSource `json:"source"` //One of two possible types of values: source.parameter, provided when a query parameter produced the error, or source.JsonPointer, provided when a problem with the entity produced the error.
}

Error The details about one error that is returned when an API request is not successful. .see https://developer.apple.com/documentation/appstoreconnectapi/errorresponse/errors

type ErrorSource

type ErrorSource struct {
	Parameter string `json:"parameter"` //The query parameter that produced the error.
	Pointer   string `json:"pointer"`   //A JSON pointer that indicates the location in the request entity where the error originates
}

ErrorSource An object that contains the query parameter that produced the error. An object that contains the JSON pointer that indicates the location of the error.

type FinancesReportType

type FinancesReportType string

FinancesReportType type

const (
	//FinancesReportTypeFinancial const
	FinancesReportTypeFinancial FinancesReportType = "FINANCIAL"
	//FinancesReportTypeFinanceDetail const
	FinancesReportTypeFinanceDetail FinancesReportType = "FINANCE_DETAIL"
)

type FinancesReportsFilter

type FinancesReportsFilter struct {
	ReportDate time.Time          //(Required) The fiscal month of the report you wish to download based on the Apple Fiscal Calendar. The fiscal month is specified in the YYYY-MM format.
	ReportType FinancesReportType //(Required) This value is always FINANCIAL. Possible values: FINANCIAL, FINANCE_DETAIL
	RegionCode string             //(Required) You can download consolidated or separate financial reports per territory. For a complete list of possible values, see Financial Report Regions and Currencies.
}

FinancesReportsFilter sales reports filter

func NewFinancesReportsFilter

func NewFinancesReportsFilter() *FinancesReportsFilter

func (*FinancesReportsFilter) IsValid

func (f *FinancesReportsFilter) IsValid() error

IsValid Validate sales report filter params

func (*FinancesReportsFilter) SetRegionCode

func (f *FinancesReportsFilter) SetRegionCode(value string) *FinancesReportsFilter

SetRegionCode Set report date

func (*FinancesReportsFilter) SetReportDate

func (f *FinancesReportsFilter) SetReportDate(value time.Time) *FinancesReportsFilter

SetReportDate Set report date

func (*FinancesReportsFilter) SetReportType

SetReportType Set report type

func (*FinancesReportsFilter) TypeFinanceDetail

func (f *FinancesReportsFilter) TypeFinanceDetail() *FinancesReportsFilter

TypeFinanceDetail Change report type to Sales

func (*FinancesReportsFilter) TypeFinancial

func (f *FinancesReportsFilter) TypeFinancial() *FinancesReportsFilter

TypeFinancial Change report type to Financial

type FinancesReportsResource

type FinancesReportsResource struct {
	*ResourceAbstract
}

FinancesReportsResource reports

func (*FinancesReportsResource) GetFinancialReports

GetFinancialReports

func (*FinancesReportsResource) GetReports

GetReports Get finances reports by filter

type FinancialReport

type FinancialReport struct {
	StartDate                            CustomDate    `csv:"Start Date" json:"start_date"`
	EndDate                              CustomDate    `csv:"End Date" json:"end_date"`
	UPC                                  string        `csv:"UPC" json:"upc"`
	ISRCIsbn                             string        `csv:"ISRC / ISBN" json:"isrc_isbn"`
	VendorIdentifier                     string        `csv:"Vendor Identifier" json:"vendor_identifier"`
	Quantity                             CustomInteger `csv:"Quantity" json:"quantity"`
	PartnerShare                         CustomFloat64 `csv:"Partner Share" json:"partner_share"`
	ExtendedPartnerShare                 CustomFloat64 `csv:"Extended Partner Share" json:"extended_partner_share"`
	PartnerShareCurrency                 string        `csv:"Partner Share Currency" json:"partner_share_currency"`
	SaleOrReturn                         string        `csv:"Sales or Return" json:"sales_or_return"`
	AppleIdentifier                      CustomInteger `csv:"Apple Identifier" json:"apple_identifier"`
	ArtistShowDeveloperAuthor            string        `csv:"Artist / Show / Developer / Author" json:"artist_show_developer_author"`
	Title                                string        `csv:"Title" json:"title"`
	LabelStudioNetworkDeveloperPublisher string        `csv:"Label / Studio / Network / Developer / Publisher" json:"label_studio_network_developer_publisher"`
	Grid                                 string        `csv:"Grid" json:"grid"`
	ProductTypeIdentifier                string        `csv:"Product Type Identifier" json:"product_type_identifier"`
	ISANOtherIdentifier                  string        `csv:"ISAN / Other Identifier" json:"isan_other_identifier"`
	CountryOfSale                        string        `csv:"Country Of Sale" json:"country_of_sale"`
	PreOrderFlag                         string        `csv:"Pre-order Flag" json:"preorder_flag"`
	PromoCode                            string        `csv:"Promo Code" json:"promo_code"`
	CustomerPrice                        CustomFloat64 `csv:"Customer Price" json:"customer_price"`
	CustomerCurrency                     string        `csv:"Customer Currency" json:"customer_currency"`
}

FinancialReport

type FinancialReportsResponse

type FinancialReportsResponse struct {
	*ResponseBody
	Data []*FinancialReport `json:"data,omitempty"`
}

FinancialReportsResponse struct

type NewsstandReportsFilter

type NewsstandReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewNewsstandReportsFilter

func NewNewsstandReportsFilter() *NewsstandReportsFilter

func (*NewsstandReportsFilter) IsValid

func (f *NewsstandReportsFilter) IsValid() error

IsValid Validate sales report filter params

type PreOrdersReport

type PreOrdersReport struct {
	Provider           string        `csv:"Provider" json:"provider"`
	ProviderCountry    string        `csv:"Provider Country" json:"provider_country"`
	SKU                string        `csv:"SKU" json:"sku"`
	Developer          string        `csv:"Developer" json:"developer"`
	Title              string        `csv:"Title" json:"title"`
	PreOrderStartDate  CustomDate    `csv:"Pre-Order Start Date" json:"preorder_start_date"`
	PreOrderEndDate    CustomDate    `csv:"Pre-Order End Date" json:"preorder_end_date"`
	Ordered            CustomFloat64 `csv:"Ordered" json:"ordered"`
	Canceled           CustomFloat64 `csv:"Canceled" json:"canceled"`
	CumulativeOrdered  CustomFloat64 `csv:"Cumulative Ordered" json:"cumulative_ordered"`
	CumulativeCanceled CustomFloat64 `csv:"Cumulative Canceled" json:"cumulative_canceled"`
	StartDate          CustomDate    `csv:"Start Date" json:"start_date"`
	EndDate            CustomDate    `csv:"End Date" json:"end_date"`
	CountryCode        string        `csv:"Country Code" json:"country_code"`
	AppleIdentifier    CustomInteger `csv:"Apple Identifier" json:"apple_identifier"`
	Device             string        `csv:"Device" json:"device"`
	SupportedPlatforms string        `csv:"Supported Platforms" json:"supported_platforms"`
	Category           string        `csv:"Category" json:"category"`
	Client             string        `csv:"Client" json:"client"`
}

PreOrdersReport Aggregated data for your apps made available for pre-order, including the number of units ordered and canceled by customers.

type PreOrdersReportsFilter

type PreOrdersReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewPreOrdersReportsFilter

func NewPreOrdersReportsFilter() *PreOrdersReportsFilter

func (*PreOrdersReportsFilter) IsValid

func (f *PreOrdersReportsFilter) IsValid() error

IsValid Validate sales report filter params

type PreOrdersReportsResponse

type PreOrdersReportsResponse struct {
	*ResponseBody
	Data []*PreOrdersReport `json:"data,omitempty"`
}

PreOrdersReportsResponse struct

type PrivateKey

type PrivateKey struct {
}

PrivateKey private key handler

func (*PrivateKey) DecodePem

func (pk *PrivateKey) DecodePem(rawBytes []byte) (*pem.Block, error)

DecodePem Decode private key pem

func (*PrivateKey) Load

func (pk *PrivateKey) Load(path string) (*ecdsa.PrivateKey, error)

Load and generate private key

func (*PrivateKey) LoadData

func (pk *PrivateKey) LoadData(pathOrContent string) ([]byte, error)

LoadData Load private key from string or file path

func (*PrivateKey) LoadFromContent

func (pk *PrivateKey) LoadFromContent(content string) ([]byte, error)

LoadFromContent Load private key from string

func (*PrivateKey) LoadFromFile

func (pk *PrivateKey) LoadFromFile(path string) ([]byte, error)

LoadFromFile Load private key from file

func (*PrivateKey) ParseP8

func (pk *PrivateKey) ParseP8(rawBytes []byte) (*ecdsa.PrivateKey, error)

ParseP8 Parse private key .p8

func (*PrivateKey) ParsePKCS8

func (pk *PrivateKey) ParsePKCS8(rawBytes []byte) (*ecdsa.PrivateKey, error)

ParsePKCS8 Parse PKCS private key .p8

type RequestBuilder

type RequestBuilder struct {
	// contains filtered or unexported fields
}

RequestBuilder handler

func (*RequestBuilder) BuildRequest

func (rb *RequestBuilder) BuildRequest(ctx context.Context, method string, path string, query map[string]interface{}, body map[string]interface{}) (req *http.Request, err error)

BuildRequest method

type ResourceAbstract

type ResourceAbstract struct {
	// contains filtered or unexported fields
}

ResourceAbstract base resource

type ResponseBody

type ResponseBody struct {

	//ErrorResult Information with error details that an API returns in the response body whenever the API request is not successful.
	// .see https://developer.apple.com/documentation/appstoreconnectapi/errorresponse
	Errors []*Error `json:"errors,omitempty"`
	// contains filtered or unexported fields
}

ResponseBody struct

func (*ResponseBody) GetError

func (r *ResponseBody) GetError() string

GetError method

func (*ResponseBody) IsSuccess

func (r *ResponseBody) IsSuccess() bool

IsSuccess method

type ResponseHandlerGzip

type ResponseHandlerGzip struct {
	FilterLines bool
}

func (*ResponseHandlerGzip) ReadBody

func (r *ResponseHandlerGzip) ReadBody(resp *http.Response) ([]byte, error)

func (*ResponseHandlerGzip) RestoreBody

func (r *ResponseHandlerGzip) RestoreBody(data []byte) (io.ReadCloser, error)

func (*ResponseHandlerGzip) UnmarshalBody

func (r *ResponseHandlerGzip) UnmarshalBody(data []byte, v interface{}) error

type ResponseHandlerInterface

type ResponseHandlerInterface interface {
	ReadBody(resp *http.Response) ([]byte, error)
	UnmarshalBody(data []byte, v interface{}) error
	RestoreBody(data []byte) (io.ReadCloser, error)
}

func NewResponseHandler

func NewResponseHandler(contentType string, filterLines bool) ResponseHandlerInterface

type ResponseHandlerJson

type ResponseHandlerJson struct {
}

func (*ResponseHandlerJson) ReadBody

func (r *ResponseHandlerJson) ReadBody(resp *http.Response) ([]byte, error)

func (*ResponseHandlerJson) RestoreBody

func (r *ResponseHandlerJson) RestoreBody(data []byte) (io.ReadCloser, error)

func (*ResponseHandlerJson) UnmarshalBody

func (r *ResponseHandlerJson) UnmarshalBody(data []byte, v interface{}) error

type SalesReport

type SalesReport struct {
	Provider              string        `csv:"Provider" json:"provider"`                               //The service provider in your reports (typically Apple).
	ProviderCountry       string        `csv:"Provider Country" json:"provider_country"`               //The service provider country code (typically U.S.).
	SKU                   string        `csv:"SKU" json:"sku"`                                         //A product identifier provided by you during app setup.
	Developer             string        `csv:"Developer" json:"developer"`                             //Provided by you during the initial account setup.
	Name                  string        `csv:"Name" json:"name"`                                       //Provided by you during app setup.
	Title                 string        `csv:"Title" json:"title"`                                     //Provided by you during app setup.
	Version               string        `csv:"SalesReportVersion" json:"version"`                      //Provided by you during app setup.
	ProductTypeIdentifier string        `csv:"Product Type Identifier" json:"product_type_identifier"` //Defines the type of transaction (for example, initial download, update, and so on). For more information, see Product Type Identifiers.
	Units                 CustomFloat64 `csv:"Units" json:"units"`                                     //The aggregated number of units. Negative values indicate refunds, or CMB credits for previously purchased apps when CMB column shows ‘CMB-C’.
	DeveloperProceeds     CustomFloat64 `csv:"Developer Proceeds" json:"developer_proceeds"`           //The amount you receive per unit. This is the Customer Price minus applicable taxes and Apple’s commission, per Schedule 2 of your Paid Applications agreement.
	BeginDate             CustomDate    `csv:"Begin Date" json:"begin_date"`                           //Start date of report.
	EndDate               CustomDate    `csv:"End Date" json:"end_date"`                               //End date of report.
	CustomerCurrency      string        `csv:"Customer Currency" json:"customer_currency"`             //Three-character ISO code indicating the customer’s currency. For more information, see Currency codes.
	CountryCode           string        `csv:"Country Code" json:"country_code"`                       //Two-character ISO country code indicating the App Store territory for the purchase. For more information, see Financial Report Regions and Currencies.
	CurrencyOfProceeds    string        `csv:"Currency of Proceeds" json:"currency_of_proceeds"`       //The currency in which your proceeds are earned. For more information, see Currency codes.
	AppleIdentifier       CustomInteger `csv:"Apple Identifier" json:"apple_identifier"`               //The Apple ID for your app.
	CustomerPrice         CustomFloat64 `csv:"Customer Price" json:"customer_price"`                   //The price per unit billed to the customer, which you set for your app or in-app purchase in App Store Connect. *Customer price is inclusive of any applicable taxes we collect and remit per Schedule 2 of the Paid Applications agreement. Negative values indicate refunds, or CMB credits for previously purchased apps when CMB column shows ‘CMB-C’.
	PromoCode             string        `csv:"Promo Code" json:"promo_code"`                           //If the transaction was part of a promotion, this field will contain a value. This field is empty for all non-promotional items. For more information, see Promotional Codes.
	ParentIdentifier      string        `csv:"Parent Identifier" json:"parent_identifier"`             //In-App Purchases will show the SKU of the associated app.
	Subscription          string        `csv:"Subscription" json:"subscription"`                       //Defines whether an auto-renewable subscription is new or a renewal.
	Period                string        `csv:"Period" json:"period"`                                   //Defines the duration of an auto-renewable subscription purchase. Values include: 7 days, 1 month, 2 months, 3 months, 6 months, and 1 year.
	Category              string        `csv:"Category" json:"category"`                               //Indicates the category of the app, such as Games.
	CMB                   string        `csv:"CMB" json:"cmb"`                                         //If the transaction involves a “completed” app bundle, this field will contain a value of “CMB.” App credits for completed bundles will show a value of “CMB-C.” Otherwise this field is blank.
	Device                string        `csv:"Device" json:"device"`                                   //List of platforms that your app supports: iOS, tvOS, iOS and tvOS, or macOS.
	SupportedPlatforms    string        `csv:"Supported Platforms" json:"supported_platforms"`         // Type of device used for purchase or redownload: iPhone, iPad, Apple TV, iPod touch, or Desktop.
	ProceedsReason        string        `csv:"Proceeds Reason" json:"proceeds_reason"`                 //For Renew events, if the price is preserved then this field equals “Yes”. Otherwise it is blank.
	PreservedPricing      string        `csv:"Preserved Pricing" json:"preserved_pricing"`             //If a subscription has been active for more than a year then you receive 85% of the customer price, minus applicable taxes, and this field equals “Rate After One Year." Otherwise, you receive 70% and the field is blank.
	Client                string        `csv:"Client" json:"client"`                                   //Indicates where the purchase happened: App Store for iMessage, News, or blank.
	OrderType             string        `csv:"Order Type" json:"order_type"`                           //For introductory offers or subscription offers, indicates what type of transaction this line item is: Pay Up Front or Pay As You Go. For pre-orders, indicates whether a purchase originated from a Pre-Order. For promotional offers, the field will populate the Order ID.
}

SalesReport Aggregated sales and download data for your apps and In-App Purchases

type SalesReportFrequency

type SalesReportFrequency string

SalesReportFrequency type

const (
	//SalesReportFrequencyDaily const
	SalesReportFrequencyDaily SalesReportFrequency = "DAILY"
	//SalesReportFrequencyWeekly const
	SalesReportFrequencyWeekly SalesReportFrequency = "WEEKLY"
	//SalesReportFrequencyMonthly const
	SalesReportFrequencyMonthly SalesReportFrequency = "MONTHLY"
	//SalesReportFrequencyYearly const
	SalesReportFrequencyYearly SalesReportFrequency = "YEARLY"
)

type SalesReportSubType

type SalesReportSubType string

SalesReportSubType type

const (
	//SalesReportSubTypeSummary const
	SalesReportSubTypeSummary SalesReportSubType = "SUMMARY"
	//SalesReportSubTypeDetailed const
	SalesReportSubTypeDetailed SalesReportSubType = "DETAILED"
	//SalesReportSubTypeOptIn const
	SalesReportSubTypeOptIn SalesReportSubType = "OPT_IN"
)

type SalesReportType

type SalesReportType string

SalesReportType type

const (
	//SalesReportTypeSales const
	SalesReportTypeSales SalesReportType = "SALES"
	//SalesReportTypePreorder const
	SalesReportTypePreorder SalesReportType = "PRE_ORDER"
	//SalesReportTypeNewsStand const
	SalesReportTypeNewsStand SalesReportType = "NEWSSTAND"
	//SalesReportTypeSubscription const
	SalesReportTypeSubscription SalesReportType = "SUBSCRIPTION"
	//SalesReportTypeSubscriptionEvent const
	SalesReportTypeSubscriptionEvent SalesReportType = "SUBSCRIPTION_EVENT"
	//SalesReportTypeSubscriptionOfferCodeRedemption const
	SalesReportTypeSubscriptionOfferCodeRedemption SalesReportType = "SUBSCRIPTION_OFFER_CODE_REDEMPTION"
	//SalesReportTypeSubscriber const
	SalesReportTypeSubscriber SalesReportType = "SUBSCRIBER"
)

type SalesReportVersion

type SalesReportVersion string

SalesReportVersion type

const (
	//SalesReportVersion10 const
	SalesReportVersion10 SalesReportVersion = "1_0"
	//SalesReportVersion12 const
	SalesReportVersion12 SalesReportVersion = "1_2"
	//SalesReportVersion13 const
	SalesReportVersion13 SalesReportVersion = "1_3"
)

type SalesReportsBaseFilter

type SalesReportsBaseFilter struct {
	ReportDate    time.Time            //The report date to download. The date is specified in the YYYY-MM-DD format for all report frequencies except DAILY, which does not require a specified date. For more information, see report availability and storage.
	ReportSubType SalesReportSubType   //(Required) The report sub type to download. For a list of values, see Allowed Values Based on Sales Report Type below. Possible values: SUMMARY, DETAILED, OPT_IN
	ReportType    SalesReportType      //(Required) The report to download. For more details on each report type see About Reports. Possible values: SALES, PRE_ORDER, NEWSSTAND, SUBSCRIPTION, SUBSCRIPTION_EVENT, SUBSCRIBER
	Frequency     SalesReportFrequency //(Required) Frequency of the report to download. For a list of values, see Allowed Values Based on Sales Report Type below. Possible values: DAILY, WEEKLY, MONTHLY, YEARLY
	Version       SalesReportVersion   //The version of the report. For a list of values, see Allowed Values Based on Sales Report Type below.
}

SalesReportsBaseFilter Sales reports filter

func (*SalesReportsBaseFilter) Daily

Daily Change frequency to Daily

func (*SalesReportsBaseFilter) IsValid

func (f *SalesReportsBaseFilter) IsValid() error

IsValid Validate sales report filter params

func (*SalesReportsBaseFilter) Monthly

Monthly Change frequency to Monthly

func (*SalesReportsBaseFilter) SetFrequency

SetFrequency Set frequency

func (*SalesReportsBaseFilter) SetReportDate

func (f *SalesReportsBaseFilter) SetReportDate(value time.Time) *SalesReportsBaseFilter

SetReportDate Set report date

func (*SalesReportsBaseFilter) SetReportSubType

SetReportSubType Set report sub type

func (*SalesReportsBaseFilter) SetReportType

SetReportType Set report type

func (*SalesReportsBaseFilter) SetVersion

SetVersion Set version

func (*SalesReportsBaseFilter) SubTypeDetailed

func (f *SalesReportsBaseFilter) SubTypeDetailed() *SalesReportsBaseFilter

SubTypeDetailed Change report sub type to Detailed

func (*SalesReportsBaseFilter) SubTypeOptIn

SubTypeOptIn Change report sub type to OptIn

func (*SalesReportsBaseFilter) SubTypeSummary

func (f *SalesReportsBaseFilter) SubTypeSummary() *SalesReportsBaseFilter

SubTypeSummary Change report sub type to Summary

func (*SalesReportsBaseFilter) ToQueryParamsMap

func (f *SalesReportsBaseFilter) ToQueryParamsMap() map[string]interface{}

ToQueryParamsMap Convert filter to query params

func (*SalesReportsBaseFilter) TypeNewsStand

func (f *SalesReportsBaseFilter) TypeNewsStand() *SalesReportsBaseFilter

TypeNewsStand Change report type to NewsStand

func (*SalesReportsBaseFilter) TypePreOrder

TypePreOrder Change report type to PreOrder

func (*SalesReportsBaseFilter) TypeSales

TypeSales Change report type to Sales

func (*SalesReportsBaseFilter) TypeSubscriber

func (f *SalesReportsBaseFilter) TypeSubscriber() *SalesReportsBaseFilter

TypeSubscriber Change report type to Subscriber

func (*SalesReportsBaseFilter) TypeSubscription

func (f *SalesReportsBaseFilter) TypeSubscription() *SalesReportsBaseFilter

TypeSubscription Change report type to Subscription

func (*SalesReportsBaseFilter) TypeSubscriptionEvent

func (f *SalesReportsBaseFilter) TypeSubscriptionEvent() *SalesReportsBaseFilter

TypeSubscriptionEvent Change report type to SubscriptionEvent

func (*SalesReportsBaseFilter) Version10

Version10 Change version to 1_0

func (*SalesReportsBaseFilter) Version12

Version12 Change version to 1_2

func (*SalesReportsBaseFilter) Version13

Version13 Change version to 1_3

func (*SalesReportsBaseFilter) Weekly

Weekly Change frequency to Weekly

func (*SalesReportsBaseFilter) Yearly

Yearly Change frequency to Yearly

type SalesReportsFilter

type SalesReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewSalesReportsFilter

func NewSalesReportsFilter() *SalesReportsFilter

func (*SalesReportsFilter) IsValid

func (f *SalesReportsFilter) IsValid() error

IsValid Validate sales report filter params

type SalesReportsFilterInterface

type SalesReportsFilterInterface interface {
	IsValid() error
	ToQueryParamsMap() map[string]interface{}
}

type SalesReportsResource

type SalesReportsResource struct {
	*ResourceAbstract
}

SalesReportsResource reports

func (*SalesReportsResource) GetPreOrdersReports

GetPreOrdersReports

func (*SalesReportsResource) GetReports

GetReports Get sales reports by filter

func (*SalesReportsResource) GetSalesReports

GetSalesReports

func (*SalesReportsResource) GetSubscribersReports

GetSubscriptionsReports

func (*SalesReportsResource) GetSubscriptionsEventsReports

GetSubscriptionsEventsReports

func (*SalesReportsResource) GetSubscriptionsReports

GetSubscriptionsReports

type SalesReportsResponse

type SalesReportsResponse struct {
	*ResponseBody
	Data []*SalesReport `json:"data,omitempty"`
}

SalesReportsResponse struct

type SubscribersReport

type SubscribersReport struct {
	EventDate                    CustomDate    `csv:"Event Date" json:"event_date"`
	AppName                      string        `csv:"App Name" json:"app_name"`
	AppAppleID                   CustomInteger `csv:"App Apple ID" json:"app_apple_id"`
	SubscriptionName             string        `csv:"Subscription Name" json:"subscription_name"`
	SubscriptionAppleID          CustomInteger `csv:"Subscription Apple ID" json:"subscription_apple_id"`
	SubscriptionGroupID          CustomInteger `csv:"Subscription Group ID" json:"subscription_group_id"`
	StandardSubscriptionDuration string        `csv:"Standard Subscription Duration" json:"standard_subscription_duration"`
	IntroductoryPriceType        string        `csv:"Introductory Price Type" json:"introductory_price_type"`
	PromotionalOfferName         string        `csv:"Promotional Offer Name" json:"promotional_offer_name"`
	PromotionalOfferID           string        `csv:"Promotional Offer ID" json:"promotional_offer_id"`
	SubscriptionOfferName        string        `csv:"Subscription Offer Name" json:"subscription_offer_name"`
	SubscriptionOfferType        string        `csv:"Subscription Offer Type" json:"subscription_offer_type"`
	SubscriptionOfferDuration    string        `csv:"Subscription Offer Duration" json:"subscription_offer_duration"`
	MarketingOptInDuration       string        `csv:"Marketing Opt-In Duration" json:"marketing_opt_in_duration"`
	CustomerPrice                CustomFloat64 `csv:"Customer Price" json:"customer_price"`
	CustomerCurrency             string        `csv:"Customer Currency" json:"customer_currency"`
	DeveloperProceeds            CustomFloat64 `csv:"Developer Proceeds" json:"developer_proceeds"`
	ProceedsCurrency             string        `csv:"Proceeds Currency" json:"proceeds_currency"`
	PreservedPricing             string        `csv:"Preserved Pricing" json:"preserved_pricing"`
	ProceedsReason               string        `csv:"Proceeds Reason" json:"proceeds_reason"`
	Client                       string        `csv:"Client" json:"client"`
	Country                      string        `csv:"Country" json:"country"`
	SubscriberID                 CustomInteger `csv:"Subscriber ID" json:"subscriber_id"`
	SubscriberIDReset            string        `csv:"Subscriber ID Reset" json:"subscriber_id_reset"`
	Refund                       string        `csv:"Refund" json:"refund"`
	PurchaseDate                 CustomDate    `csv:"Purchase Date" json:"purchase_date"`
	Units                        CustomInteger `csv:"Units" json:"units"`
}

SubscribersReport Transaction-level data about subscriber activity using randomly generated Subscriber IDs.

type SubscribersReportsFilter

type SubscribersReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewSubscribersReportsFilter

func NewSubscribersReportsFilter() *SubscribersReportsFilter

func (*SubscribersReportsFilter) IsValid

func (f *SubscribersReportsFilter) IsValid() error

IsValid Validate sales report filter params

type SubscribersReportsResponse

type SubscribersReportsResponse struct {
	*ResponseBody
	Data []*SubscribersReport `json:"data,omitempty"`
}

SubscribersReportsResponse struct

type SubscriptionsEventsReport

type SubscriptionsEventsReport struct {
	EventDate                    CustomDate    `csv:"Event Date" json:"event_date"`
	Event                        string        `csv:"Event" json:"event"`
	AppName                      string        `csv:"App Name" json:"app_name"`
	AppAppleID                   CustomInteger `csv:"App Apple ID" json:"app_apple_id"`
	SubscriptionName             string        `csv:"Subscription Name" json:"subscription_name"`
	SubscriptionAppleID          CustomInteger `csv:"Subscription Apple ID" json:"subscription_apple_id"`
	SubscriptionGroupID          CustomInteger `csv:"Subscription Group ID" json:"subscription_group_id"`
	StandardSubscriptionDuration string        `csv:"Standard Subscription Duration" json:"standard_subscription_duration"`
	PromotionalOfferName         string        `csv:"Promotional Offer Name" json:"promotional_offer_name"`
	PromotionalOfferID           string        `csv:"Promotional Offer ID" json:"promotional_offer_id"`
	SubscriptionOfferType        string        `csv:"Subscription Offer Type" json:"subscription_offer_type"`
	SubscriptionOfferDuration    string        `csv:"Subscription Offer Duration" json:"subscription_offer_duration"`
	MarketingOptIn               string        `csv:"Marketing Opt-In" json:"marketing_opt_in"`
	MarketingOptInDuration       string        `csv:"Marketing Opt-In Duration" json:"marketing_opt_in_duration"`
	PreservedPricing             string        `csv:"Preserved Pricing" json:"preserved_pricing"`
	ProceedsReason               string        `csv:"Proceeds Reason" json:"proceeds_reason"`
	ConsecutivePaidPeriods       CustomInteger `csv:"Consecutive Paid Periods" json:"consecutive_paid_periods"`
	OriginalStartDate            CustomDate    `csv:"Original Start Date" json:"original_start_date"`
	Client                       string        `csv:"Client" json:"client"`
	Device                       string        `csv:"Device" json:"device"`
	State                        string        `csv:"State" json:"state"`
	Country                      string        `csv:"Country" json:"country"`
	PreviousSubscriptionName     string        `csv:"Previous Subscription Name" json:"previous_subscription_name"`
	PreviousSubscriptionAppleID  CustomInteger `csv:"Previous Subscription Apple ID" json:"previous_subscription_apple_id"`
	DaysBeforeCanceling          CustomInteger `csv:"Days Before Canceling" json:"days_before_canceling"`
	CancellationReason           string        `csv:"Cancellation Reason" json:"cancellation_reason"`
	DaysCanceled                 CustomInteger `csv:"Days Canceled" json:"days_canceled"`
	Quantity                     CustomInteger `csv:"Quantity" json:"quantity"`
}

SubscriptionsEventsReport Aggregated data about subscriber activity, including upgrades, renewals, and introductory price conversions

type SubscriptionsEventsReportsFilter

type SubscriptionsEventsReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewSubscriptionsEventsReportsFilter

func NewSubscriptionsEventsReportsFilter() *SubscriptionsEventsReportsFilter

func (*SubscriptionsEventsReportsFilter) IsValid

IsValid Validate sales report filter params

type SubscriptionsEventsReportsResponse

type SubscriptionsEventsReportsResponse struct {
	*ResponseBody
	Data []*SubscriptionsEventsReport `json:"data,omitempty"`
}

SubscriptionsEventsReportsResponse struct

type SubscriptionsOffersCodesRedemptionReportsFilter

type SubscriptionsOffersCodesRedemptionReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewSubscriptionsOffersCodesRedemptionReportsFilter

func NewSubscriptionsOffersCodesRedemptionReportsFilter() *SubscriptionsOffersCodesRedemptionReportsFilter

func (*SubscriptionsOffersCodesRedemptionReportsFilter) IsValid

IsValid Validate sales report filter params

type SubscriptionsOffersRedemptionReport

type SubscriptionsOffersRedemptionReport struct {
	Date                CustomDate    `csv:"Date" json:"date"`
	AppName             string        `csv:"App Name" json:"app_name"`
	AppAppleID          CustomInteger `csv:"App Apple ID" json:"app_apple_id"`
	SubscriptionName    string        `csv:"Subscription Name" json:"subscription_name"`
	SubscriptionAppleID CustomInteger `csv:"Subscription Apple ID" json:"subscription_apple_id"`
	OfferReferenceName  string        `csv:"Offer Reference Name" json:"offer_reference_name"`
	OfferCode           string        `csv:"Offer Code" json:"offer_code"`
	Territory           string        `csv:"Territory" json:"territory"`
	Redemptions         CustomInteger `csv:"Redemptions" json:"redemptions"`
}

SubscriptionsOffersRedemptionReport

type SubscriptionsReport

type SubscriptionsReport struct {
	AppName                                        string        `csv:"App Name" json:"app_name"`
	AppAppleID                                     CustomInteger `csv:"App Apple ID" json:"app_apple_id"`
	SubscriptionName                               string        `csv:"Subscription Name" json:"subscription_name"`
	SubscriptionAppleID                            CustomInteger `csv:"Subscription Apple ID" json:"subscription_apple_id"`
	SubscriptionGroupID                            CustomInteger `csv:"Subscription Group ID" json:"subscription_group_id"`
	StandardSubscriptionDuration                   string        `csv:"Standard Subscription Duration" json:"standard_subscription_duration"`
	PromotionalOfferName                           string        `csv:"Promotional Offer Name" json:"promotional_offer_name"`
	PromotionalOfferID                             string        `csv:"Promotional Offer ID" json:"promotional_offer_id"`
	CustomerPrice                                  CustomFloat64 `csv:"Customer Price" json:"customer_price"`
	CustomerCurrency                               string        `csv:"Customer Currency" json:"customer_currency"`
	DeveloperProceeds                              CustomFloat64 `csv:"Developer Proceeds" json:"developer_proceeds"`
	ProceedsCurrency                               string        `csv:"Proceeds Currency" json:"proceeds_currency"`
	PreservedPricing                               string        `csv:"Preserved Pricing" json:"preserved_pricing"`
	ProceedsReason                                 string        `csv:"Proceeds Reason" json:"proceeds_reason"`
	Client                                         string        `csv:"Client" json:"client"`
	Device                                         string        `csv:"Device" json:"device"`
	State                                          string        `csv:"State" json:"state"`
	Country                                        string        `csv:"Country" json:"country"`
	ActiveStandardPriceSubscriptions               CustomInteger `csv:"Active Standard Price Subscriptions" json:"active_standard_price_subscriptions"`
	ActiveFreeTrialIntroductoryOfferSubscriptions  CustomInteger `csv:"Active Free Trial Introductory Offer Subscriptions" json:"active_free_trial_introductory_offer_subscriptions"`
	ActivePayUpFrontIntroductoryOfferSubscriptions CustomInteger `csv:"Active Pay Up Front Introductory Offer Subscriptions" json:"active_pay_up_front_introductory_offer_subscriptions"`
	ActivePayAsYouGoIntroductoryOfferSubscriptions CustomInteger `csv:"Active Pay As You Go Introductory Offer Subscriptions" json:"active_pay_as_you_go_introductory_offer_subscriptions"`
	FreeTrialPromotionalOfferSubscriptions         CustomInteger `csv:"Free Trial Promotional Offer Subscriptions" json:"free_trial_promotional_offer_subscriptions"`
	PayUpFrontPromotionalOfferSubscriptions        CustomInteger `csv:"Pay Up Front Promotional Offer Subscriptions" json:"pay_up_front_promotional_offer_subscriptions"`
	PayAsYouGoPromotionalOfferSubscriptions        CustomInteger `csv:"Pay As You Go Promotional Offer Subscriptions" json:"pay_as_you_go_promotional_offer_subscriptions"`
	MarketingOptIns                                CustomInteger `csv:"Marketing Opt-Ins" json:"marketing_opt_ins"`
	BillingRetry                                   CustomInteger `csv:"Billing Retry" json:"billing_retry"`
	GracePeriod                                    CustomInteger `csv:"Grace Period" json:"grace_period"`
	FreeTrialOfferCodeSubscriptions                CustomInteger `csv:"Free Trial Offer Code Subscriptions" json:"free_trial_offer_code_subscriptions"`
	PayUpFrontOfferCodeSubscriptions               CustomInteger `csv:"Pay Up Front Offer Code Subscriptions" json:"pay_up_front_offer_code_subscriptions"`
	PayAsYouGoOfferCodeSubscriptions               CustomInteger `csv:"Pay As You Go Offer Code Subscriptions" json:"pay_as_you_go_offer_code_subscriptions"`
	Subscribers                                    CustomFloat64 `csv:"Subscribers" json:"subscribers"`
}

SubscriptionsReport Total number of Active Subscriptions, Subscriptions with Introductory Prices, and Marketing Opt-Ins for your auto-renewable subscriptions.

type SubscriptionsReportsFilter

type SubscriptionsReportsFilter struct {
	*SalesReportsBaseFilter
}

func NewSubscriptionsReportsFilter

func NewSubscriptionsReportsFilter() *SubscriptionsReportsFilter

func (*SubscriptionsReportsFilter) IsValid

func (f *SubscriptionsReportsFilter) IsValid() error

IsValid Validate sales report filter params

type SubscriptionsReportsResponse

type SubscriptionsReportsResponse struct {
	*ResponseBody
	Data []*SubscriptionsReport `json:"data,omitempty"`
}

SubscriptionsReportsResponse struct

type TokenBuilder

type TokenBuilder struct {
	PrivateKey *PrivateKey
	// contains filtered or unexported fields
}

TokenBuilder token builder

func NewTokenBuilder

func NewTokenBuilder(cfg *Config) *TokenBuilder

NewTokenBuilder Create new TokenBuilder from config

func (*TokenBuilder) BuildAuthToken

func (tb *TokenBuilder) BuildAuthToken() (*AuthToken, error)

BuildAuthToken Build Auth token

func (*TokenBuilder) BuildJWTToken

func (tb *TokenBuilder) BuildJWTToken(payload *jwt.StandardClaims) *jwt.Token

BuildJWTToken Build JWT token

func (*TokenBuilder) BuildPayload

func (tb *TokenBuilder) BuildPayload() *jwt.StandardClaims

BuildPayload Build JWT token payload

type TokenConfig

type TokenConfig struct {
	Audience string
	Type     string
	Algo     string
	Ttl      int
}

TokenConfig token config structure

func NewTokenConfig

func NewTokenConfig() *TokenConfig

NewTokenConfig Create new token config

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport wrapper

func NewHttpTransport

func NewHttpTransport(config *Config, token *AuthToken, h *http.Client) *Transport

NewHttpTransport create new http transport

func (*Transport) Get

func (t *Transport) Get(ctx context.Context, path string, query map[string]interface{}) (resp *http.Response, err error)

Get method

func (*Transport) SendRequest

func (t *Transport) SendRequest(ctx context.Context, method string, path string, query map[string]interface{}, body map[string]interface{}) (resp *http.Response, err error)

SendRequest method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL