All URIs are relative to https://.commercelayer.io/api
Method | HTTP request | Description |
---|---|---|
DELETESubscriptionModelsSubscriptionModelId | Delete /subscription_models/{subscriptionModelId} | Delete a subscription model |
GETMarketIdSubscriptionModel | Get /markets/{marketId}/subscription_model | Retrieve the subscription model associated to the market |
GETOrderSubscriptionIdSubscriptionModel | Get /order_subscriptions/{orderSubscriptionId}/subscription_model | Retrieve the subscription model associated to the order subscription |
GETSubscriptionModels | Get /subscription_models | List all subscription models |
GETSubscriptionModelsSubscriptionModelId | Get /subscription_models/{subscriptionModelId} | Retrieve a subscription model |
PATCHSubscriptionModelsSubscriptionModelId | Patch /subscription_models/{subscriptionModelId} | Update a subscription model |
POSTSubscriptionModels | Post /subscription_models | Create a subscription model |
DELETESubscriptionModelsSubscriptionModelId(ctx, subscriptionModelId).Execute()
Delete a subscription model
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
subscriptionModelId := TODO // interface{} | The resource's id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SubscriptionModelsApi.DELETESubscriptionModelsSubscriptionModelId(context.Background(), subscriptionModelId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.DELETESubscriptionModelsSubscriptionModelId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
subscriptionModelId | interface{} | The resource's id |
Other parameters are passed through a pointer to a apiDELETESubscriptionModelsSubscriptionModelIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GETMarketIdSubscriptionModel(ctx, marketId).Execute()
Retrieve the subscription model associated to the market
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
marketId := TODO // interface{} | The resource's id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SubscriptionModelsApi.GETMarketIdSubscriptionModel(context.Background(), marketId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.GETMarketIdSubscriptionModel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
marketId | interface{} | The resource's id |
Other parameters are passed through a pointer to a apiGETMarketIdSubscriptionModelRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GETOrderSubscriptionIdSubscriptionModel(ctx, orderSubscriptionId).Execute()
Retrieve the subscription model associated to the order subscription
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
orderSubscriptionId := TODO // interface{} | The resource's id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.SubscriptionModelsApi.GETOrderSubscriptionIdSubscriptionModel(context.Background(), orderSubscriptionId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.GETOrderSubscriptionIdSubscriptionModel``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orderSubscriptionId | interface{} | The resource's id |
Other parameters are passed through a pointer to a apiGETOrderSubscriptionIdSubscriptionModelRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GETSubscriptionModels200Response GETSubscriptionModels(ctx).Execute()
List all subscription models
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubscriptionModelsApi.GETSubscriptionModels(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.GETSubscriptionModels``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GETSubscriptionModels`: GETSubscriptionModels200Response
fmt.Fprintf(os.Stdout, "Response from `SubscriptionModelsApi.GETSubscriptionModels`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGETSubscriptionModelsRequest struct via the builder pattern
GETSubscriptionModels200Response
- Content-Type: Not defined
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GETSubscriptionModelsSubscriptionModelId200Response GETSubscriptionModelsSubscriptionModelId(ctx, subscriptionModelId).Execute()
Retrieve a subscription model
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
subscriptionModelId := TODO // interface{} | The resource's id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubscriptionModelsApi.GETSubscriptionModelsSubscriptionModelId(context.Background(), subscriptionModelId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.GETSubscriptionModelsSubscriptionModelId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GETSubscriptionModelsSubscriptionModelId`: GETSubscriptionModelsSubscriptionModelId200Response
fmt.Fprintf(os.Stdout, "Response from `SubscriptionModelsApi.GETSubscriptionModelsSubscriptionModelId`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
subscriptionModelId | interface{} | The resource's id |
Other parameters are passed through a pointer to a apiGETSubscriptionModelsSubscriptionModelIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
GETSubscriptionModelsSubscriptionModelId200Response
- Content-Type: Not defined
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PATCHSubscriptionModelsSubscriptionModelId200Response PATCHSubscriptionModelsSubscriptionModelId(ctx, subscriptionModelId).SubscriptionModelUpdate(subscriptionModelUpdate).Execute()
Update a subscription model
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
subscriptionModelUpdate := *openapiclient.NewSubscriptionModelUpdate(*openapiclient.NewSubscriptionModelUpdateData(interface{}(123), interface{}(XGZwpOSrWL), *openapiclient.NewPATCHSubscriptionModelsSubscriptionModelId200ResponseDataAttributes())) // SubscriptionModelUpdate |
subscriptionModelId := TODO // interface{} | The resource's id
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubscriptionModelsApi.PATCHSubscriptionModelsSubscriptionModelId(context.Background(), subscriptionModelId).SubscriptionModelUpdate(subscriptionModelUpdate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.PATCHSubscriptionModelsSubscriptionModelId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PATCHSubscriptionModelsSubscriptionModelId`: PATCHSubscriptionModelsSubscriptionModelId200Response
fmt.Fprintf(os.Stdout, "Response from `SubscriptionModelsApi.PATCHSubscriptionModelsSubscriptionModelId`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
subscriptionModelId | interface{} | The resource's id |
Other parameters are passed through a pointer to a apiPATCHSubscriptionModelsSubscriptionModelIdRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
subscriptionModelUpdate | SubscriptionModelUpdate |
PATCHSubscriptionModelsSubscriptionModelId200Response
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
POSTSubscriptionModels201Response POSTSubscriptionModels(ctx).SubscriptionModelCreate(subscriptionModelCreate).Execute()
Create a subscription model
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/incentro-dc/go-commercelayer-sdk/api"
)
func main() {
subscriptionModelCreate := *openapiclient.NewSubscriptionModelCreate(*openapiclient.NewSubscriptionModelCreateData(interface{}(123), *openapiclient.NewPOSTSubscriptionModels201ResponseDataAttributes(interface{}(EU Subscription Model), interface{}([hourly, 10 * * * *, weekly, monthly, two-month])))) // SubscriptionModelCreate |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SubscriptionModelsApi.POSTSubscriptionModels(context.Background()).SubscriptionModelCreate(subscriptionModelCreate).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SubscriptionModelsApi.POSTSubscriptionModels``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `POSTSubscriptionModels`: POSTSubscriptionModels201Response
fmt.Fprintf(os.Stdout, "Response from `SubscriptionModelsApi.POSTSubscriptionModels`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiPOSTSubscriptionModelsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
subscriptionModelCreate | SubscriptionModelCreate |
POSTSubscriptionModels201Response
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]