import "github.com/sumup/sumup-go"
OAuth2Endpoint is SumUp's OAuth 2.0 endpoint.
var OAuth2Endpoint = oauth2.Endpoint{
AuthURL: "https://api.sumup.com/authorize",
TokenURL: "https://api.sumup.com/token",
}
type Client struct {
ApiKeys *api_keys.ApiKeysService
Checkouts *checkouts.CheckoutsService
Customers *customers.CustomersService
Members *members.MembersService
Memberships *memberships.MembershipsService
Merchant *merchant.MerchantService
Payouts *payouts.PayoutsService
Readers *readers.ReadersService
Receipts *receipts.ReceiptsService
Roles *roles.RolesService
Subaccounts *subaccounts.SubaccountsService
Transactions *transactions.TransactionsService
// contains filtered or unexported fields
}
Example
client := sumup.NewClient()
account, err := client.Merchant.Get(context.Background(), merchant.GetAccountParams{})
if err != nil {
log.Printf("[ERROR] get merchant account: %v", err)
return
}
log.Printf("[INFO] merchant profile: %+v", *account.MerchantProfile)
func NewClient(opts ...client.ClientOption) *Client
NewClient creates new SumUp API client. The client is by default configured environment variables (`SUMUP_API_KEY`). To override the default configuration use [ClientOption]s.
import "github.com/sumup/sumup-go/api_keys"
- type ApiKeysService
- func NewApiKeysService(c *client.Client) *ApiKeysService
- func (s *ApiKeysService) Create(ctx context.Context, merchantCode string, body CreateApikeyBody) (*Apikey, error)
- func (s *ApiKeysService) Delete(ctx context.Context, merchantCode string, keyId string) error
- func (s *ApiKeysService) Get(ctx context.Context, merchantCode string, keyId string) (*Apikey, error)
- func (s *ApiKeysService) List(ctx context.Context, merchantCode string, params ListApikeysParams) (*ApikeysList, error)
- func (s *ApiKeysService) Update(ctx context.Context, merchantCode string, keyId string, body UpdateApikeyBody) error
- type Apikey
- type ApikeyType
- type ApikeysList
- type CreateApikeyBody
- type ListApikeysParams
- type Oauth2Scope
- type Oauth2Scopes
- type UpdateApikeyBody
type ApiKeysService struct {
// contains filtered or unexported fields
}
func NewApiKeysService(c *client.Client) *ApiKeysService
func (s *ApiKeysService) Create(ctx context.Context, merchantCode string, body CreateApikeyBody) (*Apikey, error)
Create: Create an API key Create a new API key.
func (s *ApiKeysService) Delete(ctx context.Context, merchantCode string, keyId string) error
Delete: Delete an API key Delete an API key.
func (s *ApiKeysService) Get(ctx context.Context, merchantCode string, keyId string) (*Apikey, error)
Get: Retrieve an API Key Retrieve an API key.
func (s *ApiKeysService) List(ctx context.Context, merchantCode string, params ListApikeysParams) (*ApikeysList, error)
List: List API keys List merchant's API keys.
func (s *ApiKeysService) Update(ctx context.Context, merchantCode string, keyId string, body UpdateApikeyBody) error
Update: Update an API key Update an API key.
Apikey: An API key is a static token that allows you to authorize with SumUp APIs. Keep your API keys secret and safe. Do not share your API keys or expose them in a publicly accessible areas such as client-side code (browser or apps) or in the GitHub.
type Apikey struct {
// The timestamp of when the API key was created.
CreatedAt time.Time `json:"created_at"`
// Unique identifier of the API Key.
Id string `json:"id"`
// User-assigned name of the API Key.
Name string `json:"name"`
// The plaintext value of the API key. This field is returned only in the response to API key creation and is
// never again available in the plaintext form.
Plaintext *string `json:"plaintext,omitempty"`
// Last 8 characters of the API key.
Preview string `json:"preview"`
// Max items: 128
Scopes Oauth2Scopes `json:"scopes"`
Type ApikeyType `json:"type"`
// The timestamp of when the API key was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
ApikeyType is a schema definition.
type ApikeyType string
const (
ApikeyTypePublic ApikeyType = "public"
ApikeyTypeSecret ApikeyType = "secret"
)
ApikeysList: List of API keys.
type ApikeysList struct {
// List of API keys.
Items []Apikey `json:"items"`
// Total number of API keys.
TotalCount int `json:"total_count"`
}
CreateApikeyBody is a schema definition.
type CreateApikeyBody struct {
// Name of the API key.
// Max length: 255
Name string `json:"name"`
// Max items: 128
Scopes Oauth2Scopes `json:"scopes"`
}
ListApikeysParams: query parameters for ListAPIKeys
type ListApikeysParams struct {
// Maximum number of API Keys to return.
Limit *int
// Offset of the first API Key to return.
Offset *int
}
func (p *ListApikeysParams) QueryValues() url.Values
QueryValues converts ListApikeysParams into [url.Values].
Oauth2Scope is a schema definition.
type Oauth2Scope string
const (
Oauth2ScopeAccountingRead Oauth2Scope = "accounting.read"
Oauth2ScopeAccountingWrite Oauth2Scope = "accounting.write"
Oauth2ScopeEmail Oauth2Scope = "email"
Oauth2ScopeInvoicesRead Oauth2Scope = "invoices.read"
Oauth2ScopeInvoicesWrite Oauth2Scope = "invoices.write"
Oauth2ScopePaymentInstruments Oauth2Scope = "payment_instruments"
Oauth2ScopePayments Oauth2Scope = "payments"
Oauth2ScopeProducts Oauth2Scope = "products"
Oauth2ScopeProfile Oauth2Scope = "profile"
Oauth2ScopeReadersRead Oauth2Scope = "readers.read"
Oauth2ScopeReadersWrite Oauth2Scope = "readers.write"
Oauth2ScopeTransactionsHistory Oauth2Scope = "transactions.history"
Oauth2ScopeUserAppSettings Oauth2Scope = "user.app-settings"
Oauth2ScopeUserPayoutSettings Oauth2Scope = "user.payout-settings"
Oauth2ScopeUserProfile Oauth2Scope = "user.profile"
Oauth2ScopeUserProfileReadonly Oauth2Scope = "user.profile_readonly"
Oauth2ScopeUserSubaccounts Oauth2Scope = "user.subaccounts"
)
Oauth2Scopes is a schema definition. Max items: 128
type Oauth2Scopes []Oauth2Scope
UpdateApikeyBody is a schema definition.
type UpdateApikeyBody struct {
// New name for the API key.
// Max length: 255
Name string `json:"name"`
// Max items: 128
Scopes Oauth2Scopes `json:"scopes"`
}
import "github.com/sumup/sumup-go/checkouts"
- type Card
- type CardExpiryMonth
- type CardType
- type Checkout
- type CheckoutAccepted
- type CheckoutAcceptedNextStep
- type CheckoutAcceptedNextStepMechanism
- type CheckoutAcceptedNextStepPayload
- type CheckoutCreateRequest
- type CheckoutCreateRequestPurpose
- type CheckoutCreateRequestStatus
- type CheckoutCreateRequestTransaction
- type CheckoutCreateRequestTransactionEntryMode
- type CheckoutCreateRequestTransactionPaymentType
- type CheckoutCreateRequestTransactionStatus
- type CheckoutProcessMixin
- type CheckoutProcessMixinPaymentType
- type CheckoutStatus
- type CheckoutSuccess
- type CheckoutSuccessPaymentInstrument
- type CheckoutSuccessStatus
- type CheckoutSuccessTransaction
- type CheckoutSuccessTransactionEntryMode
- type CheckoutSuccessTransactionPaymentType
- type CheckoutSuccessTransactionStatus
- type CheckoutTransaction
- type CheckoutTransactionEntryMode
- type CheckoutTransactionPaymentType
- type CheckoutTransactionStatus
- type CheckoutsService
- func NewCheckoutsService(c *client.Client) *CheckoutsService
- func (s *CheckoutsService) Create(ctx context.Context, body CreateCheckoutBody) (*Checkout, error)
- func (s *CheckoutsService) Deactivate(ctx context.Context, id string) (*DeactivateCheckout200Response, error)
- func (s *CheckoutsService) Get(ctx context.Context, id string) (*CheckoutSuccess, error)
- func (s *CheckoutsService) List(ctx context.Context, params ListCheckoutsParams) (*ListCheckouts200Response, error)
- func (s *CheckoutsService) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, params GetPaymentMethodsParams) (*GetPaymentMethods200Response, error)
- func (s *CheckoutsService) Process(ctx context.Context, id string, body ProcessCheckoutBody) (*ProcessCheckoutResponse, error)
- type CreateCheckoutBody
- type CreateCheckoutBodyPurpose
- type CreateCheckoutBodyStatus
- type CreateCheckoutBodyTransaction
- type CreateCheckoutBodyTransactionEntryMode
- type CreateCheckoutBodyTransactionPaymentType
- type CreateCheckoutBodyTransactionStatus
- type DeactivateCheckout200Response
- type DeactivateCheckout200ResponsePurpose
- type DeactivateCheckout200ResponseStatus
- type DeactivateCheckout200ResponseTransaction
- type DeactivateCheckout200ResponseTransactionEntryMode
- type DeactivateCheckout200ResponseTransactionPaymentType
- type DeactivateCheckout200ResponseTransactionStatus
- type DetailsError
- type DetailsErrorFailedConstraint
- type ErrorExtended
- type GetPaymentMethods200Response
- type GetPaymentMethods200ResponseAvailablePaymentMethod
- type GetPaymentMethodsParams
- type ListCheckouts200Response
- type ListCheckoutsParams
- type MandatePayload
- type MandatePayloadType
- type ProcessCheckout400Response
- type ProcessCheckoutBody
- type ProcessCheckoutBodyPaymentType
- type ProcessCheckoutResponse
Card: __Required when payment type is `card`.__ Details of the payment card.
type Card struct {
// Three or four-digit card verification value (security code) of the payment card.
// Write only
// Min length: 3
// Max length: 4
Cvv string `json:"cvv"`
// Month from the expiration time of the payment card. Accepted format is `MM`.
// Write only
ExpiryMonth CardExpiryMonth `json:"expiry_month"`
// Year from the expiration time of the payment card. Accepted formats are `YY` and `YYYY`.
// Write only
// Min length: 2
// Max length: 4
ExpiryYear string `json:"expiry_year"`
// Last 4 digits of the payment card number.
// Read only
// Min length: 4
// Max length: 4
Last4Digits string `json:"last_4_digits"`
// Name of the cardholder as it appears on the payment card.
// Write only
Name string `json:"name"`
// Number of the payment card (without spaces).
// Write only
Number string `json:"number"`
// Issuing card network of the payment card.
// Read only
Type CardType `json:"type"`
// Required five-digit ZIP code. Applicable only to merchant users in the USA.
// Write only
// Min length: 5
// Max length: 5
ZipCode *string `json:"zip_code,omitempty"`
}
CardExpiryMonth: Month from the expiration time of the payment card. Accepted format is `MM`. Write only
type CardExpiryMonth string
const (
CardExpiryMonth01 CardExpiryMonth = "01"
CardExpiryMonth02 CardExpiryMonth = "02"
CardExpiryMonth03 CardExpiryMonth = "03"
CardExpiryMonth04 CardExpiryMonth = "04"
CardExpiryMonth05 CardExpiryMonth = "05"
CardExpiryMonth06 CardExpiryMonth = "06"
CardExpiryMonth07 CardExpiryMonth = "07"
CardExpiryMonth08 CardExpiryMonth = "08"
CardExpiryMonth09 CardExpiryMonth = "09"
CardExpiryMonth10 CardExpiryMonth = "10"
CardExpiryMonth11 CardExpiryMonth = "11"
CardExpiryMonth12 CardExpiryMonth = "12"
)
CardType: Issuing card network of the payment card. Read only
type CardType string
const (
CardTypeAmex CardType = "AMEX"
CardTypeCup CardType = "CUP"
CardTypeDiners CardType = "DINERS"
CardTypeDiscover CardType = "DISCOVER"
CardTypeElo CardType = "ELO"
CardTypeElv CardType = "ELV"
CardTypeHipercard CardType = "HIPERCARD"
CardTypeJcb CardType = "JCB"
CardTypeMaestro CardType = "MAESTRO"
CardTypeMastercard CardType = "MASTERCARD"
CardTypeUnknown CardType = "UNKNOWN"
CardTypeVisa CardType = "VISA"
CardTypeVisaElectron CardType = "VISA_ELECTRON"
CardTypeVisaVpay CardType = "VISA_VPAY"
)
Checkout: Details of the payment checkout.
type Checkout struct {
// Amount of the payment.
Amount *float64 `json:"amount,omitempty"`
// Unique ID of the payment checkout specified by the client application when creating the checkout resource.
// Max length: 90
CheckoutReference *string `json:"checkout_reference,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
// the referenced customer.
CustomerId *string `json:"customer_id,omitempty"`
// Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Date *time.Time `json:"date,omitempty"`
// Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
// easier identification of a checkout.
Description *string `json:"description,omitempty"`
// Unique ID of the checkout resource.
// Read only
Id *string `json:"id,omitempty"`
// Created mandate
Mandate *shared.MandateResponse `json:"mandate,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode *string `json:"merchant_code,omitempty"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
// Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
PayToEmail *string `json:"pay_to_email,omitempty"`
// URL to which the SumUp platform sends the processing status of the payment checkout.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// Current status of the checkout.
Status *CheckoutStatus `json:"status,omitempty"`
// List of transactions related to the payment.
// Unique items only
Transactions *[]CheckoutTransaction `json:"transactions,omitempty"`
// Date and time of the checkout expiration before which the client application needs to send a processing request.
// If no value is present, the checkout does not have an expiration time.
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
CheckoutAccepted: 3DS Response
type CheckoutAccepted struct {
// Required action processing 3D Secure payments.
NextStep *CheckoutAcceptedNextStep `json:"next_step,omitempty"`
}
CheckoutAcceptedNextStep: Required action processing 3D Secure payments.
type CheckoutAcceptedNextStep struct {
// Indicates allowed mechanisms for redirecting an end user. If both values are provided to ensure a redirect takes
// place in either.
Mechanism *[]CheckoutAcceptedNextStepMechanism `json:"mechanism,omitempty"`
// Method used to complete the redirect.
Method *string `json:"method,omitempty"`
// Contains parameters essential for form redirection. Number of object keys and their content can vary.
Payload *CheckoutAcceptedNextStepPayload `json:"payload,omitempty"`
// Refers to a url where the end user is redirected once the payment processing completes.
RedirectUrl *string `json:"redirect_url,omitempty"`
// Where the end user is redirected.
Url *string `json:"url,omitempty"`
}
CheckoutAcceptedNextStepMechanism is a schema definition.
type CheckoutAcceptedNextStepMechanism string
const (
CheckoutAcceptedNextStepMechanismBrowser CheckoutAcceptedNextStepMechanism = "browser"
CheckoutAcceptedNextStepMechanismIframe CheckoutAcceptedNextStepMechanism = "iframe"
)
CheckoutAcceptedNextStepPayload: Contains parameters essential for form redirection. Number of object keys and their content can vary.
type CheckoutAcceptedNextStepPayload struct {
Md *interface{} `json:"md,omitempty"`
PaReq *interface{} `json:"pa_req,omitempty"`
TermUrl *interface{} `json:"term_url,omitempty"`
}
CheckoutCreateRequest: Details of the payment checkout.
type CheckoutCreateRequest struct {
// Amount of the payment.
Amount float64 `json:"amount"`
// Unique ID of the payment checkout specified by the client application when creating the checkout resource.
// Max length: 90
CheckoutReference string `json:"checkout_reference"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency shared.Currency `json:"currency"`
// Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
// the referenced customer.
CustomerId *string `json:"customer_id,omitempty"`
// Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
//
// Read only
Date *time.Time `json:"date,omitempty"`
// Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
// easier identification of a checkout.
Description *string `json:"description,omitempty"`
// Unique ID of the checkout resource.
// Read only
Id *string `json:"id,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode string `json:"merchant_code"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
// Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
PayToEmail *string `json:"pay_to_email,omitempty"`
// Purpose of the checkout.
// Default: CHECKOUT
Purpose *CheckoutCreateRequestPurpose `json:"purpose,omitempty"`
// __Required__ for [APMs](https://developer.sumup.com/online-payments/apm/introduction) and __recommended__ for
// card payments. Refers to a url where the end user is redirected once the payment processing completes. If
// not specified, the [Payment Widget](https://developer.sumup.com/online-payments/tools/card-widget) renders [3DS
// challenge](https://developer.sumup.com/online-payments/features/3ds) within an iframe instead of performing a
// full-page redirect.
RedirectUrl *string `json:"redirect_url,omitempty"`
// URL to which the SumUp platform sends the processing status of the payment checkout.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// Current status of the checkout.
// Read only
Status *CheckoutCreateRequestStatus `json:"status,omitempty"`
// List of transactions related to the payment.
// Read only
// Unique items only
Transactions *[]CheckoutCreateRequestTransaction `json:"transactions,omitempty"`
// Date and time of the checkout expiration before which the client application needs to send a processing request.
// If no value is present, the checkout does not have an expiration time.
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
CheckoutCreateRequestPurpose: Purpose of the checkout. Default: CHECKOUT
type CheckoutCreateRequestPurpose string
const (
CheckoutCreateRequestPurposeCheckout CheckoutCreateRequestPurpose = "CHECKOUT"
CheckoutCreateRequestPurposeSetupRecurringPayment CheckoutCreateRequestPurpose = "SETUP_RECURRING_PAYMENT"
)
CheckoutCreateRequestStatus: Current status of the checkout. Read only
type CheckoutCreateRequestStatus string
const (
CheckoutCreateRequestStatusFailed CheckoutCreateRequestStatus = "FAILED"
CheckoutCreateRequestStatusPaid CheckoutCreateRequestStatus = "PAID"
CheckoutCreateRequestStatusPending CheckoutCreateRequestStatus = "PENDING"
)
CheckoutCreateRequestTransaction is a schema definition.
type CheckoutCreateRequestTransaction struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *CheckoutCreateRequestTransactionEntryMode `json:"entry_mode,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *CheckoutCreateRequestTransactionPaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *CheckoutCreateRequestTransactionStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
CheckoutCreateRequestTransactionEntryMode: Entry mode of the payment details.
type CheckoutCreateRequestTransactionEntryMode string
const (
CheckoutCreateRequestTransactionEntryModeBoleto CheckoutCreateRequestTransactionEntryMode = "BOLETO"
CheckoutCreateRequestTransactionEntryModeCustomerEntry CheckoutCreateRequestTransactionEntryMode = "CUSTOMER_ENTRY"
)
CheckoutCreateRequestTransactionPaymentType: Payment type used for the transaction.
type CheckoutCreateRequestTransactionPaymentType string
const (
CheckoutCreateRequestTransactionPaymentTypeBoleto CheckoutCreateRequestTransactionPaymentType = "BOLETO"
CheckoutCreateRequestTransactionPaymentTypeEcom CheckoutCreateRequestTransactionPaymentType = "ECOM"
CheckoutCreateRequestTransactionPaymentTypeRecurring CheckoutCreateRequestTransactionPaymentType = "RECURRING"
)
CheckoutCreateRequestTransactionStatus: Current status of the transaction.
type CheckoutCreateRequestTransactionStatus string
const (
CheckoutCreateRequestTransactionStatusCancelled CheckoutCreateRequestTransactionStatus = "CANCELLED"
CheckoutCreateRequestTransactionStatusFailed CheckoutCreateRequestTransactionStatus = "FAILED"
CheckoutCreateRequestTransactionStatusPending CheckoutCreateRequestTransactionStatus = "PENDING"
CheckoutCreateRequestTransactionStatusSuccessful CheckoutCreateRequestTransactionStatus = "SUCCESSFUL"
)
CheckoutProcessMixin: Details of the payment instrument for processing the checkout.
type CheckoutProcessMixin struct {
// __Required when payment type is `card`.__ Details of the payment card.
Card *Card `json:"card,omitempty"`
// __Required when `token` is provided.__ Unique ID of the customer.
CustomerId *string `json:"customer_id,omitempty"`
// Number of installments for deferred payments. Available only to merchant users in Brazil.
// Min: 1
// Max: 12
Installments *int `json:"installments,omitempty"`
// Mandate is passed when a card is to be tokenized
Mandate *MandatePayload `json:"mandate,omitempty"`
// Describes the payment method used to attempt processing
PaymentType CheckoutProcessMixinPaymentType `json:"payment_type"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
// __Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card
// for a customer.
Token *string `json:"token,omitempty"`
}
CheckoutProcessMixinPaymentType: Describes the payment method used to attempt processing
type CheckoutProcessMixinPaymentType string
const (
CheckoutProcessMixinPaymentTypeBancontact CheckoutProcessMixinPaymentType = "bancontact"
CheckoutProcessMixinPaymentTypeBlik CheckoutProcessMixinPaymentType = "blik"
CheckoutProcessMixinPaymentTypeBoleto CheckoutProcessMixinPaymentType = "boleto"
CheckoutProcessMixinPaymentTypeCard CheckoutProcessMixinPaymentType = "card"
CheckoutProcessMixinPaymentTypeIdeal CheckoutProcessMixinPaymentType = "ideal"
)
CheckoutStatus: Current status of the checkout.
type CheckoutStatus string
const (
CheckoutStatusFailed CheckoutStatus = "FAILED"
CheckoutStatusPaid CheckoutStatus = "PAID"
CheckoutStatusPending CheckoutStatus = "PENDING"
)
CheckoutSuccess is a schema definition.
type CheckoutSuccess struct {
// Amount of the payment.
Amount *float64 `json:"amount,omitempty"`
// Unique ID of the payment checkout specified by the client application when creating the checkout resource.
// Max length: 90
CheckoutReference *string `json:"checkout_reference,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
// the referenced customer.
CustomerId *string `json:"customer_id,omitempty"`
// Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Date *time.Time `json:"date,omitempty"`
// Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
// easier identification of a checkout.
Description *string `json:"description,omitempty"`
// Unique ID of the checkout resource.
// Read only
Id *string `json:"id,omitempty"`
// Created mandate
Mandate *shared.MandateResponse `json:"mandate,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode *string `json:"merchant_code,omitempty"`
// Name of the merchant
MerchantName *string `json:"merchant_name,omitempty"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
// Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
PayToEmail *string `json:"pay_to_email,omitempty"`
// Object containing token information for the specified payment instrument
PaymentInstrument *CheckoutSuccessPaymentInstrument `json:"payment_instrument,omitempty"`
// Refers to a url where the end user is redirected once the payment processing completes.
RedirectUrl *string `json:"redirect_url,omitempty"`
// URL to which the SumUp platform sends the processing status of the payment checkout.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// Current status of the checkout.
Status *CheckoutSuccessStatus `json:"status,omitempty"`
// Transaction code of the successful transaction with which the payment for the checkout is completed.
// Read only
TransactionCode *string `json:"transaction_code,omitempty"`
// Transaction ID of the successful transaction with which the payment for the checkout is completed.
// Read only
TransactionId *string `json:"transaction_id,omitempty"`
// List of transactions related to the payment.
// Unique items only
Transactions *[]CheckoutSuccessTransaction `json:"transactions,omitempty"`
// Date and time of the checkout expiration before which the client application needs to send a processing request.
// If no value is present, the checkout does not have an expiration time.
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
CheckoutSuccessPaymentInstrument: Object containing token information for the specified payment instrument
type CheckoutSuccessPaymentInstrument struct {
// Token value
Token *string `json:"token,omitempty"`
}
CheckoutSuccessStatus: Current status of the checkout.
type CheckoutSuccessStatus string
const (
CheckoutSuccessStatusFailed CheckoutSuccessStatus = "FAILED"
CheckoutSuccessStatusPaid CheckoutSuccessStatus = "PAID"
CheckoutSuccessStatusPending CheckoutSuccessStatus = "PENDING"
)
CheckoutSuccessTransaction is a schema definition.
type CheckoutSuccessTransaction struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *CheckoutSuccessTransactionEntryMode `json:"entry_mode,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *CheckoutSuccessTransactionPaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *CheckoutSuccessTransactionStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
CheckoutSuccessTransactionEntryMode: Entry mode of the payment details.
type CheckoutSuccessTransactionEntryMode string
const (
CheckoutSuccessTransactionEntryModeBoleto CheckoutSuccessTransactionEntryMode = "BOLETO"
CheckoutSuccessTransactionEntryModeCustomerEntry CheckoutSuccessTransactionEntryMode = "CUSTOMER_ENTRY"
)
CheckoutSuccessTransactionPaymentType: Payment type used for the transaction.
type CheckoutSuccessTransactionPaymentType string
const (
CheckoutSuccessTransactionPaymentTypeBoleto CheckoutSuccessTransactionPaymentType = "BOLETO"
CheckoutSuccessTransactionPaymentTypeEcom CheckoutSuccessTransactionPaymentType = "ECOM"
CheckoutSuccessTransactionPaymentTypeRecurring CheckoutSuccessTransactionPaymentType = "RECURRING"
)
CheckoutSuccessTransactionStatus: Current status of the transaction.
type CheckoutSuccessTransactionStatus string
const (
CheckoutSuccessTransactionStatusCancelled CheckoutSuccessTransactionStatus = "CANCELLED"
CheckoutSuccessTransactionStatusFailed CheckoutSuccessTransactionStatus = "FAILED"
CheckoutSuccessTransactionStatusPending CheckoutSuccessTransactionStatus = "PENDING"
CheckoutSuccessTransactionStatusSuccessful CheckoutSuccessTransactionStatus = "SUCCESSFUL"
)
CheckoutTransaction is a schema definition.
type CheckoutTransaction struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *CheckoutTransactionEntryMode `json:"entry_mode,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *CheckoutTransactionPaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *CheckoutTransactionStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
CheckoutTransactionEntryMode: Entry mode of the payment details.
type CheckoutTransactionEntryMode string
const (
CheckoutTransactionEntryModeBoleto CheckoutTransactionEntryMode = "BOLETO"
CheckoutTransactionEntryModeCustomerEntry CheckoutTransactionEntryMode = "CUSTOMER_ENTRY"
)
CheckoutTransactionPaymentType: Payment type used for the transaction.
type CheckoutTransactionPaymentType string
const (
CheckoutTransactionPaymentTypeBoleto CheckoutTransactionPaymentType = "BOLETO"
CheckoutTransactionPaymentTypeEcom CheckoutTransactionPaymentType = "ECOM"
CheckoutTransactionPaymentTypeRecurring CheckoutTransactionPaymentType = "RECURRING"
)
CheckoutTransactionStatus: Current status of the transaction.
type CheckoutTransactionStatus string
const (
CheckoutTransactionStatusCancelled CheckoutTransactionStatus = "CANCELLED"
CheckoutTransactionStatusFailed CheckoutTransactionStatus = "FAILED"
CheckoutTransactionStatusPending CheckoutTransactionStatus = "PENDING"
CheckoutTransactionStatusSuccessful CheckoutTransactionStatus = "SUCCESSFUL"
)
type CheckoutsService struct {
// contains filtered or unexported fields
}
func NewCheckoutsService(c *client.Client) *CheckoutsService
func (s *CheckoutsService) Create(ctx context.Context, body CreateCheckoutBody) (*Checkout, error)
Create: Create a checkout Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.
For 3DS checkouts, add the `redirect_url` parameter to your request body schema.
Follow by processing a checkout to charge the provided payment instrument.
func (s *CheckoutsService) Deactivate(ctx context.Context, id string) (*DeactivateCheckout200Response, error)
Deactivate: Deactivate a checkout Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.
func (s *CheckoutsService) Get(ctx context.Context, id string) (*CheckoutSuccess, error)
Get: Retrieve a checkout Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.
func (s *CheckoutsService) List(ctx context.Context, params ListCheckoutsParams) (*ListCheckouts200Response, error)
List: List checkouts Lists created checkout resources according to the applied `checkout_reference`.
func (s *CheckoutsService) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, params GetPaymentMethodsParams) (*GetPaymentMethods200Response, error)
ListAvailablePaymentMethods: Get available payment methods Get payment methods available for the given merchant to use with a checkout.
func (s *CheckoutsService) Process(ctx context.Context, id string, body ProcessCheckoutBody) (*ProcessCheckoutResponse, error)
Process: Process a checkout Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the `Create a checkout` endpoint.
Follow this request with `Retrieve a checkout` to confirm its status.
CreateCheckoutBody: Details of the payment checkout.
type CreateCheckoutBody struct {
// Amount of the payment.
Amount float64 `json:"amount"`
// Unique ID of the payment checkout specified by the client application when creating the checkout resource.
// Max length: 90
CheckoutReference string `json:"checkout_reference"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency shared.Currency `json:"currency"`
// Unique identification of a customer. If specified, the checkout session and payment instrument are associated with
// the referenced customer.
CustomerId *string `json:"customer_id,omitempty"`
// Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
//
// Read only
Date *time.Time `json:"date,omitempty"`
// Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
// easier identification of a checkout.
Description *string `json:"description,omitempty"`
// Unique ID of the checkout resource.
// Read only
Id *string `json:"id,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode string `json:"merchant_code"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
// Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
PayToEmail *string `json:"pay_to_email,omitempty"`
// Purpose of the checkout.
// Default: CHECKOUT
Purpose *CreateCheckoutBodyPurpose `json:"purpose,omitempty"`
// __Required__ for [APMs](https://developer.sumup.com/online-payments/apm/introduction) and __recommended__ for
// card payments. Refers to a url where the end user is redirected once the payment processing completes. If
// not specified, the [Payment Widget](https://developer.sumup.com/online-payments/tools/card-widget) renders [3DS
// challenge](https://developer.sumup.com/online-payments/features/3ds) within an iframe instead of performing a
// full-page redirect.
RedirectUrl *string `json:"redirect_url,omitempty"`
// URL to which the SumUp platform sends the processing status of the payment checkout.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// Current status of the checkout.
// Read only
Status *CreateCheckoutBodyStatus `json:"status,omitempty"`
// List of transactions related to the payment.
// Read only
// Unique items only
Transactions *[]CreateCheckoutBodyTransaction `json:"transactions,omitempty"`
// Date and time of the checkout expiration before which the client application needs to send a processing request.
// If no value is present, the checkout does not have an expiration time.
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
CreateCheckoutBodyPurpose: Purpose of the checkout. Default: CHECKOUT
type CreateCheckoutBodyPurpose string
const (
CreateCheckoutBodyPurposeCheckout CreateCheckoutBodyPurpose = "CHECKOUT"
CreateCheckoutBodyPurposeSetupRecurringPayment CreateCheckoutBodyPurpose = "SETUP_RECURRING_PAYMENT"
)
CreateCheckoutBodyStatus: Current status of the checkout. Read only
type CreateCheckoutBodyStatus string
const (
CreateCheckoutBodyStatusFailed CreateCheckoutBodyStatus = "FAILED"
CreateCheckoutBodyStatusPaid CreateCheckoutBodyStatus = "PAID"
CreateCheckoutBodyStatusPending CreateCheckoutBodyStatus = "PENDING"
)
CreateCheckoutBodyTransaction is a schema definition.
type CreateCheckoutBodyTransaction struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *CreateCheckoutBodyTransactionEntryMode `json:"entry_mode,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *CreateCheckoutBodyTransactionPaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *CreateCheckoutBodyTransactionStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
CreateCheckoutBodyTransactionEntryMode: Entry mode of the payment details.
type CreateCheckoutBodyTransactionEntryMode string
const (
CreateCheckoutBodyTransactionEntryModeBoleto CreateCheckoutBodyTransactionEntryMode = "BOLETO"
CreateCheckoutBodyTransactionEntryModeCustomerEntry CreateCheckoutBodyTransactionEntryMode = "CUSTOMER_ENTRY"
)
CreateCheckoutBodyTransactionPaymentType: Payment type used for the transaction.
type CreateCheckoutBodyTransactionPaymentType string
const (
CreateCheckoutBodyTransactionPaymentTypeBoleto CreateCheckoutBodyTransactionPaymentType = "BOLETO"
CreateCheckoutBodyTransactionPaymentTypeEcom CreateCheckoutBodyTransactionPaymentType = "ECOM"
CreateCheckoutBodyTransactionPaymentTypeRecurring CreateCheckoutBodyTransactionPaymentType = "RECURRING"
)
CreateCheckoutBodyTransactionStatus: Current status of the transaction.
type CreateCheckoutBodyTransactionStatus string
const (
CreateCheckoutBodyTransactionStatusCancelled CreateCheckoutBodyTransactionStatus = "CANCELLED"
CreateCheckoutBodyTransactionStatusFailed CreateCheckoutBodyTransactionStatus = "FAILED"
CreateCheckoutBodyTransactionStatusPending CreateCheckoutBodyTransactionStatus = "PENDING"
CreateCheckoutBodyTransactionStatusSuccessful CreateCheckoutBodyTransactionStatus = "SUCCESSFUL"
)
DeactivateCheckout200Response: Details of the deleted checkout.
type DeactivateCheckout200Response struct {
// Amount of the payment.
Amount *float64 `json:"amount,omitempty"`
// Unique ID of the payment checkout specified by the client application when creating the checkout resource.
// Max length: 90
CheckoutReference *string `json:"checkout_reference,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Date and time of the creation of the payment checkout. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
//
// Read only
Date *time.Time `json:"date,omitempty"`
// Short description of the checkout visible in the SumUp dashboard. The description can contribute to reporting, allowing
// easier identification of a checkout.
Description *string `json:"description,omitempty"`
// Unique ID of the checkout resource.
// Read only
Id *string `json:"id,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode *string `json:"merchant_code,omitempty"`
// The merchant's country
MerchantCountry *string `json:"merchant_country,omitempty"`
// Merchant name
MerchantName *string `json:"merchant_name,omitempty"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
// Deprecated: `pay_to_email` is deprecated, use `merchant_code` instead.
PayToEmail *string `json:"pay_to_email,omitempty"`
// Purpose of the checkout creation initially
Purpose *DeactivateCheckout200ResponsePurpose `json:"purpose,omitempty"`
// Current status of the checkout.
// Read only
Status *DeactivateCheckout200ResponseStatus `json:"status,omitempty"`
// List of transactions related to the payment.
// Read only
// Unique items only
Transactions *[]DeactivateCheckout200ResponseTransaction `json:"transactions,omitempty"`
// Date and time of the checkout expiration before which the client application needs to send a processing request.
// If no value is present, the checkout does not have an expiration time.
// Read only
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
DeactivateCheckout200ResponsePurpose: Purpose of the checkout creation initially
type DeactivateCheckout200ResponsePurpose string
const (
DeactivateCheckout200ResponsePurposeCheckout DeactivateCheckout200ResponsePurpose = "CHECKOUT"
DeactivateCheckout200ResponsePurposeSetupRecurringPayment DeactivateCheckout200ResponsePurpose = "SETUP_RECURRING_PAYMENT"
)
DeactivateCheckout200ResponseStatus: Current status of the checkout. Read only
type DeactivateCheckout200ResponseStatus string
const (
DeactivateCheckout200ResponseStatusExpired DeactivateCheckout200ResponseStatus = "EXPIRED"
)
DeactivateCheckout200ResponseTransaction is a schema definition.
type DeactivateCheckout200ResponseTransaction struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *DeactivateCheckout200ResponseTransactionEntryMode `json:"entry_mode,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *DeactivateCheckout200ResponseTransactionPaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *DeactivateCheckout200ResponseTransactionStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
DeactivateCheckout200ResponseTransactionEntryMode: Entry mode of the payment details.
type DeactivateCheckout200ResponseTransactionEntryMode string
const (
DeactivateCheckout200ResponseTransactionEntryModeBoleto DeactivateCheckout200ResponseTransactionEntryMode = "BOLETO"
DeactivateCheckout200ResponseTransactionEntryModeCustomerEntry DeactivateCheckout200ResponseTransactionEntryMode = "CUSTOMER_ENTRY"
)
DeactivateCheckout200ResponseTransactionPaymentType: Payment type used for the transaction.
type DeactivateCheckout200ResponseTransactionPaymentType string
const (
DeactivateCheckout200ResponseTransactionPaymentTypeBoleto DeactivateCheckout200ResponseTransactionPaymentType = "BOLETO"
DeactivateCheckout200ResponseTransactionPaymentTypeEcom DeactivateCheckout200ResponseTransactionPaymentType = "ECOM"
DeactivateCheckout200ResponseTransactionPaymentTypeRecurring DeactivateCheckout200ResponseTransactionPaymentType = "RECURRING"
)
DeactivateCheckout200ResponseTransactionStatus: Current status of the transaction.
type DeactivateCheckout200ResponseTransactionStatus string
const (
DeactivateCheckout200ResponseTransactionStatusCancelled DeactivateCheckout200ResponseTransactionStatus = "CANCELLED"
DeactivateCheckout200ResponseTransactionStatusFailed DeactivateCheckout200ResponseTransactionStatus = "FAILED"
DeactivateCheckout200ResponseTransactionStatusPending DeactivateCheckout200ResponseTransactionStatus = "PENDING"
DeactivateCheckout200ResponseTransactionStatusSuccessful DeactivateCheckout200ResponseTransactionStatus = "SUCCESSFUL"
)
DetailsError: Error message structure.
type DetailsError struct {
// Details of the error.
Details *string `json:"details,omitempty"`
FailedConstraints *[]DetailsErrorFailedConstraint `json:"failed_constraints,omitempty"`
// The status code.
Status *float64 `json:"status,omitempty"`
// Short title of the error.
Title *string `json:"title,omitempty"`
}
func (e *DetailsError) Error() string
DetailsErrorFailedConstraint is a schema definition.
type DetailsErrorFailedConstraint struct {
Message *string `json:"message,omitempty"`
Reference *string `json:"reference,omitempty"`
}
ErrorExtended is a schema definition.
type ErrorExtended struct {
// Platform code for the error.
ErrorCode *string `json:"error_code,omitempty"`
// Short description of the error.
Message *string `json:"message,omitempty"`
// Parameter name (with relative location) to which the error applies. Parameters from embedded resources are
// displayed using dot notation. For example, `card.name` refers to the `name` parameter embedded in the `card`
// object.
Param *string `json:"param,omitempty"`
}
func (e *ErrorExtended) Error() string
GetPaymentMethods200Response is a schema definition.
type GetPaymentMethods200Response struct {
AvailablePaymentMethods *[]GetPaymentMethods200ResponseAvailablePaymentMethod `json:"available_payment_methods,omitempty"`
}
GetPaymentMethods200ResponseAvailablePaymentMethod is a schema definition.
type GetPaymentMethods200ResponseAvailablePaymentMethod struct {
// The ID of the payment method.
Id string `json:"id"`
}
GetPaymentMethodsParams: query parameters for GetPaymentMethods
type GetPaymentMethodsParams struct {
// The amount for which the payment methods should be eligible, in major units. Note that currency must also
// be provided when filtering by amount.
Amount *float64
// The currency for which the payment methods should be eligible.
Currency *string
}
func (p *GetPaymentMethodsParams) QueryValues() url.Values
QueryValues converts GetPaymentMethodsParams into [url.Values].
ListCheckouts200Response is a schema definition.
type ListCheckouts200Response []CheckoutSuccess
ListCheckoutsParams: query parameters for ListCheckouts
type ListCheckoutsParams struct {
// Filters the list of checkout resources by the unique ID of the checkout.
CheckoutReference *string
}
func (p *ListCheckoutsParams) QueryValues() url.Values
QueryValues converts ListCheckoutsParams into [url.Values].
MandatePayload: Mandate is passed when a card is to be tokenized
type MandatePayload struct {
// Indicates the mandate type
Type MandatePayloadType `json:"type"`
// Operating system and web client used by the end-user
UserAgent string `json:"user_agent"`
// IP address of the end user. Supports IPv4 and IPv6
UserIp *string `json:"user_ip,omitempty"`
}
MandatePayloadType: Indicates the mandate type
type MandatePayloadType string
const (
MandatePayloadTypeRecurrent MandatePayloadType = "recurrent"
)
ProcessCheckout400Response is a schema definition.
type ProcessCheckout400Response json.RawMessage
func (e *ProcessCheckout400Response) Error() string
ProcessCheckoutBody: Details of the payment instrument for processing the checkout.
type ProcessCheckoutBody struct {
// __Required when payment type is `card`.__ Details of the payment card.
Card *Card `json:"card,omitempty"`
// __Required when `token` is provided.__ Unique ID of the customer.
CustomerId *string `json:"customer_id,omitempty"`
// Number of installments for deferred payments. Available only to merchant users in Brazil.
// Min: 1
// Max: 12
Installments *int `json:"installments,omitempty"`
// Mandate is passed when a card is to be tokenized
Mandate *MandatePayload `json:"mandate,omitempty"`
// Describes the payment method used to attempt processing
PaymentType ProcessCheckoutBodyPaymentType `json:"payment_type"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
// __Required when using a tokenized card to process a checkout.__ Unique token identifying the saved payment card
// for a customer.
Token *string `json:"token,omitempty"`
}
ProcessCheckoutBodyPaymentType: Describes the payment method used to attempt processing
type ProcessCheckoutBodyPaymentType string
const (
ProcessCheckoutBodyPaymentTypeBancontact ProcessCheckoutBodyPaymentType = "bancontact"
ProcessCheckoutBodyPaymentTypeBlik ProcessCheckoutBodyPaymentType = "blik"
ProcessCheckoutBodyPaymentTypeBoleto ProcessCheckoutBodyPaymentType = "boleto"
ProcessCheckoutBodyPaymentTypeCard ProcessCheckoutBodyPaymentType = "card"
ProcessCheckoutBodyPaymentTypeIdeal ProcessCheckoutBodyPaymentType = "ideal"
)
type ProcessCheckoutResponse struct {
CheckoutSuccess *CheckoutSuccess
CheckoutAccepted *CheckoutAccepted
}
func (r *ProcessCheckoutResponse) AsCheckoutAccepted() (*CheckoutAccepted, bool)
func (r *ProcessCheckoutResponse) AsCheckoutSuccess() (*CheckoutSuccess, bool)
import "github.com/sumup/sumup-go/client"
- Constants
- type Client
- func New(opts ...ClientOption) *Client
- func (c *Client) Call(ctx context.Context, method, path string, opts ...RequestOption) (*http.Response, error)
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error)
- func (c *Client) WithAPIKey(key string) ClientOption
- func (c *Client) WithBaseURL(base string) ClientOption
- func (c *Client) WithHTTPClient(client *http.Client) ClientOption
- type ClientOption
- type RequestOption
const (
// APIUrl is the URL of our API.
APIUrl = "https://api.sumup.com"
)
type Client struct {
// contains filtered or unexported fields
}
func New(opts ...ClientOption) *Client
New creates new HTTP API client. The client is by default configured with environment variables (e.g. `SUMUP_API_KEY`). To override the default configuration use [ClientOption]s.
func (c *Client) Call(ctx context.Context, method, path string, opts ...RequestOption) (*http.Response, error)
Call executes a SumUp API call. Use [RequestOption]s to configure the request.
func (c *Client) Do(req *http.Request) (*http.Response, error)
Do sends an HTTP request and returns an HTTP response, following policy (such as redirects, cookies, auth) as configured on the HTTP client.
func (c *Client) NewRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error)
NewRequest returns a new [http.Request] given a method, URL, and optional body.
NewRequest returns a Request suitable for use with Client.Do.
func (c *Client) WithAPIKey(key string) ClientOption
WithAPIKey returns a ClientOption that configures the client with an API key for authorization.
func (c *Client) WithBaseURL(base string) ClientOption
WithBaseURL returns a ClientOption that configures the client with a base URL that the individual API call paths will be resolved against.
func (c *Client) WithHTTPClient(client *http.Client) ClientOption
WithClient returns a ClientOption that configures the client to use a specific http client for underlying requests.
ClientOption is an option for the SumUp API client.
type ClientOption func(c *Client) error
RequestOption is an option for the request made by the SumUp Client.
type RequestOption func(req *request) error
func WithHTTPClient(client *http.Client) RequestOption
WithHTTPClient returns a RequestOption that overrides the underlying [http.Client] of the service used to make the request.
func WithHeader(key, value string) RequestOption
WithHeader returns a RequestOption that sets a header key-value pair. Any previously set value will be overwritten.
func WithJSONBody(v any) RequestOption
WithBody returns a RequestOption that sets the request body as a JSON of the value v.
func WithQueryValues(q url.Values) RequestOption
WithQueryValues returns a RequestOption that sets the request query params.
import "github.com/sumup/sumup-go/customers"
- type CreateCustomerBody
- type Customer
- type CustomersService
- func NewCustomersService(c *client.Client) *CustomersService
- func (s *CustomersService) Create(ctx context.Context, body CreateCustomerBody) (*Customer, error)
- func (s *CustomersService) DeactivatePaymentInstrument(ctx context.Context, customerId string, token string) (*DeactivatePaymentInstrument204Response, error)
- func (s *CustomersService) Get(ctx context.Context, customerId string) (*Customer, error)
- func (s *CustomersService) ListPaymentInstruments(ctx context.Context, customerId string) (*ListPaymentInstruments200Response, error)
- func (s *CustomersService) Update(ctx context.Context, customerId string, body UpdateCustomerBody) (*Customer, error)
- type DeactivatePaymentInstrument204Response
- type ListPaymentInstruments200Response
- type PaymentInstrumentResponse
- type PaymentInstrumentResponseCard
- type PaymentInstrumentResponseCardType
- type PaymentInstrumentResponseType
- type UpdateCustomerBody
CreateCustomerBody is a schema definition.
type CreateCustomerBody struct {
// Unique ID of the customer.
CustomerId string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
Customer is a schema definition.
type Customer struct {
// Unique ID of the customer.
CustomerId string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
type CustomersService struct {
// contains filtered or unexported fields
}
func NewCustomersService(c *client.Client) *CustomersService
func (s *CustomersService) Create(ctx context.Context, body CreateCustomerBody) (*Customer, error)
Create: Create a customer Creates a new saved customer resource which you can later manipulate and save payment instruments to.
func (s *CustomersService) DeactivatePaymentInstrument(ctx context.Context, customerId string, token string) (*DeactivatePaymentInstrument204Response, error)
DeactivatePaymentInstrument: Deactivate a payment instrument Deactivates an identified card payment instrument resource for a customer.
func (s *CustomersService) Get(ctx context.Context, customerId string) (*Customer, error)
Get: Retrieve a customer Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
func (s *CustomersService) ListPaymentInstruments(ctx context.Context, customerId string) (*ListPaymentInstruments200Response, error)
ListPaymentInstruments: List payment instruments Lists all payment instrument resources that are saved for an identified customer.
func (s *CustomersService) Update(ctx context.Context, customerId string, body UpdateCustomerBody) (*Customer, error)
Update: Update a customer Updates an identified saved customer resource's personal details.
The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.
DeactivatePaymentInstrument204Response is a schema definition.
type DeactivatePaymentInstrument204Response struct {
}
ListPaymentInstruments200Response is a schema definition.
type ListPaymentInstruments200Response []PaymentInstrumentResponse
PaymentInstrumentResponse: Payment Instrument Response
type PaymentInstrumentResponse struct {
// Indicates whether the payment instrument is active and can be used for payments. To deactivate it, send a
// `DELETE` request to the resource endpoint.
// Read only
// Default: true
Active *bool `json:"active,omitempty"`
// Details of the payment card.
Card *PaymentInstrumentResponseCard `json:"card,omitempty"`
// Creation date of payment instrument. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
CreatedAt *time.Time `json:"created_at,omitempty"`
// Created mandate
Mandate *shared.MandateResponse `json:"mandate,omitempty"`
// Unique token identifying the saved payment card for a customer.
// Read only
Token *string `json:"token,omitempty"`
// Type of the payment instrument.
Type *PaymentInstrumentResponseType `json:"type,omitempty"`
}
PaymentInstrumentResponseCard: Details of the payment card.
type PaymentInstrumentResponseCard struct {
// Last 4 digits of the payment card number.
// Read only
// Min length: 4
// Max length: 4
Last4Digits *string `json:"last_4_digits,omitempty"`
// Issuing card network of the payment card.
// Read only
Type *PaymentInstrumentResponseCardType `json:"type,omitempty"`
}
PaymentInstrumentResponseCardType: Issuing card network of the payment card. Read only
type PaymentInstrumentResponseCardType string
const (
PaymentInstrumentResponseCardTypeAmex PaymentInstrumentResponseCardType = "AMEX"
PaymentInstrumentResponseCardTypeCup PaymentInstrumentResponseCardType = "CUP"
PaymentInstrumentResponseCardTypeDiners PaymentInstrumentResponseCardType = "DINERS"
PaymentInstrumentResponseCardTypeDiscover PaymentInstrumentResponseCardType = "DISCOVER"
PaymentInstrumentResponseCardTypeElo PaymentInstrumentResponseCardType = "ELO"
PaymentInstrumentResponseCardTypeElv PaymentInstrumentResponseCardType = "ELV"
PaymentInstrumentResponseCardTypeHipercard PaymentInstrumentResponseCardType = "HIPERCARD"
PaymentInstrumentResponseCardTypeJcb PaymentInstrumentResponseCardType = "JCB"
PaymentInstrumentResponseCardTypeMaestro PaymentInstrumentResponseCardType = "MAESTRO"
PaymentInstrumentResponseCardTypeMastercard PaymentInstrumentResponseCardType = "MASTERCARD"
PaymentInstrumentResponseCardTypeUnknown PaymentInstrumentResponseCardType = "UNKNOWN"
PaymentInstrumentResponseCardTypeVisa PaymentInstrumentResponseCardType = "VISA"
PaymentInstrumentResponseCardTypeVisaElectron PaymentInstrumentResponseCardType = "VISA_ELECTRON"
PaymentInstrumentResponseCardTypeVisaVpay PaymentInstrumentResponseCardType = "VISA_VPAY"
)
PaymentInstrumentResponseType: Type of the payment instrument.
type PaymentInstrumentResponseType string
const (
PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)
UpdateCustomerBody is a schema definition.
type UpdateCustomerBody struct {
// Personal details for the customer.
PersonalDetails *shared.PersonalDetails `json:"personal_details,omitempty"`
}
import "github.com/sumup/sumup-go/members"
- type CreateMerchantMemberBody
- type ListMerchantMembers200Response
- type ListMerchantMembersParams
- type Member
- type MembersService
- func NewMembersService(c *client.Client) *MembersService
- func (s *MembersService) Create(ctx context.Context, merchantCode string, body CreateMerchantMemberBody) (*Member, error)
- func (s *MembersService) Delete(ctx context.Context, merchantCode string, memberId string) error
- func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)
- func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)
- func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, body UpdateMerchantMemberBody) (*Member, error)
- type MembershipUser
- type MembershipUserClassic
- type UpdateMerchantMemberBody
- type UpdateMerchantMemberBodyUser
CreateMerchantMemberBody is a schema definition.
type CreateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.Attributes `json:"attributes,omitempty"`
// Email address of the member to add.
// Format: email
Email string `json:"email"`
// True if the user is managed by the merchant. In this case, we'll created a virtual user with the provided password
// and nickname.
IsManagedUser *bool `json:"is_managed_user,omitempty"`
// True if the user is a service account. It can later be used to create OAuth2 clients.
IsServiceAccount *bool `json:"is_service_account,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// Nickname of the member to add. Only used if `is_managed_user` is true. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// Password of the member to add. Only used if `is_managed_user` is true. In the case of service accounts, the
// password is not used and can not be defined by the caller.
// Format: password
// Min length: 8
Password *string `json:"password,omitempty"`
// List of roles to assign to the new member. In the case of service accounts, the roles are predefined.
Roles []string `json:"roles"`
}
ListMerchantMembers200Response is a schema definition.
type ListMerchantMembers200Response struct {
Items []Member `json:"items"`
TotalCount *int `json:"total_count,omitempty"`
}
ListMerchantMembersParams: query parameters for ListMerchantMembers
type ListMerchantMembersParams struct {
// Filter the returned members by email address prefix.
Email *string
// Maximum number of members to return.
Limit *int
// Offset of the first member to return.
Offset *int
// Filter the returned members by role.
Roles *[]string
// Indicates to skip count query.
Scroll *bool
// Filter the returned members by the membership status.
Status *shared.MembershipStatus
}
func (p *ListMerchantMembersParams) QueryValues() url.Values
QueryValues converts ListMerchantMembersParams into [url.Values].
Member: A member is user within specific resource identified by resource id, resource type, and associated roles.
type Member struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.Attributes `json:"attributes,omitempty"`
// The timestamp of when the member was created.
CreatedAt time.Time `json:"created_at"`
// ID of the member.
Id string `json:"id"`
// Pending invitation for membership.
Invite *shared.Invite `json:"invite,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// User's permissions.
Permissions []string `json:"permissions"`
// User's roles.
Roles []string `json:"roles"`
// The status of the membership.
Status shared.MembershipStatus `json:"status"`
// The timestamp of when the member was last updated.
UpdatedAt time.Time `json:"updated_at"`
// Information about the user associated with the membership.
User *MembershipUser `json:"user,omitempty"`
}
type MembersService struct {
// contains filtered or unexported fields
}
func NewMembersService(c *client.Client) *MembersService
func (s *MembersService) Create(ctx context.Context, merchantCode string, body CreateMerchantMemberBody) (*Member, error)
Create: Create a member Create a merchant member.
func (s *MembersService) Delete(ctx context.Context, merchantCode string, memberId string) error
Delete: Delete a member Deletes a merchant member.
func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)
Get: Retrieve a member Retrieve a merchant member.
func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)
List: List members Lists merchant members.
func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, body UpdateMerchantMemberBody) (*Member, error)
Update: Update a member Update the merchant member.
MembershipUser: Information about the user associated with the membership.
type MembershipUser struct {
// Classic identifiers of the user.
// Deprecated: this operation is deprecated
Classic *MembershipUserClassic `json:"classic,omitempty"`
// Time when the user has been disabled. Applies only to virtual users (`virtual_user: true`).
DisabledAt *time.Time `json:"disabled_at,omitempty"`
// End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The
// RP MUST NOT rely upon this value being unique, for unique identification use ID instead.
Email string `json:"email"`
// Identifier for the End-User (also called Subject).
Id string `json:"id"`
// True if the user has enabled MFA on login.
MfaOnLoginEnabled bool `json:"mfa_on_login_enabled"`
// User's preferred name. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// URL of the End-User's profile picture. This URL refers to an image file (for example, a PNG, JPEG, or GIF
// image file), rather than to a Web page containing an image.
// Format: uri
Picture *string `json:"picture,omitempty"`
// True if the user is a service account.
ServiceAccountUser bool `json:"service_account_user"`
// True if the user is a virtual user (operator).
VirtualUser bool `json:"virtual_user"`
}
MembershipUserClassic: Classic identifiers of the user. Deprecated: this operation is deprecated
type MembershipUserClassic struct {
// Format: int32
UserId int `json:"user_id"`
}
UpdateMerchantMemberBody is a schema definition.
type UpdateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.Attributes `json:"attributes,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
Roles *[]string `json:"roles,omitempty"`
// Allows you to update user data of managed users.
User *UpdateMerchantMemberBodyUser `json:"user,omitempty"`
}
UpdateMerchantMemberBodyUser: Allows you to update user data of managed users.
type UpdateMerchantMemberBodyUser struct {
// User's preferred name. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// Password of the member to add. Only used if `is_managed_user` is true.
// Format: password
// Min length: 8
Password *string `json:"password,omitempty"`
}
import "github.com/sumup/sumup-go/memberships"
- type ListMemberships200Response
- type ListMembershipsParams
- type Membership
- type MembershipResource
- type MembershipResourceType
- type MembershipType
- type MembershipsService
ListMemberships200Response is a schema definition.
type ListMemberships200Response struct {
Items []Membership `json:"items"`
TotalCount int `json:"total_count"`
}
ListMembershipsParams: query parameters for ListMemberships
type ListMembershipsParams struct {
// Filter memberships by resource kind.
Kind *string
// Maximum number of members to return.
Limit *int
// Offset of the first member to return.
Offset *int
// Filter memberships by the sandbox status of the resource the membership is in.
ResourceAttributesSandbox *bool
}
func (p *ListMembershipsParams) QueryValues() url.Values
QueryValues converts ListMembershipsParams into [url.Values].
Membership: A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.
type Membership struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.Attributes `json:"attributes,omitempty"`
// The timestamp of when the membership was created.
CreatedAt time.Time `json:"created_at"`
// ID of the membership.
Id string `json:"id"`
// Pending invitation for membership.
Invite *shared.Invite `json:"invite,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// User's permissions.
Permissions []string `json:"permissions"`
// Information about the resource the membership is in.
Resource MembershipResource `json:"resource"`
// ID of the resource the membership is in.
ResourceId string `json:"resource_id"`
// User's roles.
Roles []string `json:"roles"`
// The status of the membership.
Status shared.MembershipStatus `json:"status"`
// Type of the resource the membership is in.
Type MembershipType `json:"type"`
// The timestamp of when the membership was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
MembershipResource: Information about the resource the membership is in.
type MembershipResource struct {
// Object attributes that modifiable only by SumUp applications.
Attributes shared.Attributes `json:"attributes"`
// The timestamp of when the membership resource was created.
CreatedAt time.Time `json:"created_at"`
// ID of the resource the membership is in.
Id string `json:"id"`
// Logo fo the resource.
// Format: uri
// Max length: 256
Logo *string `json:"logo,omitempty"`
// Display name of the resource.
Name string `json:"name"`
Type MembershipResourceType `json:"type"`
// The timestamp of when the membership resource was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
MembershipResourceType is a schema definition.
type MembershipResourceType string
const (
MembershipResourceTypeMerchant MembershipResourceType = "merchant"
)
MembershipType: Type of the resource the membership is in.
type MembershipType string
const (
MembershipTypeMerchant MembershipType = "merchant"
)
type MembershipsService struct {
// contains filtered or unexported fields
}
func NewMembershipsService(c *client.Client) *MembershipsService
func (s *MembershipsService) List(ctx context.Context, params ListMembershipsParams) (*ListMemberships200Response, error)
List: List memberships List memberships of the current user.
import "github.com/sumup/sumup-go/merchant"
- type Account
- type AccountType
- type AddressWithDetails
- type AppSettings
- type BankAccount
- type BusinessOwner
- type BusinessOwners
- type CountryDetails
- type DoingBusinessAs
- type DoingBusinessAsAddress
- type GetAccountParams
- type LegalType
- type ListBankAccounts200Response
- type ListBankAccountsParams
- type ListBankAccountsV11200Response
- type ListBankAccountsV11Params
- type MerchantAccount
- type MerchantProfile
- type MerchantService
- func NewMerchantService(c *client.Client) *MerchantService
- func (s *MerchantService) Get(ctx context.Context, params GetAccountParams) (*MerchantAccount, error)
- func (s *MerchantService) GetDoingBusinessAs(ctx context.Context) (*DoingBusinessAs, error)
- func (s *MerchantService) GetMerchantProfile(ctx context.Context) (*MerchantProfile, error)
- func (s *MerchantService) GetPersonalProfile(ctx context.Context) (*PersonalProfile, error)
- func (s *MerchantService) GetSettings(ctx context.Context) (*MerchantSettings, error)
- func (s *MerchantService) ListBankAccounts(ctx context.Context, merchantCode string, params ListBankAccountsV11Params) (*ListBankAccountsV11200Response, error)
- func (s *MerchantService) ListBankAccountsDeprecated(ctx context.Context, params ListBankAccountsParams) (*ListBankAccounts200Response, error)
- type MerchantSettings
- type MerchantSettingsMotoPayment
- type PersonalProfile
- type TimeoffsetDetails
- type VatRates
Account: Profile information.
type Account struct {
// The role of the user.
Type *AccountType `json:"type,omitempty"`
// Username of the user profile.
Username *string `json:"username,omitempty"`
}
AccountType: The role of the user.
type AccountType string
const (
AccountTypeNormal AccountType = "normal"
AccountTypeOperator AccountType = "operator"
)
AddressWithDetails: Details of the registered address.
type AddressWithDetails struct {
// Address line 1
AddressLine1 *string `json:"address_line_1,omitempty"`
// Address line 2
AddressLine2 *string `json:"address_line_2,omitempty"`
// City
City *string `json:"city,omitempty"`
// undefined
Company *string `json:"company,omitempty"`
// Country ISO 3166-1 code
Country *string `json:"country,omitempty"`
// Country Details
CountryDetails *CountryDetails `json:"country_details,omitempty"`
// undefined
FirstName *string `json:"first_name,omitempty"`
// Landline number
Landline *string `json:"landline,omitempty"`
// undefined
LastName *string `json:"last_name,omitempty"`
// Postal code
PostCode *string `json:"post_code,omitempty"`
// Region code
RegionCode *string `json:"region_code,omitempty"`
// Country region id
RegionId *float64 `json:"region_id,omitempty"`
// Region name
RegionName *string `json:"region_name,omitempty"`
// undefined
StateId *string `json:"state_id,omitempty"`
// TimeOffset Details
TimeoffsetDetails *TimeoffsetDetails `json:"timeoffset_details,omitempty"`
}
AppSettings: Mobile app settings
type AppSettings struct {
// Advanced mode.
AdvancedMode *string `json:"advanced_mode,omitempty"`
// Barcode scanner.
BarcodeScanner *string `json:"barcode_scanner,omitempty"`
// Cash payment.
CashPayment *string `json:"cash_payment,omitempty"`
// Checkout preference
CheckoutPreference *string `json:"checkout_preference,omitempty"`
// Expected max transaction amount.
ExpectedMaxTransactionAmount *float64 `json:"expected_max_transaction_amount,omitempty"`
// Include vat.
IncludeVat *bool `json:"include_vat,omitempty"`
// Manual entry.
ManualEntry *string `json:"manual_entry,omitempty"`
// Manual entry tutorial.
ManualEntryTutorial *bool `json:"manual_entry_tutorial,omitempty"`
// Mobile payment.
MobilePayment *string `json:"mobile_payment,omitempty"`
// Mobile payment tutorial.
MobilePaymentTutorial *bool `json:"mobile_payment_tutorial,omitempty"`
// Reader payment.
ReaderPayment *string `json:"reader_payment,omitempty"`
// Referral.
Referral *string `json:"referral,omitempty"`
// Tax enabled.
TaxEnabled *bool `json:"tax_enabled,omitempty"`
// Terminal mode tutorial.
TerminalModeTutorial *bool `json:"terminal_mode_tutorial,omitempty"`
// Tip rates.
TipRates *[]float64 `json:"tip_rates,omitempty"`
// Tipping.
Tipping *string `json:"tipping,omitempty"`
}
BankAccount is a schema definition.
type BankAccount struct {
// Account category - business or personal
AccountCategory *string `json:"account_category,omitempty"`
AccountHolderName *string `json:"account_holder_name,omitempty"`
// Account number
AccountNumber *string `json:"account_number,omitempty"`
// Type of the account
AccountType *string `json:"account_type,omitempty"`
// Bank code
BankCode *string `json:"bank_code,omitempty"`
// Bank name
BankName *string `json:"bank_name,omitempty"`
// Branch code
BranchCode *string `json:"branch_code,omitempty"`
// Creation date of the bank account
CreatedAt *string `json:"created_at,omitempty"`
// IBAN
Iban *string `json:"iban,omitempty"`
// The primary bank account is the one used for payouts
Primary *bool `json:"primary,omitempty"`
// Status in the verification process
Status *string `json:"status,omitempty"`
// SWIFT code
Swift *string `json:"swift,omitempty"`
}
BusinessOwner is a schema definition.
type BusinessOwner struct {
// Date of birth
DateOfBirth *string `json:"date_of_birth,omitempty"`
// BO's first name
FirstName *string `json:"first_name,omitempty"`
// BO's Landline
Landline *string `json:"landline,omitempty"`
// BO's last name of the user
LastName *string `json:"last_name,omitempty"`
// Mobile phone number
MobilePhone *string `json:"mobile_phone,omitempty"`
// Ownership percentage
Ownership *float64 `json:"ownership,omitempty"`
}
BusinessOwners: Business owners information.
type BusinessOwners []BusinessOwner
CountryDetails: Country Details
type CountryDetails struct {
// Currency ISO 4217 code
Currency *string `json:"currency,omitempty"`
// Country EN name
EnName *string `json:"en_name,omitempty"`
// Country ISO code
IsoCode *string `json:"iso_code,omitempty"`
// Country native name
NativeName *string `json:"native_name,omitempty"`
}
DoingBusinessAs: Doing Business As information
type DoingBusinessAs struct {
Address *DoingBusinessAsAddress `json:"address,omitempty"`
// Doing business as name
BusinessName *string `json:"business_name,omitempty"`
// Doing business as company registration number
CompanyRegistrationNumber *string `json:"company_registration_number,omitempty"`
// Doing business as email
Email *string `json:"email,omitempty"`
// Doing business as VAT ID
VatId *string `json:"vat_id,omitempty"`
// Doing business as website
Website *string `json:"website,omitempty"`
}
DoingBusinessAsAddress is a schema definition.
type DoingBusinessAsAddress struct {
// Address line 1
AddressLine1 *string `json:"address_line_1,omitempty"`
// Address line 2
AddressLine2 *string `json:"address_line_2,omitempty"`
// City
City *string `json:"city,omitempty"`
// Country ISO 3166-1 code
Country *string `json:"country,omitempty"`
// Postal code
PostCode *string `json:"post_code,omitempty"`
// Country region ID
RegionId *float64 `json:"region_id,omitempty"`
// Country region name
RegionName *string `json:"region_name,omitempty"`
}
GetAccountParams: query parameters for GetAccount
type GetAccountParams struct {
// A list of additional information you want to receive for the user. By default only personal and merchant profile
// information will be returned.
Include *[]string
}
func (p *GetAccountParams) QueryValues() url.Values
QueryValues converts GetAccountParams into [url.Values].
LegalType: Id of the legal type of the merchant profile
type LegalType struct {
// Legal type short description
Description *string `json:"description,omitempty"`
// Legal type description
FullDescription *string `json:"full_description,omitempty"`
// Unique id
Id *float64 `json:"id,omitempty"`
// Sole trader legal type if true
SoleTrader *bool `json:"sole_trader,omitempty"`
}
ListBankAccounts200Response is a schema definition.
type ListBankAccounts200Response []BankAccount
ListBankAccountsParams: query parameters for ListBankAccounts
type ListBankAccountsParams struct {
// If true only the primary bank account (the one used for payouts) will be returned.
Primary *bool
}
func (p *ListBankAccountsParams) QueryValues() url.Values
QueryValues converts ListBankAccountsParams into [url.Values].
ListBankAccountsV11200Response is a schema definition.
type ListBankAccountsV11200Response []BankAccount
ListBankAccountsV11Params: query parameters for ListBankAccountsV11
type ListBankAccountsV11Params struct {
// If true only the primary bank account (the one used for payouts) will be returned.
Primary *bool
}
func (p *ListBankAccountsV11Params) QueryValues() url.Values
QueryValues converts ListBankAccountsV11Params into [url.Values].
MerchantAccount: Details of the merchant account.
type MerchantAccount struct {
// Profile information.
Account *Account `json:"account,omitempty"`
// Mobile app settings
AppSettings *AppSettings `json:"app_settings,omitempty"`
// Merchant comes from payleven BR migration
IsMigratedPaylevenBr *bool `json:"is_migrated_payleven_br,omitempty"`
// Account's merchant profile
MerchantProfile *MerchantProfile `json:"merchant_profile,omitempty"`
// User permissions
Permissions *shared.Permissions `json:"permissions,omitempty"`
// Account's personal profile.
PersonalProfile *PersonalProfile `json:"personal_profile,omitempty"`
}
MerchantProfile: Account's merchant profile
type MerchantProfile struct {
// Details of the registered address.
Address *AddressWithDetails `json:"address,omitempty"`
BankAccounts *[]BankAccount `json:"bank_accounts,omitempty"`
// Business owners information.
BusinessOwners *BusinessOwners `json:"business_owners,omitempty"`
// Company name
CompanyName *string `json:"company_name,omitempty"`
// Company registration number
CompanyRegistrationNumber *string `json:"company_registration_number,omitempty"`
// Merchant country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) (for
// internal usage only)
Country *string `json:"country,omitempty"`
// Doing Business As information
DoingBusinessAs *DoingBusinessAs `json:"doing_business_as,omitempty"`
// True if the merchant is extdev
Extdev *bool `json:"extdev,omitempty"`
// Id of the legal type of the merchant profile
LegalType *LegalType `json:"legal_type,omitempty"`
// Merchant locale (for internal usage only)
Locale *string `json:"locale,omitempty"`
// Merchant category code
MerchantCategoryCode *string `json:"merchant_category_code,omitempty"`
// Unique identifying code of the merchant profile
MerchantCode *string `json:"merchant_code,omitempty"`
// Mobile phone number
MobilePhone *string `json:"mobile_phone,omitempty"`
// Nature and purpose of the business
NatureAndPurpose *string `json:"nature_and_purpose,omitempty"`
// True if the payout zone of this merchant is migrated
PayoutZoneMigrated *bool `json:"payout_zone_migrated,omitempty"`
// Permanent certificate access code (Portugal)
PermanentCertificateAccessCode *string `json:"permanent_certificate_access_code,omitempty"`
// Merchant settings (like \"payout_type\", \"payout_period\")
Settings *MerchantSettings `json:"settings,omitempty"`
// Vat ID
VatId *string `json:"vat_id,omitempty"`
// Merchant VAT rates
VatRates *VatRates `json:"vat_rates,omitempty"`
// Website
Website *string `json:"website,omitempty"`
}
type MerchantService struct {
// contains filtered or unexported fields
}
func NewMerchantService(c *client.Client) *MerchantService
func (s *MerchantService) Get(ctx context.Context, params GetAccountParams) (*MerchantAccount, error)
Get: Retrieve a profile Returns user profile information.
func (s *MerchantService) GetDoingBusinessAs(ctx context.Context) (*DoingBusinessAs, error)
GetDoingBusinessAs: Retrieve DBA Retrieves Doing Business As profile.
func (s *MerchantService) GetMerchantProfile(ctx context.Context) (*MerchantProfile, error)
GetMerchantProfile: Retrieve a merchant profile Retrieves merchant profile data.
func (s *MerchantService) GetPersonalProfile(ctx context.Context) (*PersonalProfile, error)
GetPersonalProfile: Retrieve a personal profile Retrieves personal profile data.
func (s *MerchantService) GetSettings(ctx context.Context) (*MerchantSettings, error)
GetSettings: Get settings Retrieves merchant settings.
func (s *MerchantService) ListBankAccounts(ctx context.Context, merchantCode string, params ListBankAccountsV11Params) (*ListBankAccountsV11200Response, error)
ListBankAccounts: List bank accounts Retrieves bank accounts of the merchant.
func (s *MerchantService) ListBankAccountsDeprecated(ctx context.Context, params ListBankAccountsParams) (*ListBankAccounts200Response, error)
ListBankAccountsDeprecated: List bank accounts Retrieves bank accounts of the merchant. Deprecated: this operation is deprecated
MerchantSettings: Merchant settings (like \"payout_type\", \"payout_period\")
type MerchantSettings struct {
// Whether merchant will receive daily payout emails
DailyPayoutEmail *bool `json:"daily_payout_email,omitempty"`
// Whether merchant has gross settlement enabled
GrossSettlement *bool `json:"gross_settlement,omitempty"`
// Whether merchant will receive monthly payout emails
MonthlyPayoutEmail *bool `json:"monthly_payout_email,omitempty"`
// Whether merchant can make MOTO payments
MotoPayment *MerchantSettingsMotoPayment `json:"moto_payment,omitempty"`
// Payout Instrument
PayoutInstrument *string `json:"payout_instrument,omitempty"`
// Whether merchant will receive payouts on demand
PayoutOnDemand *bool `json:"payout_on_demand,omitempty"`
// Whether merchant can edit payouts on demand
PayoutOnDemandAvailable *bool `json:"payout_on_demand_available,omitempty"`
// Payout frequency
PayoutPeriod *string `json:"payout_period,omitempty"`
// Payout type
PayoutType *string `json:"payout_type,omitempty"`
// Whether to show printers in mobile app
PrintersEnabled *bool `json:"printers_enabled,omitempty"`
// Stone merchant code
StoneMerchantCode *string `json:"stone_merchant_code,omitempty"`
// Whether to show tax in receipts (saved per transaction)
TaxEnabled *bool `json:"tax_enabled,omitempty"`
}
MerchantSettingsMotoPayment: Whether merchant can make MOTO payments
type MerchantSettingsMotoPayment string
const (
MerchantSettingsMotoPaymentEnforced MerchantSettingsMotoPayment = "ENFORCED"
MerchantSettingsMotoPaymentOff MerchantSettingsMotoPayment = "OFF"
MerchantSettingsMotoPaymentOn MerchantSettingsMotoPayment = "ON"
MerchantSettingsMotoPaymentUnavailable MerchantSettingsMotoPayment = "UNAVAILABLE"
)
PersonalProfile: Account's personal profile.
type PersonalProfile struct {
// Details of the registered address.
Address *AddressWithDetails `json:"address,omitempty"`
Complete *bool `json:"complete,omitempty"`
// Date of birth
DateOfBirth *string `json:"date_of_birth,omitempty"`
// First name of the user
FirstName *string `json:"first_name,omitempty"`
// Last name of the user
LastName *string `json:"last_name,omitempty"`
// Mobile phone number
MobilePhone *string `json:"mobile_phone,omitempty"`
}
TimeoffsetDetails: TimeOffset Details
type TimeoffsetDetails struct {
// Daylight Saving Time
Dst *bool `json:"dst,omitempty"`
// UTC offset
Offset *float64 `json:"offset,omitempty"`
// Postal code
PostCode *string `json:"post_code,omitempty"`
}
VatRates: Merchant VAT rates
type VatRates struct {
// Country ISO code
Country *string `json:"country,omitempty"`
// Description
Description *string `json:"description,omitempty"`
// Internal ID
Id *float64 `json:"id,omitempty"`
// Ordering
Ordering *float64 `json:"ordering,omitempty"`
// Rate
Rate *float64 `json:"rate,omitempty"`
}
import "github.com/sumup/sumup-go/payouts"
- type FinancialPayout
- type FinancialPayoutStatus
- type FinancialPayoutType
- type FinancialPayouts
- type ListPayoutsParams
- type ListPayoutsV1Params
- type PayoutsService
FinancialPayout is a schema definition.
type FinancialPayout struct {
Amount *float64 `json:"amount,omitempty"`
Currency *string `json:"currency,omitempty"`
// Format: date
Date *shared.Date `json:"date,omitempty"`
Fee *float64 `json:"fee,omitempty"`
Id *int `json:"id,omitempty"`
Reference *string `json:"reference,omitempty"`
Status *FinancialPayoutStatus `json:"status,omitempty"`
TransactionCode *string `json:"transaction_code,omitempty"`
Type *FinancialPayoutType `json:"type,omitempty"`
}
FinancialPayoutStatus is a schema definition.
type FinancialPayoutStatus string
const (
FinancialPayoutStatusFailed FinancialPayoutStatus = "FAILED"
FinancialPayoutStatusSuccessful FinancialPayoutStatus = "SUCCESSFUL"
)
FinancialPayoutType is a schema definition.
type FinancialPayoutType string
const (
FinancialPayoutTypeBalanceDeduction FinancialPayoutType = "BALANCE_DEDUCTION"
FinancialPayoutTypeChargeBackDeduction FinancialPayoutType = "CHARGE_BACK_DEDUCTION"
FinancialPayoutTypeDdReturnDeduction FinancialPayoutType = "DD_RETURN_DEDUCTION"
FinancialPayoutTypePayout FinancialPayoutType = "PAYOUT"
FinancialPayoutTypeRefundDeduction FinancialPayoutType = "REFUND_DEDUCTION"
)
FinancialPayouts is a schema definition.
type FinancialPayouts []FinancialPayout
ListPayoutsParams: query parameters for ListPayouts
type ListPayoutsParams struct {
// End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
EndDate shared.Date
Format *string
Limit *int
Order *string
// Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
StartDate shared.Date
}
func (p *ListPayoutsParams) QueryValues() url.Values
QueryValues converts ListPayoutsParams into [url.Values].
ListPayoutsV1Params: query parameters for ListPayoutsV1
type ListPayoutsV1Params struct {
// End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
EndDate shared.Date
Format *string
Limit *int
Order *string
// Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
StartDate shared.Date
}
func (p *ListPayoutsV1Params) QueryValues() url.Values
QueryValues converts ListPayoutsV1Params into [url.Values].
type PayoutsService struct {
// contains filtered or unexported fields
}
func NewPayoutsService(c *client.Client) *PayoutsService
func (s *PayoutsService) List(ctx context.Context, merchantCode string, params ListPayoutsV1Params) (*FinancialPayouts, error)
List: List payouts Lists ordered payouts for the merchant profile.
func (s *PayoutsService) ListDeprecated(ctx context.Context, params ListPayoutsParams) (*FinancialPayouts, error)
ListDeprecated: List payouts Lists ordered payouts for the merchant profile. Deprecated: this operation is deprecated
import "github.com/sumup/sumup-go/readers"
- type Affiliate
- type AffiliateTags
- type CreateReaderBody
- type CreateReaderCheckout
- type CreateReaderCheckout201Response
- type CreateReaderCheckout201ResponseData
- type CreateReaderCheckout400Response
- type CreateReaderCheckout400ResponseErrors
- type CreateReaderCheckout422Response
- type CreateReaderCheckout422ResponseErrors
- type CreateReaderCheckout500Response
- type CreateReaderCheckout500ResponseErrors
- type CreateReaderCheckout502Response
- type CreateReaderCheckout502ResponseErrors
- type CreateReaderCheckout504Response
- type CreateReaderCheckout504ResponseErrors
- type CreateReaderCheckoutAmount
- type CreateReaderCheckoutBody
- type CreateReaderCheckoutBodyCardType
- type CreateReaderCheckoutCardType
- type CreateReaderTerminate422Response
- type CreateReaderTerminate422ResponseErrors
- type CreateReaderTerminate500Response
- type CreateReaderTerminate500ResponseErrors
- type CreateReaderTerminate502Response
- type CreateReaderTerminate502ResponseErrors
- type CreateReaderTerminate504Response
- type CreateReaderTerminate504ResponseErrors
- type GetReaderParams
- type ListReaders200Response
- type Meta
- type Reader
- type ReaderDevice
- type ReaderDeviceModel
- type ReaderId
- type ReaderName
- type ReaderPairingCode
- type ReaderStatus
- type ReadersService
- func NewReadersService(c *client.Client) *ReadersService
- func (s *ReadersService) Create(ctx context.Context, merchantCode string, body CreateReaderBody) (*Reader, error)
- func (s *ReadersService) CreateCheckout(ctx context.Context, merchantCode string, id string, body CreateReaderCheckoutBody) (*CreateReaderCheckout201Response, error)
- func (s *ReadersService) DeleteReader(ctx context.Context, merchantCode string, id ReaderId) error
- func (s *ReadersService) Get(ctx context.Context, merchantCode string, id ReaderId, params GetReaderParams) (*Reader, error)
- func (s *ReadersService) List(ctx context.Context, merchantCode string) (*ListReaders200Response, error)
- func (s *ReadersService) TerminateCheckout(ctx context.Context, merchantCode string, id string) error
- func (s *ReadersService) Update(ctx context.Context, merchantCode string, id ReaderId, body UpdateReaderBody) error
- type UpdateReaderBody
Affiliate: Affiliate metadata for the transaction. It is an optional field that allow for integrators to track the source of the transaction.
type Affiliate struct {
// Application ID of the affiliate.
// It is a unique identifier for the application and should be set by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.
AppId string `json:"app_id"`
// Foreign transaction ID of the affiliate.
// It is a unique identifier for the transaction.
// It can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).
ForeignTransactionId string `json:"foreign_transaction_id"`
// Key of the affiliate.
// It is a unique identifier for the key and should be generated by the integrator in the [Affiliate Keys](https://developer.sumup.com/affiliate-keys) page.
//
// Format: uuid
Key string `json:"key"`
// Additional metadata for the transaction.
// It is key-value object that can be associated with the transaction.
Tags *AffiliateTags `json:"tags,omitempty"`
}
AffiliateTags: Additional metadata for the transaction. It is key-value object that can be associated with the transaction.
type AffiliateTags map[string]any
CreateReaderBody is a schema definition.
type CreateReaderBody struct {
// Set of user-defined key-value pairs attached to the object.
// Max properties: 50
Meta *Meta `json:"meta,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name *ReaderName `json:"name,omitempty"`
// The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating
// the pairing. It is used to link the physical device to the created pairing.
// Min length: 8
// Max length: 9
PairingCode ReaderPairingCode `json:"pairing_code"`
}
CreateReaderCheckout: Reader Checkout
type CreateReaderCheckout struct {
// Affiliate metadata for the transaction.
// It is an optional field that allow for integrators to track the source of the transaction.
Affiliate *Affiliate `json:"affiliate,omitempty"`
// The card type of the card used for the transaction.
// Is is required only for some countries (e.g: Brazil).
CardType *CreateReaderCheckoutCardType `json:"card_type,omitempty"`
// Description of the checkout to be shown in the Merchant Sales
Description *string `json:"description,omitempty"`
// Number of installments for the transaction.
// It may vary according to the merchant country.
// For example, in Brazil, the maximum number of installments is 12.
Installments *int `json:"installments,omitempty"`
// Webhook URL to which the payment result will be sent.
// It must be a HTTPS url.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// List of tipping rates to be displayed to the cardholder.
// The rates are in percentage and should be between 0.01 and 0.99.
// The list should be sorted in ascending order.
TipRates *[]float64 `json:"tip_rates,omitempty"`
// Amount of the transaction.
// The amount is represented as an integer value altogether with the currency and the minor unit.
// For example, EUR 1.00 is represented as value 100 with minor unit of 2.
TotalAmount CreateReaderCheckoutAmount `json:"total_amount"`
}
CreateReaderCheckout201Response is a schema definition.
type CreateReaderCheckout201Response struct {
Data *CreateReaderCheckout201ResponseData `json:"data,omitempty"`
}
CreateReaderCheckout201ResponseData is a schema definition.
type CreateReaderCheckout201ResponseData struct {
// The client transaction ID is a unique identifier for the transaction that is generated for the client.
// It can be used later to fetch the transaction details via the [Transactions API](https://developer.sumup.com/api/transactions/get).
// Format: uuid
ClientTransactionId *string `json:"client_transaction_id,omitempty"`
}
CreateReaderCheckout400Response is a schema definition.
type CreateReaderCheckout400Response struct {
Errors *CreateReaderCheckout400ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderCheckout400Response) Error() string
CreateReaderCheckout400ResponseErrors is a schema definition.
type CreateReaderCheckout400ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderCheckout422Response is a schema definition.
type CreateReaderCheckout422Response struct {
Errors *CreateReaderCheckout422ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderCheckout422Response) Error() string
CreateReaderCheckout422ResponseErrors is a schema definition.
type CreateReaderCheckout422ResponseErrors map[string]any
CreateReaderCheckout500Response is a schema definition.
type CreateReaderCheckout500Response struct {
Errors *CreateReaderCheckout500ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderCheckout500Response) Error() string
CreateReaderCheckout500ResponseErrors is a schema definition.
type CreateReaderCheckout500ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderCheckout502Response is a schema definition.
type CreateReaderCheckout502Response struct {
Errors *CreateReaderCheckout502ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderCheckout502Response) Error() string
CreateReaderCheckout502ResponseErrors is a schema definition.
type CreateReaderCheckout502ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderCheckout504Response is a schema definition.
type CreateReaderCheckout504Response struct {
Errors *CreateReaderCheckout504ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderCheckout504Response) Error() string
CreateReaderCheckout504ResponseErrors is a schema definition.
type CreateReaderCheckout504ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderCheckoutAmount: Amount of the transaction. The amount is represented as an integer value altogether with the currency and the minor unit. For example, EUR 1.00 is represented as value 100 with minor unit of 2.
type CreateReaderCheckoutAmount struct {
// Currency ISO 4217 code
Currency string `json:"currency"`
// The minor units of the currency. It represents the number of decimals of the currency.
// For the currencies CLP, COP and HUF, the minor unit is 0.
MinorUnit int `json:"minor_unit"`
// Total amount of the transaction.
// It must be a positive integer.
Value int `json:"value"`
}
CreateReaderCheckoutBody: Reader Checkout
type CreateReaderCheckoutBody struct {
// Affiliate metadata for the transaction.
// It is an optional field that allow for integrators to track the source of the transaction.
Affiliate *Affiliate `json:"affiliate,omitempty"`
// The card type of the card used for the transaction.
// Is is required only for some countries (e.g: Brazil).
CardType *CreateReaderCheckoutBodyCardType `json:"card_type,omitempty"`
// Description of the checkout to be shown in the Merchant Sales
Description *string `json:"description,omitempty"`
// Number of installments for the transaction.
// It may vary according to the merchant country.
// For example, in Brazil, the maximum number of installments is 12.
Installments *int `json:"installments,omitempty"`
// Webhook URL to which the payment result will be sent.
// It must be a HTTPS url.
// Format: uri
ReturnUrl *string `json:"return_url,omitempty"`
// List of tipping rates to be displayed to the cardholder.
// The rates are in percentage and should be between 0.01 and 0.99.
// The list should be sorted in ascending order.
TipRates *[]float64 `json:"tip_rates,omitempty"`
// Amount of the transaction.
// The amount is represented as an integer value altogether with the currency and the minor unit.
// For example, EUR 1.00 is represented as value 100 with minor unit of 2.
TotalAmount CreateReaderCheckoutAmount `json:"total_amount"`
}
CreateReaderCheckoutBodyCardType: The card type of the card used for the transaction. Is is required only for some countries (e.g: Brazil).
type CreateReaderCheckoutBodyCardType string
const (
CreateReaderCheckoutBodyCardTypeCredit CreateReaderCheckoutBodyCardType = "credit"
CreateReaderCheckoutBodyCardTypeDebit CreateReaderCheckoutBodyCardType = "debit"
)
CreateReaderCheckoutCardType: The card type of the card used for the transaction. Is is required only for some countries (e.g: Brazil).
type CreateReaderCheckoutCardType string
const (
CreateReaderCheckoutCardTypeCredit CreateReaderCheckoutCardType = "credit"
CreateReaderCheckoutCardTypeDebit CreateReaderCheckoutCardType = "debit"
)
CreateReaderTerminate422Response is a schema definition.
type CreateReaderTerminate422Response struct {
Errors *CreateReaderTerminate422ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderTerminate422Response) Error() string
CreateReaderTerminate422ResponseErrors is a schema definition.
type CreateReaderTerminate422ResponseErrors map[string]any
CreateReaderTerminate500Response is a schema definition.
type CreateReaderTerminate500Response struct {
Errors *CreateReaderTerminate500ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderTerminate500Response) Error() string
CreateReaderTerminate500ResponseErrors is a schema definition.
type CreateReaderTerminate500ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderTerminate502Response is a schema definition.
type CreateReaderTerminate502Response struct {
Errors *CreateReaderTerminate502ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderTerminate502Response) Error() string
CreateReaderTerminate502ResponseErrors is a schema definition.
type CreateReaderTerminate502ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
CreateReaderTerminate504Response is a schema definition.
type CreateReaderTerminate504Response struct {
Errors *CreateReaderTerminate504ResponseErrors `json:"errors,omitempty"`
}
func (e *CreateReaderTerminate504Response) Error() string
CreateReaderTerminate504ResponseErrors is a schema definition.
type CreateReaderTerminate504ResponseErrors struct {
Detail *string `json:"detail,omitempty"`
}
GetReaderParams: query parameters for GetReader
type GetReaderParams struct {
// Return the reader only if it has been modified after the specified timestamp given in the headers.
//
// Timestamps are accepted in the following formats:
//
// - HTTP Standard: [IMF format (RFC 5322)](https://www.rfc-editor.org/rfc/rfc5322#section-3.3), sometimes also
// referred to as [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1).
// - RFC 3339: Used for timestamps in JSON payloads on this API.
IfModifiedSince *string
}
func (p *GetReaderParams) QueryValues() url.Values
QueryValues converts GetReaderParams into [url.Values].
ListReaders200Response is a schema definition.
type ListReaders200Response struct {
Items []Reader `json:"items"`
}
Meta: Set of user-defined key-value pairs attached to the object. Max properties: 50
type Meta map[string]any
Reader: A physical card reader device that can accept in-person payments.
type Reader struct {
// The timestamp of when the reader was created.
CreatedAt time.Time `json:"created_at"`
// Information about the underlying physical device.
Device ReaderDevice `json:"device"`
// Unique identifier of the object.
// Note that this identifies the instance of the physical devices pairing with your SumUp account.
// If you DELETE a reader, and pair the device again, the ID will be different. Do not use this ID to refer to
// a physical device.
// Min length: 30
// Max length: 30
Id ReaderId `json:"id"`
// Set of user-defined key-value pairs attached to the object.
// Max properties: 50
Meta *Meta `json:"meta,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name ReaderName `json:"name"`
// The status of the reader object gives information about the current state of the reader.
//
// Possible values:
//
// - `unknown` - The reader status is unknown.
// - `processing` - The reader is created and waits for the physical device to confirm the pairing.
// - `paired` - The reader is paired with a merchant account and can be used with SumUp APIs.
// - `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated
Status ReaderStatus `json:"status"`
// The timestamp of when the reader was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
ReaderDevice: Information about the underlying physical device.
type ReaderDevice struct {
// A unique identifier of the physical device (e.g. serial number).
Identifier string `json:"identifier"`
// Identifier of the model of the device.
Model ReaderDeviceModel `json:"model"`
}
ReaderDeviceModel: Identifier of the model of the device.
type ReaderDeviceModel string
const (
ReaderDeviceModelSolo ReaderDeviceModel = "solo"
ReaderDeviceModelVirtualSolo ReaderDeviceModel = "virtual-solo"
)
ReaderId: Unique identifier of the object. Note that this identifies the instance of the physical devices pairing with your SumUp account. If you DELETE a reader, and pair the device again, the ID will be different. Do not use this ID to refer to a physical device. Min length: 30 Max length: 30
type ReaderId string
ReaderName: Custom human-readable, user-defined name for easier identification of the reader. Max length: 500
type ReaderName string
ReaderPairingCode: The pairing code is a 8 or 9 character alphanumeric string that is displayed on a SumUp Device after initiating the pairing. It is used to link the physical device to the created pairing. Min length: 8 Max length: 9
type ReaderPairingCode string
ReaderStatus: The status of the reader object gives information about the current state of the reader.
Possible values:
- `unknown` - The reader status is unknown. - `processing` - The reader is created and waits for the physical device to confirm the pairing. - `paired` - The reader is paired with a merchant account and can be used with SumUp APIs. - `expired` - The pairing is expired and no longer usable with the account. The resource needs to get recreated
type ReaderStatus string
const (
ReaderStatusExpired ReaderStatus = "expired"
ReaderStatusPaired ReaderStatus = "paired"
ReaderStatusProcessing ReaderStatus = "processing"
ReaderStatusUnknown ReaderStatus = "unknown"
)
type ReadersService struct {
// contains filtered or unexported fields
}
func NewReadersService(c *client.Client) *ReadersService
func (s *ReadersService) Create(ctx context.Context, merchantCode string, body CreateReaderBody) (*Reader, error)
Create: Create a Reader Create a new Reader for the merchant account.
func (s *ReadersService) CreateCheckout(ctx context.Context, merchantCode string, id string, body CreateReaderCheckoutBody) (*CreateReaderCheckout201Response, error)
CreateCheckout: Create a Reader Checkout Create a Checkout for a Reader.
This process is asynchronous and the actual transaction may take some time to be stared on the device.
There are some caveats when using this endpoint: * The target device must be online, otherwise checkout won't be accepted * After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.
**Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.
func (s *ReadersService) DeleteReader(ctx context.Context, merchantCode string, id ReaderId) error
DeleteReader: Delete a reader Delete a reader.
func (s *ReadersService) Get(ctx context.Context, merchantCode string, id ReaderId, params GetReaderParams) (*Reader, error)
Get: Retrieve a Reader Retrieve a Reader.
func (s *ReadersService) List(ctx context.Context, merchantCode string) (*ListReaders200Response, error)
List: List Readers List all readers of the merchant.
func (s *ReadersService) TerminateCheckout(ctx context.Context, merchantCode string, id string) error
TerminateCheckout: Create a Reader Terminate action Create a Terminate action for a Reader.
It stops the current transaction on the target device.
This process is asynchronous and the actual termination may take some time to be performed on the device.
There are some caveats when using this endpoint: * The target device must be online, otherwise terminate won't be accepted * The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc. * There is no confirmation of the termination.
If a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.
**Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.
func (s *ReadersService) Update(ctx context.Context, merchantCode string, id ReaderId, body UpdateReaderBody) error
Update: Update a Reader Update a Reader.
UpdateReaderBody is a schema definition.
type UpdateReaderBody struct {
// Set of user-defined key-value pairs attached to the object.
// Max properties: 50
Meta *Meta `json:"meta,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name *ReaderName `json:"name,omitempty"`
}
import "github.com/sumup/sumup-go/receipts"
- type GetReceiptParams
- type Receipt
- type ReceiptAcquirerData
- type ReceiptCard
- type ReceiptEmvData
- type ReceiptEvent
- type ReceiptMerchantData
- type ReceiptMerchantDataMerchantProfile
- type ReceiptMerchantDataMerchantProfileAddress
- type ReceiptTransaction
- type ReceiptTransactionProduct
- type ReceiptTransactionVatRate
- type ReceiptsService
GetReceiptParams: query parameters for GetReceipt
type GetReceiptParams struct {
// Merchant code.
Mid string
// The ID of the transaction event (refund).
TxEventId *int
}
func (p *GetReceiptParams) QueryValues() url.Values
QueryValues converts GetReceiptParams into [url.Values].
Receipt is a schema definition.
type Receipt struct {
AcquirerData *ReceiptAcquirerData `json:"acquirer_data,omitempty"`
EmvData *ReceiptEmvData `json:"emv_data,omitempty"`
// Receipt merchant data
MerchantData *ReceiptMerchantData `json:"merchant_data,omitempty"`
// Transaction information.
TransactionData *ReceiptTransaction `json:"transaction_data,omitempty"`
}
ReceiptAcquirerData is a schema definition.
type ReceiptAcquirerData struct {
AuthorizationCode *string `json:"authorization_code,omitempty"`
LocalTime *string `json:"local_time,omitempty"`
ReturnCode *string `json:"return_code,omitempty"`
Tid *string `json:"tid,omitempty"`
}
ReceiptCard is a schema definition.
type ReceiptCard struct {
// Card last 4 digits.
Last4Digits *string `json:"last_4_digits,omitempty"`
// Card Scheme.
Type *string `json:"type,omitempty"`
}
ReceiptEmvData is a schema definition.
type ReceiptEmvData struct {
}
ReceiptEvent is a schema definition.
type ReceiptEvent struct {
// Amount of the event.
Amount *shared.AmountEvent `json:"amount,omitempty"`
// Unique ID of the transaction event.
// Format: int64
Id *shared.EventId `json:"id,omitempty"`
ReceiptNo *string `json:"receipt_no,omitempty"`
// Status of the transaction event.
Status *shared.EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
// Unique ID of the transaction.
TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
// Type of the transaction event.
Type *shared.EventType `json:"type,omitempty"`
}
ReceiptMerchantData: Receipt merchant data
type ReceiptMerchantData struct {
Locale *string `json:"locale,omitempty"`
MerchantProfile *ReceiptMerchantDataMerchantProfile `json:"merchant_profile,omitempty"`
}
ReceiptMerchantDataMerchantProfile is a schema definition.
type ReceiptMerchantDataMerchantProfile struct {
Address *ReceiptMerchantDataMerchantProfileAddress `json:"address,omitempty"`
BusinessName *string `json:"business_name,omitempty"`
Email *string `json:"email,omitempty"`
MerchantCode *string `json:"merchant_code,omitempty"`
}
ReceiptMerchantDataMerchantProfileAddress is a schema definition.
type ReceiptMerchantDataMerchantProfileAddress struct {
AddressLine1 *string `json:"address_line_1,omitempty"`
City *string `json:"city,omitempty"`
Country *string `json:"country,omitempty"`
CountryEnName *string `json:"country_en_name,omitempty"`
CountryNativeName *string `json:"country_native_name,omitempty"`
Landline *string `json:"landline,omitempty"`
PostCode *string `json:"post_code,omitempty"`
}
ReceiptTransaction: Transaction information.
type ReceiptTransaction struct {
// Transaction amount.
Amount *string `json:"amount,omitempty"`
Card *ReceiptCard `json:"card,omitempty"`
// Transaction currency.
Currency *string `json:"currency,omitempty"`
// Transaction entry mode.
EntryMode *string `json:"entry_mode,omitempty"`
// Events
Events *[]ReceiptEvent `json:"events,omitempty"`
// Number of installments.
InstallmentsCount *int `json:"installments_count,omitempty"`
// Transaction type.
PaymentType *string `json:"payment_type,omitempty"`
// Products
Products *[]ReceiptTransactionProduct `json:"products,omitempty"`
// Receipt number
ReceiptNo *string `json:"receipt_no,omitempty"`
// Transaction processing status.
Status *string `json:"status,omitempty"`
// Time created at.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Tip amount (included in transaction amount).
TipAmount *string `json:"tip_amount,omitempty"`
// Transaction code.
TransactionCode *string `json:"transaction_code,omitempty"`
// Transaction VAT amount.
VatAmount *string `json:"vat_amount,omitempty"`
// Vat rates.
VatRates *[]ReceiptTransactionVatRate `json:"vat_rates,omitempty"`
// Cardholder verification method.
VerificationMethod *string `json:"verification_method,omitempty"`
}
ReceiptTransactionProduct is a schema definition.
type ReceiptTransactionProduct struct {
// Product description.
Description *string `json:"description,omitempty"`
// Product name.
Name *string `json:"name,omitempty"`
// Product price.
Price *float64 `json:"price,omitempty"`
// Product quantity.
Quantity *int `json:"quantity,omitempty"`
// Quantity x product price.
TotalPrice *float64 `json:"total_price,omitempty"`
}
ReceiptTransactionVatRate is a schema definition.
type ReceiptTransactionVatRate struct {
// Gross
Gross *float64 `json:"gross,omitempty"`
// Net
Net *float64 `json:"net,omitempty"`
// Rate
Rate *float64 `json:"rate,omitempty"`
// Vat
Vat *float64 `json:"vat,omitempty"`
}
type ReceiptsService struct {
// contains filtered or unexported fields
}
func NewReceiptsService(c *client.Client) *ReceiptsService
func (s *ReceiptsService) Get(ctx context.Context, id string, params GetReceiptParams) (*Receipt, error)
Get: Retrieve receipt details Retrieves receipt specific data for a transaction.
import "github.com/sumup/sumup-go/roles"
- type CreateMerchantRoleBody
- type ListMerchantRoles200Response
- type Role
- type RolesService
- func NewRolesService(c *client.Client) *RolesService
- func (s *RolesService) Create(ctx context.Context, merchantCode string, body CreateMerchantRoleBody) (*Role, error)
- func (s *RolesService) Delete(ctx context.Context, merchantCode string, roleId string) error
- func (s *RolesService) Get(ctx context.Context, merchantCode string, roleId string) (*Role, error)
- func (s *RolesService) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)
- func (s *RolesService) Update(ctx context.Context, merchantCode string, roleId string, body UpdateMerchantRoleBody) (*Role, error)
- type UpdateMerchantRoleBody
CreateMerchantRoleBody is a schema definition.
type CreateMerchantRoleBody struct {
// User-defined description of the role.
Description *string `json:"description,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// User-defined name of the role.
Name string `json:"name"`
// User's permissions.
// Max items: 100
Permissions []string `json:"permissions"`
}
ListMerchantRoles200Response is a schema definition.
type ListMerchantRoles200Response struct {
Items []Role `json:"items"`
}
Role: A custom role that can be used to assign set of permissions to members.
type Role struct {
// The timestamp of when the role was created.
CreatedAt time.Time `json:"created_at"`
// User-defined description of the role.
Description *string `json:"description,omitempty"`
// Unique identifier of the role.
Id string `json:"id"`
// True if the role is provided by SumUp.
IsPredefined bool `json:"is_predefined"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// User-defined name of the role.
Name string `json:"name"`
// List of permission granted by this role.
// Max items: 100
Permissions []string `json:"permissions"`
// The timestamp of when the role was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
type RolesService struct {
// contains filtered or unexported fields
}
func NewRolesService(c *client.Client) *RolesService
func (s *RolesService) Create(ctx context.Context, merchantCode string, body CreateMerchantRoleBody) (*Role, error)
Create: Create a role Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.
func (s *RolesService) Delete(ctx context.Context, merchantCode string, roleId string) error
Delete: Delete a role Delete a custom role.
func (s *RolesService) Get(ctx context.Context, merchantCode string, roleId string) (*Role, error)
Get: Retrieve a role Retrieve a custom role by ID.
func (s *RolesService) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)
List: List roles List merchant's custom roles.
func (s *RolesService) Update(ctx context.Context, merchantCode string, roleId string, body UpdateMerchantRoleBody) (*Role, error)
Update: Update a role Update a custom role.
UpdateMerchantRoleBody is a schema definition.
type UpdateMerchantRoleBody struct {
// User-defined description of the role.
Description *string `json:"description,omitempty"`
// User-defined name of the role.
Name *string `json:"name,omitempty"`
// User's permissions.
// Max items: 100
Permissions *[]string `json:"permissions,omitempty"`
}
import "github.com/sumup/sumup-go/shared"
- type Address
- type AmountEvent
- type Attributes
- type Currency
- type Date
- type Error
- type ErrorForbidden
- type EventId
- type EventStatus
- type EventType
- type Invite
- type MandateResponse
- type MembershipStatus
- type Metadata
- type Permissions
- type PersonalDetails
- type Time
- type TimestampEvent
- type TransactionId
- type TransactionMixinBase
- type TransactionMixinBasePaymentType
- type TransactionMixinBaseStatus
- type TransactionMixinCheckout
- type TransactionMixinCheckoutEntryMode
Address: Profile's personal address information.
type Address struct {
// City name from the address.
City *string `json:"city,omitempty"`
// Two letter country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
Country *string `json:"country,omitempty"`
// First line of the address with details of the street name and number.
Line1 *string `json:"line_1,omitempty"`
// Second line of the address with details of the building, unit, apartment, and floor numbers.
Line2 *string `json:"line_2,omitempty"`
// Postal code from the address.
PostalCode *string `json:"postal_code,omitempty"`
// State name or abbreviation from the address.
State *string `json:"state,omitempty"`
}
AmountEvent: Amount of the event.
type AmountEvent float64
Attributes: Object attributes that modifiable only by SumUp applications.
type Attributes map[string]any
Currency: Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217\) code of the currency for the amount. Currently supported currency values are enumerated above.
type Currency string
const (
CurrencyBgn Currency = "BGN"
CurrencyBrl Currency = "BRL"
CurrencyChf Currency = "CHF"
CurrencyClp Currency = "CLP"
CurrencyCzk Currency = "CZK"
CurrencyDkk Currency = "DKK"
CurrencyEur Currency = "EUR"
CurrencyGbp Currency = "GBP"
CurrencyHrk Currency = "HRK"
CurrencyHuf Currency = "HUF"
CurrencyNok Currency = "NOK"
CurrencyPln Currency = "PLN"
CurrencyRon Currency = "RON"
CurrencySek Currency = "SEK"
CurrencyUsd Currency = "USD"
)
type Date struct{ time.Time }
func (d Date) MarshalJSON() ([]byte, error)
func (d Date) String() string
func (d *Date) UnmarshalJSON(b []byte) (err error)
Error: Error message structure.
type Error struct {
// Platform code for the error.
ErrorCode *string `json:"error_code,omitempty"`
// Short description of the error.
Message *string `json:"message,omitempty"`
}
func (e *Error) Error() string
ErrorForbidden: Error message for forbidden requests.
type ErrorForbidden struct {
// Platform code for the error.
ErrorCode *string `json:"error_code,omitempty"`
// Short description of the error.
ErrorMessage *string `json:"error_message,omitempty"`
// HTTP status code for the error.
StatusCode *string `json:"status_code,omitempty"`
}
func (e *ErrorForbidden) Error() string
EventId: Unique ID of the transaction event. Format: int64
type EventId int64
EventStatus: Status of the transaction event.
type EventStatus string
const (
EventStatusFailed EventStatus = "FAILED"
EventStatusPaidOut EventStatus = "PAID_OUT"
EventStatusPending EventStatus = "PENDING"
EventStatusRefunded EventStatus = "REFUNDED"
EventStatusScheduled EventStatus = "SCHEDULED"
EventStatusSuccessful EventStatus = "SUCCESSFUL"
)
EventType: Type of the transaction event.
type EventType string
const (
EventTypeChargeBack EventType = "CHARGE_BACK"
EventTypePayout EventType = "PAYOUT"
EventTypePayoutDeduction EventType = "PAYOUT_DEDUCTION"
EventTypeRefund EventType = "REFUND"
)
Invite: Pending invitation for membership.
type Invite struct {
// Email address of the invited user.
// Format: email
Email string `json:"email"`
ExpiresAt time.Time `json:"expires_at"`
}
MandateResponse: Created mandate
type MandateResponse struct {
// Merchant code which has the mandate
MerchantCode *string `json:"merchant_code,omitempty"`
// Mandate status
Status *string `json:"status,omitempty"`
// Indicates the mandate type
Type *string `json:"type,omitempty"`
}
MembershipStatus: The status of the membership.
type MembershipStatus string
const (
MembershipStatusAccepted MembershipStatus = "accepted"
MembershipStatusDisabled MembershipStatus = "disabled"
MembershipStatusExpired MembershipStatus = "expired"
MembershipStatusPending MembershipStatus = "pending"
MembershipStatusUnknown MembershipStatus = "unknown"
)
Metadata: Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata.
type Metadata map[string]any
Permissions: User permissions
type Permissions struct {
// Create MOTO payments
CreateMotoPayments *bool `json:"create_moto_payments,omitempty"`
// Create referral
CreateReferral *bool `json:"create_referral,omitempty"`
// Can view full merchant transaction history
FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
// Refund transactions
RefundTransactions *bool `json:"refund_transactions,omitempty"`
}
PersonalDetails: Personal details for the customer.
type PersonalDetails struct {
// Profile's personal address information.
Address *Address `json:"address,omitempty"`
// Date of birth of the customer.
// Format: date
BirthDate *Date `json:"birth_date,omitempty"`
// Email address of the customer.
Email *string `json:"email,omitempty"`
// First name of the customer.
FirstName *string `json:"first_name,omitempty"`
// Last name of the customer.
LastName *string `json:"last_name,omitempty"`
// Phone number of the customer.
Phone *string `json:"phone,omitempty"`
// An identification number user for tax purposes (e.g. CPF)
// Max length: 255
TaxId *string `json:"tax_id,omitempty"`
}
type Time struct{ time.Time }
func (t Time) MarshalJSON() ([]byte, error)
func (t Time) String() string
func (t *Time) UnmarshalJSON(b []byte) (err error)
TimestampEvent: Date and time of the transaction event.
type TimestampEvent string
TransactionId: Unique ID of the transaction.
type TransactionId string
TransactionMixinBase: Details of the transaction.
type TransactionMixinBase struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *Currency `json:"currency,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Payment type used for the transaction.
PaymentType *TransactionMixinBasePaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *TransactionMixinBaseStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
}
TransactionMixinBasePaymentType: Payment type used for the transaction.
type TransactionMixinBasePaymentType string
const (
TransactionMixinBasePaymentTypeBoleto TransactionMixinBasePaymentType = "BOLETO"
TransactionMixinBasePaymentTypeEcom TransactionMixinBasePaymentType = "ECOM"
TransactionMixinBasePaymentTypeRecurring TransactionMixinBasePaymentType = "RECURRING"
)
TransactionMixinBaseStatus: Current status of the transaction.
type TransactionMixinBaseStatus string
const (
TransactionMixinBaseStatusCancelled TransactionMixinBaseStatus = "CANCELLED"
TransactionMixinBaseStatusFailed TransactionMixinBaseStatus = "FAILED"
TransactionMixinBaseStatusPending TransactionMixinBaseStatus = "PENDING"
TransactionMixinBaseStatusSuccessful TransactionMixinBaseStatus = "SUCCESSFUL"
)
TransactionMixinCheckout is a schema definition.
type TransactionMixinCheckout struct {
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Entry mode of the payment details.
EntryMode *TransactionMixinCheckoutEntryMode `json:"entry_mode,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
}
TransactionMixinCheckoutEntryMode: Entry mode of the payment details.
type TransactionMixinCheckoutEntryMode string
const (
TransactionMixinCheckoutEntryModeBoleto TransactionMixinCheckoutEntryMode = "BOLETO"
TransactionMixinCheckoutEntryModeCustomerEntry TransactionMixinCheckoutEntryMode = "CUSTOMER_ENTRY"
)
import "github.com/sumup/sumup-go/subaccounts"
- type CompatError
- type CreateSubAccountBody
- type CreateSubAccountBodyPermissions
- type ListSubAccounts200Response
- type ListSubAccountsParams
- type Operator
- type OperatorAccountType
- type SubaccountsService
- func NewSubaccountsService(c *client.Client) *SubaccountsService
- func (s *SubaccountsService) CompatGetOperator(ctx context.Context, operatorId int) (*Operator, error)
- func (s *SubaccountsService) CreateSubAccount(ctx context.Context, body CreateSubAccountBody) (*Operator, error)
- func (s *SubaccountsService) DeactivateSubAccount(ctx context.Context, operatorId int) (*Operator, error)
- func (s *SubaccountsService) ListSubAccounts(ctx context.Context, params ListSubAccountsParams) (*ListSubAccounts200Response, error)
- func (s *SubaccountsService) UpdateSubAccount(ctx context.Context, operatorId int, body UpdateSubAccountBody) (*Operator, error)
- type UpdateSubAccountBody
- type UpdateSubAccountBodyPermissions
CompatError: Error
type CompatError struct {
ErrorCode string `json:"error_code"`
Message string `json:"message"`
}
func (e *CompatError) Error() string
CreateSubAccountBody is a schema definition.
type CreateSubAccountBody struct {
Nickname *string `json:"nickname,omitempty"`
// Min length: 8
Password string `json:"password"`
Permissions *CreateSubAccountBodyPermissions `json:"permissions,omitempty"`
// Format: email
Username string `json:"username"`
}
CreateSubAccountBodyPermissions is a schema definition.
type CreateSubAccountBodyPermissions struct {
CreateMotoPayments *bool `json:"create_moto_payments,omitempty"`
CreateReferral *bool `json:"create_referral,omitempty"`
FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
RefundTransactions *bool `json:"refund_transactions,omitempty"`
}
ListSubAccounts200Response is a schema definition.
type ListSubAccounts200Response []Operator
ListSubAccountsParams: query parameters for ListSubAccounts
type ListSubAccountsParams struct {
// If true the list of operators will include also the primary user.
IncludePrimary *bool
// Search query used to filter users that match given query term.
//
// Current implementation allow querying only over the email address.
// All operators whos email address contains the query string are returned.
Query *string
}
func (p *ListSubAccountsParams) QueryValues() url.Values
QueryValues converts ListSubAccountsParams into [url.Values].
Operator is a schema definition.
type Operator struct {
AccountType OperatorAccountType `json:"account_type"`
// The timestamp of when the operator was created.
CreatedAt time.Time `json:"created_at"`
Disabled bool `json:"disabled"`
// Format: int32
Id int `json:"id"`
Nickname *string `json:"nickname,omitempty"`
// User permissions
Permissions shared.Permissions `json:"permissions"`
// The timestamp of when the operator was last updated.
UpdatedAt time.Time `json:"updated_at"`
Username string `json:"username"`
}
OperatorAccountType is a schema definition.
type OperatorAccountType string
const (
OperatorAccountTypeNormal OperatorAccountType = "normal"
OperatorAccountTypeOperator OperatorAccountType = "operator"
)
type SubaccountsService struct {
// contains filtered or unexported fields
}
func NewSubaccountsService(c *client.Client) *SubaccountsService
func (s *SubaccountsService) CompatGetOperator(ctx context.Context, operatorId int) (*Operator, error)
CompatGetOperator: Get operator Returns specific operator. Deprecated: Subaccounts API is deprecated, to get an user that's a member of your merchant account please use [Get member](https://developer.sumup.com/api/members/get\) instead.
func (s *SubaccountsService) CreateSubAccount(ctx context.Context, body CreateSubAccountBody) (*Operator, error)
CreateSubAccount: Create operator. Creates new operator for currently authorized users' merchant. Deprecated: Subaccounts API is deprecated, to create an user in your merchant account please use [Create member](https://developer.sumup.com/api/members/create\) instead.
func (s *SubaccountsService) DeactivateSubAccount(ctx context.Context, operatorId int) (*Operator, error)
DeactivateSubAccount: Disable operator.
Deprecated: Subaccounts API is deprecated, to remove an user that's a member of your merchant account please use [Delete member](https://developer.sumup.com/api/members/delete\) instead.
func (s *SubaccountsService) ListSubAccounts(ctx context.Context, params ListSubAccountsParams) (*ListSubAccounts200Response, error)
ListSubAccounts: List operators. Returns list of operators for currently authorized user's merchant. Deprecated: Subaccounts API is deprecated, to list users in your merchant account please use [List members](https://developer.sumup.com/api/members/list\) instead.
func (s *SubaccountsService) UpdateSubAccount(ctx context.Context, operatorId int, body UpdateSubAccountBody) (*Operator, error)
UpdateSubAccount: Update operator. Updates operator. If the operator was disabled and their password is updated they will be unblocked. Deprecated: Subaccounts API is deprecated, to update an user that's a member of your merchant account please use [Update member](https://developer.sumup.com/api/members/update\) instead.
UpdateSubAccountBody is a schema definition.
type UpdateSubAccountBody struct {
Disabled *bool `json:"disabled,omitempty"`
Nickname *string `json:"nickname,omitempty"`
// Min length: 8
Password *string `json:"password,omitempty"`
Permissions *UpdateSubAccountBodyPermissions `json:"permissions,omitempty"`
// Format: email
// Max length: 256
Username *string `json:"username,omitempty"`
}
UpdateSubAccountBodyPermissions is a schema definition.
type UpdateSubAccountBodyPermissions struct {
CreateMotoPayments *bool `json:"create_moto_payments,omitempty"`
CreateReferral *bool `json:"create_referral,omitempty"`
FullTransactionHistoryView *bool `json:"full_transaction_history_view,omitempty"`
RefundTransactions *bool `json:"refund_transactions,omitempty"`
}
import "github.com/sumup/sumup-go/transactions"
- type CardResponse
- type CardResponseType
- type Event
- type GetTransactionParams
- type GetTransactionV21Params
- type HorizontalAccuracy
- type Lat
- type Link
- type LinkRefund
- type ListTransactions200Response
- type ListTransactionsParams
- type ListTransactionsV21200Response
- type ListTransactionsV21Params
- type Lon
- type Product
- type RefundTransaction204Response
- type RefundTransactionBody
- type TransactionEvent
- type TransactionFull
- type TransactionFullEntryMode
- type TransactionFullLocation
- type TransactionFullPaymentType
- type TransactionFullPayoutPlan
- type TransactionFullPayoutType
- type TransactionFullSimplePaymentType
- type TransactionFullSimpleStatus
- type TransactionFullStatus
- type TransactionFullVerificationMethod
- type TransactionHistory
- type TransactionHistoryCardType
- type TransactionHistoryPaymentType
- type TransactionHistoryPayoutPlan
- type TransactionHistoryStatus
- type TransactionHistoryType
- type TransactionMixinHistory
- type TransactionMixinHistoryPayoutPlan
- type TransactionsService
- func NewTransactionsService(c *client.Client) *TransactionsService
- func (s *TransactionsService) Get(ctx context.Context, merchantCode string, params GetTransactionV21Params) (*TransactionFull, error)
- func (s *TransactionsService) GetDeprecated(ctx context.Context, params GetTransactionParams) (*TransactionFull, error)
- func (s *TransactionsService) List(ctx context.Context, merchantCode string, params ListTransactionsV21Params) (*ListTransactionsV21200Response, error)
- func (s *TransactionsService) ListDeprecated(ctx context.Context, params ListTransactionsParams) (*ListTransactions200Response, error)
- func (s *TransactionsService) Refund(ctx context.Context, txnId string, body RefundTransactionBody) (*RefundTransaction204Response, error)
CardResponse: Details of the payment card.
type CardResponse struct {
// Last 4 digits of the payment card number.
// Read only
// Min length: 4
// Max length: 4
Last4Digits *string `json:"last_4_digits,omitempty"`
// Issuing card network of the payment card.
// Read only
Type *CardResponseType `json:"type,omitempty"`
}
CardResponseType: Issuing card network of the payment card. Read only
type CardResponseType string
const (
CardResponseTypeAmex CardResponseType = "AMEX"
CardResponseTypeCup CardResponseType = "CUP"
CardResponseTypeDiners CardResponseType = "DINERS"
CardResponseTypeDiscover CardResponseType = "DISCOVER"
CardResponseTypeElo CardResponseType = "ELO"
CardResponseTypeElv CardResponseType = "ELV"
CardResponseTypeHipercard CardResponseType = "HIPERCARD"
CardResponseTypeJcb CardResponseType = "JCB"
CardResponseTypeMaestro CardResponseType = "MAESTRO"
CardResponseTypeMastercard CardResponseType = "MASTERCARD"
CardResponseTypeUnknown CardResponseType = "UNKNOWN"
CardResponseTypeVisa CardResponseType = "VISA"
CardResponseTypeVisaElectron CardResponseType = "VISA_ELECTRON"
CardResponseTypeVisaVpay CardResponseType = "VISA_VPAY"
)
Event is a schema definition.
type Event struct {
// Amount of the event.
Amount *shared.AmountEvent `json:"amount,omitempty"`
// Amount deducted for the event.
DeductedAmount *float64 `json:"deducted_amount,omitempty"`
// Amount of the fee deducted for the event.
DeductedFeeAmount *float64 `json:"deducted_fee_amount,omitempty"`
// Amount of the fee related to the event.
FeeAmount *float64 `json:"fee_amount,omitempty"`
// Unique ID of the transaction event.
// Format: int64
Id *shared.EventId `json:"id,omitempty"`
// Consecutive number of the installment.
InstallmentNumber *int `json:"installment_number,omitempty"`
// Status of the transaction event.
Status *shared.EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
// Unique ID of the transaction.
TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
// Type of the transaction event.
Type *shared.EventType `json:"type,omitempty"`
}
GetTransactionParams: query parameters for GetTransaction
type GetTransactionParams struct {
// Retrieves the transaction resource with the specified transaction ID (the `id` parameter in the transaction resource).
Id *string
// Retrieves the transaction resource with the specified internal transaction ID (the `internal_id` parameter in
// the transaction resource).
InternalId *string
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
}
func (p *GetTransactionParams) QueryValues() url.Values
QueryValues converts GetTransactionParams into [url.Values].
GetTransactionV21Params: query parameters for GetTransactionV2.1
type GetTransactionV21Params struct {
// Retrieves the transaction resource with the specified transaction ID (the `id` parameter in the transaction resource).
Id *string
// Retrieves the transaction resource with the specified internal transaction ID (the `internal_id` parameter in
// the transaction resource).
InternalId *string
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
}
func (p *GetTransactionV21Params) QueryValues() url.Values
QueryValues converts GetTransactionV21Params into [url.Values].
HorizontalAccuracy: Indication of the precision of the geographical position received from the payment terminal.
type HorizontalAccuracy float64
Lat: Latitude value from the coordinates of the payment location (as received from the payment terminal reader).
Min: 0 Max: 90
type Lat float64
Link: Details of a link to a related resource.
type Link struct {
// URL for accessing the related resource.
// Format: uri
Href *string `json:"href,omitempty"`
// Specifies the relation to the current resource.
Rel *string `json:"rel,omitempty"`
// Specifies the media type of the related resource.
Type *string `json:"type,omitempty"`
}
LinkRefund is a schema definition.
type LinkRefund struct {
// URL for accessing the related resource.
// Format: uri
Href *string `json:"href,omitempty"`
// Maximum allowed amount for the refund.
MaxAmount *float64 `json:"max_amount,omitempty"`
// Minimum allowed amount for the refund.
MinAmount *float64 `json:"min_amount,omitempty"`
// Specifies the relation to the current resource.
Rel *string `json:"rel,omitempty"`
// Specifies the media type of the related resource.
Type *string `json:"type,omitempty"`
}
ListTransactions200Response is a schema definition.
type ListTransactions200Response struct {
Items *[]TransactionHistory `json:"items,omitempty"`
Links *[]Link `json:"links,omitempty"`
}
ListTransactionsParams: query parameters for ListTransactions
type ListTransactionsParams struct {
// Filters the results by the latest modification time of resources and returns only transactions that are modified
// *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
ChangesSince *time.Time
// Specifies the maximum number of results per page. Value must be a positive integer and if not specified, will
// return 10 results.
Limit *int
// Filters the results by the reference ID of transaction events and returns only transactions with events whose
// IDs are *smaller* than the specified value. This parameters supersedes the `newest_time` parameter (if both
// are provided in the request).
NewestRef *string
// Filters the results by the creation time of resources and returns only transactions that are created *before*
// the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
NewestTime *time.Time
// Filters the results by the reference ID of transaction events and returns only transactions with events whose
// IDs are *greater* than the specified value. This parameters supersedes the `oldest_time` parameter (if both
// are provided in the request).
OldestRef *string
// Filters the results by the creation time of resources and returns only transactions that are created *at
// or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
OldestTime *time.Time
// Specifies the order in which the returned results are displayed.
Order *string
// Filters the returned results by the specified list of payment types used for the transactions.
PaymentTypes *[]string
// Filters the returned results by the specified list of final statuses of the transactions.
Statuses *[]string
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
// Filters the returned results by the specified list of transaction types.
Types *[]string
// Filters the returned results by user email.
Users *[]string
}
func (p *ListTransactionsParams) QueryValues() url.Values
QueryValues converts ListTransactionsParams into [url.Values].
ListTransactionsV21200Response is a schema definition.
type ListTransactionsV21200Response struct {
Items *[]TransactionHistory `json:"items,omitempty"`
Links *[]Link `json:"links,omitempty"`
}
ListTransactionsV21Params: query parameters for ListTransactionsV2.1
type ListTransactionsV21Params struct {
// Filters the results by the latest modification time of resources and returns only transactions that are modified
// *at or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
ChangesSince *time.Time
// Specifies the maximum number of results per page. Value must be a positive integer and if not specified, will
// return 10 results.
Limit *int
// Filters the results by the reference ID of transaction events and returns only transactions with events whose
// IDs are *smaller* than the specified value. This parameters supersedes the `newest_time` parameter (if both
// are provided in the request).
NewestRef *string
// Filters the results by the creation time of resources and returns only transactions that are created *before*
// the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
NewestTime *time.Time
// Filters the results by the reference ID of transaction events and returns only transactions with events whose
// IDs are *greater* than the specified value. This parameters supersedes the `oldest_time` parameter (if both
// are provided in the request).
OldestRef *string
// Filters the results by the creation time of resources and returns only transactions that are created *at
// or after* the specified timestamp (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
OldestTime *time.Time
// Specifies the order in which the returned results are displayed.
Order *string
// Filters the returned results by the specified list of payment types used for the transactions.
PaymentTypes *[]string
// Filters the returned results by the specified list of final statuses of the transactions.
Statuses *[]string
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
// Filters the returned results by the specified list of transaction types.
Types *[]string
// Filters the returned results by user email.
Users *[]string
}
func (p *ListTransactionsV21Params) QueryValues() url.Values
QueryValues converts ListTransactionsV21Params into [url.Values].
Lon: Longitude value from the coordinates of the payment location (as received from the payment terminal reader).
Min: 0 Max: 180
type Lon float64
Product: Details of the product for which the payment is made.
type Product struct {
// Name of the product from the merchant's catalog.
Name *string `json:"name,omitempty"`
// Price of the product without VAT.
Price *float64 `json:"price,omitempty"`
// Price of a single product item with VAT.
PriceWithVat *float64 `json:"price_with_vat,omitempty"`
// Number of product items for the purchase.
Quantity *float64 `json:"quantity,omitempty"`
// Amount of the VAT for a single product item (calculated as the product of `price` and `vat_rate`, i.e. `single_vat_amount
// = price * vat_rate`).
SingleVatAmount *float64 `json:"single_vat_amount,omitempty"`
// Total price of the product items without VAT (calculated as the product of `price` and `quantity`, i.e. `total_price
// = price * quantity`).
TotalPrice *float64 `json:"total_price,omitempty"`
// Total price of the product items including VAT (calculated as the product of `price_with_vat` and `quantity`, i.e.
// `total_with_vat = price_with_vat * quantity`).
TotalWithVat *float64 `json:"total_with_vat,omitempty"`
// Total VAT amount for the purchase (calculated as the product of `single_vat_amount` and `quantity`, i.e. `vat_amount
// = single_vat_amount * quantity`).
VatAmount *float64 `json:"vat_amount,omitempty"`
// VAT rate applicable to the product.
VatRate *float64 `json:"vat_rate,omitempty"`
}
RefundTransaction204Response is a schema definition.
type RefundTransaction204Response struct {
}
RefundTransactionBody: Optional amount for partial refunds of transactions.
type RefundTransactionBody struct {
// Amount to be refunded. Eligible amount can't exceed the amount of the transaction and varies based on country
// and currency. If you do not specify a value, the system performs a full refund of the transaction.
Amount *float64 `json:"amount,omitempty"`
}
TransactionEvent: Details of a transaction event.
type TransactionEvent struct {
// Amount of the event.
Amount *shared.AmountEvent `json:"amount,omitempty"`
// Date when the transaction event occurred.
// Format: date
Date *shared.Date `json:"date,omitempty"`
// Date when the transaction event is due to occur.
// Format: date
DueDate *shared.Date `json:"due_date,omitempty"`
// Type of the transaction event.
EventType *shared.EventType `json:"event_type,omitempty"`
// Unique ID of the transaction event.
// Format: int64
Id *shared.EventId `json:"id,omitempty"`
// Consecutive number of the installment that is paid. Applicable only payout events, i.e. `event_type = PAYOUT`.
InstallmentNumber *int `json:"installment_number,omitempty"`
// Status of the transaction event.
Status *shared.EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *shared.TimestampEvent `json:"timestamp,omitempty"`
}
TransactionFull is a schema definition.
type TransactionFull struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Authorization code for the transaction sent by the payment card issuer or bank. Applicable only to card payments.
AuthCode *string `json:"auth_code,omitempty"`
// Details of the payment card.
Card *CardResponse `json:"card,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *TransactionFullEntryMode `json:"entry_mode,omitempty"`
// List of events related to the transaction.
// Unique items only
Events *[]Event `json:"events,omitempty"`
// Indication of the precision of the geographical position received from the payment terminal.
HorizontalAccuracy *HorizontalAccuracy `json:"horizontal_accuracy,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
InternalId *int `json:"internal_id,omitempty"`
// Latitude value from the coordinates of the payment location (as received from the payment terminal reader).
// Min: 0
// Max: 90
Lat *Lat `json:"lat,omitempty"`
// List of hyperlinks for accessing related resources.
// Unique items only
Links *[]interface{} `json:"links,omitempty"`
// Local date and time of the creation of the transaction.
LocalTime *time.Time `json:"local_time,omitempty"`
// Details of the payment location as received from the payment terminal.
Location *TransactionFullLocation `json:"location,omitempty"`
// Longitude value from the coordinates of the payment location (as received from the payment terminal reader).
// Min: 0
// Max: 180
Lon *Lon `json:"lon,omitempty"`
// Unique code of the registered merchant to whom the payment is made.
MerchantCode *string `json:"merchant_code,omitempty"`
// Payment type used for the transaction.
PaymentType *TransactionFullPaymentType `json:"payment_type,omitempty"`
// Payout plan of the registered user at the time when the transaction was made.
PayoutPlan *TransactionFullPayoutPlan `json:"payout_plan,omitempty"`
// Payout type for the transaction.
PayoutType *TransactionFullPayoutType `json:"payout_type,omitempty"`
// Number of payouts that are made to the registered user specified in the `user` property.
PayoutsReceived *int `json:"payouts_received,omitempty"`
// Total number of payouts to the registered user specified in the `user` property.
PayoutsTotal *int `json:"payouts_total,omitempty"`
// Short description of the payment. The value is taken from the `description` property of the related checkout resource.
ProductSummary *string `json:"product_summary,omitempty"`
// List of products from the merchant's catalogue for which the transaction serves as a payment.
Products *[]Product `json:"products,omitempty"`
// Simple name of the payment type.
SimplePaymentType *TransactionFullSimplePaymentType `json:"simple_payment_type,omitempty"`
// Status generated from the processing status and the latest transaction state.
SimpleStatus *TransactionFullSimpleStatus `json:"simple_status,omitempty"`
// Current status of the transaction.
Status *TransactionFullStatus `json:"status,omitempty"`
// Indicates whether tax deduction is enabled for the transaction.
TaxEnabled *bool `json:"tax_enabled,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Amount of the tip (out of the total transaction amount).
TipAmount *float64 `json:"tip_amount,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// List of transaction events related to the transaction.
TransactionEvents *[]TransactionEvent `json:"transaction_events,omitempty"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
Username *string `json:"username,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VatAmount *float64 `json:"vat_amount,omitempty"`
// List of VAT rates applicable to the transaction.
VatRates *[]interface{} `json:"vat_rates,omitempty"`
// Verification method used for the transaction.
VerificationMethod *TransactionFullVerificationMethod `json:"verification_method,omitempty"`
}
TransactionFullEntryMode: Entry mode of the payment details.
type TransactionFullEntryMode string
const (
TransactionFullEntryModeBoleto TransactionFullEntryMode = "BOLETO"
TransactionFullEntryModeCustomerEntry TransactionFullEntryMode = "CUSTOMER_ENTRY"
)
TransactionFullLocation: Details of the payment location as received from the payment terminal.
type TransactionFullLocation struct {
// Indication of the precision of the geographical position received from the payment terminal.
HorizontalAccuracy *HorizontalAccuracy `json:"horizontal_accuracy,omitempty"`
// Latitude value from the coordinates of the payment location (as received from the payment terminal reader).
// Min: 0
// Max: 90
Lat *Lat `json:"lat,omitempty"`
// Longitude value from the coordinates of the payment location (as received from the payment terminal reader).
// Min: 0
// Max: 180
Lon *Lon `json:"lon,omitempty"`
}
TransactionFullPaymentType: Payment type used for the transaction.
type TransactionFullPaymentType string
const (
TransactionFullPaymentTypeBoleto TransactionFullPaymentType = "BOLETO"
TransactionFullPaymentTypeEcom TransactionFullPaymentType = "ECOM"
TransactionFullPaymentTypeRecurring TransactionFullPaymentType = "RECURRING"
)
TransactionFullPayoutPlan: Payout plan of the registered user at the time when the transaction was made.
type TransactionFullPayoutPlan string
const (
TransactionFullPayoutPlanAcceleratedInstallment TransactionFullPayoutPlan = "ACCELERATED_INSTALLMENT"
TransactionFullPayoutPlanSinglePayment TransactionFullPayoutPlan = "SINGLE_PAYMENT"
TransactionFullPayoutPlanTrueInstallment TransactionFullPayoutPlan = "TRUE_INSTALLMENT"
)
TransactionFullPayoutType: Payout type for the transaction.
type TransactionFullPayoutType string
const (
TransactionFullPayoutTypeBalance TransactionFullPayoutType = "BALANCE"
TransactionFullPayoutTypeBankAccount TransactionFullPayoutType = "BANK_ACCOUNT"
TransactionFullPayoutTypePrepaidCard TransactionFullPayoutType = "PREPAID_CARD"
)
TransactionFullSimplePaymentType: Simple name of the payment type.
type TransactionFullSimplePaymentType string
const (
TransactionFullSimplePaymentTypeCash TransactionFullSimplePaymentType = "CASH"
TransactionFullSimplePaymentTypeCcCustomerEntered TransactionFullSimplePaymentType = "CC_CUSTOMER_ENTERED"
TransactionFullSimplePaymentTypeCcSignature TransactionFullSimplePaymentType = "CC_SIGNATURE"
TransactionFullSimplePaymentTypeElv TransactionFullSimplePaymentType = "ELV"
TransactionFullSimplePaymentTypeEmv TransactionFullSimplePaymentType = "EMV"
TransactionFullSimplePaymentTypeManualEntry TransactionFullSimplePaymentType = "MANUAL_ENTRY"
TransactionFullSimplePaymentTypeMoto TransactionFullSimplePaymentType = "MOTO"
)
TransactionFullSimpleStatus: Status generated from the processing status and the latest transaction state.
type TransactionFullSimpleStatus string
const (
TransactionFullSimpleStatusCancelFailed TransactionFullSimpleStatus = "CANCEL_FAILED"
TransactionFullSimpleStatusCancelled TransactionFullSimpleStatus = "CANCELLED"
TransactionFullSimpleStatusChargeback TransactionFullSimpleStatus = "CHARGEBACK"
TransactionFullSimpleStatusFailed TransactionFullSimpleStatus = "FAILED"
TransactionFullSimpleStatusNonCollection TransactionFullSimpleStatus = "NON_COLLECTION"
TransactionFullSimpleStatusPaidOut TransactionFullSimpleStatus = "PAID_OUT"
TransactionFullSimpleStatusRefundFailed TransactionFullSimpleStatus = "REFUND_FAILED"
TransactionFullSimpleStatusRefunded TransactionFullSimpleStatus = "REFUNDED"
TransactionFullSimpleStatusSuccessful TransactionFullSimpleStatus = "SUCCESSFUL"
)
TransactionFullStatus: Current status of the transaction.
type TransactionFullStatus string
const (
TransactionFullStatusCancelled TransactionFullStatus = "CANCELLED"
TransactionFullStatusFailed TransactionFullStatus = "FAILED"
TransactionFullStatusPending TransactionFullStatus = "PENDING"
TransactionFullStatusSuccessful TransactionFullStatus = "SUCCESSFUL"
)
TransactionFullVerificationMethod: Verification method used for the transaction.
type TransactionFullVerificationMethod string
const (
TransactionFullVerificationMethodConfirmationCodeVerified TransactionFullVerificationMethod = "confirmation code verified"
TransactionFullVerificationMethodNone TransactionFullVerificationMethod = "none"
TransactionFullVerificationMethodOfflinePin TransactionFullVerificationMethod = "offline pin"
TransactionFullVerificationMethodOfflinePinSignature TransactionFullVerificationMethod = "offline pin + signature"
TransactionFullVerificationMethodOnlinePin TransactionFullVerificationMethod = "online pin"
TransactionFullVerificationMethodSignature TransactionFullVerificationMethod = "signature"
)
TransactionHistory is a schema definition.
type TransactionHistory struct {
// Total amount of the transaction.
Amount *float64 `json:"amount,omitempty"`
// Issuing card network of the payment card used for the transaction.
CardType *TransactionHistoryCardType `json:"card_type,omitempty"`
// Client-specific ID of the transaction.
ClientTransactionId *string `json:"client_transaction_id,omitempty"`
// Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported
// currency values are enumerated above.
Currency *shared.Currency `json:"currency,omitempty"`
// Unique ID of the transaction.
Id *string `json:"id,omitempty"`
// Current number of the installment for deferred payments.
// Min: 1
InstallmentsCount *int `json:"installments_count,omitempty"`
// Payment type used for the transaction.
PaymentType *TransactionHistoryPaymentType `json:"payment_type,omitempty"`
// Payout plan of the registered user at the time when the transaction was made.
PayoutPlan *TransactionHistoryPayoutPlan `json:"payout_plan,omitempty"`
// Number of payouts that are made to the registered user specified in the `user` property.
PayoutsReceived *int `json:"payouts_received,omitempty"`
// Total number of payouts to the registered user specified in the `user` property.
PayoutsTotal *int `json:"payouts_total,omitempty"`
// Short description of the payment. The value is taken from the `description` property of the related checkout resource.
ProductSummary *string `json:"product_summary,omitempty"`
// Current status of the transaction.
Status *TransactionHistoryStatus `json:"status,omitempty"`
// Date and time of the creation of the transaction. Response format expressed according to [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) code.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Transaction code returned by the acquirer/processing entity after processing the transaction.
TransactionCode *string `json:"transaction_code,omitempty"`
// Unique ID of the transaction.
TransactionId *shared.TransactionId `json:"transaction_id,omitempty"`
// Type of the transaction for the registered user specified in the `user` property.
Type *TransactionHistoryType `json:"type,omitempty"`
// Email address of the registered user (merchant) to whom the payment is made.
// Format: email
User *string `json:"user,omitempty"`
}
TransactionHistoryCardType: Issuing card network of the payment card used for the transaction.
type TransactionHistoryCardType string
const (
TransactionHistoryCardTypeAmex TransactionHistoryCardType = "AMEX"
TransactionHistoryCardTypeCup TransactionHistoryCardType = "CUP"
TransactionHistoryCardTypeDiners TransactionHistoryCardType = "DINERS"
TransactionHistoryCardTypeDiscover TransactionHistoryCardType = "DISCOVER"
TransactionHistoryCardTypeElo TransactionHistoryCardType = "ELO"
TransactionHistoryCardTypeElv TransactionHistoryCardType = "ELV"
TransactionHistoryCardTypeHipercard TransactionHistoryCardType = "HIPERCARD"
TransactionHistoryCardTypeJcb TransactionHistoryCardType = "JCB"
TransactionHistoryCardTypeMaestro TransactionHistoryCardType = "MAESTRO"
TransactionHistoryCardTypeMastercard TransactionHistoryCardType = "MASTERCARD"
TransactionHistoryCardTypeUnknown TransactionHistoryCardType = "UNKNOWN"
TransactionHistoryCardTypeVisa TransactionHistoryCardType = "VISA"
TransactionHistoryCardTypeVisaElectron TransactionHistoryCardType = "VISA_ELECTRON"
TransactionHistoryCardTypeVisaVpay TransactionHistoryCardType = "VISA_VPAY"
)
TransactionHistoryPaymentType: Payment type used for the transaction.
type TransactionHistoryPaymentType string
const (
TransactionHistoryPaymentTypeBoleto TransactionHistoryPaymentType = "BOLETO"
TransactionHistoryPaymentTypeEcom TransactionHistoryPaymentType = "ECOM"
TransactionHistoryPaymentTypeRecurring TransactionHistoryPaymentType = "RECURRING"
)
TransactionHistoryPayoutPlan: Payout plan of the registered user at the time when the transaction was made.
type TransactionHistoryPayoutPlan string
const (
TransactionHistoryPayoutPlanAcceleratedInstallment TransactionHistoryPayoutPlan = "ACCELERATED_INSTALLMENT"
TransactionHistoryPayoutPlanSinglePayment TransactionHistoryPayoutPlan = "SINGLE_PAYMENT"
TransactionHistoryPayoutPlanTrueInstallment TransactionHistoryPayoutPlan = "TRUE_INSTALLMENT"
)
TransactionHistoryStatus: Current status of the transaction.
type TransactionHistoryStatus string
const (
TransactionHistoryStatusCancelled TransactionHistoryStatus = "CANCELLED"
TransactionHistoryStatusFailed TransactionHistoryStatus = "FAILED"
TransactionHistoryStatusPending TransactionHistoryStatus = "PENDING"
TransactionHistoryStatusSuccessful TransactionHistoryStatus = "SUCCESSFUL"
)
TransactionHistoryType: Type of the transaction for the registered user specified in the `user` property.
type TransactionHistoryType string
const (
TransactionHistoryTypeChargeBack TransactionHistoryType = "CHARGE_BACK"
TransactionHistoryTypePayment TransactionHistoryType = "PAYMENT"
TransactionHistoryTypeRefund TransactionHistoryType = "REFUND"
)
TransactionMixinHistory is a schema definition.
type TransactionMixinHistory struct {
// Payout plan of the registered user at the time when the transaction was made.
PayoutPlan *TransactionMixinHistoryPayoutPlan `json:"payout_plan,omitempty"`
// Number of payouts that are made to the registered user specified in the `user` property.
PayoutsReceived *int `json:"payouts_received,omitempty"`
// Total number of payouts to the registered user specified in the `user` property.
PayoutsTotal *int `json:"payouts_total,omitempty"`
// Short description of the payment. The value is taken from the `description` property of the related checkout resource.
ProductSummary *string `json:"product_summary,omitempty"`
}
TransactionMixinHistoryPayoutPlan: Payout plan of the registered user at the time when the transaction was made.
type TransactionMixinHistoryPayoutPlan string
const (
TransactionMixinHistoryPayoutPlanAcceleratedInstallment TransactionMixinHistoryPayoutPlan = "ACCELERATED_INSTALLMENT"
TransactionMixinHistoryPayoutPlanSinglePayment TransactionMixinHistoryPayoutPlan = "SINGLE_PAYMENT"
TransactionMixinHistoryPayoutPlanTrueInstallment TransactionMixinHistoryPayoutPlan = "TRUE_INSTALLMENT"
)
type TransactionsService struct {
// contains filtered or unexported fields
}
func NewTransactionsService(c *client.Client) *TransactionsService
func (s *TransactionsService) Get(ctx context.Context, merchantCode string, params GetTransactionV21Params) (*TransactionFull, error)
Get: Retrieve a transaction Retrieves the full details of an identified transaction. The transaction resource is identified by a query parameter and *one* of following parameters is required:
- `id`
- `internal_id`
- `transaction_code`
- `foreign_transaction_id`
- `client_transaction_id`
func (s *TransactionsService) GetDeprecated(ctx context.Context, params GetTransactionParams) (*TransactionFull, error)
GetDeprecated: Retrieve a transaction Retrieves the full details of an identified transaction. The transaction resource is identified by a query parameter and *one* of following parameters is required:
- `id`
- `internal_id`
- `transaction_code`
- `foreign_transaction_id`
- `client_transaction_id`
Deprecated: this operation is deprecated
func (s *TransactionsService) List(ctx context.Context, merchantCode string, params ListTransactionsV21Params) (*ListTransactionsV21200Response, error)
List: List transactions Lists detailed history of all transactions associated with the merchant profile.
func (s *TransactionsService) ListDeprecated(ctx context.Context, params ListTransactionsParams) (*ListTransactions200Response, error)
ListDeprecated: List transactions Lists detailed history of all transactions associated with the merchant profile. Deprecated: this operation is deprecated
func (s *TransactionsService) Refund(ctx context.Context, txnId string, body RefundTransactionBody) (*RefundTransaction204Response, error)
Refund: Refund a transaction Refunds an identified transaction either in full or partially.
import "github.com/sumup/sumup-go/example/checkout"
import "github.com/sumup/sumup-go/example/simple"
Generated by gomarkdoc