Skip to content

Latest commit

 

History

History
773 lines (505 loc) · 21.5 KB

File metadata and controls

773 lines (505 loc) · 21.5 KB

\InvoicesAPI

All URIs are relative to https://connto.getopenpay.com

Method HTTP request Description
AddComment Post /invoices/{invoice_external_id}/comment Add Comment
CreateInvoice Post /invoices/ Create Invoice
FinalizeInvoice Post /invoices/{invoice_external_id}/finalize Finalize Invoice
GetInvoice Get /invoices/{invoice_external_id} Get Invoice
GetInvoicePublic Get /invoices/public/{public_permanent_token} Get Invoice Public
ListInvoices Post /invoices/list List Invoices
MarkInvoiceAsUncollectible Post /invoices/{invoice_external_id}/mark_uncollectible Mark Invoice As Uncollectible
MarkInvoiceAsVoid Post /invoices/{invoice_external_id}/void Mark Invoice As Void
PayInvoice Post /invoices/{invoice_external_id}/pay Pay Invoice
PreviewNextInvoice Get /invoices/preview_next_invoice/{subscription_id} Preview Next Invoice
UpdateInvoice Put /invoices/{invoice_id} Update Invoice

AddComment

InvoiceExternal AddComment(ctx, invoiceExternalId).AddCommentRequest(addCommentRequest).Execute()

Add Comment

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	addCommentRequest := *openapiclient.NewAddCommentRequest("Marked as paid.") // AddCommentRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.AddComment(context.Background(), invoiceExternalId).AddCommentRequest(addCommentRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.AddComment``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `AddComment`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.AddComment`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiAddCommentRequest struct via the builder pattern

Name Type Description Notes

addCommentRequest | AddCommentRequest | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateInvoice

InvoiceExternal CreateInvoice(ctx).CreateInvoiceRequest(createInvoiceRequest).Execute()

Create Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	createInvoiceRequest := *openapiclient.NewCreateInvoiceRequest("CustomerId_example") // CreateInvoiceRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.CreateInvoice(context.Background()).CreateInvoiceRequest(createInvoiceRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.CreateInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.CreateInvoice`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateInvoiceRequest struct via the builder pattern

Name Type Description Notes
createInvoiceRequest CreateInvoiceRequest

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FinalizeInvoice

InvoiceExternal FinalizeInvoice(ctx, invoiceExternalId).Execute()

Finalize Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.FinalizeInvoice(context.Background(), invoiceExternalId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.FinalizeInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `FinalizeInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.FinalizeInvoice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiFinalizeInvoiceRequest struct via the builder pattern

Name Type Description Notes

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetInvoice

InvoiceExternal GetInvoice(ctx, invoiceExternalId).Expand(expand).Execute()

Get Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	expand := []string{"Inner_example"} // []string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.GetInvoice(context.Background(), invoiceExternalId).Expand(expand).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.GetInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.GetInvoice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiGetInvoiceRequest struct via the builder pattern

Name Type Description Notes

expand | []string | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetInvoicePublic

InvoicePublic GetInvoicePublic(ctx, publicPermanentToken).Execute()

Get Invoice Public

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	publicPermanentToken := "00000000-aaaa-bbbb-cccc-dddddddddddd" // string | Public token for the invoice.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.GetInvoicePublic(context.Background(), publicPermanentToken).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.GetInvoicePublic``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetInvoicePublic`: InvoicePublic
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.GetInvoicePublic`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
publicPermanentToken string Public token for the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiGetInvoicePublicRequest struct via the builder pattern

Name Type Description Notes

Return type

InvoicePublic

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListInvoices

ListResponseInvoiceExternal ListInvoices(ctx).InvoiceQueryParams(invoiceQueryParams).Execute()

List Invoices

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceQueryParams := *openapiclient.NewInvoiceQueryParams() // InvoiceQueryParams | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.ListInvoices(context.Background()).InvoiceQueryParams(invoiceQueryParams).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.ListInvoices``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListInvoices`: ListResponseInvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.ListInvoices`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListInvoicesRequest struct via the builder pattern

Name Type Description Notes
invoiceQueryParams InvoiceQueryParams

Return type

ListResponseInvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MarkInvoiceAsUncollectible

InvoiceExternal MarkInvoiceAsUncollectible(ctx, invoiceExternalId).MarkUncollectibleRequest(markUncollectibleRequest).Execute()

Mark Invoice As Uncollectible

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	markUncollectibleRequest := *openapiclient.NewMarkUncollectibleRequest() // MarkUncollectibleRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.MarkInvoiceAsUncollectible(context.Background(), invoiceExternalId).MarkUncollectibleRequest(markUncollectibleRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.MarkInvoiceAsUncollectible``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `MarkInvoiceAsUncollectible`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.MarkInvoiceAsUncollectible`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiMarkInvoiceAsUncollectibleRequest struct via the builder pattern

Name Type Description Notes

markUncollectibleRequest | MarkUncollectibleRequest | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MarkInvoiceAsVoid

InvoiceExternal MarkInvoiceAsVoid(ctx, invoiceExternalId).MarkVoidRequest(markVoidRequest).Execute()

Mark Invoice As Void

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	markVoidRequest := *openapiclient.NewMarkVoidRequest() // MarkVoidRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.MarkInvoiceAsVoid(context.Background(), invoiceExternalId).MarkVoidRequest(markVoidRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.MarkInvoiceAsVoid``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `MarkInvoiceAsVoid`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.MarkInvoiceAsVoid`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiMarkInvoiceAsVoidRequest struct via the builder pattern

Name Type Description Notes

markVoidRequest | MarkVoidRequest | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PayInvoice

InvoiceExternal PayInvoice(ctx, invoiceExternalId).PayInvoiceRequest(payInvoiceRequest).Execute()

Pay Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceExternalId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	payInvoiceRequest := *openapiclient.NewPayInvoiceRequest() // PayInvoiceRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.PayInvoice(context.Background(), invoiceExternalId).PayInvoiceRequest(payInvoiceRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.PayInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PayInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.PayInvoice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceExternalId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiPayInvoiceRequest struct via the builder pattern

Name Type Description Notes

payInvoiceRequest | PayInvoiceRequest | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PreviewNextInvoice

InvoiceExternal PreviewNextInvoice(ctx, subscriptionId).Execute()

Preview Next Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	subscriptionId := "subscriptionId_example" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.PreviewNextInvoice(context.Background(), subscriptionId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.PreviewNextInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PreviewNextInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.PreviewNextInvoice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
subscriptionId string

Other Parameters

Other parameters are passed through a pointer to a apiPreviewNextInvoiceRequest struct via the builder pattern

Name Type Description Notes

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateInvoice

InvoiceExternal UpdateInvoice(ctx, invoiceId).UpdateInvoiceRequest(updateInvoiceRequest).Execute()

Update Invoice

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	invoiceId := "invoice_dev_abc123" // string | Unique identifier of the invoice.
	updateInvoiceRequest := *openapiclient.NewUpdateInvoiceRequest() // UpdateInvoiceRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InvoicesAPI.UpdateInvoice(context.Background(), invoiceId).UpdateInvoiceRequest(updateInvoiceRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InvoicesAPI.UpdateInvoice``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateInvoice`: InvoiceExternal
	fmt.Fprintf(os.Stdout, "Response from `InvoicesAPI.UpdateInvoice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
invoiceId string Unique identifier of the invoice.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateInvoiceRequest struct via the builder pattern

Name Type Description Notes

updateInvoiceRequest | UpdateInvoiceRequest | |

Return type

InvoiceExternal

Authorization

HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]