Skip to content

Latest commit

 

History

History
437 lines (310 loc) · 12.3 KB

api-exports.md

File metadata and controls

437 lines (310 loc) · 12.3 KB

API Exports

aPIExportsController := client.APIExportsController()

Class Name

APIExportsController

Methods

List Exported Proforma Invoices

This API returns an array of exported proforma invoices for a provided batch_id. Pay close attention to pagination in order to control responses from the server.

Example: GET https://{subdomain}.chargify.com/api_exports/proforma_invoices/123/rows?per_page=10000&page=1.

ListExportedProformaInvoices(
    ctx context.Context,
    input ListExportedProformaInvoicesInput) (
    models.ApiResponse[[]models.ProformaInvoice],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.
perPage *int Query, Optional This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
Default: 100
Constraints: >= 1, <= 10000
page *int Query, Optional Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query page=1.
Default: 1
Constraints: >= 1

Response Type

[]models.ProformaInvoice

Example Usage

ctx := context.Background()

collectedInput := advancedbilling.ListExportedProformaInvoicesInput{
    BatchId: "batch_id8",
    PerPage: models.ToPointer(100),
    Page:    models.ToPointer(2),
}

apiResponse, err := aPIExportsController.ListExportedProformaInvoices(ctx, collectedInput)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError

List Exported Invoices

This API returns an array of exported invoices for a provided batch_id. Pay close attention to pagination in order to control responses from the server.

Example: GET https://{subdomain}.chargify.com/api_exports/invoices/123/rows?per_page=10000&page=1.

ListExportedInvoices(
    ctx context.Context,
    input ListExportedInvoicesInput) (
    models.ApiResponse[[]models.Invoice],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.
perPage *int Query, Optional This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
Default: 100
Constraints: >= 1, <= 10000
page *int Query, Optional Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query page=1.
Default: 1
Constraints: >= 1

Response Type

[]models.Invoice

Example Usage

ctx := context.Background()

collectedInput := advancedbilling.ListExportedInvoicesInput{
    BatchId: "batch_id8",
    PerPage: models.ToPointer(100),
    Page:    models.ToPointer(2),
}

apiResponse, err := aPIExportsController.ListExportedInvoices(ctx, collectedInput)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError

List Exported Subscriptions

This API returns an array of exported subscriptions for a provided batch_id. Pay close attention to pagination in order to control responses from the server.

Example: GET https://{subdomain}.chargify.com/api_exports/subscriptions/123/rows?per_page=200&page=1.

ListExportedSubscriptions(
    ctx context.Context,
    input ListExportedSubscriptionsInput) (
    models.ApiResponse[[]models.Subscription],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.
perPage *int Query, Optional This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
Default: 100
Constraints: >= 1, <= 10000
page *int Query, Optional Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query page=1.
Default: 1
Constraints: >= 1

Response Type

[]models.Subscription

Example Usage

ctx := context.Background()

collectedInput := advancedbilling.ListExportedSubscriptionsInput{
    BatchId: "batch_id8",
    PerPage: models.ToPointer(100),
    Page:    models.ToPointer(2),
}

apiResponse, err := aPIExportsController.ListExportedSubscriptions(ctx, collectedInput)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError

Export Proforma Invoices

This API creates a proforma invoices export and returns a batchjob object.

It is only available for Relationship Invoicing architecture.

ExportProformaInvoices(
    ctx context.Context) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

apiResponse, err := aPIExportsController.ExportProformaInvoices(ctx)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError
409 Conflict SingleErrorResponseException

Export Invoices

This API creates an invoices export and returns a batchjob object.

ExportInvoices(
    ctx context.Context) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

apiResponse, err := aPIExportsController.ExportInvoices(ctx)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError
409 Conflict SingleErrorResponseException

Export Subscriptions

This API creates a subscriptions export and returns a batchjob object.

ExportSubscriptions(
    ctx context.Context) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

apiResponse, err := aPIExportsController.ExportSubscriptions(ctx)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
409 Conflict SingleErrorResponseException

Read Proforma Invoices Export

This API returns a batchjob object for proforma invoices export.

ReadProformaInvoicesExport(
    ctx context.Context,
    batchId string) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

batchId := "batch_id8"

apiResponse, err := aPIExportsController.ReadProformaInvoicesExport(ctx, batchId)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError

Read Invoices Export

This API returns a batchjob object for invoices export.

ReadInvoicesExport(
    ctx context.Context,
    batchId string) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

batchId := "batch_id8"

apiResponse, err := aPIExportsController.ReadInvoicesExport(ctx, batchId)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError

Read Subscriptions Export

This API returns a batchjob object for subscriptions export.

ReadSubscriptionsExport(
    ctx context.Context,
    batchId string) (
    models.ApiResponse[models.BatchJobResponse],
    error)

Parameters

Parameter Type Tags Description
batchId string Template, Required Id of a Batch Job.

Response Type

models.BatchJobResponse

Example Usage

ctx := context.Background()

batchId := "batch_id8"

apiResponse, err := aPIExportsController.ReadSubscriptionsExport(ctx, batchId)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Errors

HTTP Status Code Error Description Exception Class
404 Not Found ApiError