All URIs are relative to https://connto.getopenpay.com
| Method | HTTP request | Description |
|---|---|---|
| CreateProduct | Post /products/ | Create Product |
| DeleteProduct | Delete /products/{product_id} | Delete Product |
| GetProduct | Get /products/{product_id} | Get Product |
| ListProducts | Post /products/list | List Products |
| UpdateProduct | Put /products/{product_id} | Update Product |
ProductExternal CreateProduct(ctx).CreateProductRequest(createProductRequest).Execute()
Create Product
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
createProductRequest := *openapiclient.NewCreateProductRequest("This is description for product1", "product1") // CreateProductRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProductsAPI.CreateProduct(context.Background()).CreateProductRequest(createProductRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.CreateProduct``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateProduct`: ProductExternal
fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.CreateProduct`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateProductRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createProductRequest | CreateProductRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteProductResponse DeleteProduct(ctx, productId).Execute()
Delete Product
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
productId := "product_dev_abc123" // string | Unique identifier of the product.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProductsAPI.DeleteProduct(context.Background(), productId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.DeleteProduct``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteProduct`: DeleteProductResponse
fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.DeleteProduct`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| productId | string | Unique identifier of the product. |
Other parameters are passed through a pointer to a apiDeleteProductRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProductExternal GetProduct(ctx, productId).Execute()
Get Product
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
productId := "product_dev_abc123" // string | Unique identifier of the product.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProductsAPI.GetProduct(context.Background(), productId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.GetProduct``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetProduct`: ProductExternal
fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.GetProduct`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| productId | string | Unique identifier of the product. |
Other parameters are passed through a pointer to a apiGetProductRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListResponseProductExternal ListProducts(ctx).ProductQueryParams(productQueryParams).Execute()
List Products
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
productQueryParams := *openapiclient.NewProductQueryParams() // ProductQueryParams |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProductsAPI.ListProducts(context.Background()).ProductQueryParams(productQueryParams).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.ListProducts``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListProducts`: ListResponseProductExternal
fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.ListProducts`: %v\n", resp)
}Other parameters are passed through a pointer to a apiListProductsRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| productQueryParams | ProductQueryParams |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProductExternal UpdateProduct(ctx, productId).UpdateProductRequest(updateProductRequest).Execute()
Update Product
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/getopenpay/getopenpay-go"
)
func main() {
productId := "product_dev_abc123" // string | Unique identifier of the product.
updateProductRequest := *openapiclient.NewUpdateProductRequest() // UpdateProductRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ProductsAPI.UpdateProduct(context.Background(), productId).UpdateProductRequest(updateProductRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.UpdateProduct``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateProduct`: ProductExternal
fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.UpdateProduct`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| productId | string | Unique identifier of the product. |
Other parameters are passed through a pointer to a apiUpdateProductRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
updateProductRequest | UpdateProductRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]