Skip to content

Latest commit

 

History

History
760 lines (684 loc) · 67.6 KB

README.md

File metadata and controls

760 lines (684 loc) · 67.6 KB

Companies

(Crm.Companies)

Overview

Available Operations

List

List companies

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/components"
	"github.com/apideck-libraries/sdk-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Crm.Companies.List(ctx, operations.CrmCompaniesAllRequest{
        ServiceID: sdkgo.String("salesforce"),
        Filter: &components.CompaniesFilter{
            Name: sdkgo.String("SpaceX"),
        },
        Sort: &components.CompaniesSort{
            By: components.CompaniesSortByCreatedAt.ToPointer(),
            Direction: components.SortDirectionDesc.ToPointer(),
        },
        PassThrough: map[string]any{
            "search": "San Francisco",
        },
        Fields: sdkgo.String("id,updated_at"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.GetCompaniesResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.CrmCompaniesAllRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.CrmCompaniesAllResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*

Create

Create company

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/components"
	"github.com/apideck-libraries/sdk-go/types"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Crm.Companies.Create(ctx, components.CompanyInput{
        Name: sdkgo.String("SpaceX"),
        OwnerID: sdkgo.String("12345"),
        Image: sdkgo.String("https://www.spacex.com/static/images/share.jpg"),
        Description: sdkgo.String("Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California."),
        VatNumber: sdkgo.String("BE0689615164"),
        Currency: components.CurrencyUsd.ToPointer(),
        Status: sdkgo.String("Open"),
        Fax: sdkgo.String("+12129876543"),
        AnnualRevenue: sdkgo.String("+$35m"),
        NumberOfEmployees: sdkgo.String("500-1000"),
        Industry: sdkgo.String("Apparel"),
        Ownership: sdkgo.String("Public"),
        SalesTaxNumber: sdkgo.String("12456EN"),
        PayeeNumber: sdkgo.String("78932EN"),
        AbnOrTfn: sdkgo.String("46 115 614 695"),
        AbnBranch: sdkgo.String("123"),
        Acn: sdkgo.String("XXX XXX XXX"),
        FirstName: sdkgo.String("Elon"),
        LastName: sdkgo.String("Musk"),
        BankAccounts: []components.BankAccount{
            components.BankAccount{
                BankName: sdkgo.String("Monzo"),
                AccountNumber: sdkgo.String("123465"),
                AccountName: sdkgo.String("SPACEX LLC"),
                AccountType: components.AccountTypeCreditCard.ToPointer(),
                Iban: sdkgo.String("CH2989144532982975332"),
                Bic: sdkgo.String("AUDSCHGGXXX"),
                RoutingNumber: sdkgo.String("012345678"),
                BsbNumber: sdkgo.String("062-001"),
                BranchIdentifier: sdkgo.String("001"),
                BankCode: sdkgo.String("BNH"),
                Currency: components.CurrencyUsd.ToPointer(),
            },
        },
        Websites: []components.Website{
            components.Website{
                ID: sdkgo.String("12345"),
                URL: "http://example.com",
                Type: components.WebsiteTypePrimary.ToPointer(),
            },
            components.Website{
                ID: sdkgo.String("12345"),
                URL: "http://example.com",
                Type: components.WebsiteTypePrimary.ToPointer(),
            },
        },
        Addresses: []components.Address{
            components.Address{
                ID: sdkgo.String("123"),
                Type: components.TypePrimary.ToPointer(),
                String: sdkgo.String("25 Spring Street, Blackburn, VIC 3130"),
                Name: sdkgo.String("HQ US"),
                Line1: sdkgo.String("Main street"),
                Line2: sdkgo.String("apt #"),
                Line3: sdkgo.String("Suite #"),
                Line4: sdkgo.String("delivery instructions"),
                StreetNumber: sdkgo.String("25"),
                City: sdkgo.String("San Francisco"),
                State: sdkgo.String("CA"),
                PostalCode: sdkgo.String("94104"),
                Country: sdkgo.String("US"),
                Latitude: sdkgo.String("40.759211"),
                Longitude: sdkgo.String("-73.984638"),
                County: sdkgo.String("Santa Clara"),
                ContactName: sdkgo.String("Elon Musk"),
                Salutation: sdkgo.String("Mr"),
                PhoneNumber: sdkgo.String("111-111-1111"),
                Fax: sdkgo.String("122-111-1111"),
                Email: sdkgo.String("elon@musk.com"),
                Website: sdkgo.String("https://elonmusk.com"),
                Notes: sdkgo.String("Address notes or delivery instructions."),
                RowVersion: sdkgo.String("1-12345"),
            },
        },
        SocialLinks: []components.SocialLink{
            components.SocialLink{
                ID: sdkgo.String("12345"),
                URL: "https://www.twitter.com/apideck",
                Type: sdkgo.String("twitter"),
            },
        },
        PhoneNumbers: []components.PhoneNumber{
            components.PhoneNumber{
                ID: sdkgo.String("12345"),
                CountryCode: sdkgo.String("1"),
                AreaCode: sdkgo.String("323"),
                Number: "111-111-1111",
                Extension: sdkgo.String("105"),
                Type: components.PhoneNumberTypePrimary.ToPointer(),
            },
        },
        Emails: []components.Email{
            components.Email{
                ID: sdkgo.String("123"),
                Email: sdkgo.String("elon@musk.com"),
                Type: components.EmailTypePrimary.ToPointer(),
            },
            components.Email{
                ID: sdkgo.String("123"),
                Email: sdkgo.String("elon@musk.com"),
                Type: components.EmailTypePrimary.ToPointer(),
            },
            components.Email{
                ID: sdkgo.String("123"),
                Email: sdkgo.String("elon@musk.com"),
                Type: components.EmailTypePrimary.ToPointer(),
            },
        },
        RowType: &components.CompanyRowType{
            ID: sdkgo.String("12345"),
            Name: sdkgo.String("Customer Account"),
        },
        CustomFields: []components.CustomField{
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
                Value: sdkgo.Pointer(components.CreateValueStr(
                    "Uses Salesforce and Marketo",
                )),
            },
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
                Value: sdkgo.Pointer(components.CreateValueNumber(
                    10,
                )),
            },
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
                Value: sdkgo.Pointer(components.CreateValueStr(
                    "Uses Salesforce and Marketo",
                )),
            },
        },
        Tags: []string{
            "New",
        },
        ReadOnly: sdkgo.Bool(false),
        Salutation: sdkgo.String("Mr"),
        Birthday: types.MustNewDateFromString("2000-08-12"),
        PassThrough: []components.PassThroughBody{
            components.PassThroughBody{
                ServiceID: "<id>",
                ExtendPaths: []components.ExtendPaths{
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                },
            },
            components.PassThroughBody{
                ServiceID: "<id>",
                ExtendPaths: []components.ExtendPaths{
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                },
            },
            components.PassThroughBody{
                ServiceID: "<id>",
                ExtendPaths: []components.ExtendPaths{
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                },
            },
        },
    }, nil, sdkgo.String("salesforce"))
    if err != nil {
        log.Fatal(err)
    }
    if res.CreateCompanyResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
company components.CompanyInput ✔️ N/A
raw *bool Include raw response. Mostly used for debugging purposes
serviceID *string Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
opts []operations.Option The options for this request.

Response

*operations.CrmCompaniesAddResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*

Get

Get company

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Crm.Companies.Get(ctx, "<id>", nil, sdkgo.String("salesforce"), sdkgo.String("id,updated_at"))
    if err != nil {
        log.Fatal(err)
    }
    if res.GetCompanyResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
id string ✔️ ID of the record you are acting upon.
raw *bool Include raw response. Mostly used for debugging purposes
serviceID *string Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
fields *string The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: fields=name,email,addresses.city

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded.
id,updated_at
opts []operations.Option The options for this request.

Response

*operations.CrmCompaniesOneResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*

Update

Update company

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/components"
	"github.com/apideck-libraries/sdk-go/types"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Crm.Companies.Update(ctx, "<id>", components.CompanyInput{
        Name: sdkgo.String("SpaceX"),
        OwnerID: sdkgo.String("12345"),
        Image: sdkgo.String("https://www.spacex.com/static/images/share.jpg"),
        Description: sdkgo.String("Space Exploration Technologies Corp. is an American aerospace manufacturer, space transportation services and communications company headquartered in Hawthorne, California."),
        VatNumber: sdkgo.String("BE0689615164"),
        Currency: components.CurrencyUsd.ToPointer(),
        Status: sdkgo.String("Open"),
        Fax: sdkgo.String("+12129876543"),
        AnnualRevenue: sdkgo.String("+$35m"),
        NumberOfEmployees: sdkgo.String("500-1000"),
        Industry: sdkgo.String("Apparel"),
        Ownership: sdkgo.String("Public"),
        SalesTaxNumber: sdkgo.String("12456EN"),
        PayeeNumber: sdkgo.String("78932EN"),
        AbnOrTfn: sdkgo.String("46 115 614 695"),
        AbnBranch: sdkgo.String("123"),
        Acn: sdkgo.String("XXX XXX XXX"),
        FirstName: sdkgo.String("Elon"),
        LastName: sdkgo.String("Musk"),
        BankAccounts: []components.BankAccount{
            components.BankAccount{
                BankName: sdkgo.String("Monzo"),
                AccountNumber: sdkgo.String("123465"),
                AccountName: sdkgo.String("SPACEX LLC"),
                AccountType: components.AccountTypeCreditCard.ToPointer(),
                Iban: sdkgo.String("CH2989144532982975332"),
                Bic: sdkgo.String("AUDSCHGGXXX"),
                RoutingNumber: sdkgo.String("012345678"),
                BsbNumber: sdkgo.String("062-001"),
                BranchIdentifier: sdkgo.String("001"),
                BankCode: sdkgo.String("BNH"),
                Currency: components.CurrencyUsd.ToPointer(),
            },
            components.BankAccount{
                BankName: sdkgo.String("Monzo"),
                AccountNumber: sdkgo.String("123465"),
                AccountName: sdkgo.String("SPACEX LLC"),
                AccountType: components.AccountTypeCreditCard.ToPointer(),
                Iban: sdkgo.String("CH2989144532982975332"),
                Bic: sdkgo.String("AUDSCHGGXXX"),
                RoutingNumber: sdkgo.String("012345678"),
                BsbNumber: sdkgo.String("062-001"),
                BranchIdentifier: sdkgo.String("001"),
                BankCode: sdkgo.String("BNH"),
                Currency: components.CurrencyUsd.ToPointer(),
            },
            components.BankAccount{
                BankName: sdkgo.String("Monzo"),
                AccountNumber: sdkgo.String("123465"),
                AccountName: sdkgo.String("SPACEX LLC"),
                AccountType: components.AccountTypeCreditCard.ToPointer(),
                Iban: sdkgo.String("CH2989144532982975332"),
                Bic: sdkgo.String("AUDSCHGGXXX"),
                RoutingNumber: sdkgo.String("012345678"),
                BsbNumber: sdkgo.String("062-001"),
                BranchIdentifier: sdkgo.String("001"),
                BankCode: sdkgo.String("BNH"),
                Currency: components.CurrencyUsd.ToPointer(),
            },
        },
        Websites: []components.Website{
            components.Website{
                ID: sdkgo.String("12345"),
                URL: "http://example.com",
                Type: components.WebsiteTypePrimary.ToPointer(),
            },
            components.Website{
                ID: sdkgo.String("12345"),
                URL: "http://example.com",
                Type: components.WebsiteTypePrimary.ToPointer(),
            },
        },
        Addresses: []components.Address{
            components.Address{
                ID: sdkgo.String("123"),
                Type: components.TypePrimary.ToPointer(),
                String: sdkgo.String("25 Spring Street, Blackburn, VIC 3130"),
                Name: sdkgo.String("HQ US"),
                Line1: sdkgo.String("Main street"),
                Line2: sdkgo.String("apt #"),
                Line3: sdkgo.String("Suite #"),
                Line4: sdkgo.String("delivery instructions"),
                StreetNumber: sdkgo.String("25"),
                City: sdkgo.String("San Francisco"),
                State: sdkgo.String("CA"),
                PostalCode: sdkgo.String("94104"),
                Country: sdkgo.String("US"),
                Latitude: sdkgo.String("40.759211"),
                Longitude: sdkgo.String("-73.984638"),
                County: sdkgo.String("Santa Clara"),
                ContactName: sdkgo.String("Elon Musk"),
                Salutation: sdkgo.String("Mr"),
                PhoneNumber: sdkgo.String("111-111-1111"),
                Fax: sdkgo.String("122-111-1111"),
                Email: sdkgo.String("elon@musk.com"),
                Website: sdkgo.String("https://elonmusk.com"),
                Notes: sdkgo.String("Address notes or delivery instructions."),
                RowVersion: sdkgo.String("1-12345"),
            },
        },
        SocialLinks: []components.SocialLink{
            components.SocialLink{
                ID: sdkgo.String("12345"),
                URL: "https://www.twitter.com/apideck",
                Type: sdkgo.String("twitter"),
            },
            components.SocialLink{
                ID: sdkgo.String("12345"),
                URL: "https://www.twitter.com/apideck",
                Type: sdkgo.String("twitter"),
            },
            components.SocialLink{
                ID: sdkgo.String("12345"),
                URL: "https://www.twitter.com/apideck",
                Type: sdkgo.String("twitter"),
            },
        },
        PhoneNumbers: []components.PhoneNumber{
            components.PhoneNumber{
                ID: sdkgo.String("12345"),
                CountryCode: sdkgo.String("1"),
                AreaCode: sdkgo.String("323"),
                Number: "111-111-1111",
                Extension: sdkgo.String("105"),
                Type: components.PhoneNumberTypePrimary.ToPointer(),
            },
            components.PhoneNumber{
                ID: sdkgo.String("12345"),
                CountryCode: sdkgo.String("1"),
                AreaCode: sdkgo.String("323"),
                Number: "111-111-1111",
                Extension: sdkgo.String("105"),
                Type: components.PhoneNumberTypePrimary.ToPointer(),
            },
        },
        Emails: []components.Email{
            components.Email{
                ID: sdkgo.String("123"),
                Email: sdkgo.String("elon@musk.com"),
                Type: components.EmailTypePrimary.ToPointer(),
            },
        },
        RowType: &components.CompanyRowType{
            ID: sdkgo.String("12345"),
            Name: sdkgo.String("Customer Account"),
        },
        CustomFields: []components.CustomField{
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
                Value: sdkgo.Pointer(components.CreateValueStr(
                    "Uses Salesforce and Marketo",
                )),
            },
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
            },
            components.CustomField{
                ID: sdkgo.String("2389328923893298"),
                Name: sdkgo.String("employee_level"),
                Description: sdkgo.String("Employee Level"),
                Value: sdkgo.Pointer(components.CreateValueNumber(
                    10,
                )),
            },
        },
        Tags: []string{
            "New",
        },
        ReadOnly: sdkgo.Bool(false),
        Salutation: sdkgo.String("Mr"),
        Birthday: types.MustNewDateFromString("2000-08-12"),
        PassThrough: []components.PassThroughBody{
            components.PassThroughBody{
                ServiceID: "<id>",
                ExtendPaths: []components.ExtendPaths{
                    components.ExtendPaths{
                        Path: "$.nested.property",
                        Value: map[string]any{
                            "TaxClassificationRef": map[string]any{
                                "value": "EUC-99990201-V1-00020000",
                            },
                        },
                    },
                },
            },
        },
    }, nil, sdkgo.String("salesforce"))
    if err != nil {
        log.Fatal(err)
    }
    if res.UpdateCompanyResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
id string ✔️ ID of the record you are acting upon.
company components.CompanyInput ✔️ N/A
raw *bool Include raw response. Mostly used for debugging purposes
serviceID *string Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
opts []operations.Option The options for this request.

Response

*operations.CrmCompaniesUpdateResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*

Delete

Delete company

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Crm.Companies.Delete(ctx, "<id>", nil, sdkgo.String("salesforce"))
    if err != nil {
        log.Fatal(err)
    }
    if res.DeleteCompanyResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
id string ✔️ ID of the record you are acting upon.
raw *bool Include raw response. Mostly used for debugging purposes
serviceID *string Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. salesforce
opts []operations.Option The options for this request.

Response

*operations.CrmCompaniesDeleteResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*