Skip to content

Latest commit

 

History

History
709 lines (460 loc) · 20.7 KB

File metadata and controls

709 lines (460 loc) · 20.7 KB

\CustomersAPI

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

Method HTTP request Description
CreateCustomer Post /customers/ Create Customer
CreateCustomerBalanceTransaction Post /customers/{customer_id}/balance-transactions Create Customer Balance Transaction
DeleteCustomerDiscount Delete /customers/{customer_id}/discount Delete Customer Discount
GetCustomer Get /customers/{customer_id} Get Customer
GetCustomerBalanceTransaction Get /customers/{customer_id}/balance-transactions/{transaction_id} Get Customer Balance Transaction
GetCustomerBalanceTransactions Get /customers/{customer_id}/balance-transactions Get Customer Balance Transactions
ListCustomerPaymentMethods Post /customers/{customer_id}/payment-methods List Customer Payment Methods
ListCustomers Post /customers/list List Customers
ListValidSubscriptions Post /customers/{customer_id}/list_valid_subscriptions List Valid Subscriptions
UpdateCustomer Put /customers/{customer_external_id} Update Customer

CreateCustomer

CustomerExternal CreateCustomer(ctx).CreateCustomerRequest(createCustomerRequest).Execute()

Create Customer

Example

package main

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

func main() {
	createCustomerRequest := *openapiclient.NewCreateCustomerRequest("johndoes@xyz.com") // CreateCustomerRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createCustomerRequest CreateCustomerRequest

Return type

CustomerExternal

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]

CreateCustomerBalanceTransaction

CustomerBalanceTransactionExternal CreateCustomerBalanceTransaction(ctx, customerId).CreateCustomerBalanceTransactionRequest(createCustomerBalanceTransactionRequest).Execute()

Create Customer Balance Transaction

Example

package main

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

func main() {
	customerId := "customerId_example" // string | 
	createCustomerBalanceTransactionRequest := *openapiclient.NewCreateCustomerBalanceTransactionRequest(int32(123)) // CreateCustomerBalanceTransactionRequest | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

createCustomerBalanceTransactionRequest | CreateCustomerBalanceTransactionRequest | |

Return type

CustomerBalanceTransactionExternal

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]

DeleteCustomerDiscount

CustomerExternal DeleteCustomerDiscount(ctx, customerId).Execute()

Delete Customer Discount

Example

package main

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

func main() {
	customerId := "customerId_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

CustomerExternal

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]

GetCustomer

CustomerExternal GetCustomer(ctx, customerId).Expand(expand).Execute()

Get Customer

Example

package main

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

func main() {
	customerId := "customerId_example" // string | 
	expand := []*string{"Inner_example"} // []*string |  (optional)

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

expand | []string | |

Return type

CustomerExternal

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]

GetCustomerBalanceTransaction

CustomerBalanceTransactionExternal GetCustomerBalanceTransaction(ctx, customerId, transactionId).Execute()

Get Customer Balance Transaction

Example

package main

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

func main() {
	customerId := "customerId_example" // string | 
	transactionId := "transactionId_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

CustomerBalanceTransactionExternal

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]

GetCustomerBalanceTransactions

[]CustomerBalanceTransactionExternal GetCustomerBalanceTransactions(ctx, customerId).Execute()

Get Customer Balance Transactions

Example

package main

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

func main() {
	customerId := "customerId_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

[]CustomerBalanceTransactionExternal

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]

ListCustomerPaymentMethods

ListResponseUnionTokenizedCreditCardExternalPaymentMethodExternal ListCustomerPaymentMethods(ctx, customerId).CustomerPaymentMethodQueryParams(customerPaymentMethodQueryParams).Execute()

List Customer Payment Methods

Example

package main

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

func main() {
	customerId := "customerId_example" // string | Unique Identifier of the customer.
	customerPaymentMethodQueryParams := *openapiclient.NewCustomerPaymentMethodQueryParams() // CustomerPaymentMethodQueryParams | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
customerId string Unique Identifier of the customer.

Other Parameters

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

Name Type Description Notes

customerPaymentMethodQueryParams | CustomerPaymentMethodQueryParams | |

Return type

ListResponseUnionTokenizedCreditCardExternalPaymentMethodExternal

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]

ListCustomers

ListResponseCustomerExternal ListCustomers(ctx).CustomerQueryParams(customerQueryParams).Execute()

List Customers

Example

package main

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

func main() {
	customerQueryParams := *openapiclient.NewCustomerQueryParams() // CustomerQueryParams | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
customerQueryParams CustomerQueryParams

Return type

ListResponseCustomerExternal

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]

ListValidSubscriptions

ActiveSubResponse ListValidSubscriptions(ctx, customerId).ListActiveSubParams(listActiveSubParams).Execute()

List Valid Subscriptions

Example

package main

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

func main() {
	customerId := "customerId_example" // string | Unique Identifier of the customer.
	listActiveSubParams := *openapiclient.NewListActiveSubParams() // ListActiveSubParams |  (optional)

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
customerId string Unique Identifier of the customer.

Other Parameters

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

Name Type Description Notes

listActiveSubParams | ListActiveSubParams | |

Return type

ActiveSubResponse

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]

UpdateCustomer

CustomerExternal UpdateCustomer(ctx, customerExternalId).UpdateCustomerRequest(updateCustomerRequest).Execute()

Update Customer

Example

package main

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

func main() {
	customerExternalId := "customerExternalId_example" // string | 
	updateCustomerRequest := *openapiclient.NewUpdateCustomerRequest() // UpdateCustomerRequest | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

updateCustomerRequest | UpdateCustomerRequest | |

Return type

CustomerExternal

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]