Documentation
¶
Index ¶
- Variables
- type Address
- type AddressLegacy
- type Attributes
- type BadRequest
- type BadRequestErrors
- type BadRequestErrorsType
- type BasePerson
- type Branding
- type BusinessProfile
- type Card
- type CardExpiryMonth
- type CardResponse
- type CardType
- type ChangeStatus
- type Checkout
- type CheckoutAccepted
- type CheckoutAcceptedNextStep
- type CheckoutAcceptedNextStepMechanism
- type CheckoutAcceptedNextStepPayload
- type CheckoutCreateRequest
- type CheckoutCreateRequestPurpose
- type CheckoutStatus
- type CheckoutSuccess
- type CheckoutSuccessPaymentInstrument
- type CheckoutSuccessStatus
- type CheckoutSuccessTransaction
- type CheckoutSuccessTransactionStatus
- type CheckoutTransaction
- type CheckoutTransactionStatus
- type CheckoutsClient
- func (c *CheckoutsClient) Create(ctx context.Context, body CheckoutsCreateParams) (*Checkout, error)
- func (c *CheckoutsClient) Deactivate(ctx context.Context, id string) (*Checkout, error)
- func (c *CheckoutsClient) Get(ctx context.Context, id string) (*CheckoutSuccess, error)
- func (c *CheckoutsClient) List(ctx context.Context, params CheckoutsListParams) (*CheckoutsListResponse, error)
- func (c *CheckoutsClient) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, ...) (*CheckoutsListAvailablePaymentMethodsResponse, error)
- func (c *CheckoutsClient) Process(ctx context.Context, id string, body CheckoutsProcessParams) (*CheckoutsProcessResponse, error)
- type CheckoutsCreateParams
- type CheckoutsListAvailablePaymentMethodsParams
- type CheckoutsListAvailablePaymentMethodsResponse
- type CheckoutsListAvailablePaymentMethodsResponseAvailablePaymentMethod
- type CheckoutsListParams
- type CheckoutsListResponse
- type CheckoutsProcess400Response
- type CheckoutsProcessParams
- type CheckoutsProcessResponse
- type ClassicMerchantIdentifiers
- type Client
- type Company
- type CompanyIdentifier
- type CompanyIdentifiers
- type CountryCode
- type CreateCheckoutRequest
- type CreateCheckoutRequestAADE
- type CreateCheckoutRequestAffiliate
- type CreateCheckoutRequestAffiliateTags
- type CreateCheckoutRequestCardType
- type CreateCheckoutRequestTotalAmount
- type CreateReaderCheckoutError
- type CreateReaderCheckoutErrorErrors
- type CreateReaderCheckoutResponse
- type CreateReaderCheckoutResponseData
- type CreateReaderCheckoutUnprocessableEntity
- type CreateReaderCheckoutUnprocessableEntityErrors
- type CreateReaderTerminateError
- type CreateReaderTerminateErrorErrors
- type CreateReaderTerminateUnprocessableEntity
- type CreateReaderTerminateUnprocessableEntityErrors
- type Currency
- type Customer
- type CustomersClient
- func (c *CustomersClient) Create(ctx context.Context, body CustomersCreateParams) (*Customer, error)
- func (c *CustomersClient) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
- func (c *CustomersClient) Get(ctx context.Context, customerID string) (*Customer, error)
- func (c *CustomersClient) ListPaymentInstruments(ctx context.Context, customerID string) (*CustomersListPaymentInstrumentsResponse, error)
- func (c *CustomersClient) Update(ctx context.Context, customerID string, body CustomersUpdateParams) (*Customer, error)
- type CustomersCreate400Response
- type CustomersCreateParams
- type CustomersListPaymentInstrumentsResponse
- type CustomersUpdateParams
- type DetailsError
- type DetailsErrorFailedConstraint
- type Device
- type ElvCardAccount
- type EntryMode
- type Error
- type ErrorExtended
- type ErrorForbidden
- type Event
- type EventID
- type EventStatus
- type EventType
- type FinancialPayout
- type FinancialPayoutStatus
- type FinancialPayoutType
- type FinancialPayouts
- type HorizontalAccuracy
- type Invite
- type Lat
- type LegalType
- type Link
- type ListPersonsResponseBody
- type Lon
- type MandatePayload
- type MandatePayloadType
- type MandateResponse
- type Member
- type MembersClient
- func (c *MembersClient) Create(ctx context.Context, merchantCode string, body MembersCreateParams) (*Member, error)
- func (c *MembersClient) Delete(ctx context.Context, merchantCode string, memberID string) error
- func (c *MembersClient) Get(ctx context.Context, merchantCode string, memberID string) (*Member, error)
- func (c *MembersClient) List(ctx context.Context, merchantCode string, params MembersListParams) (*MembersListResponse, error)
- func (c *MembersClient) Update(ctx context.Context, merchantCode string, memberID string, ...) (*Member, error)
- type MembersCreateParams
- type MembersListParams
- type MembersListResponse
- type MembersUpdateParams
- type MembersUpdateParamsUser
- type Membership
- type MembershipResource
- type MembershipStatus
- type MembershipUser
- type MembershipUserClassic
- type MembershipsClient
- type MembershipsListParams
- type MembershipsListResponse
- type Merchant
- type MerchantsClient
- func (c *MerchantsClient) Get(ctx context.Context, merchantCode string, params MerchantsGetParams) (*Merchant, error)
- func (c *MerchantsClient) GetPerson(ctx context.Context, merchantCode string, personID string, ...) (*Person, error)
- func (c *MerchantsClient) ListPersons(ctx context.Context, merchantCode string, params MerchantsListPersonsParams) (*ListPersonsResponseBody, error)
- type MerchantsGetParams
- type MerchantsGetPersonParams
- type MerchantsListPersonsParams
- type Meta
- type Metadata
- type NotFound
- type NotFoundErrors
- type Operator
- type OperatorAccountType
- type Ownership
- type PaymentInstrumentResponse
- type PaymentInstrumentResponseCard
- type PaymentInstrumentResponseType
- type PaymentType
- type PayoutsClient
- type PayoutsList400Response
- type PayoutsListDeprecated400Response
- type PayoutsListDeprecatedFormat
- type PayoutsListDeprecatedOrder
- type PayoutsListDeprecatedParams
- type PayoutsListFormat
- type PayoutsListOrder
- type PayoutsListParams
- type Permissions
- type Person
- type PersonalDetails
- type PersonalIdentifier
- type PhoneNumber
- type Problem
- type ProcessCheckout
- type ProcessCheckoutPaymentType
- type Product
- type Reader
- type ReaderDevice
- type ReaderDeviceModel
- type ReaderID
- type ReaderName
- type ReaderPairingCode
- type ReaderStatus
- type ReadersClient
- func (c *ReadersClient) Create(ctx context.Context, merchantCode string, body ReadersCreateParams) (*Reader, error)
- func (c *ReadersClient) CreateCheckout(ctx context.Context, merchantCode string, readerID string, ...) (*CreateReaderCheckoutResponse, error)
- func (c *ReadersClient) Delete(ctx context.Context, merchantCode string, id ReaderID) error
- func (c *ReadersClient) Get(ctx context.Context, merchantCode string, id ReaderID, params ReadersGetParams) (*Reader, error)
- func (c *ReadersClient) GetStatus(ctx context.Context, merchantCode string, readerID string) (*StatusResponse, error)
- func (c *ReadersClient) List(ctx context.Context, merchantCode string) (*ReadersListResponse, error)
- func (c *ReadersClient) TerminateCheckout(ctx context.Context, merchantCode string, readerID string) error
- func (c *ReadersClient) Update(ctx context.Context, merchantCode string, id ReaderID, ...) (*Reader, error)
- type ReadersCreateCheckoutParams
- type ReadersCreateParams
- type ReadersGetParams
- type ReadersListResponse
- type ReadersUpdateParams
- type Receipt
- type ReceiptAcquirerData
- type ReceiptCard
- type ReceiptEvent
- type ReceiptMerchantData
- type ReceiptMerchantDataMerchantProfile
- type ReceiptMerchantDataMerchantProfileAddress
- type ReceiptReader
- type ReceiptTransaction
- type ReceiptTransactionProcessA
- type ReceiptTransactionProduct
- type ReceiptTransactionVATRate
- type ReceiptsClient
- type ReceiptsGetParams
- type ResourceType
- type Role
- type RolesClient
- func (c *RolesClient) Create(ctx context.Context, merchantCode string, body RolesCreateParams) (*Role, error)
- func (c *RolesClient) Delete(ctx context.Context, merchantCode string, roleID string) error
- func (c *RolesClient) Get(ctx context.Context, merchantCode string, roleID string) (*Role, error)
- func (c *RolesClient) List(ctx context.Context, merchantCode string) (*RolesListResponse, error)
- func (c *RolesClient) Update(ctx context.Context, merchantCode string, roleID string, ...) (*Role, error)
- type RolesCreateParams
- type RolesListResponse
- type RolesUpdateParams
- type StatusResponse
- type StatusResponseData
- type StatusResponseDataConnectionType
- type StatusResponseDataState
- type StatusResponseDataStatus
- type SubaccountsClient
- func (c *SubaccountsClient) CompatGetOperator(ctx context.Context, operatorID int32) (*Operator, error)
- func (c *SubaccountsClient) CreateSubAccount(ctx context.Context, body SubaccountsCreateSubAccountParams) (*Operator, error)
- func (c *SubaccountsClient) ListSubAccounts(ctx context.Context, params SubaccountsListSubAccountsParams) (*SubaccountsListSubAccountsResponse, error)
- func (c *SubaccountsClient) UpdateSubAccount(ctx context.Context, operatorID int32, body SubaccountsUpdateSubAccountParams) (*Operator, error)
- type SubaccountsCreateSubAccountParams
- type SubaccountsCreateSubAccountParamsPermissions
- type SubaccountsListSubAccountsParams
- type SubaccountsListSubAccountsResponse
- type SubaccountsUpdateSubAccountParams
- type SubaccountsUpdateSubAccountParamsPermissions
- type Timestamps
- type TransactionBase
- type TransactionBaseStatus
- type TransactionCheckoutInfo
- type TransactionEvent
- type TransactionFull
- type TransactionFullLocation
- type TransactionFullPayoutPlan
- type TransactionFullPayoutType
- type TransactionFullProcessA
- type TransactionFullSimplePaymentType
- type TransactionFullSimpleStatus
- type TransactionFullStatus
- type TransactionFullVATRate
- type TransactionFullVerificationMethod
- type TransactionHistory
- type TransactionHistoryPayoutPlan
- type TransactionHistoryPayoutType
- type TransactionHistoryStatus
- type TransactionHistoryType
- type TransactionID
- type TransactionMixinHistory
- type TransactionMixinHistoryPayoutPlan
- type TransactionsClient
- func (c *TransactionsClient) Get(ctx context.Context, merchantCode string, params TransactionsGetParams) (*TransactionFull, error)
- func (c *TransactionsClient) GetDeprecated(ctx context.Context, params TransactionsGetDeprecatedParams) (*TransactionFull, error)deprecated
- func (c *TransactionsClient) List(ctx context.Context, merchantCode string, params TransactionsListParams) (*TransactionsListResponse, error)
- func (c *TransactionsClient) ListDeprecated(ctx context.Context, params TransactionsListDeprecatedParams) (*TransactionsListDeprecatedResponse, error)
- func (c *TransactionsClient) Refund(ctx context.Context, txnID string, body TransactionsRefundParams) error
- type TransactionsGetDeprecatedParams
- type TransactionsGetParams
- type TransactionsHistoryLink
- type TransactionsListDeprecatedOrder
- type TransactionsListDeprecatedParams
- type TransactionsListDeprecatedResponse
- type TransactionsListDeprecatedStatusesItem
- type TransactionsListDeprecatedTypesItem
- type TransactionsListOrder
- type TransactionsListParams
- type TransactionsListResponse
- type TransactionsListStatusesItem
- type TransactionsListTypesItem
- type TransactionsRefundParams
- type Unauthorized
- type UnauthorizedErrors
- type UnauthorizedErrorsType
- type Version
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var OAuth2Endpoint = oauth2.Endpoint{
AuthURL: "https://api.sumup.com/authorize",
TokenURL: "https://api.sumup.com/token",
}
OAuth2Endpoint is SumUp's OAuth 2.0 endpoint.
Functions ¶
This section is empty.
Types ¶
type Address ¶ added in v0.14.0
type Address struct {
// In Spain, an autonomous community is the first sub-national level of political and administrative division.
// Max length: 512
AutonomousCommunity *string `json:"autonomous_community,omitempty"`
// The city of the address.
// Max length: 512
City *string `json:"city,omitempty"`
// In many countries, terms cognate with "commune" are used, referring to the community living in the area and
// the common interest. Used in countries such as Chile.
// Max length: 512
Commune *string `json:"commune,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// country code. This definition users `oneOf` with a two-character string
// type to allow for support of future countries in client code.
// Min length: 2
// Max length: 2
// Pattern: ^[A-Z]{2}$
Country CountryCode `json:"country"`
// A county is a geographic region of a country used for administrative or other purposes in some nations. Used
// in countries such as Ireland, Romania, etc.
// Max length: 512
County *string `json:"county,omitempty"`
// A department (French: département, Spanish: departamento) is an administrative or political division in
// several countries. Used in countries such as Colombia.
// Max length: 512
Department *string `json:"department,omitempty"`
// A district is a type of administrative division that in some countries is managed by the local government. Used
// in countries such as Portugal.
// Max length: 512
District *string `json:"district,omitempty"`
// A postal address in Ireland.
// Max length: 512
Eircode *string `json:"eircode,omitempty"`
// A municipality is usually a single administrative division having corporate status and powers of self-government or
// jurisdiction as granted by national and regional laws to which it is subordinate. Used in countries such as
// Colombia.
// Max length: 512
Municipality *string `json:"municipality,omitempty"`
// Locality level of the address. Used in countries such as Brazil or Chile.
// Max length: 512
Neighborhood *string `json:"neighborhood,omitempty"`
// The postal code (aka. zip code) of the address.
// Max length: 32
PostCode *string `json:"post_code,omitempty"`
// A post town is a required part of all postal addresses in the United Kingdom and Ireland, and a basic unit
// of the postal delivery system.
// Max length: 512
PostTown *string `json:"post_town,omitempty"`
// The province where the address is located. This may not be relevant in some countries.
// Max length: 512
Province *string `json:"province,omitempty"`
// The region where the address is located. This may not be relevant in some countries.
// Max length: 512
Region *string `json:"region,omitempty"`
// Most often, a country has a single state, with various administrative divisions. The term "state" is sometimes
// used to refer to the federated polities that make up the federation. Used in countries such as the United States
// and Brazil.
// Max length: 512
State *string `json:"state,omitempty"`
// Max items: 2
StreetAddress []string `json:"street_address,omitempty"`
// A US system of postal codes used by the United States Postal Service (USPS).
// Max length: 512
ZipCode *string `json:"zip_code,omitempty"`
}
An address somewhere in the world. The address fields used depend on the country conventions. For example, in Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses is `state`, whereas in Chile it's `region`. Whether an address is valid or not depends on whether the locally required fields are present. Fields not supported in a country will be ignored. Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
type AddressLegacy ¶ added in v0.14.0
type AddressLegacy 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"`
}
Profile's personal address information.
type Attributes ¶ added in v0.14.0
Object attributes that are modifiable only by SumUp applications.
type BadRequest ¶ added in v0.14.0
type BadRequest struct {
Errors BadRequestErrors `json:"errors"`
}
400 Bad Request
func (*BadRequest) Error ¶ added in v0.14.0
func (e *BadRequest) Error() string
type BadRequestErrors ¶ added in v0.14.0
type BadRequestErrors struct {
// Fuller message giving context to error
Detail *string `json:"detail,omitempty"`
// Key indicating type of error
Type BadRequestErrorsType `json:"type"`
}
BadRequestErrors is a schema definition.
type BadRequestErrorsType ¶ added in v0.14.0
type BadRequestErrorsType string
Key indicating type of error
const ( BadRequestErrorsTypeDuplicateHeaders BadRequestErrorsType = "DUPLICATE_HEADERS" BadRequestErrorsTypeInvalidBearerToken BadRequestErrorsType = "INVALID_BEARER_TOKEN" BadRequestErrorsTypeInvalidUserAgent BadRequestErrorsType = "INVALID_USER_AGENT" BadRequestErrorsTypeNotEnoughUnpaidPayouts BadRequestErrorsType = "NOT_ENOUGH_UNPAID_PAYOUTS" )
type BasePerson ¶ added in v0.14.0
type BasePerson struct {
// An address somewhere in the world. The address fields used depend on the country conventions. For example, in
// Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses
// is `state`, whereas in Chile it's `region`.
// Whether an address is valid or not depends on whether the locally required fields are present. Fields not
// supported in a country will be ignored.
// Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
Address *Address `json:"address,omitempty"`
// The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
// Format: date
Birthdate *datetime.Date `json:"birthdate,omitempty"`
// Reflects the status of changes submitted through the `PATCH` endpoints for the merchant or persons. If some
// changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status
// `done`.
// The status is only returned after write operations or on read endpoints when the `version` query parameter is
// provided.
// Read only
ChangeStatus *ChangeStatus `json:"change_status,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// country code. This definition users `oneOf` with a two-character string
// type to allow for support of future countries in client code.
// Min length: 2
// Max length: 2
// Pattern: ^[A-Z]{2}$
Citizenship *CountryCode `json:"citizenship,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country
// where the person resides.
// Min length: 2
// Max length: 2
CountryOfResidence *nullable.Field[string] `json:"country_of_residence,omitempty"`
// The last name(s) of the individual.
// Max length: 60
FamilyName *string `json:"family_name,omitempty"`
// The first name(s) of the individual.
// Max length: 60
GivenName *string `json:"given_name,omitempty"`
// The unique identifier for the person. This is a [typeid](https://github.com/sumup/typeid).
// Read only
ID string `json:"id"`
// A list of country-specific personal identifiers.
// Max items: 5
Identifiers []PersonalIdentifier `json:"identifiers,omitempty"`
// Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can
// be present, with the names being separated by space characters. Also note that in some cultures, middle names
// are not used.
// Max length: 60
MiddleName *string `json:"middle_name,omitempty"`
// The persons nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country
// code, but legacy data may not conform to this standard.
Nationality *nullable.Field[string] `json:"nationality,omitempty"`
Ownership *Ownership `json:"ownership,omitempty"`
// A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
// Max length: 16
PhoneNumber *PhoneNumber `json:"phone_number,omitempty"`
// A list of roles the person has in the merchant or towards SumUp. A merchant must have at least one person with
// the relationship `representative`.
// Min items: 1
// Max items: 1
Relationships []string `json:"relationships,omitempty"`
// A corresponding identity user ID for the person, if they have a user account.
UserID *string `json:"user_id,omitempty"`
// The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH`
// endpoints.
Version *Version `json:"version,omitempty"`
}
Base schema for a person associated with a merchant. This can be a legal representative, business owner (ultimate beneficial owner), or an officer. A legal representative is the person who registered the merchant with SumUp. They should always have a `user_id`.
Person documentation: https://developer.sumup.com/tools/models/merchant#persons
type Branding ¶ added in v0.14.0
type Branding struct {
// A hex color value representing the preferred background color of this merchant.
BackgroundColor *string `json:"background_color,omitempty"`
// Data-URL encoded hero image for the merchant business.
// Format: uri
Hero *string `json:"hero,omitempty"`
// An icon for the merchant. Must be square.
// Format: uri
Icon *string `json:"icon,omitempty"`
// A logo for the merchant that will be used in place of the icon and without the merchant's name next to it
// if there's sufficient space.
// Format: uri
Logo *string `json:"logo,omitempty"`
// A hex color value representing the primary branding color of this merchant (your brand color).
PrimaryColor *string `json:"primary_color,omitempty"`
// A hex color value representing the color of the text displayed on branding color of this merchant.
PrimaryColorFg *string `json:"primary_color_fg,omitempty"`
// A hex color value representing the secondary branding color of this merchant (accent color used for buttons).
SecondaryColor *string `json:"secondary_color,omitempty"`
// A hex color value representing the color of the text displayed on secondary branding color of this merchant.
SecondaryColorFg *string `json:"secondary_color_fg,omitempty"`
}
Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.
type BusinessProfile ¶ added in v0.14.0
type BusinessProfile struct {
// An address somewhere in the world. The address fields used depend on the country conventions. For example, in
// Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses
// is `state`, whereas in Chile it's `region`.
// Whether an address is valid or not depends on whether the locally required fields are present. Fields not
// supported in a country will be ignored.
// Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
Address *Address `json:"address,omitempty"`
// Settings used to apply the Merchant's branding to email receipts, invoices, checkouts, and other products.
Branding *Branding `json:"branding,omitempty"`
// The descriptor is the text that your customer sees on their bank account statement.
// The more recognisable your descriptor is, the less risk you have of receiving disputes (e.g. chargebacks).
// Min length: 1
// Max length: 30
// Pattern: ^[a-zA-Z0-9 \-+\'_.]{0,30}$
DynamicDescriptor *string `json:"dynamic_descriptor,omitempty"`
// A publicly available email address.
// Max length: 255
Email *string `json:"email,omitempty"`
// The customer-facing business name.
// Min length: 1
// Max length: 150
Name *string `json:"name,omitempty"`
// A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
// Max length: 16
PhoneNumber *PhoneNumber `json:"phone_number,omitempty"`
// The business's publicly available website.
// Format: uri
// Max length: 255
Website *string `json:"website,omitempty"`
}
Business information about the merchant. This information will be visible to the merchant's customers.
type Card ¶ added in v0.14.0
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"`
// 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 used for the transaction.
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"`
}
__Required when payment type is `card`.__ Details of the payment card.
type CardExpiryMonth ¶ added in v0.14.0
type CardExpiryMonth string
Month from the expiration time of the payment card. Accepted format is `MM`. Write only
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" )
type CardResponse ¶ added in v0.14.0
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 used for the transaction.
Type *CardType `json:"type,omitempty"`
}
Details of the payment card.
type CardType ¶ added in v0.14.0
type CardType string
Issuing card network of the payment card used for the transaction.
const ( CardTypeAlelo CardType = "ALELO" CardTypeAmex CardType = "AMEX" CardTypeConecs CardType = "CONECS" CardTypeCup CardType = "CUP" CardTypeDiners CardType = "DINERS" CardTypeDiscover CardType = "DISCOVER" CardTypeEftpos CardType = "EFTPOS" CardTypeElo CardType = "ELO" CardTypeElv CardType = "ELV" CardTypeGirocard CardType = "GIROCARD" CardTypeHipercard CardType = "HIPERCARD" CardTypeInterac CardType = "INTERAC" CardTypeJcb CardType = "JCB" CardTypeMaestro CardType = "MAESTRO" CardTypeMastercard CardType = "MASTERCARD" CardTypePluxee CardType = "PLUXEE" CardTypeSwile CardType = "SWILE" CardTypeTicket CardType = "TICKET" CardTypeUnknown CardType = "UNKNOWN" CardTypeVisa CardType = "VISA" CardTypeVisaElectron CardType = "VISA_ELECTRON" CardTypeVisaVpay CardType = "VISA_VPAY" CardTypeVpay CardType = "VPAY" CardTypeVr CardType = "VR" )
type ChangeStatus ¶ added in v0.14.0
type ChangeStatus string
Reflects the status of changes submitted through the `PATCH` endpoints for the merchant or persons. If some changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status `done`. The status is only returned after write operations or on read endpoints when the `version` query parameter is provided.
Read only
type Checkout ¶ added in v0.14.0
type Checkout struct {
// Amount of the payment.
Amount *float32 `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 *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 *MandateResponse `json:"mandate,omitempty"`
// Unique identifying code of the merchant profile.
MerchantCode *string `json:"merchant_code,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 *nullable.Field[time.Time] `json:"valid_until,omitempty"`
}
Details of the payment checkout.
type CheckoutAccepted ¶ added in v0.14.0
type CheckoutAccepted struct {
// Required action processing 3D Secure payments.
NextStep *CheckoutAcceptedNextStep `json:"next_step,omitempty"`
}
3DS Response
type CheckoutAcceptedNextStep ¶ added in v0.14.0
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"`
}
Required action processing 3D Secure payments.
type CheckoutAcceptedNextStepMechanism ¶ added in v0.14.0
type CheckoutAcceptedNextStepMechanism string
CheckoutAcceptedNextStepMechanism is a schema definition.
const ( CheckoutAcceptedNextStepMechanismBrowser CheckoutAcceptedNextStepMechanism = "browser" CheckoutAcceptedNextStepMechanismIframe CheckoutAcceptedNextStepMechanism = "iframe" )
type CheckoutAcceptedNextStepPayload ¶ added in v0.14.0
type CheckoutAcceptedNextStepPayload struct {
Md *any `json:"md,omitempty"`
PaReq *any `json:"pa_req,omitempty"`
TermURL *any `json:"term_url,omitempty"`
}
Contains parameters essential for form redirection. Number of object keys and their content can vary.
type CheckoutCreateRequest ¶ added in v0.14.0
type CheckoutCreateRequest struct {
// Amount of the payment.
Amount float32 `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 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"`
// 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 identifying code of the merchant profile.
MerchantCode string `json:"merchant_code"`
// 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"`
// 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 *nullable.Field[time.Time] `json:"valid_until,omitempty"`
}
Details of the payment checkout.
type CheckoutCreateRequestPurpose ¶ added in v0.14.0
type CheckoutCreateRequestPurpose string
Purpose of the checkout. Default: CHECKOUT
const ( CheckoutCreateRequestPurposeCheckout CheckoutCreateRequestPurpose = "CHECKOUT" CheckoutCreateRequestPurposeSetupRecurringPayment CheckoutCreateRequestPurpose = "SETUP_RECURRING_PAYMENT" )
type CheckoutStatus ¶ added in v0.14.0
type CheckoutStatus string
Current status of the checkout.
const ( CheckoutStatusExpired CheckoutStatus = "EXPIRED" CheckoutStatusFailed CheckoutStatus = "FAILED" CheckoutStatusPaid CheckoutStatus = "PAID" CheckoutStatusPending CheckoutStatus = "PENDING" )
type CheckoutSuccess ¶ added in v0.14.0
type CheckoutSuccess struct {
// Amount of the payment.
Amount *float32 `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 *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 *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"`
// 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 *nullable.Field[time.Time] `json:"valid_until,omitempty"`
}
Checkout response returned after a successful processing attempt.
type CheckoutSuccessPaymentInstrument ¶ added in v0.14.0
type CheckoutSuccessPaymentInstrument struct {
// Token value
Token *string `json:"token,omitempty"`
}
Object containing token information for the specified payment instrument
type CheckoutSuccessStatus ¶ added in v0.14.0
type CheckoutSuccessStatus string
Current status of the checkout.
const ( CheckoutSuccessStatusExpired CheckoutSuccessStatus = "EXPIRED" CheckoutSuccessStatusFailed CheckoutSuccessStatus = "FAILED" CheckoutSuccessStatusPaid CheckoutSuccessStatus = "PAID" CheckoutSuccessStatusPending CheckoutSuccessStatus = "PENDING" )
type CheckoutSuccessTransaction ¶ added in v0.14.0
type CheckoutSuccessTransaction struct {
// Total amount of the transaction.
Amount *float32 `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 *Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *EntryMode `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.
// Format: int64
InternalID *int64 `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 *PaymentType `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}
CheckoutSuccessTransaction is a schema definition.
type CheckoutSuccessTransactionStatus ¶ added in v0.14.0
type CheckoutSuccessTransactionStatus string
Current status of the transaction.
const ( CheckoutSuccessTransactionStatusCancelled CheckoutSuccessTransactionStatus = "CANCELLED" CheckoutSuccessTransactionStatusFailed CheckoutSuccessTransactionStatus = "FAILED" CheckoutSuccessTransactionStatusPending CheckoutSuccessTransactionStatus = "PENDING" CheckoutSuccessTransactionStatusSuccessful CheckoutSuccessTransactionStatus = "SUCCESSFUL" )
type CheckoutTransaction ¶ added in v0.14.0
type CheckoutTransaction struct {
// Total amount of the transaction.
Amount *float32 `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 *Currency `json:"currency,omitempty"`
// Entry mode of the payment details.
EntryMode *EntryMode `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.
// Format: int64
InternalID *int64 `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 *PaymentType `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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
}
CheckoutTransaction is a schema definition.
type CheckoutTransactionStatus ¶ added in v0.14.0
type CheckoutTransactionStatus string
Current status of the transaction.
const ( CheckoutTransactionStatusCancelled CheckoutTransactionStatus = "CANCELLED" CheckoutTransactionStatusFailed CheckoutTransactionStatus = "FAILED" CheckoutTransactionStatusPending CheckoutTransactionStatus = "PENDING" CheckoutTransactionStatusSuccessful CheckoutTransactionStatus = "SUCCESSFUL" )
type CheckoutsClient ¶ added in v0.14.0
type CheckoutsClient struct {
// contains filtered or unexported fields
}
func NewCheckoutsClient ¶ added in v0.14.0
func NewCheckoutsClient(c *client.Client) *CheckoutsClient
func (*CheckoutsClient) Create ¶ added in v0.14.0
func (c *CheckoutsClient) Create(ctx context.Context, body CheckoutsCreateParams) (*Checkout, error)
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 (*CheckoutsClient) Deactivate ¶ added in v0.14.0
Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.
func (*CheckoutsClient) Get ¶ added in v0.14.0
func (c *CheckoutsClient) Get(ctx context.Context, id string) (*CheckoutSuccess, error)
Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.
func (*CheckoutsClient) List ¶ added in v0.14.0
func (c *CheckoutsClient) List(ctx context.Context, params CheckoutsListParams) (*CheckoutsListResponse, error)
Lists created checkout resources according to the applied `checkout_reference`.
func (*CheckoutsClient) ListAvailablePaymentMethods ¶ added in v0.14.0
func (c *CheckoutsClient) ListAvailablePaymentMethods(ctx context.Context, merchantCode string, params CheckoutsListAvailablePaymentMethodsParams) (*CheckoutsListAvailablePaymentMethodsResponse, error)
Get payment methods available for the given merchant to use with a checkout.
func (*CheckoutsClient) Process ¶ added in v0.14.0
func (c *CheckoutsClient) Process(ctx context.Context, id string, body CheckoutsProcessParams) (*CheckoutsProcessResponse, error)
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.
type CheckoutsCreateParams ¶ added in v0.14.0
type CheckoutsCreateParams = CheckoutCreateRequest
type CheckoutsListAvailablePaymentMethodsParams ¶ added in v0.14.0
type CheckoutsListAvailablePaymentMethodsParams struct {
// The amount for which the payment methods should be eligible, in major units.
Amount *float64
// The currency for which the payment methods should be eligible.
Currency *string
}
CheckoutsListAvailablePaymentMethodsParams are query parameters for GetPaymentMethods.
func (*CheckoutsListAvailablePaymentMethodsParams) QueryValues ¶ added in v0.14.0
func (p *CheckoutsListAvailablePaymentMethodsParams) QueryValues() url.Values
QueryValues converts CheckoutsListAvailablePaymentMethodsParams into url.Values.
type CheckoutsListAvailablePaymentMethodsResponse ¶ added in v0.14.0
type CheckoutsListAvailablePaymentMethodsResponse struct {
AvailablePaymentMethods []CheckoutsListAvailablePaymentMethodsResponseAvailablePaymentMethod `json:"available_payment_methods,omitempty"`
}
CheckoutsListAvailablePaymentMethodsResponse is a schema definition.
type CheckoutsListAvailablePaymentMethodsResponseAvailablePaymentMethod ¶ added in v0.14.0
type CheckoutsListAvailablePaymentMethodsResponseAvailablePaymentMethod struct {
// The ID of the payment method.
ID string `json:"id"`
}
CheckoutsListAvailablePaymentMethodsResponseAvailablePaymentMethod is a schema definition.
type CheckoutsListParams ¶ added in v0.14.0
type CheckoutsListParams struct {
// Filters the list of checkout resources by the unique ID of the checkout.
CheckoutReference *string
}
CheckoutsListParams are query parameters for ListCheckouts.
func (*CheckoutsListParams) QueryValues ¶ added in v0.14.0
func (p *CheckoutsListParams) QueryValues() url.Values
QueryValues converts CheckoutsListParams into url.Values.
type CheckoutsListResponse ¶ added in v0.14.0
type CheckoutsListResponse []CheckoutSuccess
CheckoutsListResponse is a schema definition.
type CheckoutsProcess400Response ¶ added in v0.14.0
type CheckoutsProcess400Response json.RawMessage
CheckoutsProcess400Response is a schema definition.
func (*CheckoutsProcess400Response) Error ¶ added in v0.14.0
func (e *CheckoutsProcess400Response) Error() string
type CheckoutsProcessParams ¶ added in v0.14.0
type CheckoutsProcessParams = ProcessCheckout
type CheckoutsProcessResponse ¶ added in v0.14.0
type CheckoutsProcessResponse struct {
CheckoutSuccess *CheckoutSuccess
CheckoutAccepted *CheckoutAccepted
}
func (*CheckoutsProcessResponse) AsCheckoutAccepted ¶ added in v0.14.0
func (r *CheckoutsProcessResponse) AsCheckoutAccepted() (*CheckoutAccepted, bool)
func (*CheckoutsProcessResponse) AsCheckoutSuccess ¶ added in v0.14.0
func (r *CheckoutsProcessResponse) AsCheckoutSuccess() (*CheckoutSuccess, bool)
type ClassicMerchantIdentifiers ¶ added in v0.14.0
type ClassicMerchantIdentifiers struct {
// Classic (serial) merchant ID.
// Format: int64
// Deprecated: this operation is deprecated
ID int64 `json:"id"`
}
ClassicMerchantIdentifiers is a schema definition.
type Client ¶
type Client struct {
Checkouts *CheckoutsClient
Customers *CustomersClient
Members *MembersClient
Memberships *MembershipsClient
Merchants *MerchantsClient
Payouts *PayoutsClient
Readers *ReadersClient
Receipts *ReceiptsClient
Roles *RolesClient
Subaccounts *SubaccountsClient
Transactions *TransactionsClient
// contains filtered or unexported fields
}
Example ¶
client := sumup.NewClient()
merchant, err := client.Merchants.Get(context.Background(), os.Getenv("SUMUP_MERCHANT_CODE"), sumup.MerchantsGetParams{})
if err != nil {
log.Printf("[ERROR] get merchant account: %v", err)
return
}
log.Printf("[INFO] business profile: %+v", merchant.BusinessProfile)
func NewClient ¶
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.
type Company ¶ added in v0.14.0
type Company struct {
// An address somewhere in the world. The address fields used depend on the country conventions. For example, in
// Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses
// is `state`, whereas in Chile it's `region`.
// Whether an address is valid or not depends on whether the locally required fields are present. Fields not
// supported in a country will be ignored.
// Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
Address *Address `json:"address,omitempty"`
// Object attributes that are modifiable only by SumUp applications.
Attributes Attributes `json:"attributes,omitempty"`
// A list of country-specific company identifiers.
Identifiers CompanyIdentifiers `json:"identifiers,omitempty"`
// The unique legal type reference as defined in the country SDK. We do not rely on IDs as used by other services.
// Consumers of this API are expected to use the country SDK to map to any other IDs, translation keys, or
// descriptions.
// Min length: 4
// Max length: 64
// The country SDK documentation for legal types.: https://developer.sumup.com/tools/models/merchant#legal-types
LegalType *LegalType `json:"legal_type,omitempty"`
// The merchant category code for the account as specified by [ISO18245](https://www.iso.org/standard/33365.html). MCCs
// are used to classify businesses based on the goods or services they provide.
// Pattern: ^[0-9]{4}$
MerchantCategoryCode *string `json:"merchant_category_code,omitempty"`
// The company's legal name.
// Min length: 1
// Max length: 150
Name *string `json:"name,omitempty"`
// A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
// Max length: 16
PhoneNumber *PhoneNumber `json:"phone_number,omitempty"`
// An address somewhere in the world. The address fields used depend on the country conventions. For example, in
// Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses
// is `state`, whereas in Chile it's `region`.
// Whether an address is valid or not depends on whether the locally required fields are present. Fields not
// supported in a country will be ignored.
// Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
TradingAddress *Address `json:"trading_address,omitempty"`
// HTTP(S) URL of the company's website.
// Format: uri
// Max length: 255
Website *nullable.Field[string] `json:"website,omitempty"`
}
Information about the company or business. This is legal information that is used for verification.
Company documentation: https://developer.sumup.com/tools/models/merchant#company
type CompanyIdentifier ¶ added in v0.14.0
type CompanyIdentifier struct {
// The unique reference for the company identifier type as defined in the country SDK.
Ref string `json:"ref"`
// The company identifier value.
// Max length: 100
Value string `json:"value"`
}
CompanyIdentifier is a schema definition. Company identifier documentation: https://developer.sumup.com/tools/models/merchant#company-identifiers
type CompanyIdentifiers ¶ added in v0.14.0
type CompanyIdentifiers []CompanyIdentifier
A list of country-specific company identifiers.
type CountryCode ¶ added in v0.14.0
type CountryCode string
An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. This definition users `oneOf` with a two-character string type to allow for support of future countries in client code. Min length: 2 Max length: 2 Pattern: ^[A-Z]{2}$
type CreateCheckoutRequest ¶ added in v0.14.0
type CreateCheckoutRequest struct {
// Optional object containing data for transactions from ERP integrators in Greece that comply with the AADE
// 1155 protocol.
// When such regulatory/business requirements apply, this object must be provided and contains the data needed
// to validate the transaction with the AADE signature provider.
AADE *CreateCheckoutRequestAADE `json:"aade,omitempty"`
// Affiliate metadata for the transaction.
// It is a field that allow for integrators to track the source of the transaction.
Affiliate *nullable.Field[CreateCheckoutRequestAffiliate] `json:"affiliate,omitempty"`
// The card type of the card used for the transaction.
// Is is required only for some countries (e.g: Brazil).
CardType *CreateCheckoutRequestCardType `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.
//
// Omit if the merchant country does support installments.
// Otherwise, the checkout will be rejected.
// Min: 1
Installments *nullable.Field[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 []float32 `json:"tip_rates,omitempty"`
// Time in seconds the cardholder has to select a tip rate.
// If not provided, the default value is 30 seconds.
//
// It can only be set if `tip_rates` is provided.
//
// **Note**: If the target device is a Solo, it must be in version 3.3.38.0 or higher.
// Default: 30
// Min: 30
// Max: 120
TipTimeout *int `json:"tip_timeout,omitempty"`
// Amount structure.
//
// 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 CreateCheckoutRequestTotalAmount `json:"total_amount"`
}
Reader Checkout
type CreateCheckoutRequestAADE ¶ added in v0.15.2
type CreateCheckoutRequestAADE struct {
// The identifier of the AADE signature provider.
ProviderID string `json:"provider_id"`
// The base64 encoded signature of the transaction data.
Signature string `json:"signature"`
// The string containing the signed transaction data.
SignatureData string `json:"signature_data"`
}
Optional object containing data for transactions from ERP integrators in Greece that comply with the AADE 1155 protocol. When such regulatory/business requirements apply, this object must be provided and contains the data needed to validate the transaction with the AADE signature provider.
type CreateCheckoutRequestAffiliate ¶ added in v0.14.0
type CreateCheckoutRequestAffiliate 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.
Key string `json:"key"`
// Additional metadata for the transaction.
// It is key-value object that can be associated with the transaction.
Tags CreateCheckoutRequestAffiliateTags `json:"tags,omitempty"`
}
Affiliate metadata for the transaction. It is a field that allow for integrators to track the source of the transaction.
type CreateCheckoutRequestAffiliateTags ¶ added in v0.14.0
Additional metadata for the transaction. It is key-value object that can be associated with the transaction.
type CreateCheckoutRequestCardType ¶ added in v0.14.0
type CreateCheckoutRequestCardType string
The card type of the card used for the transaction. Is is required only for some countries (e.g: Brazil).
const ( CreateCheckoutRequestCardTypeCredit CreateCheckoutRequestCardType = "credit" CreateCheckoutRequestCardTypeDebit CreateCheckoutRequestCardType = "debit" )
type CreateCheckoutRequestTotalAmount ¶ added in v0.14.0
type CreateCheckoutRequestTotalAmount 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.
// Min: 0
MinorUnit int `json:"minor_unit"`
// Integer value of the amount.
// Min: 0
Value int `json:"value"`
}
Amount structure.
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 CreateReaderCheckoutError ¶ added in v0.14.0
type CreateReaderCheckoutError struct {
Errors CreateReaderCheckoutErrorErrors `json:"errors"`
}
Error description
func (*CreateReaderCheckoutError) Error ¶ added in v0.14.0
func (e *CreateReaderCheckoutError) Error() string
type CreateReaderCheckoutErrorErrors ¶ added in v0.14.0
type CreateReaderCheckoutErrorErrors struct {
// Error message
Detail *string `json:"detail,omitempty"`
// Error code
Type string `json:"type"`
}
CreateReaderCheckoutErrorErrors is a schema definition.
type CreateReaderCheckoutResponse ¶ added in v0.14.0
type CreateReaderCheckoutResponse struct {
Data CreateReaderCheckoutResponseData `json:"data"`
}
CreateReaderCheckoutResponse is a schema definition.
type CreateReaderCheckoutResponseData ¶ added in v0.14.0
type CreateReaderCheckoutResponseData 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).
ClientTransactionID string `json:"client_transaction_id"`
}
CreateReaderCheckoutResponseData is a schema definition.
type CreateReaderCheckoutUnprocessableEntity ¶ added in v0.14.0
type CreateReaderCheckoutUnprocessableEntity struct {
Errors CreateReaderCheckoutUnprocessableEntityErrors `json:"errors"`
}
Unprocessable entity
func (*CreateReaderCheckoutUnprocessableEntity) Error ¶ added in v0.14.0
func (e *CreateReaderCheckoutUnprocessableEntity) Error() string
type CreateReaderCheckoutUnprocessableEntityErrors ¶ added in v0.14.0
CreateReaderCheckoutUnprocessableEntityErrors is a schema definition.
type CreateReaderTerminateError ¶ added in v0.14.0
type CreateReaderTerminateError struct {
Errors CreateReaderTerminateErrorErrors `json:"errors"`
}
Error description
func (*CreateReaderTerminateError) Error ¶ added in v0.14.0
func (e *CreateReaderTerminateError) Error() string
type CreateReaderTerminateErrorErrors ¶ added in v0.14.0
type CreateReaderTerminateErrorErrors struct {
// Error message
Detail *string `json:"detail,omitempty"`
// Error code
Type string `json:"type"`
}
CreateReaderTerminateErrorErrors is a schema definition.
type CreateReaderTerminateUnprocessableEntity ¶ added in v0.14.0
type CreateReaderTerminateUnprocessableEntity struct {
Errors CreateReaderTerminateUnprocessableEntityErrors `json:"errors"`
}
Unprocessable entity
func (*CreateReaderTerminateUnprocessableEntity) Error ¶ added in v0.14.0
func (e *CreateReaderTerminateUnprocessableEntity) Error() string
type CreateReaderTerminateUnprocessableEntityErrors ¶ added in v0.14.0
CreateReaderTerminateUnprocessableEntityErrors is a schema definition.
type Currency ¶ added in v0.14.0
type Currency string
Three-letter [ISO4217](https://en.wikipedia.org/wiki/ISO_4217) code of the currency for the amount. Currently supported currency values are enumerated above.
const ( CurrencyBGN Currency = "BGN" CurrencyBRL Currency = "BRL" CurrencyCHF Currency = "CHF" CurrencyCLP Currency = "CLP" CurrencyCZK Currency = "CZK" CurrencyCop Currency = "COP" 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 Customer ¶ added in v0.14.0
type Customer struct {
// Unique ID of the customer.
CustomerID string `json:"customer_id"`
// Personal details for the customer.
PersonalDetails *PersonalDetails `json:"personal_details,omitempty"`
}
Saved customer details.
type CustomersClient ¶ added in v0.14.0
type CustomersClient struct {
// contains filtered or unexported fields
}
func NewCustomersClient ¶ added in v0.14.0
func NewCustomersClient(c *client.Client) *CustomersClient
func (*CustomersClient) Create ¶ added in v0.14.0
func (c *CustomersClient) Create(ctx context.Context, body CustomersCreateParams) (*Customer, error)
Creates a new saved customer resource which you can later manipulate and save payment instruments to.
func (*CustomersClient) DeactivatePaymentInstrument ¶ added in v0.14.0
func (c *CustomersClient) DeactivatePaymentInstrument(ctx context.Context, customerID string, token string) error
Deactivates an identified card payment instrument resource for a customer.
func (*CustomersClient) Get ¶ added in v0.14.0
Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
func (*CustomersClient) ListPaymentInstruments ¶ added in v0.14.0
func (c *CustomersClient) ListPaymentInstruments(ctx context.Context, customerID string) (*CustomersListPaymentInstrumentsResponse, error)
Lists all payment instrument resources that are saved for an identified customer.
func (*CustomersClient) Update ¶ added in v0.14.0
func (c *CustomersClient) Update(ctx context.Context, customerID string, body CustomersUpdateParams) (*Customer, error)
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.
type CustomersCreate400Response ¶ added in v0.15.1
type CustomersCreate400Response json.RawMessage
CustomersCreate400Response is a schema definition.
func (*CustomersCreate400Response) Error ¶ added in v0.15.1
func (e *CustomersCreate400Response) Error() string
type CustomersCreateParams ¶ added in v0.14.0
type CustomersCreateParams = Customer
type CustomersListPaymentInstrumentsResponse ¶ added in v0.14.0
type CustomersListPaymentInstrumentsResponse []PaymentInstrumentResponse
CustomersListPaymentInstrumentsResponse is a schema definition.
type CustomersUpdateParams ¶ added in v0.14.0
type CustomersUpdateParams struct {
// Personal details for the customer.
PersonalDetails *PersonalDetails `json:"personal_details,omitempty"`
}
CustomersUpdateParams is a schema definition.
type DetailsError ¶ added in v0.14.0
type DetailsError struct {
// Details of the error.
Details *string `json:"details,omitempty"`
// List of violated validation constraints.
FailedConstraints []DetailsErrorFailedConstraint `json:"failed_constraints,omitempty"`
// The status code.
Status *float64 `json:"status,omitempty"`
// Short title of the error.
Title *string `json:"title,omitempty"`
}
Error message structure.
func (*DetailsError) Error ¶ added in v0.14.0
func (e *DetailsError) Error() string
type DetailsErrorFailedConstraint ¶ added in v0.14.0
type DetailsErrorFailedConstraint struct {
Message *string `json:"message,omitempty"`
Reference *string `json:"reference,omitempty"`
}
DetailsErrorFailedConstraint is a schema definition.
type Device ¶ added in v0.15.1
type Device struct {
// Device model.
Model *string `json:"model,omitempty"`
// Device name.
Name *string `json:"name,omitempty"`
// Device OS.
SystemName *string `json:"system_name,omitempty"`
// Device OS version.
SystemVersion *string `json:"system_version,omitempty"`
// Device UUID.
UUID *string `json:"uuid,omitempty"`
}
Details of the device used to create the transaction.
type ElvCardAccount ¶ added in v0.15.1
type ElvCardAccount struct {
// ELV IBAN.
IBAN *string `json:"iban,omitempty"`
// ELV card account number last 4 digits.
Last4Digits *string `json:"last_4_digits,omitempty"`
// ELV card sequence number.
SequenceNo *int `json:"sequence_no,omitempty"`
// ELV card sort code.
SortCode *string `json:"sort_code,omitempty"`
}
Details of the ELV card account associated with the transaction.
type EntryMode ¶ added in v0.14.0
type EntryMode string
Entry mode of the payment details.
const ( EntryModeApplePay EntryMode = "APPLE_PAY" EntryModeBancontact EntryMode = "BANCONTACT" EntryModeBlik EntryMode = "BLIK" EntryModeBoleto EntryMode = "BOLETO" EntryModeChip EntryMode = "CHIP" EntryModeContactless EntryMode = "CONTACTLESS" EntryModeContactlessMagstripe EntryMode = "CONTACTLESS_MAGSTRIPE" EntryModeCustomerEntry EntryMode = "CUSTOMER_ENTRY" EntryModeDirectDebit EntryMode = "DIRECT_DEBIT" EntryModeEps EntryMode = "EPS" EntryModeGiropay EntryMode = "GIROPAY" EntryModeGooglePay EntryMode = "GOOGLE_PAY" EntryModeIdeal EntryMode = "IDEAL" EntryModeMagstripe EntryMode = "MAGSTRIPE" EntryModeMagstripeFallback EntryMode = "MAGSTRIPE_FALLBACK" EntryModeManualEntry EntryMode = "MANUAL_ENTRY" EntryModeMoto EntryMode = "MOTO" EntryModeMybank EntryMode = "MYBANK" EntryModeNA EntryMode = "N/A" EntryModeNone EntryMode = "NONE" EntryModeP24 EntryMode = "P24" EntryModePaypal EntryMode = "PAYPAL" EntryModePix EntryMode = "PIX" EntryModeQrCodePix EntryMode = "QR_CODE_PIX" EntryModeSatispay EntryMode = "SATISPAY" EntryModeSofort EntryMode = "SOFORT" EntryModeTwint EntryMode = "TWINT" )
type Error ¶ added in v0.14.0
type Error struct {
// Platform code for the error.
ErrorCode *string `json:"error_code,omitempty"`
// Short description of the error.
Message *string `json:"message,omitempty"`
}
Error message structure.
type ErrorExtended ¶ added in v0.14.0
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"`
}
Error payload with the invalid parameter reference.
func (*ErrorExtended) Error ¶ added in v0.14.0
func (e *ErrorExtended) Error() string
type ErrorForbidden ¶ added in v0.14.0
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"`
}
Error message for forbidden requests.
func (*ErrorForbidden) Error ¶ added in v0.14.0
func (e *ErrorForbidden) Error() string
type Event ¶ added in v0.14.0
type Event struct {
// Amount of the event.
Amount *float32 `json:"amount,omitempty"`
// Amount deducted for the event.
DeductedAmount *float32 `json:"deducted_amount,omitempty"`
// Amount of the fee deducted for the event.
DeductedFeeAmount *float32 `json:"deducted_fee_amount,omitempty"`
// Amount of the fee related to the event.
FeeAmount *float32 `json:"fee_amount,omitempty"`
// Unique ID of the transaction event.
// Format: int64
ID *EventID `json:"id,omitempty"`
// Consecutive number of the installment.
InstallmentNumber *int `json:"installment_number,omitempty"`
// Status of the transaction event.
Status *EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Unique ID of the transaction.
TransactionID *TransactionID `json:"transaction_id,omitempty"`
// Type of the transaction event.
Type *EventType `json:"type,omitempty"`
}
Transaction event details.
type EventID ¶ added in v0.14.0
type EventID int64
Unique ID of the transaction event. Format: int64
type EventStatus ¶ added in v0.14.0
type EventStatus string
Status of the transaction event.
const ( EventStatusFailed EventStatus = "FAILED" EventStatusPaidOut EventStatus = "PAID_OUT" EventStatusPending EventStatus = "PENDING" EventStatusReconciled EventStatus = "RECONCILED" EventStatusRefunded EventStatus = "REFUNDED" EventStatusScheduled EventStatus = "SCHEDULED" EventStatusSuccessful EventStatus = "SUCCESSFUL" )
type FinancialPayout ¶ added in v0.14.0
type FinancialPayout struct {
Amount *float32 `json:"amount,omitempty"`
Currency *string `json:"currency,omitempty"`
// Format: date
Date *datetime.Date `json:"date,omitempty"`
Fee *float32 `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"`
}
FinancialPayout is a schema definition.
type FinancialPayoutStatus ¶ added in v0.14.0
type FinancialPayoutStatus string
FinancialPayoutStatus is a schema definition.
const ( FinancialPayoutStatusFailed FinancialPayoutStatus = "FAILED" FinancialPayoutStatusSuccessful FinancialPayoutStatus = "SUCCESSFUL" )
type FinancialPayoutType ¶ added in v0.14.0
type FinancialPayoutType string
FinancialPayoutType is a schema definition.
const ( FinancialPayoutTypeBalanceDeduction FinancialPayoutType = "BALANCE_DEDUCTION" FinancialPayoutTypeChargeBackDeduction FinancialPayoutType = "CHARGE_BACK_DEDUCTION" FinancialPayoutTypeDdReturnDeduction FinancialPayoutType = "DD_RETURN_DEDUCTION" FinancialPayoutTypePayout FinancialPayoutType = "PAYOUT" FinancialPayoutTypeRefundDeduction FinancialPayoutType = "REFUND_DEDUCTION" )
type FinancialPayouts ¶ added in v0.14.0
type FinancialPayouts []FinancialPayout
List of payout summaries.
type HorizontalAccuracy ¶ added in v0.14.0
type HorizontalAccuracy float32
Indication of the precision of the geographical position received from the payment terminal.
type Invite ¶ added in v0.14.0
type Invite struct {
// Email address of the invited user.
// Format: email
Email string `json:"email"`
ExpiresAt time.Time `json:"expires_at"`
}
Pending invitation for membership.
type Lat ¶ added in v0.14.0
type Lat float32
Latitude value from the coordinates of the payment location (as received from the payment terminal reader). Min: 0 Max: 90
type LegalType ¶ added in v0.14.0
type LegalType string
The unique legal type reference as defined in the country SDK. We do not rely on IDs as used by other services. Consumers of this API are expected to use the country SDK to map to any other IDs, translation keys, or descriptions.
Min length: 4 Max length: 64 The country SDK documentation for legal types.: https://developer.sumup.com/tools/models/merchant#legal-types
type Link ¶ added in v0.14.0
type Link struct {
// URL for accessing the related resource.
// Format: uri
Href *string `json:"href,omitempty"`
// Maximum allowed amount for the refund.
MaxAmount *float32 `json:"max_amount,omitempty"`
// Minimum allowed amount for the refund.
MinAmount *float32 `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"`
}
Details of a link to a related resource.
type ListPersonsResponseBody ¶ added in v0.14.0
type ListPersonsResponseBody struct {
Items []Person `json:"items"`
}
ListPersonsResponseBody is a schema definition.
type Lon ¶ added in v0.14.0
type Lon float32
Longitude value from the coordinates of the payment location (as received from the payment terminal reader). Min: 0 Max: 180
type MandatePayload ¶ added in v0.14.0
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"`
}
Mandate is passed when a card is to be tokenized
type MandatePayloadType ¶ added in v0.14.0
type MandatePayloadType string
Indicates the mandate type
const (
MandatePayloadTypeRecurrent MandatePayloadType = "recurrent"
)
type MandateResponse ¶ added in v0.14.0
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"`
}
Created mandate
type Member ¶ added in v0.14.0
type Member struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes 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 *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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// User's permissions.
// Deprecated: Permissions include only legacy permissions, please use roles instead. Member access is based on
// roles within a given resource and the permissions these roles grant.
Permissions []string `json:"permissions"`
// User's roles.
Roles []string `json:"roles"`
// The status of the membership.
Status 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"`
}
A member is user within specific resource identified by resource id, resource type, and associated roles.
type MembersClient ¶ added in v0.14.0
type MembersClient struct {
// contains filtered or unexported fields
}
func NewMembersClient ¶ added in v0.14.0
func NewMembersClient(c *client.Client) *MembersClient
func (*MembersClient) Create ¶ added in v0.14.0
func (c *MembersClient) Create(ctx context.Context, merchantCode string, body MembersCreateParams) (*Member, error)
Create a merchant member.
func (*MembersClient) Get ¶ added in v0.14.0
func (c *MembersClient) Get(ctx context.Context, merchantCode string, memberID string) (*Member, error)
Retrieve a merchant member.
func (*MembersClient) List ¶ added in v0.14.0
func (c *MembersClient) List(ctx context.Context, merchantCode string, params MembersListParams) (*MembersListResponse, error)
Lists merchant members.
func (*MembersClient) Update ¶ added in v0.14.0
func (c *MembersClient) Update(ctx context.Context, merchantCode string, memberID string, body MembersUpdateParams) (*Member, error)
Update the merchant member.
type MembersCreateParams ¶ added in v0.14.0
type MembersCreateParams struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes 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"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata 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 *secret.Secret `json:"password,omitempty"`
// List of roles to assign to the new member.
Roles []string `json:"roles"`
}
MembersCreateParams is a schema definition.
type MembersListParams ¶ added in v0.14.0
type MembersListParams 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 *MembershipStatus
// Search for a member by user id.
UserID *string
}
MembersListParams are query parameters for ListMerchantMembers.
func (*MembersListParams) QueryValues ¶ added in v0.14.0
func (p *MembersListParams) QueryValues() url.Values
QueryValues converts MembersListParams into url.Values.
type MembersListResponse ¶ added in v0.14.0
type MembersListResponse struct {
Items []Member `json:"items"`
TotalCount *int `json:"total_count,omitempty"`
}
MembersListResponse is a schema definition.
type MembersUpdateParams ¶ added in v0.14.0
type MembersUpdateParams struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes 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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
Roles []string `json:"roles,omitempty"`
// Allows you to update user data of managed users.
User *MembersUpdateParamsUser `json:"user,omitempty"`
}
MembersUpdateParams is a schema definition.
type MembersUpdateParamsUser ¶ added in v0.14.0
type MembersUpdateParamsUser 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 *secret.Secret `json:"password,omitempty"`
}
Allows you to update user data of managed users.
type Membership ¶ added in v0.14.0
type Membership struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes 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 *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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// User's permissions.
// Deprecated: Permissions include only legacy permissions, please use roles instead. Member access is based on
// their roles within a given resource and the permissions these roles grant.
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 MembershipStatus `json:"status"`
// The type of the membership resource.
// Possible values are:
// * `merchant` - merchant account(s)
// * `organization` - organization(s)
Type ResourceType `json:"type"`
// The timestamp of when the membership was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.
type MembershipResource ¶ added in v0.14.0
type MembershipResource struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes Attributes `json:"attributes,omitempty"`
// 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"`
// The type of the membership resource.
// Possible values are:
// * `merchant` - merchant account(s)
// * `organization` - organization(s)
Type ResourceType `json:"type"`
// The timestamp of when the membership resource was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Information about the resource the membership is in.
type MembershipStatus ¶ added in v0.14.0
type MembershipStatus string
The status of the membership.
const ( MembershipStatusAccepted MembershipStatus = "accepted" MembershipStatusDisabled MembershipStatus = "disabled" MembershipStatusExpired MembershipStatus = "expired" MembershipStatusPending MembershipStatus = "pending" MembershipStatusUnknown MembershipStatus = "unknown" )
type MembershipUser ¶ added in v0.14.0
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"`
}
Information about the user associated with the membership.
type MembershipUserClassic ¶ added in v0.14.0
type MembershipUserClassic struct {
// Format: int32
UserID int32 `json:"user_id"`
}
Classic identifiers of the user. Deprecated: this operation is deprecated
type MembershipsClient ¶ added in v0.14.0
type MembershipsClient struct {
// contains filtered or unexported fields
}
func NewMembershipsClient ¶ added in v0.14.0
func NewMembershipsClient(c *client.Client) *MembershipsClient
func (*MembershipsClient) List ¶ added in v0.14.0
func (c *MembershipsClient) List(ctx context.Context, params MembershipsListParams) (*MembershipsListResponse, error)
List memberships of the current user.
type MembershipsListParams ¶ added in v0.14.0
type MembershipsListParams struct {
// Filter memberships by resource kind.
Kind *ResourceType
// 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
// Filter memberships by the name of the resource the membership is in.
ResourceName *string
// Filter memberships by the parent of the resource the membership is in.
// When filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null
// to filter for resources without a parent.
ResourceParentID *string
// Filter memberships by the parent of the resource the membership is in.
// When filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null
// to filter for resources without a parent.
ResourceParentType *ResourceType
// Filter memberships by resource kind.
ResourceType *ResourceType
// Filter the returned memberships by role.
Roles []string
// Filter the returned memberships by the membership status.
Status *MembershipStatus
}
MembershipsListParams are query parameters for ListMemberships.
func (*MembershipsListParams) QueryValues ¶ added in v0.14.0
func (p *MembershipsListParams) QueryValues() url.Values
QueryValues converts MembershipsListParams into url.Values.
type MembershipsListResponse ¶ added in v0.14.0
type MembershipsListResponse struct {
Items []Membership `json:"items"`
TotalCount int `json:"total_count"`
}
MembershipsListResponse is a schema definition.
type Merchant ¶ added in v0.14.0
type Merchant struct {
// A user-facing name of the merchant account for use in dashboards and other user-facing applications. For
// customer-facing business name see `merchant.business_profile`.
Alias *string `json:"alias,omitempty"`
// A user-facing small-format logo for use in dashboards and other user-facing applications. For customer-facing branding
// see `merchant.business_profile.branding`.
// Format: uri
Avatar *string `json:"avatar,omitempty"`
// Business information about the merchant. This information will be visible to the merchant's customers.
BusinessProfile *BusinessProfile `json:"business_profile,omitempty"`
// The business type.
// * `sole_trader`: The business is run by an self-employed individual.
// * `company`: The business is run as a company with one or more shareholders
// * `partnership`: The business is run as a company with two or more shareholders that can be also other legal
// entities
// * `non_profit`: The business is run as a nonprofit organization that operates for public or social benefit
// * `government_entity`: The business is state owned and operated
BusinessType *string `json:"business_type,omitempty"`
// Reflects the status of changes submitted through the `PATCH` endpoints for the merchant or persons. If some
// changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status
// `done`.
// The status is only returned after write operations or on read endpoints when the `version` query parameter is
// provided.
// Read only
ChangeStatus *ChangeStatus `json:"change_status,omitempty"`
Classic *ClassicMerchantIdentifiers `json:"classic,omitempty"`
// Information about the company or business. This is legal information that is used for verification.
// Company documentation: https://developer.sumup.com/tools/models/merchant#company
Company *Company `json:"company,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// country code. This definition users `oneOf` with a two-character string
// type to allow for support of future countries in client code.
// Min length: 2
// Max length: 2
// Pattern: ^[A-Z]{2}$
Country CountryCode `json:"country"`
// The date and time when the resource was created. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
// Read only
CreatedAt time.Time `json:"created_at"`
// Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217) representing the default currency for
// the account.
// Read only
// Min length: 3
// Max length: 3
DefaultCurrency string `json:"default_currency"`
// Merchant's default locale, represented as a BCP47 [RFC5646](https://datatracker.ietf.org/doc/html/rfc5646) language
// tag. This is typically an ISO 639-1 Alpha-2 [ISO639‑1](https://www.iso.org/iso-639-language-code) language code
// in lowercase and an ISO 3166-1 Alpha-2 [ISO3166‑1](https://www.iso.org/iso-3166-country-codes.html) country
// code in uppercase, separated by a dash. For example, en-US or fr-CA.
// In multilingual countries this is the merchant's preferred locale out of those, that are officially spoken in
// the country. In a countries with a single official language this will match the official language.
// Min length: 2
// Max length: 5
DefaultLocale string `json:"default_locale"`
// Short unique identifier for the merchant.
// Read only
MerchantCode string `json:"merchant_code"`
// A set of key-value pairs that you can attach to an object. This can be useful for storing additional information
// about the object in a structured format.
//
// **Warning**: Updating Meta will overwrite the existing data. Make sure to always include the complete JSON
// object.
Meta Meta `json:"meta,omitempty"`
// ID of the organization the merchant belongs to (if any).
OrganizationID *string `json:"organization_id,omitempty"`
// True if the merchant is a sandbox for testing.
Sandbox *bool `json:"sandbox,omitempty"`
// The date and time when the resource was last updated. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
//
// Read only
UpdatedAt time.Time `json:"updated_at"`
// The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH`
// endpoints.
Version *Version `json:"version,omitempty"`
}
Merchant is a schema definition. Merchant documentation: https://developer.sumup.com/tools/models/merchant
type MerchantsClient ¶ added in v0.14.0
type MerchantsClient struct {
// contains filtered or unexported fields
}
func NewMerchantsClient ¶ added in v0.14.0
func NewMerchantsClient(c *client.Client) *MerchantsClient
func (*MerchantsClient) Get ¶ added in v0.14.0
func (c *MerchantsClient) Get(ctx context.Context, merchantCode string, params MerchantsGetParams) (*Merchant, error)
Retrieve a merchant. Merchant documentation: https://developer.sumup.com/tools/models/merchant
func (*MerchantsClient) GetPerson ¶ added in v0.14.0
func (c *MerchantsClient) GetPerson(ctx context.Context, merchantCode string, personID string, params MerchantsGetPersonParams) (*Person, error)
Returns a single person related to the merchant. Persons documentation: https://developer.sumup.com/tools/models/merchant#persons
func (*MerchantsClient) ListPersons ¶ added in v0.14.0
func (c *MerchantsClient) ListPersons(ctx context.Context, merchantCode string, params MerchantsListPersonsParams) (*ListPersonsResponseBody, error)
Returns a list of persons related to the merchant. Persons documentation: https://developer.sumup.com/tools/models/merchant#persons
type MerchantsGetParams ¶ added in v0.14.0
type MerchantsGetParams struct {
// The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested
// resource's `change_status` is pending, the resource will be returned with all pending changes applied. When
// no changes are pending the resource is returned as is. The `change_status` in the response body will reflect
// the current state of the resource.
Version *string
}
MerchantsGetParams are query parameters for GetMerchant.
func (*MerchantsGetParams) QueryValues ¶ added in v0.14.0
func (p *MerchantsGetParams) QueryValues() url.Values
QueryValues converts MerchantsGetParams into url.Values.
type MerchantsGetPersonParams ¶ added in v0.14.0
type MerchantsGetPersonParams struct {
// The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested
// resource's `change_status` is pending, the resource will be returned with all pending changes applied. When
// no changes are pending the resource is returned as is. The `change_status` in the response body will reflect
// the current state of the resource.
Version *string
}
MerchantsGetPersonParams are query parameters for GetPerson.
func (*MerchantsGetPersonParams) QueryValues ¶ added in v0.14.0
func (p *MerchantsGetPersonParams) QueryValues() url.Values
QueryValues converts MerchantsGetPersonParams into url.Values.
type MerchantsListPersonsParams ¶ added in v0.14.0
type MerchantsListPersonsParams struct {
// The version of the resource. At the moment, the only supported value is `latest`. When provided and the requested
// resource's `change_status` is pending, the resource will be returned with all pending changes applied. When
// no changes are pending the resource is returned as is. The `change_status` in the response body will reflect
// the current state of the resource.
Version *string
}
MerchantsListPersonsParams are query parameters for ListPersons.
func (*MerchantsListPersonsParams) QueryValues ¶ added in v0.14.0
func (p *MerchantsListPersonsParams) QueryValues() url.Values
QueryValues converts MerchantsListPersonsParams into url.Values.
type Meta ¶ added in v0.14.0
A set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
**Warning**: Updating Meta will overwrite the existing data. Make sure to always include the complete JSON object.
type Metadata ¶ added in v0.14.0
Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object. Max properties: 64
type NotFound ¶ added in v0.14.0
type NotFound struct {
Errors NotFoundErrors `json:"errors"`
}
404 Not Found
type NotFoundErrors ¶ added in v0.14.0
type NotFoundErrors struct {
// Fuller message giving context to error
Detail string `json:"detail"`
}
NotFoundErrors is a schema definition.
type Operator ¶ added in v0.14.0
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 int32 `json:"id"`
Nickname *nullable.Field[string] `json:"nickname,omitempty"`
// Permissions assigned to an operator or user.
Permissions Permissions `json:"permissions"`
// The timestamp of when the operator was last updated.
UpdatedAt time.Time `json:"updated_at"`
Username string `json:"username"`
}
Operator account for a merchant.
type OperatorAccountType ¶ added in v0.14.0
type OperatorAccountType string
OperatorAccountType is a schema definition.
const ( OperatorAccountTypeNormal OperatorAccountType = "normal" OperatorAccountTypeOperator OperatorAccountType = "operator" )
type Ownership ¶ added in v0.14.0
type Ownership struct {
// the relationship `owner` can have ownership.
// Format: int32
// Min: 25000
// Max: 100000
Share int32 `json:"share"`
}
Ownership is a schema definition.
type PaymentInstrumentResponse ¶ added in v0.14.0
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 *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"`
}
Payment Instrument Response
type PaymentInstrumentResponseCard ¶ added in v0.14.0
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 used for the transaction.
Type *CardType `json:"type,omitempty"`
}
Details of the payment card.
type PaymentInstrumentResponseType ¶ added in v0.14.0
type PaymentInstrumentResponseType string
Type of the payment instrument.
const (
PaymentInstrumentResponseTypeCard PaymentInstrumentResponseType = "card"
)
type PaymentType ¶ added in v0.14.0
type PaymentType string
Payment type used for the transaction.
const ( PaymentTypeApm PaymentType = "APM" PaymentTypeBalance PaymentType = "BALANCE" PaymentTypeBitcoin PaymentType = "BITCOIN" PaymentTypeBoleto PaymentType = "BOLETO" PaymentTypeCash PaymentType = "CASH" PaymentTypeDirectDebit PaymentType = "DIRECT_DEBIT" PaymentTypeEcom PaymentType = "ECOM" PaymentTypeMoto PaymentType = "MOTO" PaymentTypePOS PaymentType = "POS" PaymentTypeRecurring PaymentType = "RECURRING" PaymentTypeUnknown PaymentType = "UNKNOWN" )
type PayoutsClient ¶ added in v0.14.0
type PayoutsClient struct {
// contains filtered or unexported fields
}
func NewPayoutsClient ¶ added in v0.14.0
func NewPayoutsClient(c *client.Client) *PayoutsClient
func (*PayoutsClient) List ¶ added in v0.14.0
func (c *PayoutsClient) List(ctx context.Context, merchantCode string, params PayoutsListParams) (*FinancialPayouts, error)
Lists ordered payouts for the merchant profile.
func (*PayoutsClient) ListDeprecated ¶ added in v0.14.0
func (c *PayoutsClient) ListDeprecated(ctx context.Context, params PayoutsListDeprecatedParams) (*FinancialPayouts, error)
Lists ordered payouts for the merchant profile. Deprecated: this operation is deprecated
type PayoutsList400Response ¶ added in v0.15.1
type PayoutsList400Response []ErrorExtended
PayoutsList400Response is a schema definition.
func (*PayoutsList400Response) Error ¶ added in v0.15.1
func (e *PayoutsList400Response) Error() string
type PayoutsListDeprecated400Response ¶ added in v0.15.1
type PayoutsListDeprecated400Response []ErrorExtended
PayoutsListDeprecated400Response is a schema definition.
func (*PayoutsListDeprecated400Response) Error ¶ added in v0.15.1
func (e *PayoutsListDeprecated400Response) Error() string
type PayoutsListDeprecatedFormat ¶ added in v0.15.2
type PayoutsListDeprecatedFormat string
PayoutsListDeprecatedFormat is a schema definition.
const ( PayoutsListDeprecatedFormatCSV PayoutsListDeprecatedFormat = "csv" PayoutsListDeprecatedFormatJSON PayoutsListDeprecatedFormat = "json" )
type PayoutsListDeprecatedOrder ¶ added in v0.15.2
type PayoutsListDeprecatedOrder string
PayoutsListDeprecatedOrder is a schema definition.
const ( PayoutsListDeprecatedOrderASC PayoutsListDeprecatedOrder = "asc" PayoutsListDeprecatedOrderDESC PayoutsListDeprecatedOrder = "desc" )
type PayoutsListDeprecatedParams ¶ added in v0.14.0
type PayoutsListDeprecatedParams struct {
// End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
EndDate datetime.Date
Format *PayoutsListDeprecatedFormat
Limit *int
Order *PayoutsListDeprecatedOrder
// Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
StartDate datetime.Date
}
PayoutsListDeprecatedParams are query parameters for ListPayouts.
func (*PayoutsListDeprecatedParams) QueryValues ¶ added in v0.14.0
func (p *PayoutsListDeprecatedParams) QueryValues() url.Values
QueryValues converts PayoutsListDeprecatedParams into url.Values.
type PayoutsListFormat ¶ added in v0.15.2
type PayoutsListFormat string
PayoutsListFormat is a schema definition.
const ( PayoutsListFormatCSV PayoutsListFormat = "csv" PayoutsListFormatJSON PayoutsListFormat = "json" )
type PayoutsListOrder ¶ added in v0.15.2
type PayoutsListOrder string
PayoutsListOrder is a schema definition.
const ( PayoutsListOrderASC PayoutsListOrder = "asc" PayoutsListOrderDESC PayoutsListOrder = "desc" )
type PayoutsListParams ¶ added in v0.14.0
type PayoutsListParams struct {
// End date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
EndDate datetime.Date
Format *PayoutsListFormat
Limit *int
Order *PayoutsListOrder
// Start date (in [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format).
StartDate datetime.Date
}
PayoutsListParams are query parameters for ListPayoutsV1.
func (*PayoutsListParams) QueryValues ¶ added in v0.14.0
func (p *PayoutsListParams) QueryValues() url.Values
QueryValues converts PayoutsListParams into url.Values.
type Permissions ¶ added in v0.14.0
type Permissions struct {
Admin bool `json:"admin"`
CreateMotoPayments bool `json:"create_moto_payments"`
CreateReferral bool `json:"create_referral"`
FullTransactionHistoryView bool `json:"full_transaction_history_view"`
RefundTransactions bool `json:"refund_transactions"`
}
Permissions assigned to an operator or user.
type Person ¶ added in v0.14.0
type Person struct {
// An address somewhere in the world. The address fields used depend on the country conventions. For example, in
// Great Britain, `city` is `post_town`. In the United States, the top-level administrative unit used in addresses
// is `state`, whereas in Chile it's `region`.
// Whether an address is valid or not depends on whether the locally required fields are present. Fields not
// supported in a country will be ignored.
// Address documentation: https://backstage.sumup.net/docs/default/Component/merchants/merchant/#addresses
Address *Address `json:"address,omitempty"`
// The date of birth of the individual, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
// Format: date
Birthdate *datetime.Date `json:"birthdate,omitempty"`
// Reflects the status of changes submitted through the `PATCH` endpoints for the merchant or persons. If some
// changes have not been applied yet, the status will be `pending`. If all changes have been applied, the status
// `done`.
// The status is only returned after write operations or on read endpoints when the `version` query parameter is
// provided.
// Read only
ChangeStatus *ChangeStatus `json:"change_status,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// country code. This definition users `oneOf` with a two-character string
// type to allow for support of future countries in client code.
// Min length: 2
// Max length: 2
// Pattern: ^[A-Z]{2}$
Citizenship *CountryCode `json:"citizenship,omitempty"`
// An [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code representing the country
// where the person resides.
// Min length: 2
// Max length: 2
CountryOfResidence *nullable.Field[string] `json:"country_of_residence,omitempty"`
// The last name(s) of the individual.
// Max length: 60
FamilyName *string `json:"family_name,omitempty"`
// The first name(s) of the individual.
// Max length: 60
GivenName *string `json:"given_name,omitempty"`
// The unique identifier for the person. This is a [typeid](https://github.com/sumup/typeid).
// Read only
ID string `json:"id"`
// A list of country-specific personal identifiers.
// Max items: 5
Identifiers []PersonalIdentifier `json:"identifiers,omitempty"`
// Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can
// be present, with the names being separated by space characters. Also note that in some cultures, middle names
// are not used.
// Max length: 60
MiddleName *string `json:"middle_name,omitempty"`
// The persons nationality. May be an [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country
// code, but legacy data may not conform to this standard.
Nationality *nullable.Field[string] `json:"nationality,omitempty"`
Ownership *Ownership `json:"ownership,omitempty"`
// A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
// Max length: 16
PhoneNumber *PhoneNumber `json:"phone_number,omitempty"`
// A list of roles the person has in the merchant or towards SumUp. A merchant must have at least one person with
// the relationship `representative`.
// Min items: 1
// Max items: 1
Relationships []string `json:"relationships,omitempty"`
// A corresponding identity user ID for the person, if they have a user account.
UserID *string `json:"user_id,omitempty"`
// The version of the resource. The version reflects a specific change submitted to the API via one of the `PATCH`
// endpoints.
Version *Version `json:"version,omitempty"`
}
Person is a schema definition.
type PersonalDetails ¶ added in v0.14.0
type PersonalDetails struct {
// Profile's personal address information.
Address *AddressLegacy `json:"address,omitempty"`
// Date of birth of the customer.
// Format: date
BirthDate *datetime.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"`
}
Personal details for the customer.
type PersonalIdentifier ¶ added in v0.14.0
type PersonalIdentifier struct {
// The unique reference for the personal identifier type.
// Max length: 32
Ref string `json:"ref"`
// The company identifier value.
// Max length: 128
Value string `json:"value"`
}
PersonalIdentifier is a schema definition.
type PhoneNumber ¶ added in v0.14.0
type PhoneNumber string
A publicly available phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format.
Max length: 16
type Problem ¶ added in v0.14.0
type Problem struct {
// A human-readable explanation specific to this occurrence of the problem.
Detail *string `json:"detail,omitempty"`
// A URI reference that identifies the specific occurrence of the problem.
// Format: uri
Instance *string `json:"instance,omitempty"`
// The HTTP status code generated by the origin server for this occurrence of the problem.
Status *int `json:"status,omitempty"`
// A short, human-readable summary of the problem type.
Title *string `json:"title,omitempty"`
// A URI reference that identifies the problem type.
// Format: uri
Type string `json:"type"`
}
A RFC 9457 problem details object.
Additional properties specific to the problem type may be present.
type ProcessCheckout ¶ added in v0.14.0
type ProcessCheckout struct {
// Raw payment token object received from Apple Pay. Send the Apple Pay response payload as-is.
ApplePay *json.RawMessage `json:"apple_pay,omitempty"`
// __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"`
// Raw `PaymentData` object received from Google Pay. Send the Google Pay response payload as-is.
GooglePay *json.RawMessage `json:"google_pay,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 ProcessCheckoutPaymentType `json:"payment_type"`
// Personal details for the customer.
PersonalDetails *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"`
}
Details of the payment instrument for processing the checkout.
type ProcessCheckoutPaymentType ¶ added in v0.14.0
type ProcessCheckoutPaymentType string
Describes the payment method used to attempt processing
const ( ProcessCheckoutPaymentTypeApplePay ProcessCheckoutPaymentType = "apple_pay" ProcessCheckoutPaymentTypeBancontact ProcessCheckoutPaymentType = "bancontact" ProcessCheckoutPaymentTypeBlik ProcessCheckoutPaymentType = "blik" ProcessCheckoutPaymentTypeBoleto ProcessCheckoutPaymentType = "boleto" ProcessCheckoutPaymentTypeCard ProcessCheckoutPaymentType = "card" ProcessCheckoutPaymentTypeGooglePay ProcessCheckoutPaymentType = "google_pay" ProcessCheckoutPaymentTypeIdeal ProcessCheckoutPaymentType = "ideal" )
type Product ¶ added in v0.14.0
type Product struct {
// Product name.
Name *string `json:"name,omitempty"`
// Product price.
// Format: decimal
Price *float64 `json:"price,omitempty"`
// Product description.
PriceLabel *string `json:"price_label,omitempty"`
// Product price incl. VAT.
// Format: decimal
PriceWithVAT *float64 `json:"price_with_vat,omitempty"`
// Product quantity.
Quantity *int `json:"quantity,omitempty"`
// VAT amount for a single product.
// Format: decimal
SingleVATAmount *float64 `json:"single_vat_amount,omitempty"`
// Quantity x product price.
// Format: decimal
TotalPrice *float64 `json:"total_price,omitempty"`
// Total price incl. VAT.
// Format: decimal
TotalWithVAT *float64 `json:"total_with_vat,omitempty"`
// VAT amount.
// Format: decimal
VATAmount *float64 `json:"vat_amount,omitempty"`
// VAT percentage.
// Format: decimal
VATRate *float64 `json:"vat_rate,omitempty"`
}
Purchase product.
type Reader ¶ added in v0.14.0
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](https://developer.sumup.com/api/readers/delete-reader)
// 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. Partial updates are not supported. When updating, always
// submit whole metadata. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name ReaderName `json:"name"`
// Identifier of the system-managed service account associated with this reader.
// Present only for readers that are already paired.
// This field is currently in beta and may change.
// Format: uuid
ServiceAccountID *string `json:"service_account_id,omitempty"`
// 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"`
}
A physical card reader device that can accept in-person payments.
type ReaderDevice ¶ added in v0.14.0
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"`
}
Information about the underlying physical device.
type ReaderDeviceModel ¶ added in v0.14.0
type ReaderDeviceModel string
Identifier of the model of the device.
const ( ReaderDeviceModelSolo ReaderDeviceModel = "solo" ReaderDeviceModelVirtualSolo ReaderDeviceModel = "virtual-solo" )
type ReaderID ¶ added in v0.14.0
type ReaderID string
Unique identifier of the object.
Note that this identifies the instance of the physical devices pairing with your SumUp account. If you [delete](https://developer.sumup.com/api/readers/delete-reader) 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 ReaderName ¶ added in v0.14.0
type ReaderName string
Custom human-readable, user-defined name for easier identification of the reader. Max length: 500
type ReaderPairingCode ¶ added in v0.14.0
type ReaderPairingCode string
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 ReaderStatus ¶ added in v0.14.0
type ReaderStatus string
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.
const ( ReaderStatusExpired ReaderStatus = "expired" ReaderStatusPaired ReaderStatus = "paired" ReaderStatusProcessing ReaderStatus = "processing" ReaderStatusUnknown ReaderStatus = "unknown" )
type ReadersClient ¶ added in v0.14.0
type ReadersClient struct {
// contains filtered or unexported fields
}
func NewReadersClient ¶ added in v0.14.0
func NewReadersClient(c *client.Client) *ReadersClient
func (*ReadersClient) Create ¶ added in v0.14.0
func (c *ReadersClient) Create(ctx context.Context, merchantCode string, body ReadersCreateParams) (*Reader, error)
Create a new Reader for the merchant account.
func (*ReadersClient) CreateCheckout ¶ added in v0.14.0
func (c *ReadersClient) CreateCheckout(ctx context.Context, merchantCode string, readerID string, body ReadersCreateCheckoutParams) (*CreateReaderCheckoutResponse, error)
Creates a Checkout for a Reader.
This process is asynchronous and the actual transaction may take some time to be started 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 (*ReadersClient) Get ¶ added in v0.14.0
func (c *ReadersClient) Get(ctx context.Context, merchantCode string, id ReaderID, params ReadersGetParams) (*Reader, error)
Retrieve a Reader.
func (*ReadersClient) GetStatus ¶ added in v0.14.0
func (c *ReadersClient) GetStatus(ctx context.Context, merchantCode string, readerID string) (*StatusResponse, error)
Provides the last known status for a Reader.
This endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).
Supported States ¶
* `IDLE` – Reader ready for next transaction * `SELECTING_TIP` – Waiting for tip input * `WAITING_FOR_CARD` – Awaiting card insert/tap * `WAITING_FOR_PIN` – Waiting for PIN entry * `WAITING_FOR_SIGNATURE` – Waiting for customer signature * `UPDATING_FIRMWARE` – Firmware update in progress
Device Status ¶
* `ONLINE` – Device connected and operational * `OFFLINE` – Device disconnected (last state persisted)
**Note**: If the target device is a Solo, it must be in version 3.3.39.0 or higher.
func (*ReadersClient) List ¶ added in v0.14.0
func (c *ReadersClient) List(ctx context.Context, merchantCode string) (*ReadersListResponse, error)
List all readers of the merchant.
func (*ReadersClient) TerminateCheckout ¶ added in v0.14.0
func (c *ReadersClient) TerminateCheckout(ctx context.Context, merchantCode string, readerID string) error
Terminate a Reader Checkout 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 (*ReadersClient) Update ¶ added in v0.14.0
func (c *ReadersClient) Update(ctx context.Context, merchantCode string, id ReaderID, body ReadersUpdateParams) (*Reader, error)
Update a Reader.
type ReadersCreateCheckoutParams ¶ added in v0.14.0
type ReadersCreateCheckoutParams = CreateCheckoutRequest
type ReadersCreateParams ¶ added in v0.14.0
type ReadersCreateParams struct {
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name ReaderName `json:"name"`
// 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"`
}
ReadersCreateParams is a schema definition.
type ReadersGetParams ¶ added in v0.14.0
type ReadersGetParams 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
}
ReadersGetParams are query parameters for GetReader.
func (*ReadersGetParams) QueryValues ¶ added in v0.14.0
func (p *ReadersGetParams) QueryValues() url.Values
QueryValues converts ReadersGetParams into url.Values.
type ReadersListResponse ¶ added in v0.14.0
type ReadersListResponse struct {
Items []Reader `json:"items"`
}
ReadersListResponse is a schema definition.
type ReadersUpdateParams ¶ added in v0.14.0
type ReadersUpdateParams struct {
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// Custom human-readable, user-defined name for easier identification of the reader.
// Max length: 500
Name *ReaderName `json:"name,omitempty"`
}
ReadersUpdateParams is a schema definition.
type Receipt ¶ added in v0.14.0
type Receipt struct {
// Acquirer-specific metadata related to the card authorization.
AcquirerData *ReceiptAcquirerData `json:"acquirer_data,omitempty"`
// EMV-specific metadata returned for card-present payments.
EmvData *json.RawMessage `json:"emv_data,omitempty"`
// Receipt merchant data
MerchantData *ReceiptMerchantData `json:"merchant_data,omitempty"`
// Transaction information.
TransactionData *ReceiptTransaction `json:"transaction_data,omitempty"`
}
Receipt details for a transaction.
type ReceiptAcquirerData ¶ added in v0.14.0
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"`
}
Acquirer-specific metadata related to the card authorization.
type ReceiptCard ¶ added in v0.14.0
type ReceiptCard struct {
// Card last 4 digits.
Last4Digits *string `json:"last_4_digits,omitempty"`
// Card Scheme.
Type *string `json:"type,omitempty"`
}
Payment card details displayed on the receipt.
type ReceiptEvent ¶ added in v0.14.0
type ReceiptEvent struct {
// Amount of the event.
// Format: double
Amount *json.Number `json:"amount,omitempty"`
// Unique ID of the transaction event.
// Format: int64
ID *EventID `json:"id,omitempty"`
// Receipt number associated with the event.
ReceiptNo *string `json:"receipt_no,omitempty"`
// Status of the transaction event.
Status *EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Unique ID of the transaction.
TransactionID *TransactionID `json:"transaction_id,omitempty"`
// Type of the transaction event.
Type *EventType `json:"type,omitempty"`
}
Transaction event details as rendered on the receipt.
type ReceiptMerchantData ¶ added in v0.14.0
type ReceiptMerchantData struct {
// Locale used for rendering localized receipt fields.
Locale *string `json:"locale,omitempty"`
// Merchant profile details displayed on the receipt.
MerchantProfile *ReceiptMerchantDataMerchantProfile `json:"merchant_profile,omitempty"`
}
Receipt merchant data
type ReceiptMerchantDataMerchantProfile ¶ added in v0.14.0
type ReceiptMerchantDataMerchantProfile struct {
Address *ReceiptMerchantDataMerchantProfileAddress `json:"address,omitempty"`
BusinessName *string `json:"business_name,omitempty"`
CompanyRegistrationNumber *string `json:"company_registration_number,omitempty"`
Email *string `json:"email,omitempty"`
Language *string `json:"language,omitempty"`
MerchantCode *string `json:"merchant_code,omitempty"`
VATID *string `json:"vat_id,omitempty"`
Website *string `json:"website,omitempty"`
}
Merchant profile details displayed on the receipt.
type ReceiptMerchantDataMerchantProfileAddress ¶ added in v0.14.0
type ReceiptMerchantDataMerchantProfileAddress struct {
AddressLine1 *string `json:"address_line_1,omitempty"`
AddressLine2 *string `json:"address_line_2,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"`
RegionName *string `json:"region_name,omitempty"`
}
ReceiptMerchantDataMerchantProfileAddress is a schema definition.
type ReceiptReader ¶ added in v0.15.2
type ReceiptReader struct {
// Reader serial number.
Code *string `json:"code,omitempty"`
// Reader type.
Type *string `json:"type,omitempty"`
}
Card reader details displayed on the receipt.
type ReceiptTransaction ¶ added in v0.14.0
type ReceiptTransaction struct {
// Transaction amount.
Amount *string `json:"amount,omitempty"`
// Payment card details displayed on the receipt.
Card *ReceiptCard `json:"card,omitempty"`
// Card reader details displayed on the receipt.
CardReader *ReceiptReader `json:"card_reader,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"`
// Merchant code.
MerchantCode *string `json:"merchant_code,omitempty"`
// Transaction type.
PaymentType *string `json:"payment_type,omitempty"`
// Debit/Credit.
ProcessAs *ReceiptTransactionProcessA `json:"process_as,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"`
// Unique ID of the transaction.
TransactionID *TransactionID `json:"transaction_id,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"`
}
Transaction information.
type ReceiptTransactionProcessA ¶ added in v0.15.2
type ReceiptTransactionProcessA string
Debit/Credit.
const ( ReceiptTransactionProcessACredit ReceiptTransactionProcessA = "CREDIT" ReceiptTransactionProcessADebit ReceiptTransactionProcessA = "DEBIT" )
type ReceiptTransactionProduct ¶ added in v0.14.0
type ReceiptTransactionProduct struct {
// Product description
Description *string `json:"description,omitempty"`
// Product name
Name *string `json:"name,omitempty"`
// Product price
// Format: double
Price *json.Number `json:"price,omitempty"`
// Product price including VAT
// Format: double
PriceWithVAT *json.Number `json:"price_with_vat,omitempty"`
// Product quantity
// Format: int64
Quantity *int64 `json:"quantity,omitempty"`
// VAT amount for a single product
// Format: double
SingleVATAmount *json.Number `json:"single_vat_amount,omitempty"`
// Quantity x product price
// Format: double
TotalPrice *json.Number `json:"total_price,omitempty"`
// Total price including VAT
// Format: double
TotalWithVAT *json.Number `json:"total_with_vat,omitempty"`
// VAT amount
// Format: double
VATAmount *json.Number `json:"vat_amount,omitempty"`
// VAT rate
// Format: double
VATRate *json.Number `json:"vat_rate,omitempty"`
}
ReceiptTransactionProduct is a schema definition.
type ReceiptTransactionVATRate ¶ added in v0.14.0
type ReceiptTransactionVATRate struct {
// Gross
Gross *float32 `json:"gross,omitempty"`
// Net
Net *float32 `json:"net,omitempty"`
// Rate
Rate *float32 `json:"rate,omitempty"`
// Vat
VAT *float32 `json:"vat,omitempty"`
}
ReceiptTransactionVATRate is a schema definition.
type ReceiptsClient ¶ added in v0.14.0
type ReceiptsClient struct {
// contains filtered or unexported fields
}
func NewReceiptsClient ¶ added in v0.14.0
func NewReceiptsClient(c *client.Client) *ReceiptsClient
func (*ReceiptsClient) Get ¶ added in v0.14.0
func (c *ReceiptsClient) Get(ctx context.Context, id string, params ReceiptsGetParams) (*Receipt, error)
Retrieves receipt specific data for a transaction.
type ReceiptsGetParams ¶ added in v0.14.0
type ReceiptsGetParams struct {
// Merchant code.
Mid string
// The ID of the transaction event (refund).
TxEventID *int
}
ReceiptsGetParams are query parameters for GetReceipt.
func (*ReceiptsGetParams) QueryValues ¶ added in v0.14.0
func (p *ReceiptsGetParams) QueryValues() url.Values
QueryValues converts ReceiptsGetParams into url.Values.
type ResourceType ¶ added in v0.14.0
type ResourceType string
The type of the membership resource. Possible values are: * `merchant` - merchant account(s) * `organization` - organization(s)
type Role ¶ added in v0.14.0
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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata 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"`
}
A custom role that can be used to assign set of permissions to members.
type RolesClient ¶ added in v0.14.0
type RolesClient struct {
// contains filtered or unexported fields
}
func NewRolesClient ¶ added in v0.14.0
func NewRolesClient(c *client.Client) *RolesClient
func (*RolesClient) Create ¶ added in v0.14.0
func (c *RolesClient) Create(ctx context.Context, merchantCode string, body RolesCreateParams) (*Role, error)
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 (*RolesClient) List ¶ added in v0.14.0
func (c *RolesClient) List(ctx context.Context, merchantCode string) (*RolesListResponse, error)
List merchant's custom roles.
func (*RolesClient) Update ¶ added in v0.14.0
func (c *RolesClient) Update(ctx context.Context, merchantCode string, roleID string, body RolesUpdateParams) (*Role, error)
Update a custom role.
type RolesCreateParams ¶ added in v0.14.0
type RolesCreateParams 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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata Metadata `json:"metadata,omitempty"`
// User-defined name of the role.
Name string `json:"name"`
// User's permissions.
// Max items: 100
Permissions []string `json:"permissions"`
}
RolesCreateParams is a schema definition.
type RolesListResponse ¶ added in v0.14.0
type RolesListResponse struct {
Items []Role `json:"items"`
}
RolesListResponse is a schema definition.
type RolesUpdateParams ¶ added in v0.14.0
type RolesUpdateParams 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"`
}
RolesUpdateParams is a schema definition.
type StatusResponse ¶ added in v0.14.0
type StatusResponse struct {
Data StatusResponseData `json:"data"`
}
Status of a device
type StatusResponseData ¶ added in v0.14.0
type StatusResponseData struct {
// Battery level percentage
// Min: 0
// Max: 100
BatteryLevel *float32 `json:"battery_level,omitempty"`
// Battery temperature in Celsius
BatteryTemperature *int `json:"battery_temperature,omitempty"`
// Type of connection used by the device
ConnectionType *StatusResponseDataConnectionType `json:"connection_type,omitempty"`
// Firmware version of the device
FirmwareVersion *string `json:"firmware_version,omitempty"`
// Timestamp of the last activity from the device
LastActivity *time.Time `json:"last_activity,omitempty"`
// Latest state of the device
State *StatusResponseDataState `json:"state,omitempty"`
// Status of a device
Status StatusResponseDataStatus `json:"status"`
}
StatusResponseData is a schema definition.
type StatusResponseDataConnectionType ¶ added in v0.14.0
type StatusResponseDataConnectionType string
Type of connection used by the device
const ( StatusResponseDataConnectionTypeBtle StatusResponseDataConnectionType = "btle" StatusResponseDataConnectionTypeEdge StatusResponseDataConnectionType = "edge" StatusResponseDataConnectionTypeGprs StatusResponseDataConnectionType = "gprs" StatusResponseDataConnectionTypeLte StatusResponseDataConnectionType = "lte" StatusResponseDataConnectionTypeUmts StatusResponseDataConnectionType = "umts" StatusResponseDataConnectionTypeUsb StatusResponseDataConnectionType = "usb" StatusResponseDataConnectionTypeWiFi StatusResponseDataConnectionType = "Wi-Fi" )
type StatusResponseDataState ¶ added in v0.14.0
type StatusResponseDataState string
Latest state of the device
const ( StatusResponseDataStateIdle StatusResponseDataState = "IDLE" StatusResponseDataStateSelectingTip StatusResponseDataState = "SELECTING_TIP" StatusResponseDataStateUpdatingFirmware StatusResponseDataState = "UPDATING_FIRMWARE" StatusResponseDataStateWaitingForCard StatusResponseDataState = "WAITING_FOR_CARD" StatusResponseDataStateWaitingForPIN StatusResponseDataState = "WAITING_FOR_PIN" StatusResponseDataStateWaitingForSignature StatusResponseDataState = "WAITING_FOR_SIGNATURE" )
type StatusResponseDataStatus ¶ added in v0.14.0
type StatusResponseDataStatus string
Status of a device
const ( StatusResponseDataStatusOffline StatusResponseDataStatus = "OFFLINE" StatusResponseDataStatusOnline StatusResponseDataStatus = "ONLINE" )
type SubaccountsClient ¶ added in v0.14.0
type SubaccountsClient struct {
// contains filtered or unexported fields
}
func NewSubaccountsClient ¶ added in v0.14.0
func NewSubaccountsClient(c *client.Client) *SubaccountsClient
func (*SubaccountsClient) CompatGetOperator ¶ added in v0.14.0
func (c *SubaccountsClient) CompatGetOperator(ctx context.Context, operatorID int32) (*Operator, error)
Returns specific operator. Deprecated: Subaccounts API is deprecated, to get a user that's a member of your merchant account please use [Get member](https://developer.sumup.com/api/members/get) instead.
func (*SubaccountsClient) CreateSubAccount ¶ added in v0.14.0
func (c *SubaccountsClient) CreateSubAccount(ctx context.Context, body SubaccountsCreateSubAccountParams) (*Operator, error)
Creates new operator for currently authorized users' merchant. Deprecated: Subaccounts API is deprecated, to create a user in your merchant account please use [Create member](https://developer.sumup.com/api/members/create) instead.
func (*SubaccountsClient) ListSubAccounts ¶ added in v0.14.0
func (c *SubaccountsClient) ListSubAccounts(ctx context.Context, params SubaccountsListSubAccountsParams) (*SubaccountsListSubAccountsResponse, error)
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 (*SubaccountsClient) UpdateSubAccount ¶ added in v0.14.0
func (c *SubaccountsClient) UpdateSubAccount(ctx context.Context, operatorID int32, body SubaccountsUpdateSubAccountParams) (*Operator, error)
Updates operator. If the operator was disabled and their password is updated they will be unblocked. Deprecated: Subaccounts API is deprecated, to update a user that's a member of your merchant account please use [Update member](https://developer.sumup.com/api/members/update) instead.
type SubaccountsCreateSubAccountParams ¶ added in v0.14.0
type SubaccountsCreateSubAccountParams struct {
Nickname *string `json:"nickname,omitempty"`
// Min length: 8
Password string `json:"password"`
Permissions *SubaccountsCreateSubAccountParamsPermissions `json:"permissions,omitempty"`
// Format: email
Username string `json:"username"`
}
SubaccountsCreateSubAccountParams is a schema definition.
type SubaccountsCreateSubAccountParamsPermissions ¶ added in v0.14.0
type SubaccountsCreateSubAccountParamsPermissions 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"`
}
SubaccountsCreateSubAccountParamsPermissions is a schema definition.
type SubaccountsListSubAccountsParams ¶ added in v0.14.0
type SubaccountsListSubAccountsParams 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
}
SubaccountsListSubAccountsParams are query parameters for ListSubAccounts.
func (*SubaccountsListSubAccountsParams) QueryValues ¶ added in v0.14.0
func (p *SubaccountsListSubAccountsParams) QueryValues() url.Values
QueryValues converts SubaccountsListSubAccountsParams into url.Values.
type SubaccountsListSubAccountsResponse ¶ added in v0.14.0
type SubaccountsListSubAccountsResponse []Operator
SubaccountsListSubAccountsResponse is a schema definition.
type SubaccountsUpdateSubAccountParams ¶ added in v0.14.0
type SubaccountsUpdateSubAccountParams struct {
Disabled *bool `json:"disabled,omitempty"`
Nickname *string `json:"nickname,omitempty"`
// Min length: 8
Password *string `json:"password,omitempty"`
Permissions *SubaccountsUpdateSubAccountParamsPermissions `json:"permissions,omitempty"`
// Format: email
// Max length: 256
Username *string `json:"username,omitempty"`
}
SubaccountsUpdateSubAccountParams is a schema definition.
type SubaccountsUpdateSubAccountParamsPermissions ¶ added in v0.14.0
type SubaccountsUpdateSubAccountParamsPermissions 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"`
}
SubaccountsUpdateSubAccountParamsPermissions is a schema definition.
type Timestamps ¶ added in v0.14.0
type Timestamps struct {
// The date and time when the resource was created. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
// Read only
CreatedAt time.Time `json:"created_at"`
// The date and time when the resource was last updated. This is a string as defined in [RFC 3339, section 5.6](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).
//
// Read only
UpdatedAt time.Time `json:"updated_at"`
}
Timestamps is a schema definition.
type TransactionBase ¶ added in v0.14.0
type TransactionBase struct {
// Total amount of the transaction.
Amount *float32 `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 *PaymentType `json:"payment_type,omitempty"`
// Current status of the transaction.
Status *TransactionBaseStatus `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"`
}
Details of the transaction.
type TransactionBaseStatus ¶ added in v0.14.0
type TransactionBaseStatus string
Current status of the transaction.
const ( TransactionBaseStatusCancelled TransactionBaseStatus = "CANCELLED" TransactionBaseStatusFailed TransactionBaseStatus = "FAILED" TransactionBaseStatusPending TransactionBaseStatus = "PENDING" TransactionBaseStatusSuccessful TransactionBaseStatus = "SUCCESSFUL" )
type TransactionCheckoutInfo ¶ added in v0.14.0
type TransactionCheckoutInfo 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 *EntryMode `json:"entry_mode,omitempty"`
// Internal unique ID of the transaction on the SumUp platform.
// Format: int64
InternalID *int64 `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 *float32 `json:"tip_amount,omitempty"`
// Amount of the applicable VAT (out of the total transaction amount).
VATAmount *float32 `json:"vat_amount,omitempty"`
}
Checkout-specific fields associated with a transaction.
type TransactionEvent ¶ added in v0.14.0
type TransactionEvent struct {
// Amount of the event.
// Format: decimal
Amount *float64 `json:"amount,omitempty"`
// Date when the transaction event occurred.
// Format: date
Date *datetime.Date `json:"date,omitempty"`
// Date when the transaction event is due to occur.
// Format: date
DueDate *datetime.Date `json:"due_date,omitempty"`
// Type of the transaction event.
EventType *EventType `json:"event_type,omitempty"`
// Unique ID of the transaction event.
// Format: int64
ID *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 *EventStatus `json:"status,omitempty"`
// Date and time of the transaction event.
Timestamp *time.Time `json:"timestamp,omitempty"`
}
Details of a transaction event.
type TransactionFull ¶ added in v0.14.0
type TransactionFull struct {
// Total amount of the transaction.
Amount *float32 `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"`
// Client transaction id.
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 *Currency `json:"currency,omitempty"`
// Details of the device used to create the transaction.
DeviceInfo *Device `json:"device_info,omitempty"`
// Details of the ELV card account associated with the transaction.
ElvAccount *ElvCardAccount `json:"elv_account,omitempty"`
// Entry mode of the payment details.
EntryMode *EntryMode `json:"entry_mode,omitempty"`
// List of events related to the transaction.
Events []Event `json:"events,omitempty"`
// Transaction SumUp total fee amount.
// Format: decimal
FeeAmount *float64 `json:"fee_amount,omitempty"`
// External/foreign transaction id (passed by clients).
ForeignTransactionID *string `json:"foreign_transaction_id,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.
// Format: int64
InternalID *int64 `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.
Links []Link `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"`
// SumUp merchant internal Id.
// Format: int64
MerchantID *int64 `json:"merchant_id,omitempty"`
// Payment type used for the transaction.
PaymentType *PaymentType `json:"payment_type,omitempty"`
// The date of the payout.
// Format: date
PayoutDate *datetime.Date `json:"payout_date,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"`
// Debit/Credit.
ProcessAs *TransactionFullProcessA `json:"process_as,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 *float32 `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 *float32 `json:"vat_amount,omitempty"`
// List of VAT rates applicable to the transaction.
VATRates []TransactionFullVATRate `json:"vat_rates,omitempty"`
// Verification method used for the transaction.
VerificationMethod *TransactionFullVerificationMethod `json:"verification_method,omitempty"`
}
Full transaction resource with checkout, payout, and event details.
type TransactionFullLocation ¶ added in v0.14.0
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"`
}
Details of the payment location as received from the payment terminal.
type TransactionFullPayoutPlan ¶ added in v0.14.0
type TransactionFullPayoutPlan string
Payout plan of the registered user at the time when the transaction was made.
const ( TransactionFullPayoutPlanAcceleratedInstallment TransactionFullPayoutPlan = "ACCELERATED_INSTALLMENT" TransactionFullPayoutPlanSinglePayment TransactionFullPayoutPlan = "SINGLE_PAYMENT" TransactionFullPayoutPlanTrueInstallment TransactionFullPayoutPlan = "TRUE_INSTALLMENT" )
type TransactionFullPayoutType ¶ added in v0.14.0
type TransactionFullPayoutType string
Payout type for the transaction.
const ( TransactionFullPayoutTypeBankAccount TransactionFullPayoutType = "BANK_ACCOUNT" TransactionFullPayoutTypePrepaidCard TransactionFullPayoutType = "PREPAID_CARD" )
type TransactionFullProcessA ¶ added in v0.15.1
type TransactionFullProcessA string
Debit/Credit.
const ( TransactionFullProcessACredit TransactionFullProcessA = "CREDIT" TransactionFullProcessADebit TransactionFullProcessA = "DEBIT" )
type TransactionFullSimplePaymentType ¶ added in v0.14.0
type TransactionFullSimplePaymentType string
Simple name of the payment type.
const ( TransactionFullSimplePaymentTypeApm TransactionFullSimplePaymentType = "APM" TransactionFullSimplePaymentTypeBalance TransactionFullSimplePaymentType = "BALANCE" TransactionFullSimplePaymentTypeBitcoin TransactionFullSimplePaymentType = "BITCOIN" TransactionFullSimplePaymentTypeBoleto TransactionFullSimplePaymentType = "BOLETO" TransactionFullSimplePaymentTypeCard TransactionFullSimplePaymentType = "CARD" TransactionFullSimplePaymentTypeCash TransactionFullSimplePaymentType = "CASH" TransactionFullSimplePaymentTypeCcCustomerEntered TransactionFullSimplePaymentType = "CC_CUSTOMER_ENTERED" TransactionFullSimplePaymentTypeCcSignature TransactionFullSimplePaymentType = "CC_SIGNATURE" TransactionFullSimplePaymentTypeElv TransactionFullSimplePaymentType = "ELV" TransactionFullSimplePaymentTypeElvWithoutSignature TransactionFullSimplePaymentType = "ELV_WITHOUT_SIGNATURE" TransactionFullSimplePaymentTypeEmv TransactionFullSimplePaymentType = "EMV" TransactionFullSimplePaymentTypeManualEntry TransactionFullSimplePaymentType = "MANUAL_ENTRY" TransactionFullSimplePaymentTypeMoto TransactionFullSimplePaymentType = "MOTO" TransactionFullSimplePaymentTypeRecurring TransactionFullSimplePaymentType = "RECURRING" )
type TransactionFullSimpleStatus ¶ added in v0.14.0
type TransactionFullSimpleStatus string
Status generated from the processing status and the latest transaction state.
const ( TransactionFullSimpleStatusCancelFailed TransactionFullSimpleStatus = "CANCEL_FAILED" TransactionFullSimpleStatusCancelled TransactionFullSimpleStatus = "CANCELLED" TransactionFullSimpleStatusChargeback TransactionFullSimpleStatus = "CHARGEBACK" TransactionFullSimpleStatusFailed TransactionFullSimpleStatus = "FAILED" TransactionFullSimpleStatusNonCollection TransactionFullSimpleStatus = "NON_COLLECTION" TransactionFullSimpleStatusPaidOut TransactionFullSimpleStatus = "PAID_OUT" TransactionFullSimpleStatusPending TransactionFullSimpleStatus = "PENDING" TransactionFullSimpleStatusRefundFailed TransactionFullSimpleStatus = "REFUND_FAILED" TransactionFullSimpleStatusRefunded TransactionFullSimpleStatus = "REFUNDED" TransactionFullSimpleStatusSuccessful TransactionFullSimpleStatus = "SUCCESSFUL" )
type TransactionFullStatus ¶ added in v0.14.0
type TransactionFullStatus string
Current status of the transaction.
const ( TransactionFullStatusCancelled TransactionFullStatus = "CANCELLED" TransactionFullStatusFailed TransactionFullStatus = "FAILED" TransactionFullStatusPending TransactionFullStatus = "PENDING" TransactionFullStatusSuccessful TransactionFullStatus = "SUCCESSFUL" )
type TransactionFullVATRate ¶ added in v0.15.1
type TransactionFullVATRate struct {
// Gross amount of products having this VAT rate applied.
// Format: decimal
Gross *float64 `json:"gross,omitempty"`
// NET amount of products having this VAT rate applied.
// Format: decimal
Net *float64 `json:"net,omitempty"`
// VAT rate.
// Format: decimal
Rate *float64 `json:"rate,omitempty"`
// VAT amount of this rate applied.
// Format: decimal
VAT *float64 `json:"vat,omitempty"`
}
TransactionFullVATRate is a schema definition.
type TransactionFullVerificationMethod ¶ added in v0.14.0
type TransactionFullVerificationMethod string
Verification method used for the transaction.
const ( TransactionFullVerificationMethodNa TransactionFullVerificationMethod = "na" TransactionFullVerificationMethodNone TransactionFullVerificationMethod = "none" TransactionFullVerificationMethodOfflinePIN TransactionFullVerificationMethod = "offline PIN" TransactionFullVerificationMethodOfflinePINSignature TransactionFullVerificationMethod = "offline PIN + signature" TransactionFullVerificationMethodOnlinePIN TransactionFullVerificationMethod = "online PIN" TransactionFullVerificationMethodSignature TransactionFullVerificationMethod = "signature" )
type TransactionHistory ¶ added in v0.14.0
type TransactionHistory struct {
// Total amount of the transaction.
Amount *float32 `json:"amount,omitempty"`
// Issuing card network of the payment card used for the transaction.
CardType *CardType `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 *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 *PaymentType `json:"payment_type,omitempty"`
// Payout date (if paid out at once).
// Format: date
PayoutDate *datetime.Date `json:"payout_date,omitempty"`
// Payout plan of the registered user at the time when the transaction was made.
PayoutPlan *TransactionHistoryPayoutPlan `json:"payout_plan,omitempty"`
// Payout type.
PayoutType *TransactionHistoryPayoutType `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"`
// Total refunded amount.
// Format: decimal
RefundedAmount *float64 `json:"refunded_amount,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 *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"`
}
Transaction entry returned in history listing responses.
type TransactionHistoryPayoutPlan ¶ added in v0.14.0
type TransactionHistoryPayoutPlan string
Payout plan of the registered user at the time when the transaction was made.
const ( TransactionHistoryPayoutPlanAcceleratedInstallment TransactionHistoryPayoutPlan = "ACCELERATED_INSTALLMENT" TransactionHistoryPayoutPlanSinglePayment TransactionHistoryPayoutPlan = "SINGLE_PAYMENT" TransactionHistoryPayoutPlanTrueInstallment TransactionHistoryPayoutPlan = "TRUE_INSTALLMENT" )
type TransactionHistoryPayoutType ¶ added in v0.15.1
type TransactionHistoryPayoutType string
Payout type.
const ( TransactionHistoryPayoutTypeBankAccount TransactionHistoryPayoutType = "BANK_ACCOUNT" TransactionHistoryPayoutTypePrepaidCard TransactionHistoryPayoutType = "PREPAID_CARD" )
type TransactionHistoryStatus ¶ added in v0.14.0
type TransactionHistoryStatus string
Current status of the transaction.
const ( TransactionHistoryStatusCancelled TransactionHistoryStatus = "CANCELLED" TransactionHistoryStatusFailed TransactionHistoryStatus = "FAILED" TransactionHistoryStatusPending TransactionHistoryStatus = "PENDING" TransactionHistoryStatusSuccessful TransactionHistoryStatus = "SUCCESSFUL" )
type TransactionHistoryType ¶ added in v0.14.0
type TransactionHistoryType string
Type of the transaction for the registered user specified in the `user` property.
const ( TransactionHistoryTypeChargeBack TransactionHistoryType = "CHARGE_BACK" TransactionHistoryTypePayment TransactionHistoryType = "PAYMENT" TransactionHistoryTypeRefund TransactionHistoryType = "REFUND" )
type TransactionMixinHistory ¶ added in v0.14.0
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"`
}
Additional transaction fields used by history and detailed views.
type TransactionMixinHistoryPayoutPlan ¶ added in v0.14.0
type TransactionMixinHistoryPayoutPlan string
Payout plan of the registered user at the time when the transaction was made.
const ( TransactionMixinHistoryPayoutPlanAcceleratedInstallment TransactionMixinHistoryPayoutPlan = "ACCELERATED_INSTALLMENT" TransactionMixinHistoryPayoutPlanSinglePayment TransactionMixinHistoryPayoutPlan = "SINGLE_PAYMENT" TransactionMixinHistoryPayoutPlanTrueInstallment TransactionMixinHistoryPayoutPlan = "TRUE_INSTALLMENT" )
type TransactionsClient ¶ added in v0.14.0
type TransactionsClient struct {
// contains filtered or unexported fields
}
func NewTransactionsClient ¶ added in v0.14.0
func NewTransactionsClient(c *client.Client) *TransactionsClient
func (*TransactionsClient) Get ¶ added in v0.14.0
func (c *TransactionsClient) Get(ctx context.Context, merchantCode string, params TransactionsGetParams) (*TransactionFull, error)
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 (*TransactionsClient) GetDeprecated
deprecated
added in
v0.14.0
func (c *TransactionsClient) GetDeprecated(ctx context.Context, params TransactionsGetDeprecatedParams) (*TransactionFull, error)
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 (*TransactionsClient) List ¶ added in v0.14.0
func (c *TransactionsClient) List(ctx context.Context, merchantCode string, params TransactionsListParams) (*TransactionsListResponse, error)
Lists detailed history of all transactions associated with the merchant profile.
func (*TransactionsClient) ListDeprecated ¶ added in v0.14.0
func (c *TransactionsClient) ListDeprecated(ctx context.Context, params TransactionsListDeprecatedParams) (*TransactionsListDeprecatedResponse, error)
Lists detailed history of all transactions associated with the merchant profile. Deprecated: this operation is deprecated
func (*TransactionsClient) Refund ¶ added in v0.14.0
func (c *TransactionsClient) Refund(ctx context.Context, txnID string, body TransactionsRefundParams) error
Refunds an identified transaction either in full or partially.
type TransactionsGetDeprecatedParams ¶ added in v0.14.0
type TransactionsGetDeprecatedParams 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
}
TransactionsGetDeprecatedParams are query parameters for GetTransaction.
func (*TransactionsGetDeprecatedParams) QueryValues ¶ added in v0.14.0
func (p *TransactionsGetDeprecatedParams) QueryValues() url.Values
QueryValues converts TransactionsGetDeprecatedParams into url.Values.
type TransactionsGetParams ¶ added in v0.14.0
type TransactionsGetParams struct {
// Client transaction id.
ClientTransactionID *string
// External/foreign transaction id (passed by clients).
ForeignTransactionID *string
// 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
}
TransactionsGetParams are query parameters for GetTransactionV2.1.
func (*TransactionsGetParams) QueryValues ¶ added in v0.14.0
func (p *TransactionsGetParams) QueryValues() url.Values
QueryValues converts TransactionsGetParams into url.Values.
type TransactionsHistoryLink ¶ added in v0.15.1
type TransactionsHistoryLink struct {
// Location.
Href string `json:"href"`
// Relation.
Rel string `json:"rel"`
}
Hypermedia link used for transaction history pagination.
type TransactionsListDeprecatedOrder ¶ added in v0.15.2
type TransactionsListDeprecatedOrder string
TransactionsListDeprecatedOrder is a schema definition. Default: ascending
const ( TransactionsListDeprecatedOrderAscending TransactionsListDeprecatedOrder = "ascending" TransactionsListDeprecatedOrderDescending TransactionsListDeprecatedOrder = "descending" )
type TransactionsListDeprecatedParams ¶ added in v0.14.0
type TransactionsListDeprecatedParams 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 *TransactionsListDeprecatedOrder
// Filters the returned results by the specified list of payment types used for the transactions.
PaymentTypes []PaymentType
// Filters the returned results by the specified list of final statuses of the transactions.
Statuses []TransactionsListDeprecatedStatusesItem
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
// Filters the returned results by the specified list of transaction types.
Types []TransactionsListDeprecatedTypesItem
// Filters the returned results by user email.
Users []string
}
TransactionsListDeprecatedParams are query parameters for ListTransactions.
func (*TransactionsListDeprecatedParams) QueryValues ¶ added in v0.14.0
func (p *TransactionsListDeprecatedParams) QueryValues() url.Values
QueryValues converts TransactionsListDeprecatedParams into url.Values.
type TransactionsListDeprecatedResponse ¶ added in v0.14.0
type TransactionsListDeprecatedResponse struct {
Items []TransactionHistory `json:"items,omitempty"`
Links []TransactionsHistoryLink `json:"links,omitempty"`
}
TransactionsListDeprecatedResponse is a schema definition.
type TransactionsListDeprecatedStatusesItem ¶ added in v0.15.2
type TransactionsListDeprecatedStatusesItem string
TransactionsListDeprecatedStatusesItem is a schema definition.
const ( TransactionsListDeprecatedStatusesItemCancelled TransactionsListDeprecatedStatusesItem = "CANCELLED" TransactionsListDeprecatedStatusesItemChargeBack TransactionsListDeprecatedStatusesItem = "CHARGE_BACK" TransactionsListDeprecatedStatusesItemFailed TransactionsListDeprecatedStatusesItem = "FAILED" TransactionsListDeprecatedStatusesItemRefunded TransactionsListDeprecatedStatusesItem = "REFUNDED" TransactionsListDeprecatedStatusesItemSuccessful TransactionsListDeprecatedStatusesItem = "SUCCESSFUL" )
type TransactionsListDeprecatedTypesItem ¶ added in v0.15.2
type TransactionsListDeprecatedTypesItem string
TransactionsListDeprecatedTypesItem is a schema definition.
const ( TransactionsListDeprecatedTypesItemChargeBack TransactionsListDeprecatedTypesItem = "CHARGE_BACK" TransactionsListDeprecatedTypesItemPayment TransactionsListDeprecatedTypesItem = "PAYMENT" TransactionsListDeprecatedTypesItemRefund TransactionsListDeprecatedTypesItem = "REFUND" )
type TransactionsListOrder ¶ added in v0.15.2
type TransactionsListOrder string
TransactionsListOrder is a schema definition. Default: ascending
const ( TransactionsListOrderAscending TransactionsListOrder = "ascending" TransactionsListOrderDescending TransactionsListOrder = "descending" )
type TransactionsListParams ¶ added in v0.14.0
type TransactionsListParams 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
// Filters the returned results by the specified list of entry modes.
EntryModes []EntryMode
// 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 *TransactionsListOrder
// Filters the returned results by the specified list of payment types used for the transactions.
PaymentTypes []PaymentType
// Filters the returned results by the specified list of final statuses of the transactions.
Statuses []TransactionsListStatusesItem
// Retrieves the transaction resource with the specified transaction code.
TransactionCode *string
// Filters the returned results by the specified list of transaction types.
Types []TransactionsListTypesItem
// Filters the returned results by user email.
Users []string
}
TransactionsListParams are query parameters for ListTransactionsV2.1.
func (*TransactionsListParams) QueryValues ¶ added in v0.14.0
func (p *TransactionsListParams) QueryValues() url.Values
QueryValues converts TransactionsListParams into url.Values.
type TransactionsListResponse ¶ added in v0.14.0
type TransactionsListResponse struct {
Items []TransactionHistory `json:"items,omitempty"`
Links []TransactionsHistoryLink `json:"links,omitempty"`
}
TransactionsListResponse is a schema definition.
type TransactionsListStatusesItem ¶ added in v0.15.2
type TransactionsListStatusesItem string
TransactionsListStatusesItem is a schema definition.
const ( TransactionsListStatusesItemCancelled TransactionsListStatusesItem = "CANCELLED" TransactionsListStatusesItemChargeBack TransactionsListStatusesItem = "CHARGE_BACK" TransactionsListStatusesItemFailed TransactionsListStatusesItem = "FAILED" TransactionsListStatusesItemRefunded TransactionsListStatusesItem = "REFUNDED" TransactionsListStatusesItemSuccessful TransactionsListStatusesItem = "SUCCESSFUL" )
type TransactionsListTypesItem ¶ added in v0.15.2
type TransactionsListTypesItem string
TransactionsListTypesItem is a schema definition.
const ( TransactionsListTypesItemChargeBack TransactionsListTypesItem = "CHARGE_BACK" TransactionsListTypesItemPayment TransactionsListTypesItem = "PAYMENT" TransactionsListTypesItemRefund TransactionsListTypesItem = "REFUND" )
type TransactionsRefundParams ¶ added in v0.14.0
type TransactionsRefundParams 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 *float32 `json:"amount,omitempty"`
}
Optional amount for partial refunds of transactions.
type Unauthorized ¶ added in v0.14.0
type Unauthorized struct {
}
401 Unauthorized
func (*Unauthorized) Error ¶ added in v0.14.0
func (e *Unauthorized) Error() string
type UnauthorizedErrors ¶ added in v0.14.0
type UnauthorizedErrors struct {
Detail string `json:"detail"`
// for generic unauthorized responses.
Type *UnauthorizedErrorsType `json:"type,omitempty"`
}
UnauthorizedErrors is a schema definition.
type UnauthorizedErrorsType ¶ added in v0.14.0
type UnauthorizedErrorsType string
Key indicating type of error. Present only for typed 401 responses (e.g. invalid token, invalid password). Absent for generic unauthorized responses.
const ( )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package datetime provides custom date and time types with JSON marshaling support.
|
Package datetime provides custom date and time types with JSON marshaling support. |
|
example
module
|
|
|
checkout
command
|
|
|
full
command
This example demonstrates a complete checkout flow with the SumUp payment widget.
|
This example demonstrates a complete checkout flow with the SumUp payment widget. |
|
oauth2
command
OAuth 2.0 Authorization Code flow with SumUp
|
OAuth 2.0 Authorization Code flow with SumUp |
|
simple
command
|
|