| POST | /cmd/organizations |
|---|
package dtos
import (
"time"
)
type Ref struct {
Id string `json:"id"`
Val string `json:"val"`
}
type GPSCoordinates struct {
Lat float64 `json:"lat,omitempty"`
Lng float64 `json:"lng,omitempty"`
}
type Address struct {
Street string `json:"street"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postalCode"`
Country Ref `json:"country"`
Gps GPSCoordinates `json:"gps"`
Data RecordDictionary[string, string] `json:"data"`
}
type Locale struct {
TimeZone *Ref `json:"timeZone,omitempty"`
Currency *Ref `json:"currency,omitempty"`
Language *Ref `json:"language,omitempty"`
}
type WinningsExpirationPolicy struct {
Enabled bool `json:"enabled,omitempty"`
Interval time.Duration `json:"interval,omitempty"`
}
type OrganizationNature int
const (
OrganizationNatureFirstParty OrganizationNature = 1
OrganizationNaturePartner OrganizationNature = 2
)
type IntegrationConnection struct {
Url *string `json:"url,omitempty"`
CredentialsRef *string `json:"credentialsRef,omitempty"`
}
type IntegrationInstance struct {
Id *string `json:"id,omitempty"`
IntegrationId *string `json:"integrationId,omitempty"`
Wallet *IntegrationConnection `json:"wallet,omitempty"`
PartnerApi *IntegrationConnection `json:"partnerApi,omitempty"`
SlipForwardingEnabled bool `json:"slipForwardingEnabled,omitempty"`
}
type OrganizationIntegrations struct {
FirstParty *IntegrationInstance `json:"firstParty,omitempty"`
Partner *IntegrationInstance `json:"partner,omitempty"`
}
type WalletPayoutMode int
const (
WalletPayoutModeRealTime WalletPayoutMode = 0
WalletPayoutModeBatchPayout WalletPayoutMode = 1
)
type PayoutPolicy struct {
SelfService WalletPayoutMode `json:"selfService,omitempty"`
Personal WalletPayoutMode `json:"personal,omitempty"`
}
type RegisterOrganization struct {
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Address *Address `json:"address,omitempty"`
Locale *Locale `json:"locale,omitempty"`
IntegrationsData *RecordDictionary[string, string] `json:"integrationsData,omitempty"`
WinningsExpirationPolicy *WinningsExpirationPolicy `json:"winningsExpirationPolicy,omitempty"`
Nature *OrganizationNature `json:"nature,omitempty"`
Integrations *OrganizationIntegrations `json:"integrations,omitempty"`
PayoutPolicy *PayoutPolicy `json:"payoutPolicy,omitempty"`
}
type RecordDictionary[TKey any, TVal any] map[TKey]TVal
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/organizations HTTP/1.1
Host: api.bettor.webhop.biz
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"String","name":"String","address":{"street":"String","city":"String","state":"String","postalCode":"String","country":{"id":"String","val":"String"},"gps":{"lat":0,"lng":0},"data":{"String":"String"}},"locale":{"timeZone":{"id":"String","val":"String"},"currency":{"id":"String","val":"String"},"language":{"id":"String","val":"String"}},"integrationsData":{"String":"String"},"winningsExpirationPolicy":{"enabled":false,"interval":"PT0S"},"nature":0,"integrations":{"firstParty":{"id":"String","integrationId":"String","wallet":{"url":"String","credentialsRef":"String"},"partnerApi":{"url":"String","credentialsRef":"String"},"slipForwardingEnabled":false},"partner":{"id":"String","integrationId":"String","wallet":{"url":"String","credentialsRef":"String"},"partnerApi":{"url":"String","credentialsRef":"String"},"slipForwardingEnabled":false}},"payoutPolicy":{"selfService":0,"personal":0}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}