acpcheckout

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package acpcheckout serves the seller-hosted ACP Agentic Checkout API.

Implement Provider with the business logic that owns checkout sessions, then pass it to NewHandler. The handler validates request payloads and the standard ACP headers before invoking the provider.

The API creates, retrieves, updates, completes, and cancels checkout sessions. Every successful mutation returns the latest authoritative session state. See the standalone example for a complete provider skeleton.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion = string

APIVersion defines model for APIVersion.

type AcceptLanguage

type AcceptLanguage = string

AcceptLanguage defines model for AcceptLanguage.

type Address

type Address struct {
	// City City name
	City string `json:"city"`

	// Country ISO 3166-1 alpha-2 country code
	Country string `json:"country"`

	// LineOne Primary street address line
	LineOne string `json:"line_one"`

	// LineTwo Secondary address line (apartment, suite, etc.)
	LineTwo *string `json:"line_two,omitempty"`

	// Name Recipient name for this address
	Name string `json:"name"`

	// PostalCode Postal or ZIP code
	PostalCode string `json:"postal_code"`

	// State State or province code
	State string `json:"state"`
}

Address Physical address for shipping, billing, or pickup locations

type Adjustment

type Adjustment struct {
	// Amount Total amount credited to the buyer in minor currency units, inclusive of any applicable tax
	Amount *int `json:"amount,omitempty"`

	// Currency ISO 4217 currency code
	Currency *string `json:"currency,omitempty"`

	// Description Human-readable reason (e.g., 'Defective item')
	Description *string `json:"description,omitempty"`

	// Id Adjustment identifier
	Id string `json:"id"`

	// LineItems Which line items and quantities are affected (optional for order-level adjustments)
	LineItems *[]LineItemReference `json:"line_items,omitempty"`

	// OccurredAt RFC 3339 timestamp when this adjustment occurred
	OccurredAt time.Time `json:"occurred_at"`

	// Reason Structured reason code
	Reason *string `json:"reason,omitempty"`

	// Status Adjustment status. Implementations MUST accept unrecognized values gracefully. Defined values: 'pending', 'completed', 'failed'.
	Status string `json:"status"`

	// Type Type of adjustment. Implementations MUST accept unrecognized values gracefully. Defined values: 'refund', 'credit', 'return', 'exchange', 'price_adjustment', 'cancellation', 'dispute'. Use 'refund' for both full and partial refunds (distinguish by amount). 'credit' replaces 'store_credit'. 'dispute' covers chargebacks.
	Type string `json:"type"`
}

Adjustment A post-order change such as refund, credit, return, or dispute.

type AffiliateAttribution

type AffiliateAttribution struct {
	// CampaignId Provider-scoped campaign identifier.
	CampaignId *string `json:"campaign_id,omitempty"`

	// CreativeId Provider-scoped creative identifier.
	CreativeId *string `json:"creative_id,omitempty"`

	// ExpiresAt RFC3339 timestamp when the attribution token expires.
	ExpiresAt *time.Time `json:"expires_at,omitempty"`

	// IssuedAt RFC3339 timestamp when the attribution token was issued.
	IssuedAt *time.Time `json:"issued_at,omitempty"`

	// Metadata Flat key/value map for additional non-sensitive context.
	// Keys must be strings; values must be strings, numbers, or booleans.
	// Arrays and nested objects are NOT permitted.
	Metadata *AffiliateAttributionMetadata `json:"metadata,omitempty"`

	// Provider Identifier for the attribution provider / affiliate network namespace (e.g., 'impact.com').
	Provider string `json:"provider"`

	// PublisherId Provider-scoped affiliate/publisher identifier. Required if token is omitted.
	PublisherId *string `json:"publisher_id,omitempty"`

	// Source Context about where the attribution originated.
	Source *AffiliateAttributionSource `json:"source,omitempty"`

	// SubId Provider-scoped sub-tracking identifier.
	SubId *string `json:"sub_id,omitempty"`

	// Token Opaque provider-issued token for fraud-resistant validation. Treat as secret.
	Token *string `json:"token,omitempty"`

	// Touchpoint Attribution touchpoint type. Use 'first' when capturing at session creation,
	// 'last' when capturing at completion. Enables multi-touch attribution models.
	Touchpoint *AffiliateAttributionTouchpoint `json:"touchpoint,omitempty"`
	// contains filtered or unexported fields
}

AffiliateAttribution Optional affiliate attribution data for crediting third-party publishers. Write-only: not returned in responses. See RFC: Affiliate Attribution.

Forward compatibility: Servers SHOULD ignore unknown fields to support future extensions (per RFC §8.2).

func (AffiliateAttribution) AsAffiliateAttribution0

func (t AffiliateAttribution) AsAffiliateAttribution0() (AffiliateAttribution0, error)

AsAffiliateAttribution0 returns the union data inside the AffiliateAttribution as a AffiliateAttribution0

func (AffiliateAttribution) AsAffiliateAttribution1

func (t AffiliateAttribution) AsAffiliateAttribution1() (AffiliateAttribution1, error)

AsAffiliateAttribution1 returns the union data inside the AffiliateAttribution as a AffiliateAttribution1

func (*AffiliateAttribution) FromAffiliateAttribution0

func (t *AffiliateAttribution) FromAffiliateAttribution0(v AffiliateAttribution0) error

FromAffiliateAttribution0 overwrites any union data inside the AffiliateAttribution as the provided AffiliateAttribution0

func (*AffiliateAttribution) FromAffiliateAttribution1

func (t *AffiliateAttribution) FromAffiliateAttribution1(v AffiliateAttribution1) error

FromAffiliateAttribution1 overwrites any union data inside the AffiliateAttribution as the provided AffiliateAttribution1

func (AffiliateAttribution) MarshalJSON

func (t AffiliateAttribution) MarshalJSON() ([]byte, error)

func (*AffiliateAttribution) MergeAffiliateAttribution0

func (t *AffiliateAttribution) MergeAffiliateAttribution0(v AffiliateAttribution0) error

MergeAffiliateAttribution0 performs a merge with any union data inside the AffiliateAttribution, using the provided AffiliateAttribution0

func (*AffiliateAttribution) MergeAffiliateAttribution1

func (t *AffiliateAttribution) MergeAffiliateAttribution1(v AffiliateAttribution1) error

MergeAffiliateAttribution1 performs a merge with any union data inside the AffiliateAttribution, using the provided AffiliateAttribution1

func (*AffiliateAttribution) UnmarshalJSON

func (t *AffiliateAttribution) UnmarshalJSON(b []byte) error

type AffiliateAttribution0

type AffiliateAttribution0 = interface{}

AffiliateAttribution0 defines model for AffiliateAttribution.0.

type AffiliateAttribution1

type AffiliateAttribution1 = interface{}

AffiliateAttribution1 defines model for AffiliateAttribution.1.

type AffiliateAttributionMetadata

type AffiliateAttributionMetadata map[string]AffiliateAttributionMetadata_AdditionalProperties

AffiliateAttributionMetadata Flat key/value map for additional non-sensitive context. Keys must be strings; values must be strings, numbers, or booleans. Arrays and nested objects are NOT permitted.

type AffiliateAttributionMetadata0

type AffiliateAttributionMetadata0 = string

AffiliateAttributionMetadata0 String metadata value

type AffiliateAttributionMetadata1

type AffiliateAttributionMetadata1 = float32

AffiliateAttributionMetadata1 Numeric metadata value

type AffiliateAttributionMetadata2

type AffiliateAttributionMetadata2 = bool

AffiliateAttributionMetadata2 Boolean metadata value

type AffiliateAttributionMetadata_AdditionalProperties

type AffiliateAttributionMetadata_AdditionalProperties struct {
	// contains filtered or unexported fields
}

AffiliateAttributionMetadata_AdditionalProperties defines model for AffiliateAttributionMetadata.AdditionalProperties.

func (AffiliateAttributionMetadata_AdditionalProperties) AsAffiliateAttributionMetadata0

AsAffiliateAttributionMetadata0 returns the union data inside the AffiliateAttributionMetadata_AdditionalProperties as a AffiliateAttributionMetadata0

func (AffiliateAttributionMetadata_AdditionalProperties) AsAffiliateAttributionMetadata1

AsAffiliateAttributionMetadata1 returns the union data inside the AffiliateAttributionMetadata_AdditionalProperties as a AffiliateAttributionMetadata1

func (AffiliateAttributionMetadata_AdditionalProperties) AsAffiliateAttributionMetadata2

AsAffiliateAttributionMetadata2 returns the union data inside the AffiliateAttributionMetadata_AdditionalProperties as a AffiliateAttributionMetadata2

func (*AffiliateAttributionMetadata_AdditionalProperties) FromAffiliateAttributionMetadata0

FromAffiliateAttributionMetadata0 overwrites any union data inside the AffiliateAttributionMetadata_AdditionalProperties as the provided AffiliateAttributionMetadata0

func (*AffiliateAttributionMetadata_AdditionalProperties) FromAffiliateAttributionMetadata1

FromAffiliateAttributionMetadata1 overwrites any union data inside the AffiliateAttributionMetadata_AdditionalProperties as the provided AffiliateAttributionMetadata1

func (*AffiliateAttributionMetadata_AdditionalProperties) FromAffiliateAttributionMetadata2

FromAffiliateAttributionMetadata2 overwrites any union data inside the AffiliateAttributionMetadata_AdditionalProperties as the provided AffiliateAttributionMetadata2

func (AffiliateAttributionMetadata_AdditionalProperties) MarshalJSON

func (*AffiliateAttributionMetadata_AdditionalProperties) MergeAffiliateAttributionMetadata0

MergeAffiliateAttributionMetadata0 performs a merge with any union data inside the AffiliateAttributionMetadata_AdditionalProperties, using the provided AffiliateAttributionMetadata0

func (*AffiliateAttributionMetadata_AdditionalProperties) MergeAffiliateAttributionMetadata1

MergeAffiliateAttributionMetadata1 performs a merge with any union data inside the AffiliateAttributionMetadata_AdditionalProperties, using the provided AffiliateAttributionMetadata1

func (*AffiliateAttributionMetadata_AdditionalProperties) MergeAffiliateAttributionMetadata2

MergeAffiliateAttributionMetadata2 performs a merge with any union data inside the AffiliateAttributionMetadata_AdditionalProperties, using the provided AffiliateAttributionMetadata2

func (*AffiliateAttributionMetadata_AdditionalProperties) UnmarshalJSON

type AffiliateAttributionSource

type AffiliateAttributionSource struct {
	// Type The type of attribution source.
	Type AffiliateAttributionSourceType `json:"type"`

	// Url Canonical content URL when type is 'url'.
	Url *string `json:"url,omitempty"`
}

AffiliateAttributionSource Context about where the attribution originated.

type AffiliateAttributionSourceType

type AffiliateAttributionSourceType string

AffiliateAttributionSourceType The type of attribution source.

const (
	Platform AffiliateAttributionSourceType = "platform"
	Unknown  AffiliateAttributionSourceType = "unknown"
	Url      AffiliateAttributionSourceType = "url"
)

Defines values for AffiliateAttributionSourceType.

func (AffiliateAttributionSourceType) Valid

Valid indicates whether the value is a known member of the AffiliateAttributionSourceType enum.

type AffiliateAttributionTouchpoint

type AffiliateAttributionTouchpoint string

AffiliateAttributionTouchpoint Attribution touchpoint type. Use 'first' when capturing at session creation, 'last' when capturing at completion. Enables multi-touch attribution models.

const (
	First AffiliateAttributionTouchpoint = "first"
	Last  AffiliateAttributionTouchpoint = "last"
)

Defines values for AffiliateAttributionTouchpoint.

func (AffiliateAttributionTouchpoint) Valid

Valid indicates whether the value is a known member of the AffiliateAttributionTouchpoint enum.

type AppliedDiscount

type AppliedDiscount struct {
	// Allocations Breakdown of where this discount was allocated. Sum of allocation amounts equals total amount.
	Allocations *[]DiscountAllocation `json:"allocations,omitempty"`

	// Amount Total discount amount in minor (cents) currency units.
	Amount int `json:"amount"`

	// Automatic True if applied automatically by merchant rules (no code required).
	Automatic *bool `json:"automatic,omitempty"`

	// Code The discount code entered by the user. Omitted for automatic discounts.
	Code *string `json:"code,omitempty"`

	// Coupon Coupon details describing the discount terms.
	Coupon Coupon `json:"coupon"`

	// End RFC 3339 timestamp when the discount expires.
	End *time.Time `json:"end,omitempty"`

	// Id Unique identifier for this applied discount instance.
	Id string `json:"id"`

	// Method Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.
	Method *AppliedDiscountMethod `json:"method,omitempty"`

	// Priority Stacking order for discount calculation. Lower numbers applied first (1 = first).
	Priority *int `json:"priority,omitempty"`

	// Start RFC 3339 timestamp when the discount became active.
	Start *time.Time `json:"start,omitempty"`
}

AppliedDiscount A discount that was successfully applied to the checkout session.

type AppliedDiscountMethod

type AppliedDiscountMethod string

AppliedDiscountMethod Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.

const (
	Across AppliedDiscountMethod = "across"
	Each   AppliedDiscountMethod = "each"
)

Defines values for AppliedDiscountMethod.

func (AppliedDiscountMethod) Valid

func (e AppliedDiscountMethod) Valid() bool

Valid indicates whether the value is a known member of the AppliedDiscountMethod enum.

type AuthenticationMetadata

type AuthenticationMetadata struct {
	// AcquirerDetails Details about the acquirer used for this 3DS Authentication. This object MUST be present.
	AcquirerDetails struct {
		// AcquirerBin The Acquirer BIN (directory-server specific).
		AcquirerBin string `json:"acquirer_bin"`

		// AcquirerCountry Two-letter ISO 3166-1 alpha-2 country code.
		AcquirerCountry string `json:"acquirer_country"`

		// AcquirerMerchantId The Merchant ID assigned by the acquirer.
		AcquirerMerchantId string `json:"acquirer_merchant_id"`

		// MerchantName Merchant name assigned by the acquirer.
		MerchantName string `json:"merchant_name"`

		// RequestorId Requestor ID (if required by the directory server).
		RequestorId *string `json:"requestor_id,omitempty"`
	} `json:"acquirer_details"`

	// DirectoryServer The 3DS directory server used for this Authentication.
	DirectoryServer AuthenticationMetadataDirectoryServer `json:"directory_server"`

	// FlowPreference Contains additional details on the seller's preference for the 3DS authentication flow. Sellers MAY request a preference, but issuers ultimately decide the actual flow.
	FlowPreference *struct {
		// Challenge Details about the requested challenge flow.
		Challenge *struct {
			// Type Subtype of challenge preference.
			Type *AuthenticationMetadataFlowPreferenceChallengeType `json:"type,omitempty"`
		} `json:"challenge,omitempty"`

		// Frictionless Details about the requested frictionless flow.
		Frictionless *struct {
			// Type Subtype of frictionless preference.
			Type *AuthenticationMetadataFlowPreferenceFrictionlessType `json:"type,omitempty"`
		} `json:"frictionless,omitempty"`

		// Type Type of flow requested for this 3DS Authentication. "challenge" requests a challenge flow; "frictionless" requests a frictionless flow.
		Type AuthenticationMetadataFlowPreferenceType `json:"type"`
	} `json:"flow_preference,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

AuthenticationMetadata Seller-provided authentication metadata for 3DS flows.

func (AuthenticationMetadata) Get

func (a AuthenticationMetadata) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for AuthenticationMetadata. Returns the specified element and whether it was found

func (AuthenticationMetadata) MarshalJSON

func (a AuthenticationMetadata) MarshalJSON() ([]byte, error)

Override default JSON handling for AuthenticationMetadata to handle AdditionalProperties

func (*AuthenticationMetadata) Set

func (a *AuthenticationMetadata) Set(fieldName string, value interface{})

Setter for additional properties for AuthenticationMetadata

func (*AuthenticationMetadata) UnmarshalJSON

func (a *AuthenticationMetadata) UnmarshalJSON(b []byte) error

Override default JSON handling for AuthenticationMetadata to handle AdditionalProperties

type AuthenticationMetadataDirectoryServer

type AuthenticationMetadataDirectoryServer string

AuthenticationMetadataDirectoryServer The 3DS directory server used for this Authentication.

const (
	AuthenticationMetadataDirectoryServerAmericanExpress AuthenticationMetadataDirectoryServer = "american_express"
	AuthenticationMetadataDirectoryServerMastercard      AuthenticationMetadataDirectoryServer = "mastercard"
	AuthenticationMetadataDirectoryServerVisa            AuthenticationMetadataDirectoryServer = "visa"
)

Defines values for AuthenticationMetadataDirectoryServer.

func (AuthenticationMetadataDirectoryServer) Valid

Valid indicates whether the value is a known member of the AuthenticationMetadataDirectoryServer enum.

type AuthenticationMetadataFlowPreferenceChallengeType

type AuthenticationMetadataFlowPreferenceChallengeType string

AuthenticationMetadataFlowPreferenceChallengeType Subtype of challenge preference.

Defines values for AuthenticationMetadataFlowPreferenceChallengeType.

func (AuthenticationMetadataFlowPreferenceChallengeType) Valid

Valid indicates whether the value is a known member of the AuthenticationMetadataFlowPreferenceChallengeType enum.

type AuthenticationMetadataFlowPreferenceFrictionlessType

type AuthenticationMetadataFlowPreferenceFrictionlessType string

AuthenticationMetadataFlowPreferenceFrictionlessType Subtype of frictionless preference.

Defines values for AuthenticationMetadataFlowPreferenceFrictionlessType.

func (AuthenticationMetadataFlowPreferenceFrictionlessType) Valid

Valid indicates whether the value is a known member of the AuthenticationMetadataFlowPreferenceFrictionlessType enum.

type AuthenticationMetadataFlowPreferenceType

type AuthenticationMetadataFlowPreferenceType string

AuthenticationMetadataFlowPreferenceType Type of flow requested for this 3DS Authentication. "challenge" requests a challenge flow; "frictionless" requests a frictionless flow.

const (
	Challenge    AuthenticationMetadataFlowPreferenceType = "challenge"
	Frictionless AuthenticationMetadataFlowPreferenceType = "frictionless"
)

Defines values for AuthenticationMetadataFlowPreferenceType.

func (AuthenticationMetadataFlowPreferenceType) Valid

Valid indicates whether the value is a known member of the AuthenticationMetadataFlowPreferenceType enum.

type AuthenticationResult

type AuthenticationResult struct {
	// Outcome The outcome of this 3DS Authentication.
	Outcome AuthenticationResultOutcome `json:"outcome"`

	// OutcomeDetails Detailed authentication data. This field is required when the outcome is 'authenticated', 'informational', or 'attempt_acknowledged'.
	OutcomeDetails *struct {
		// ElectronicCommerceIndicator Electronic Commerce Indicator (ECI) returned by the 3D Secure provider. Indicates the degree/type of authentication performed.
		ElectronicCommerceIndicator AuthenticationResultOutcomeDetailsElectronicCommerceIndicator `json:"electronic_commerce_indicator"`

		// ThreeDsCryptogram The 3DS cryptogram (authentication value / AAV/CAVV/AEVV). This value is 20 bytes, base64-encoded into a 28-character string.
		ThreeDsCryptogram string `json:"three_ds_cryptogram"`

		// TransactionId Transaction identifier returned by the 3DS system: - For 3DS1: the XID - For 3DS2: the Directory Server Transaction ID (dsTransID)
		TransactionId string `json:"transaction_id"`

		// Version The 3D Secure version used for this authentication (for example "1.0.2" or "2.2.0").
		Version string `json:"version"`
	} `json:"outcome_details,omitempty"`
}

AuthenticationResult Agent-provided authentication results returned to the seller for card-based 3D Secure.

type AuthenticationResultOutcome

type AuthenticationResultOutcome string

AuthenticationResultOutcome The outcome of this 3DS Authentication.

const (
	AuthenticationResultOutcomeAbandoned           AuthenticationResultOutcome = "abandoned"
	AuthenticationResultOutcomeAttemptAcknowledged AuthenticationResultOutcome = "attempt_acknowledged"
	AuthenticationResultOutcomeAuthenticated       AuthenticationResultOutcome = "authenticated"
	AuthenticationResultOutcomeCanceled            AuthenticationResultOutcome = "canceled"
	AuthenticationResultOutcomeDenied              AuthenticationResultOutcome = "denied"
	AuthenticationResultOutcomeInformational       AuthenticationResultOutcome = "informational"
	AuthenticationResultOutcomeInternalError       AuthenticationResultOutcome = "internal_error"
	AuthenticationResultOutcomeNotSupported        AuthenticationResultOutcome = "not_supported"
	AuthenticationResultOutcomeProcessingError     AuthenticationResultOutcome = "processing_error"
	AuthenticationResultOutcomeRejected            AuthenticationResultOutcome = "rejected"
)

Defines values for AuthenticationResultOutcome.

func (AuthenticationResultOutcome) Valid

Valid indicates whether the value is a known member of the AuthenticationResultOutcome enum.

type AuthenticationResultOutcomeDetailsElectronicCommerceIndicator

type AuthenticationResultOutcomeDetailsElectronicCommerceIndicator string

AuthenticationResultOutcomeDetailsElectronicCommerceIndicator Electronic Commerce Indicator (ECI) returned by the 3D Secure provider. Indicates the degree/type of authentication performed.

func (AuthenticationResultOutcomeDetailsElectronicCommerceIndicator) Valid

Valid indicates whether the value is a known member of the AuthenticationResultOutcomeDetailsElectronicCommerceIndicator enum.

type Authorization

type Authorization = string

Authorization defines model for Authorization.

type Buyer

type Buyer struct {
	// AccountType Type of buyer account
	AccountType *BuyerAccountType `json:"account_type,omitempty"`

	// AuthenticationStatus Buyer's authentication status
	AuthenticationStatus *BuyerAuthenticationStatus `json:"authentication_status,omitempty"`

	// Company Information about a company or organization associated with the buyer
	Company *CompanyInfo `json:"company,omitempty"`

	// CustomerId Merchant's internal customer identifier
	CustomerId *string `json:"customer_id,omitempty"`

	// Email Buyer's email address
	Email openapi_types.Email `json:"email"`

	// FirstName Buyer's first name
	FirstName *string `json:"first_name,omitempty"`

	// FullName Buyer's full name
	FullName *string `json:"full_name,omitempty"`

	// LastName Buyer's last name
	LastName *string `json:"last_name,omitempty"`

	// Loyalty Loyalty program information including membership details and rewards balance
	Loyalty *LoyaltyInfo `json:"loyalty,omitempty"`

	// PhoneNumber Buyer's phone number
	PhoneNumber *string `json:"phone_number,omitempty"`

	// TaxExemption Tax exemption information including exemption type and applicable regions
	TaxExemption *TaxExemption `json:"tax_exemption,omitempty"`
}

Buyer Information about the buyer including contact details, company info, and loyalty status

type BuyerAccountType

type BuyerAccountType string

BuyerAccountType Type of buyer account

const (
	BuyerAccountTypeBusiness   BuyerAccountType = "business"
	BuyerAccountTypeGuest      BuyerAccountType = "guest"
	BuyerAccountTypeRegistered BuyerAccountType = "registered"
)

Defines values for BuyerAccountType.

func (BuyerAccountType) Valid

func (e BuyerAccountType) Valid() bool

Valid indicates whether the value is a known member of the BuyerAccountType enum.

type BuyerAuthenticationStatus

type BuyerAuthenticationStatus string

BuyerAuthenticationStatus Buyer's authentication status

const (
	BuyerAuthenticationStatusAuthenticated  BuyerAuthenticationStatus = "authenticated"
	BuyerAuthenticationStatusGuest          BuyerAuthenticationStatus = "guest"
	BuyerAuthenticationStatusRequiresSignin BuyerAuthenticationStatus = "requires_signin"
)

Defines values for BuyerAuthenticationStatus.

func (BuyerAuthenticationStatus) Valid

func (e BuyerAuthenticationStatus) Valid() bool

Valid indicates whether the value is a known member of the BuyerAuthenticationStatus enum.

type CancelCheckoutSessionJSONRequestBody

type CancelCheckoutSessionJSONRequestBody = CancelSessionRequest

CancelCheckoutSessionJSONRequestBody defines body for CancelCheckoutSession for application/json ContentType.

type CancelCheckoutSessionParams

type CancelCheckoutSessionParams struct {
	// Authorization Bearer token for API authentication
	Authorization  Authorization   `json:"Authorization"`
	AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
	UserAgent      *UserAgent      `json:"User-Agent,omitempty"`

	// IdempotencyKey Idempotency key. MUST be present on all POST requests. Opaque string, max 255 characters. UUID v4 recommended. Scoped to authenticated identity + endpoint.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
	RequestId      *RequestId     `json:"Request-Id,omitempty"`

	// Signature HMAC signature for webhook verification
	Signature *Signature `json:"Signature,omitempty"`

	// Timestamp RFC 3339 date-time string for request timing validation
	Timestamp  *Timestamp `json:"Timestamp,omitempty"`
	APIVersion APIVersion `json:"API-Version"`
}

CancelCheckoutSessionParams defines parameters for CancelCheckoutSession.

type CancelSessionRequest

type CancelSessionRequest struct {
	// IntentTrace Structured reason for why a buyer action was taken, used for analytics and debugging
	IntentTrace *IntentTrace `json:"intent_trace,omitempty"`
}

CancelSessionRequest Request to cancel a checkout session

type Capabilities

type Capabilities struct {
	// Extensions Extensions supported by the party.
	// Requests: array of extension identifiers.
	// Responses: array of extension declaration objects.
	Extensions *Capabilities_Extensions `json:"extensions,omitempty"`

	// Interventions Intervention capabilities.
	// Context-specific fields: display_context, redirect_context, max_redirects, max_interaction_depth (requests only).
	// required, enforcement (responses only).
	// supported field contains intersection in responses.
	Interventions *InterventionCapabilities `json:"interventions,omitempty"`

	// Payment Payment configuration with handlers
	Payment *Payment `json:"payment,omitempty"`
}

Capabilities Capabilities object used in requests and responses. Context determines the party: requests are from Agents, responses are from Sellers. Seller responses contain the intersection of supported interventions.

type CapabilitiesExtensions0

type CapabilitiesExtensions0 = []string

CapabilitiesExtensions0 Extensions the agent understands (request). Simple identifiers like 'discount'.

type CapabilitiesExtensions1

type CapabilitiesExtensions1 = []ExtensionDeclaration

CapabilitiesExtensions1 Active extensions for this session (response). Objects with name, extends, schema, spec.

type Capabilities_Extensions

type Capabilities_Extensions struct {
	// contains filtered or unexported fields
}

Capabilities_Extensions Extensions supported by the party. Requests: array of extension identifiers. Responses: array of extension declaration objects.

func (Capabilities_Extensions) AsCapabilitiesExtensions0

func (t Capabilities_Extensions) AsCapabilitiesExtensions0() (CapabilitiesExtensions0, error)

AsCapabilitiesExtensions0 returns the union data inside the Capabilities_Extensions as a CapabilitiesExtensions0

func (Capabilities_Extensions) AsCapabilitiesExtensions1

func (t Capabilities_Extensions) AsCapabilitiesExtensions1() (CapabilitiesExtensions1, error)

AsCapabilitiesExtensions1 returns the union data inside the Capabilities_Extensions as a CapabilitiesExtensions1

func (*Capabilities_Extensions) FromCapabilitiesExtensions0

func (t *Capabilities_Extensions) FromCapabilitiesExtensions0(v CapabilitiesExtensions0) error

FromCapabilitiesExtensions0 overwrites any union data inside the Capabilities_Extensions as the provided CapabilitiesExtensions0

func (*Capabilities_Extensions) FromCapabilitiesExtensions1

func (t *Capabilities_Extensions) FromCapabilitiesExtensions1(v CapabilitiesExtensions1) error

FromCapabilitiesExtensions1 overwrites any union data inside the Capabilities_Extensions as the provided CapabilitiesExtensions1

func (Capabilities_Extensions) MarshalJSON

func (t Capabilities_Extensions) MarshalJSON() ([]byte, error)

func (*Capabilities_Extensions) MergeCapabilitiesExtensions0

func (t *Capabilities_Extensions) MergeCapabilitiesExtensions0(v CapabilitiesExtensions0) error

MergeCapabilitiesExtensions0 performs a merge with any union data inside the Capabilities_Extensions, using the provided CapabilitiesExtensions0

func (*Capabilities_Extensions) MergeCapabilitiesExtensions1

func (t *Capabilities_Extensions) MergeCapabilitiesExtensions1(v CapabilitiesExtensions1) error

MergeCapabilitiesExtensions1 performs a merge with any union data inside the Capabilities_Extensions, using the provided CapabilitiesExtensions1

func (*Capabilities_Extensions) UnmarshalJSON

func (t *Capabilities_Extensions) UnmarshalJSON(b []byte) error

type CheckoutSession

type CheckoutSession = CheckoutSessionBase

CheckoutSession Checkout session response model

type CheckoutSessionBase

type CheckoutSessionBase struct {
	// AuthenticationMetadata Seller-provided authentication metadata for 3DS flows.
	AuthenticationMetadata *AuthenticationMetadata `json:"authentication_metadata,omitempty"`

	// Buyer Information about the buyer including contact details, company info, and loyalty status
	Buyer *Buyer `json:"buyer,omitempty"`

	// Capabilities Capabilities object used in requests and responses.
	// Context determines the party: requests are from Agents, responses are from Sellers.
	// Seller responses contain the intersection of supported interventions.
	Capabilities Capabilities `json:"capabilities"`

	// ContinueUrl URL to continue or resume the checkout session
	ContinueUrl *string `json:"continue_url,omitempty"`

	// CreatedAt RFC 3339 timestamp when the session was created
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Currency ISO 4217 settlement currency code
	Currency string `json:"currency"`

	// Discounts Discount codes input and applied discounts output in checkout responses.
	Discounts *DiscountsResponse `json:"discounts,omitempty"`

	// ExchangeRate Exchange rate from presentment to settlement currency
	ExchangeRate *float32 `json:"exchange_rate,omitempty"`

	// ExchangeRateTimestamp RFC 3339 timestamp when exchange rate was determined
	ExchangeRateTimestamp *time.Time `json:"exchange_rate_timestamp,omitempty"`

	// ExpiresAt RFC 3339 timestamp when the session expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`

	// FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)
	FulfillmentDetails *FulfillmentDetails `json:"fulfillment_details,omitempty"`

	// FulfillmentGroups Optional grouping of line items by fulfillment method
	FulfillmentGroups *[]FulfillmentGroup `json:"fulfillment_groups,omitempty"`

	// FulfillmentOptions Available fulfillment options
	FulfillmentOptions []CheckoutSessionBase_FulfillmentOptions_Item `json:"fulfillment_options"`

	// Id Unique identifier for the checkout session
	Id string `json:"id"`

	// LineItems Line items in the checkout session
	LineItems []LineItem `json:"line_items"`

	// Links Relevant links (terms, policies, support)
	Links []Link `json:"links"`

	// Locale Locale code (e.g., 'en-US') for localizing content
	Locale *string `json:"locale,omitempty"`

	// MarketingConsentOptions Marketing consent options the seller offers. When present, the agent SHOULD display these to the buyer before checkout completion. Agents MAY selectively surface a subset of options; options not surfaced MUST be omitted from marketing_consents. When absent, the agent MUST NOT surface any marketing consent UI. An empty array is equivalent to absent.
	MarketingConsentOptions *[]MarketingConsentOption `json:"marketing_consent_options,omitempty"`

	// Messages Messages to communicate with the buyer (info, warnings, errors)
	Messages []CheckoutSessionBase_Messages_Item `json:"messages"`

	// Metadata Arbitrary metadata for merchant use
	Metadata *map[string]interface{} `json:"metadata,omitempty"`

	// PresentmentCurrency ISO 4217 presentment currency code if different from settlement currency
	PresentmentCurrency *string `json:"presentment_currency,omitempty"`

	// Protocol Protocol metadata included in checkout responses. Indicates the ACP version.
	Protocol *ProtocolVersion `json:"protocol,omitempty"`

	// QuoteExpiresAt RFC 3339 timestamp when the quote expires
	QuoteExpiresAt *time.Time `json:"quote_expires_at,omitempty"`

	// QuoteId Quote identifier if this session is based on a quote
	QuoteId *string `json:"quote_id,omitempty"`

	// SelectedFulfillmentOptions Currently selected fulfillment options
	SelectedFulfillmentOptions *[]SelectedFulfillmentOption `json:"selected_fulfillment_options,omitempty"`

	// Status Current status of the checkout session
	Status CheckoutSessionBaseStatus `json:"status"`

	// Timezone IANA timezone identifier (e.g., 'America/New_York')
	Timezone *string `json:"timezone,omitempty"`

	// Totals Cart-level totals breakdown
	Totals []Total `json:"totals"`

	// UpdatedAt RFC 3339 timestamp of last update
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

CheckoutSessionBase Base checkout session model containing common fields for all checkout session states

type CheckoutSessionBaseStatus

type CheckoutSessionBaseStatus string

CheckoutSessionBaseStatus Current status of the checkout session

const (
	CheckoutSessionBaseStatusAuthenticationRequired CheckoutSessionBaseStatus = "authentication_required"
	CheckoutSessionBaseStatusCanceled               CheckoutSessionBaseStatus = "canceled"
	CheckoutSessionBaseStatusCompleteInProgress     CheckoutSessionBaseStatus = "complete_in_progress"
	CheckoutSessionBaseStatusCompleted              CheckoutSessionBaseStatus = "completed"
	CheckoutSessionBaseStatusExpired                CheckoutSessionBaseStatus = "expired"
	CheckoutSessionBaseStatusInProgress             CheckoutSessionBaseStatus = "in_progress"
	CheckoutSessionBaseStatusIncomplete             CheckoutSessionBaseStatus = "incomplete"
	CheckoutSessionBaseStatusNotReadyForPayment     CheckoutSessionBaseStatus = "not_ready_for_payment"
	CheckoutSessionBaseStatusPendingApproval        CheckoutSessionBaseStatus = "pending_approval"
	CheckoutSessionBaseStatusReadyForPayment        CheckoutSessionBaseStatus = "ready_for_payment"
	CheckoutSessionBaseStatusRequiresEscalation     CheckoutSessionBaseStatus = "requires_escalation"
)

Defines values for CheckoutSessionBaseStatus.

func (CheckoutSessionBaseStatus) Valid

func (e CheckoutSessionBaseStatus) Valid() bool

Valid indicates whether the value is a known member of the CheckoutSessionBaseStatus enum.

type CheckoutSessionBase_FulfillmentOptions_Item

type CheckoutSessionBase_FulfillmentOptions_Item struct {
	// contains filtered or unexported fields
}

CheckoutSessionBase_FulfillmentOptions_Item defines model for CheckoutSessionBase.fulfillment_options.Item.

func (CheckoutSessionBase_FulfillmentOptions_Item) AsFulfillmentOptionDigital

AsFulfillmentOptionDigital returns the union data inside the CheckoutSessionBase_FulfillmentOptions_Item as a FulfillmentOptionDigital

func (CheckoutSessionBase_FulfillmentOptions_Item) AsFulfillmentOptionLocalDelivery

AsFulfillmentOptionLocalDelivery returns the union data inside the CheckoutSessionBase_FulfillmentOptions_Item as a FulfillmentOptionLocalDelivery

func (CheckoutSessionBase_FulfillmentOptions_Item) AsFulfillmentOptionPickup

AsFulfillmentOptionPickup returns the union data inside the CheckoutSessionBase_FulfillmentOptions_Item as a FulfillmentOptionPickup

func (CheckoutSessionBase_FulfillmentOptions_Item) AsFulfillmentOptionShipping

AsFulfillmentOptionShipping returns the union data inside the CheckoutSessionBase_FulfillmentOptions_Item as a FulfillmentOptionShipping

func (*CheckoutSessionBase_FulfillmentOptions_Item) FromFulfillmentOptionDigital

FromFulfillmentOptionDigital overwrites any union data inside the CheckoutSessionBase_FulfillmentOptions_Item as the provided FulfillmentOptionDigital

func (*CheckoutSessionBase_FulfillmentOptions_Item) FromFulfillmentOptionLocalDelivery

func (t *CheckoutSessionBase_FulfillmentOptions_Item) FromFulfillmentOptionLocalDelivery(v FulfillmentOptionLocalDelivery) error

FromFulfillmentOptionLocalDelivery overwrites any union data inside the CheckoutSessionBase_FulfillmentOptions_Item as the provided FulfillmentOptionLocalDelivery

func (*CheckoutSessionBase_FulfillmentOptions_Item) FromFulfillmentOptionPickup

FromFulfillmentOptionPickup overwrites any union data inside the CheckoutSessionBase_FulfillmentOptions_Item as the provided FulfillmentOptionPickup

func (*CheckoutSessionBase_FulfillmentOptions_Item) FromFulfillmentOptionShipping

FromFulfillmentOptionShipping overwrites any union data inside the CheckoutSessionBase_FulfillmentOptions_Item as the provided FulfillmentOptionShipping

func (CheckoutSessionBase_FulfillmentOptions_Item) MarshalJSON

func (*CheckoutSessionBase_FulfillmentOptions_Item) MergeFulfillmentOptionDigital

MergeFulfillmentOptionDigital performs a merge with any union data inside the CheckoutSessionBase_FulfillmentOptions_Item, using the provided FulfillmentOptionDigital

func (*CheckoutSessionBase_FulfillmentOptions_Item) MergeFulfillmentOptionLocalDelivery

func (t *CheckoutSessionBase_FulfillmentOptions_Item) MergeFulfillmentOptionLocalDelivery(v FulfillmentOptionLocalDelivery) error

MergeFulfillmentOptionLocalDelivery performs a merge with any union data inside the CheckoutSessionBase_FulfillmentOptions_Item, using the provided FulfillmentOptionLocalDelivery

func (*CheckoutSessionBase_FulfillmentOptions_Item) MergeFulfillmentOptionPickup

MergeFulfillmentOptionPickup performs a merge with any union data inside the CheckoutSessionBase_FulfillmentOptions_Item, using the provided FulfillmentOptionPickup

func (*CheckoutSessionBase_FulfillmentOptions_Item) MergeFulfillmentOptionShipping

MergeFulfillmentOptionShipping performs a merge with any union data inside the CheckoutSessionBase_FulfillmentOptions_Item, using the provided FulfillmentOptionShipping

func (*CheckoutSessionBase_FulfillmentOptions_Item) UnmarshalJSON

type CheckoutSessionBase_Messages_Item

type CheckoutSessionBase_Messages_Item struct {
	// contains filtered or unexported fields
}

CheckoutSessionBase_Messages_Item defines model for CheckoutSessionBase.messages.Item.

func (CheckoutSessionBase_Messages_Item) AsMessageError

AsMessageError returns the union data inside the CheckoutSessionBase_Messages_Item as a MessageError

func (CheckoutSessionBase_Messages_Item) AsMessageInfo

AsMessageInfo returns the union data inside the CheckoutSessionBase_Messages_Item as a MessageInfo

func (CheckoutSessionBase_Messages_Item) AsMessageWarning

func (t CheckoutSessionBase_Messages_Item) AsMessageWarning() (MessageWarning, error)

AsMessageWarning returns the union data inside the CheckoutSessionBase_Messages_Item as a MessageWarning

func (*CheckoutSessionBase_Messages_Item) FromMessageError

func (t *CheckoutSessionBase_Messages_Item) FromMessageError(v MessageError) error

FromMessageError overwrites any union data inside the CheckoutSessionBase_Messages_Item as the provided MessageError

func (*CheckoutSessionBase_Messages_Item) FromMessageInfo

func (t *CheckoutSessionBase_Messages_Item) FromMessageInfo(v MessageInfo) error

FromMessageInfo overwrites any union data inside the CheckoutSessionBase_Messages_Item as the provided MessageInfo

func (*CheckoutSessionBase_Messages_Item) FromMessageWarning

func (t *CheckoutSessionBase_Messages_Item) FromMessageWarning(v MessageWarning) error

FromMessageWarning overwrites any union data inside the CheckoutSessionBase_Messages_Item as the provided MessageWarning

func (CheckoutSessionBase_Messages_Item) MarshalJSON

func (t CheckoutSessionBase_Messages_Item) MarshalJSON() ([]byte, error)

func (*CheckoutSessionBase_Messages_Item) MergeMessageError

func (t *CheckoutSessionBase_Messages_Item) MergeMessageError(v MessageError) error

MergeMessageError performs a merge with any union data inside the CheckoutSessionBase_Messages_Item, using the provided MessageError

func (*CheckoutSessionBase_Messages_Item) MergeMessageInfo

func (t *CheckoutSessionBase_Messages_Item) MergeMessageInfo(v MessageInfo) error

MergeMessageInfo performs a merge with any union data inside the CheckoutSessionBase_Messages_Item, using the provided MessageInfo

func (*CheckoutSessionBase_Messages_Item) MergeMessageWarning

func (t *CheckoutSessionBase_Messages_Item) MergeMessageWarning(v MessageWarning) error

MergeMessageWarning performs a merge with any union data inside the CheckoutSessionBase_Messages_Item, using the provided MessageWarning

func (*CheckoutSessionBase_Messages_Item) UnmarshalJSON

func (t *CheckoutSessionBase_Messages_Item) UnmarshalJSON(b []byte) error

type CheckoutSessionCompleteRequest

type CheckoutSessionCompleteRequest struct {
	// AffiliateAttribution Optional affiliate attribution data for crediting third-party publishers.
	// Write-only: not returned in responses. See RFC: Affiliate Attribution.
	//
	// Forward compatibility: Servers SHOULD ignore unknown fields to support future extensions (per RFC §8.2).
	AffiliateAttribution *AffiliateAttribution `json:"affiliate_attribution,omitempty"`

	// AuthenticationResult Agent-provided authentication results returned to the seller for card-based 3D Secure.
	AuthenticationResult *AuthenticationResult `json:"authentication_result,omitempty"`

	// Buyer Information about the buyer including contact details, company info, and loyalty status
	Buyer *Buyer `json:"buyer,omitempty"`

	// MarketingConsents Buyer's marketing consent decisions. Agents SHOULD include an entry for each consent option surfaced to the buyer. Options not surfaced MUST be omitted -- omission preserves existing subscription state. Sellers SHOULD ignore entries in marketing_consents that do not correspond to a channel in marketing_consent_options.
	MarketingConsents *[]MarketingConsent `json:"marketing_consents,omitempty"`

	// PaymentData Payment instrument data collected from the buyer (e.g., card details, wallet tokens)
	PaymentData PaymentData `json:"payment_data"`

	// RiskSignals Risk and fraud detection signals for the checkout session
	RiskSignals *RiskSignals `json:"risk_signals,omitempty"`
}

CheckoutSessionCompleteRequest Request to complete a checkout session and create an order

type CheckoutSessionCreateRequest

type CheckoutSessionCreateRequest struct {
	// AffiliateAttribution Optional affiliate attribution data for crediting third-party publishers.
	// Write-only: not returned in responses. See RFC: Affiliate Attribution.
	//
	// Forward compatibility: Servers SHOULD ignore unknown fields to support future extensions (per RFC §8.2).
	AffiliateAttribution *AffiliateAttribution `json:"affiliate_attribution,omitempty"`

	// Buyer Information about the buyer including contact details, company info, and loyalty status
	Buyer *Buyer `json:"buyer,omitempty"`

	// Capabilities Capabilities object used in requests and responses.
	// Context determines the party: requests are from Agents, responses are from Sellers.
	// Seller responses contain the intersection of supported interventions.
	Capabilities Capabilities `json:"capabilities"`

	// Coupons DEPRECATED: Use discounts.codes instead. Discount codes to apply.
	Coupons *[]string `json:"coupons,omitempty"`

	// Currency ISO 4217 currency code
	Currency string `json:"currency"`

	// Discounts Discount codes input for checkout create/update requests.
	Discounts *DiscountsRequest `json:"discounts,omitempty"`

	// FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)
	FulfillmentDetails *FulfillmentDetails `json:"fulfillment_details,omitempty"`

	// FulfillmentGroups Grouping of items by fulfillment method
	FulfillmentGroups *[]FulfillmentGroup `json:"fulfillment_groups,omitempty"`

	// LineItems Items to add to the checkout session
	LineItems []Item `json:"line_items"`

	// Locale Locale code for localizing content (e.g., 'en-US')
	Locale *string `json:"locale,omitempty"`

	// Metadata Arbitrary metadata for merchant use
	Metadata *map[string]interface{} `json:"metadata,omitempty"`

	// QuoteId Quote identifier if this session is based on a quote
	QuoteId *string `json:"quote_id,omitempty"`

	// Timezone IANA timezone identifier (e.g., 'America/New_York')
	Timezone *string `json:"timezone,omitempty"`
}

CheckoutSessionCreateRequest Request to create a new checkout session

type CheckoutSessionUpdateRequest

type CheckoutSessionUpdateRequest struct {
	// Buyer Information about the buyer including contact details, company info, and loyalty status
	Buyer *Buyer `json:"buyer,omitempty"`

	// Coupons DEPRECATED: Use discounts.codes instead. Discount codes to apply.
	Coupons *[]string `json:"coupons,omitempty"`

	// Discounts Discount codes input for checkout create/update requests.
	Discounts *DiscountsRequest `json:"discounts,omitempty"`

	// FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)
	FulfillmentDetails *FulfillmentDetails `json:"fulfillment_details,omitempty"`

	// FulfillmentGroups Updated fulfillment groupings
	FulfillmentGroups *[]FulfillmentGroup `json:"fulfillment_groups,omitempty"`

	// LineItems Items to update in the checkout session
	LineItems *[]Item `json:"line_items,omitempty"`

	// SelectedFulfillmentOptions Fulfillment option selected by the buyer
	SelectedFulfillmentOptions *[]SelectedFulfillmentOption `json:"selected_fulfillment_options,omitempty"`
}

CheckoutSessionUpdateRequest Request to update an existing checkout session

type CheckoutSessionWithOrder

type CheckoutSessionWithOrder struct {
	// AuthenticationMetadata Seller-provided authentication metadata for 3DS flows.
	AuthenticationMetadata *AuthenticationMetadata `json:"authentication_metadata,omitempty"`

	// Buyer Information about the buyer including contact details, company info, and loyalty status
	Buyer *Buyer `json:"buyer,omitempty"`

	// Capabilities Capabilities object used in requests and responses.
	// Context determines the party: requests are from Agents, responses are from Sellers.
	// Seller responses contain the intersection of supported interventions.
	Capabilities Capabilities `json:"capabilities"`

	// ContinueUrl URL to continue or resume the checkout session
	ContinueUrl *string `json:"continue_url,omitempty"`

	// CreatedAt RFC 3339 timestamp when the session was created
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Currency ISO 4217 settlement currency code
	Currency string `json:"currency"`

	// Discounts Discount codes input and applied discounts output in checkout responses.
	Discounts *DiscountsResponse `json:"discounts,omitempty"`

	// ExchangeRate Exchange rate from presentment to settlement currency
	ExchangeRate *float32 `json:"exchange_rate,omitempty"`

	// ExchangeRateTimestamp RFC 3339 timestamp when exchange rate was determined
	ExchangeRateTimestamp *time.Time `json:"exchange_rate_timestamp,omitempty"`

	// ExpiresAt RFC 3339 timestamp when the session expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`

	// FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)
	FulfillmentDetails *FulfillmentDetails `json:"fulfillment_details,omitempty"`

	// FulfillmentGroups Optional grouping of line items by fulfillment method
	FulfillmentGroups *[]FulfillmentGroup `json:"fulfillment_groups,omitempty"`

	// FulfillmentOptions Available fulfillment options
	FulfillmentOptions []CheckoutSessionWithOrder_FulfillmentOptions_Item `json:"fulfillment_options"`

	// Id Unique identifier for the checkout session
	Id string `json:"id"`

	// LineItems Line items in the checkout session
	LineItems []LineItem `json:"line_items"`

	// Links Relevant links (terms, policies, support)
	Links []Link `json:"links"`

	// Locale Locale code (e.g., 'en-US') for localizing content
	Locale *string `json:"locale,omitempty"`

	// MarketingConsentOptions Marketing consent options the seller offers. When present, the agent SHOULD display these to the buyer before checkout completion. Agents MAY selectively surface a subset of options; options not surfaced MUST be omitted from marketing_consents. When absent, the agent MUST NOT surface any marketing consent UI. An empty array is equivalent to absent.
	MarketingConsentOptions *[]MarketingConsentOption `json:"marketing_consent_options,omitempty"`

	// Messages Messages to communicate with the buyer (info, warnings, errors)
	Messages []CheckoutSessionWithOrder_Messages_Item `json:"messages"`

	// Metadata Arbitrary metadata for merchant use
	Metadata *map[string]interface{} `json:"metadata,omitempty"`

	// Order Order returned after checkout completion. Contains order details and optional
	// rich post-purchase tracking (line items, fulfillments, adjustments).
	Order Order `json:"order"`

	// PresentmentCurrency ISO 4217 presentment currency code if different from settlement currency
	PresentmentCurrency *string `json:"presentment_currency,omitempty"`

	// Protocol Protocol metadata included in checkout responses. Indicates the ACP version.
	Protocol *ProtocolVersion `json:"protocol,omitempty"`

	// QuoteExpiresAt RFC 3339 timestamp when the quote expires
	QuoteExpiresAt *time.Time `json:"quote_expires_at,omitempty"`

	// QuoteId Quote identifier if this session is based on a quote
	QuoteId *string `json:"quote_id,omitempty"`

	// SelectedFulfillmentOptions Currently selected fulfillment options
	SelectedFulfillmentOptions *[]SelectedFulfillmentOption `json:"selected_fulfillment_options,omitempty"`

	// Status Current status of the checkout session
	Status CheckoutSessionWithOrderStatus `json:"status"`

	// Timezone IANA timezone identifier (e.g., 'America/New_York')
	Timezone *string `json:"timezone,omitempty"`

	// Totals Cart-level totals breakdown
	Totals []Total `json:"totals"`

	// UpdatedAt RFC 3339 timestamp of last update
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

CheckoutSessionWithOrder Checkout session response after completion, includes the created order

type CheckoutSessionWithOrderStatus

type CheckoutSessionWithOrderStatus string

CheckoutSessionWithOrderStatus Current status of the checkout session

const (
	CheckoutSessionWithOrderStatusAuthenticationRequired CheckoutSessionWithOrderStatus = "authentication_required"
	CheckoutSessionWithOrderStatusCanceled               CheckoutSessionWithOrderStatus = "canceled"
	CheckoutSessionWithOrderStatusCompleteInProgress     CheckoutSessionWithOrderStatus = "complete_in_progress"
	CheckoutSessionWithOrderStatusCompleted              CheckoutSessionWithOrderStatus = "completed"
	CheckoutSessionWithOrderStatusExpired                CheckoutSessionWithOrderStatus = "expired"
	CheckoutSessionWithOrderStatusInProgress             CheckoutSessionWithOrderStatus = "in_progress"
	CheckoutSessionWithOrderStatusIncomplete             CheckoutSessionWithOrderStatus = "incomplete"
	CheckoutSessionWithOrderStatusNotReadyForPayment     CheckoutSessionWithOrderStatus = "not_ready_for_payment"
	CheckoutSessionWithOrderStatusPendingApproval        CheckoutSessionWithOrderStatus = "pending_approval"
	CheckoutSessionWithOrderStatusReadyForPayment        CheckoutSessionWithOrderStatus = "ready_for_payment"
	CheckoutSessionWithOrderStatusRequiresEscalation     CheckoutSessionWithOrderStatus = "requires_escalation"
)

Defines values for CheckoutSessionWithOrderStatus.

func (CheckoutSessionWithOrderStatus) Valid

Valid indicates whether the value is a known member of the CheckoutSessionWithOrderStatus enum.

type CheckoutSessionWithOrder_FulfillmentOptions_Item

type CheckoutSessionWithOrder_FulfillmentOptions_Item struct {
	// contains filtered or unexported fields
}

CheckoutSessionWithOrder_FulfillmentOptions_Item defines model for CheckoutSessionWithOrder.fulfillment_options.Item.

func (CheckoutSessionWithOrder_FulfillmentOptions_Item) AsFulfillmentOptionDigital

AsFulfillmentOptionDigital returns the union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as a FulfillmentOptionDigital

func (CheckoutSessionWithOrder_FulfillmentOptions_Item) AsFulfillmentOptionLocalDelivery

AsFulfillmentOptionLocalDelivery returns the union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as a FulfillmentOptionLocalDelivery

func (CheckoutSessionWithOrder_FulfillmentOptions_Item) AsFulfillmentOptionPickup

AsFulfillmentOptionPickup returns the union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as a FulfillmentOptionPickup

func (CheckoutSessionWithOrder_FulfillmentOptions_Item) AsFulfillmentOptionShipping

AsFulfillmentOptionShipping returns the union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as a FulfillmentOptionShipping

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) FromFulfillmentOptionDigital

FromFulfillmentOptionDigital overwrites any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as the provided FulfillmentOptionDigital

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) FromFulfillmentOptionLocalDelivery

FromFulfillmentOptionLocalDelivery overwrites any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as the provided FulfillmentOptionLocalDelivery

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) FromFulfillmentOptionPickup

FromFulfillmentOptionPickup overwrites any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as the provided FulfillmentOptionPickup

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) FromFulfillmentOptionShipping

FromFulfillmentOptionShipping overwrites any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item as the provided FulfillmentOptionShipping

func (CheckoutSessionWithOrder_FulfillmentOptions_Item) MarshalJSON

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) MergeFulfillmentOptionDigital

MergeFulfillmentOptionDigital performs a merge with any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item, using the provided FulfillmentOptionDigital

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) MergeFulfillmentOptionLocalDelivery

MergeFulfillmentOptionLocalDelivery performs a merge with any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item, using the provided FulfillmentOptionLocalDelivery

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) MergeFulfillmentOptionPickup

MergeFulfillmentOptionPickup performs a merge with any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item, using the provided FulfillmentOptionPickup

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) MergeFulfillmentOptionShipping

MergeFulfillmentOptionShipping performs a merge with any union data inside the CheckoutSessionWithOrder_FulfillmentOptions_Item, using the provided FulfillmentOptionShipping

func (*CheckoutSessionWithOrder_FulfillmentOptions_Item) UnmarshalJSON

type CheckoutSessionWithOrder_Messages_Item

type CheckoutSessionWithOrder_Messages_Item struct {
	// contains filtered or unexported fields
}

CheckoutSessionWithOrder_Messages_Item defines model for CheckoutSessionWithOrder.messages.Item.

func (CheckoutSessionWithOrder_Messages_Item) AsMessageError

AsMessageError returns the union data inside the CheckoutSessionWithOrder_Messages_Item as a MessageError

func (CheckoutSessionWithOrder_Messages_Item) AsMessageInfo

AsMessageInfo returns the union data inside the CheckoutSessionWithOrder_Messages_Item as a MessageInfo

func (CheckoutSessionWithOrder_Messages_Item) AsMessageWarning

AsMessageWarning returns the union data inside the CheckoutSessionWithOrder_Messages_Item as a MessageWarning

func (*CheckoutSessionWithOrder_Messages_Item) FromMessageError

FromMessageError overwrites any union data inside the CheckoutSessionWithOrder_Messages_Item as the provided MessageError

func (*CheckoutSessionWithOrder_Messages_Item) FromMessageInfo

FromMessageInfo overwrites any union data inside the CheckoutSessionWithOrder_Messages_Item as the provided MessageInfo

func (*CheckoutSessionWithOrder_Messages_Item) FromMessageWarning

FromMessageWarning overwrites any union data inside the CheckoutSessionWithOrder_Messages_Item as the provided MessageWarning

func (CheckoutSessionWithOrder_Messages_Item) MarshalJSON

func (t CheckoutSessionWithOrder_Messages_Item) MarshalJSON() ([]byte, error)

func (*CheckoutSessionWithOrder_Messages_Item) MergeMessageError

MergeMessageError performs a merge with any union data inside the CheckoutSessionWithOrder_Messages_Item, using the provided MessageError

func (*CheckoutSessionWithOrder_Messages_Item) MergeMessageInfo

MergeMessageInfo performs a merge with any union data inside the CheckoutSessionWithOrder_Messages_Item, using the provided MessageInfo

func (*CheckoutSessionWithOrder_Messages_Item) MergeMessageWarning

MergeMessageWarning performs a merge with any union data inside the CheckoutSessionWithOrder_Messages_Item, using the provided MessageWarning

func (*CheckoutSessionWithOrder_Messages_Item) UnmarshalJSON

func (t *CheckoutSessionWithOrder_Messages_Item) UnmarshalJSON(b []byte) error

type CompanyInfo

type CompanyInfo struct {
	// CostCenter Cost center code for internal accounting
	CostCenter *string `json:"cost_center,omitempty"`

	// Department Department within the organization
	Department *string `json:"department,omitempty"`

	// Name Company or organization name
	Name string `json:"name"`

	// TaxId Business tax identification number
	TaxId *string `json:"tax_id,omitempty"`
}

CompanyInfo Information about a company or organization associated with the buyer

type CompleteCheckoutSessionJSONRequestBody

type CompleteCheckoutSessionJSONRequestBody = CheckoutSessionCompleteRequest

CompleteCheckoutSessionJSONRequestBody defines body for CompleteCheckoutSession for application/json ContentType.

type CompleteCheckoutSessionParams

type CompleteCheckoutSessionParams struct {
	// Authorization Bearer token for API authentication
	Authorization  Authorization   `json:"Authorization"`
	ContentType    ContentType     `json:"Content-Type"`
	AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
	UserAgent      *UserAgent      `json:"User-Agent,omitempty"`

	// IdempotencyKey Idempotency key. MUST be present on all POST requests. Opaque string, max 255 characters. UUID v4 recommended. Scoped to authenticated identity + endpoint.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
	RequestId      *RequestId     `json:"Request-Id,omitempty"`

	// Signature HMAC signature for webhook verification
	Signature *Signature `json:"Signature,omitempty"`

	// Timestamp RFC 3339 date-time string for request timing validation
	Timestamp  *Timestamp `json:"Timestamp,omitempty"`
	APIVersion APIVersion `json:"API-Version"`
}

CompleteCheckoutSessionParams defines parameters for CompleteCheckoutSession.

type ContentType

type ContentType = string

ContentType defines model for ContentType.

type Coupon

type Coupon struct {
	// AmountOff Fixed discount amount in minor currency units. Mutually exclusive with percent_off.
	AmountOff *int `json:"amount_off,omitempty"`

	// Currency ISO 4217 currency code for amount_off. Required if amount_off is set.
	Currency *string `json:"currency,omitempty"`

	// Duration How long the discount applies. 'once' = single use, 'repeating' = multiple billing periods, 'forever' = indefinitely.
	Duration *CouponDuration `json:"duration,omitempty"`

	// DurationInMonths Number of months the coupon applies if duration is 'repeating'.
	DurationInMonths *int `json:"duration_in_months,omitempty"`

	// Id Unique identifier for the coupon.
	Id string `json:"id"`

	// MaxRedemptions Maximum number of times this coupon can be redeemed across all customers.
	MaxRedemptions *int `json:"max_redemptions,omitempty"`

	// Metadata Arbitrary key-value metadata attached to the coupon.
	Metadata *map[string]string `json:"metadata,omitempty"`

	// Name Human-readable coupon name (e.g., 'Summer Sale 20% Off').
	Name string `json:"name"`

	// PercentOff Percentage discount (0-100). Mutually exclusive with amount_off.
	PercentOff *float32 `json:"percent_off,omitempty"`

	// TimesRedeemed Number of times this coupon has been redeemed.
	TimesRedeemed *int `json:"times_redeemed,omitempty"`
}

Coupon Coupon details describing the discount terms.

type CouponDuration

type CouponDuration string

CouponDuration How long the discount applies. 'once' = single use, 'repeating' = multiple billing periods, 'forever' = indefinitely.

const (
	Forever   CouponDuration = "forever"
	Once      CouponDuration = "once"
	Repeating CouponDuration = "repeating"
)

Defines values for CouponDuration.

func (CouponDuration) Valid

func (e CouponDuration) Valid() bool

Valid indicates whether the value is a known member of the CouponDuration enum.

type CreateCheckoutSessionJSONRequestBody

type CreateCheckoutSessionJSONRequestBody = CheckoutSessionCreateRequest

CreateCheckoutSessionJSONRequestBody defines body for CreateCheckoutSession for application/json ContentType.

type CreateCheckoutSessionParams

type CreateCheckoutSessionParams struct {
	// Authorization Bearer token for API authentication
	Authorization  Authorization   `json:"Authorization"`
	ContentType    ContentType     `json:"Content-Type"`
	AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
	UserAgent      *UserAgent      `json:"User-Agent,omitempty"`

	// IdempotencyKey Idempotency key. MUST be present on all POST requests. Opaque string, max 255 characters. UUID v4 recommended. Scoped to authenticated identity + endpoint.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`
	RequestId      *RequestId     `json:"Request-Id,omitempty"`

	// Signature HMAC signature for webhook verification
	Signature *Signature `json:"Signature,omitempty"`

	// Timestamp RFC 3339 date-time string for request timing validation
	Timestamp  *Timestamp `json:"Timestamp,omitempty"`
	APIVersion APIVersion `json:"API-Version"`
}

CreateCheckoutSessionParams defines parameters for CreateCheckoutSession.

type CustomAttribute

type CustomAttribute struct {
	// DisplayName Human-readable label for the attribute
	DisplayName string `json:"display_name"`

	// Value Attribute value
	Value string `json:"value"`
}

CustomAttribute Custom key-value attribute for merchant-specific metadata on line items

type DimensionsInfo

type DimensionsInfo struct {
	// Height Height dimension
	Height float32 `json:"height"`

	// Length Length dimension
	Length float32 `json:"length"`

	// Unit Unit of measurement for dimensions
	Unit DimensionsInfoUnit `json:"unit"`

	// Width Width dimension
	Width float32 `json:"width"`
}

DimensionsInfo Physical dimensions of a product with unit of measurement

type DimensionsInfoUnit

type DimensionsInfoUnit string

DimensionsInfoUnit Unit of measurement for dimensions

const (
	Cm DimensionsInfoUnit = "cm"
	In DimensionsInfoUnit = "in"
)

Defines values for DimensionsInfoUnit.

func (DimensionsInfoUnit) Valid

func (e DimensionsInfoUnit) Valid() bool

Valid indicates whether the value is a known member of the DimensionsInfoUnit enum.

type Disclosure

type Disclosure struct {
	// Content The disclosure text content. When content_type is 'markdown', this MUST be valid CommonMark with no raw HTML. Agents MUST render using a CommonMark-compliant parser with raw HTML output disabled or sanitized.
	Content string `json:"content"`

	// ContentType Format of the disclosure content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.
	ContentType DisclosureContentType `json:"content_type"`

	// Type Type of disclosure
	Type DisclosureType `json:"type"`
}

Disclosure Legal disclosure or terms that must be acknowledged by the buyer

type DisclosureContentType

type DisclosureContentType string

DisclosureContentType Format of the disclosure content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.

const (
	DisclosureContentTypeMarkdown DisclosureContentType = "markdown"
	DisclosureContentTypePlain    DisclosureContentType = "plain"
)

Defines values for DisclosureContentType.

func (DisclosureContentType) Valid

func (e DisclosureContentType) Valid() bool

Valid indicates whether the value is a known member of the DisclosureContentType enum.

type DisclosureType

type DisclosureType string

DisclosureType Type of disclosure

const (
	Disclaimer DisclosureType = "disclaimer"
)

Defines values for DisclosureType.

func (DisclosureType) Valid

func (e DisclosureType) Valid() bool

Valid indicates whether the value is a known member of the DisclosureType enum.

type DiscountAllocation

type DiscountAllocation struct {
	// Amount Amount allocated to this target in minor (cents) currency units.
	Amount int `json:"amount"`

	// Path JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping').
	Path string `json:"path"`
}

DiscountAllocation Breakdown of how a discount amount was allocated to a specific target.

type DiscountDetail

type DiscountDetail struct {
	// Amount Discount amount in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100)
	Amount int `json:"amount"`

	// Code Discount code if applicable
	Code *string `json:"code,omitempty"`

	// Description Human-readable discount description
	Description *string `json:"description,omitempty"`

	// Source Source of the discount
	Source *DiscountDetailSource `json:"source,omitempty"`

	// Type Type of discount
	Type DiscountDetailType `json:"type"`
}

DiscountDetail Information about a discount applied to the checkout or a specific item

type DiscountDetailSource

type DiscountDetailSource string

DiscountDetailSource Source of the discount

const (
	DiscountDetailSourceAutomatic DiscountDetailSource = "automatic"
	DiscountDetailSourceCoupon    DiscountDetailSource = "coupon"
	DiscountDetailSourceLoyalty   DiscountDetailSource = "loyalty"
)

Defines values for DiscountDetailSource.

func (DiscountDetailSource) Valid

func (e DiscountDetailSource) Valid() bool

Valid indicates whether the value is a known member of the DiscountDetailSource enum.

type DiscountDetailType

type DiscountDetailType string

DiscountDetailType Type of discount

const (
	Bogo       DiscountDetailType = "bogo"
	Fixed      DiscountDetailType = "fixed"
	Percentage DiscountDetailType = "percentage"
	Volume     DiscountDetailType = "volume"
)

Defines values for DiscountDetailType.

func (DiscountDetailType) Valid

func (e DiscountDetailType) Valid() bool

Valid indicates whether the value is a known member of the DiscountDetailType enum.

type DiscountErrorCode

type DiscountErrorCode string

DiscountErrorCode Error codes for rejected discount codes, used in messages[].code.

const (
	DiscountErrorCodeDiscountCodeAlreadyApplied        DiscountErrorCode = "discount_code_already_applied"
	DiscountErrorCodeDiscountCodeCombinationDisallowed DiscountErrorCode = "discount_code_combination_disallowed"
	DiscountErrorCodeDiscountCodeExpired               DiscountErrorCode = "discount_code_expired"
	DiscountErrorCodeDiscountCodeInvalid               DiscountErrorCode = "discount_code_invalid"
	DiscountErrorCodeDiscountCodeMinimumNotMet         DiscountErrorCode = "discount_code_minimum_not_met"
	DiscountErrorCodeDiscountCodeUsageLimitReached     DiscountErrorCode = "discount_code_usage_limit_reached"
	DiscountErrorCodeDiscountCodeUserIneligible        DiscountErrorCode = "discount_code_user_ineligible"
	DiscountErrorCodeDiscountCodeUserNotLoggedIn       DiscountErrorCode = "discount_code_user_not_logged_in"
)

Defines values for DiscountErrorCode.

func (DiscountErrorCode) Valid

func (e DiscountErrorCode) Valid() bool

Valid indicates whether the value is a known member of the DiscountErrorCode enum.

type DiscountsRequest

type DiscountsRequest struct {
	// Codes Discount codes to apply. Case-insensitive. Replaces previously submitted codes. Send empty array to clear.
	Codes *[]string `json:"codes,omitempty"`
}

DiscountsRequest Discount codes input for checkout create/update requests.

type DiscountsResponse

type DiscountsResponse struct {
	// Applied Discounts successfully applied (code-based and automatic).
	Applied *[]AppliedDiscount `json:"applied,omitempty"`

	// Codes Echo of submitted discount codes.
	Codes *[]string `json:"codes,omitempty"`

	// Rejected Discount codes that could not be applied, with reasons.
	Rejected *[]RejectedDiscount `json:"rejected,omitempty"`
}

DiscountsResponse Discount codes input and applied discounts output in checkout responses.

type Error

type Error = acp.Error

Error is the shared ACP protocol-level error response.

type EstimatedDelivery

type EstimatedDelivery struct {
	// Earliest RFC 3339 timestamp for earliest expected delivery
	Earliest time.Time `json:"earliest"`

	// Latest RFC 3339 timestamp for latest expected delivery
	Latest time.Time `json:"latest"`
}

EstimatedDelivery Estimated delivery date range for a fulfillment option

type ExtensionDeclaration

type ExtensionDeclaration struct {
	// Extends JSONPath expressions identifying the schema fields added by this extension.
	// Format: $.<SchemaName>.<fieldName> (e.g., $.CheckoutSession.discounts).
	Extends *[]string `json:"extends,omitempty"`

	// Name Unique identifier for the extension.
	Name string `json:"name"`

	// Schema URL to the extension's JSON Schema definition.
	Schema *string `json:"schema,omitempty"`

	// Spec URL to the extension's specification document.
	Spec *string `json:"spec,omitempty"`
}

ExtensionDeclaration Extension declaration in capabilities.extensions (response). Describes an active extension and which schema fields it adds.

type Fulfillment

type Fulfillment struct {
	// Carrier Carrier name (e.g., 'FedEx', 'UPS', 'USPS'). Applies to type: shipping.
	Carrier *string `json:"carrier,omitempty"`

	// Description Human-readable description (e.g., 'Backordered - ships Feb 15')
	Description *string `json:"description,omitempty"`

	// Destination Physical address for shipping, billing, or pickup locations
	Destination *Address `json:"destination,omitempty"`

	// DigitalDelivery Digital delivery details. Applies to type: digital.
	DigitalDelivery *struct {
		// AccessUrl URL to access digital content (download link, streaming page, etc.)
		AccessUrl *string `json:"access_url,omitempty"`

		// ExpiresAt When access expires (RFC 3339 timestamp)
		ExpiresAt *time.Time `json:"expires_at,omitempty"`

		// LicenseKey License or activation key
		LicenseKey *string `json:"license_key,omitempty"`
	} `json:"digital_delivery,omitempty"`

	// EstimatedDelivery Estimated delivery date range for a fulfillment option
	EstimatedDelivery *EstimatedDelivery `json:"estimated_delivery,omitempty"`

	// Events Append-only event log tracking fulfillment progress
	Events *[]FulfillmentEvent `json:"events,omitempty"`

	// Id Fulfillment identifier
	Id string `json:"id"`

	// LineItems Which line items and quantities are in this fulfillment
	LineItems *[]LineItemReference `json:"line_items,omitempty"`

	// Status Current fulfillment status. Implementations MUST accept unrecognized values gracefully. Defined values: 'pending', 'processing', 'shipped', 'in_transit', 'out_for_delivery', 'ready_for_pickup', 'delivered', 'failed', 'canceled'. Not all statuses apply to all types:
	// - shipping: pending, processing, shipped, in_transit, out_for_delivery, delivered, failed, canceled
	// - pickup: pending, processing, ready_for_pickup, delivered, failed, canceled
	// - digital: pending, processing, delivered, failed, canceled
	Status *string `json:"status,omitempty"`

	// TrackingNumber Carrier tracking number. Applies to type: shipping.
	TrackingNumber *string `json:"tracking_number,omitempty"`

	// TrackingUrl URL to track this shipment. Applies to type: shipping.
	TrackingUrl *string `json:"tracking_url,omitempty"`

	// Type Fulfillment method type
	Type FulfillmentType `json:"type"`
}

Fulfillment A fulfillment represents how items are delivered to the buyer (shipping, pickup, digital).

type FulfillmentDetails

type FulfillmentDetails struct {
	// Address Physical address for shipping, billing, or pickup locations
	Address *Address `json:"address,omitempty"`

	// Email Contact email address
	Email *openapi_types.Email `json:"email,omitempty"`

	// Name Full name for fulfillment contact
	Name *string `json:"name,omitempty"`

	// PhoneNumber Contact phone number
	PhoneNumber *string `json:"phone_number,omitempty"`
}

FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)

type FulfillmentEvent

type FulfillmentEvent struct {
	// Description Human-readable description (e.g., 'Left at front door')
	Description *string `json:"description,omitempty"`

	// Id Event identifier
	Id string `json:"id"`

	// Location Location where this event occurred (e.g., 'Memphis, TN')
	Location *string `json:"location,omitempty"`

	// OccurredAt RFC 3339 timestamp when this event occurred
	OccurredAt time.Time `json:"occurred_at"`

	// Type Event type. Implementations MUST accept unrecognized values gracefully. Defined values: 'processing', 'shipped', 'in_transit', 'out_for_delivery', 'ready_for_pickup', 'delivered', 'failed_attempt', 'returned_to_sender', 'canceled', 'undeliverable'. 'out_for_delivery' and 'ready_for_pickup' are ACP extensions for richer agent experiences.
	Type string `json:"type"`
}

FulfillmentEvent A point-in-time event in the fulfillment lifecycle.

type FulfillmentGroup

type FulfillmentGroup struct {
	// DestinationType Type of fulfillment for this group
	DestinationType FulfillmentGroupDestinationType `json:"destination_type"`

	// FulfillmentDetails Details about how items will be fulfilled (shipping, pickup, or delivery information)
	FulfillmentDetails *FulfillmentDetails `json:"fulfillment_details,omitempty"`

	// Id Unique identifier for this fulfillment group
	Id string `json:"id"`

	// Instructions Special fulfillment instructions
	Instructions *string `json:"instructions,omitempty"`

	// ItemIds List of line item IDs in this fulfillment group
	ItemIds []string `json:"item_ids"`

	// LocationId Location identifier for pickup or local delivery
	LocationId *string `json:"location_id,omitempty"`
}

FulfillmentGroup Group of line items that share the same fulfillment method and destination

type FulfillmentGroupDestinationType

type FulfillmentGroupDestinationType string

FulfillmentGroupDestinationType Type of fulfillment for this group

const (
	FulfillmentGroupDestinationTypeDigital       FulfillmentGroupDestinationType = "digital"
	FulfillmentGroupDestinationTypeLocalDelivery FulfillmentGroupDestinationType = "local_delivery"
	FulfillmentGroupDestinationTypePickup        FulfillmentGroupDestinationType = "pickup"
	FulfillmentGroupDestinationTypeShipping      FulfillmentGroupDestinationType = "shipping"
)

Defines values for FulfillmentGroupDestinationType.

func (FulfillmentGroupDestinationType) Valid

Valid indicates whether the value is a known member of the FulfillmentGroupDestinationType enum.

type FulfillmentOptionDigital

type FulfillmentOptionDigital struct {
	// Description Additional details about digital delivery method
	Description *string `json:"description,omitempty"`

	// Id Unique identifier for this fulfillment option
	Id string `json:"id"`

	// Title Display title for this digital delivery option
	Title string `json:"title"`

	// Totals Cost breakdown for this fulfillment option
	Totals []Total `json:"totals"`

	// Type Fulfillment type discriminator
	Type FulfillmentOptionDigitalType `json:"type"`
}

FulfillmentOptionDigital Digital delivery fulfillment option for downloadable or streaming content

type FulfillmentOptionDigitalType

type FulfillmentOptionDigitalType string

FulfillmentOptionDigitalType Fulfillment type discriminator

const (
	FulfillmentOptionDigitalTypeDigital FulfillmentOptionDigitalType = "digital"
)

Defines values for FulfillmentOptionDigitalType.

func (FulfillmentOptionDigitalType) Valid

Valid indicates whether the value is a known member of the FulfillmentOptionDigitalType enum.

type FulfillmentOptionLocalDelivery

type FulfillmentOptionLocalDelivery struct {
	// DeliveryWindow Expected delivery time window
	DeliveryWindow *struct {
		// End RFC 3339 timestamp for delivery window end
		End time.Time `json:"end"`

		// Start RFC 3339 timestamp for delivery window start
		Start time.Time `json:"start"`
	} `json:"delivery_window,omitempty"`

	// Description Additional details about this delivery option
	Description *string `json:"description,omitempty"`

	// Id Unique identifier for this fulfillment option
	Id string `json:"id"`

	// ServiceArea Geographic service area for local delivery
	ServiceArea *struct {
		// CenterPostalCode Center point postal code for delivery radius
		CenterPostalCode *string `json:"center_postal_code,omitempty"`

		// RadiusMiles Delivery radius in miles
		RadiusMiles *float32 `json:"radius_miles,omitempty"`
	} `json:"service_area,omitempty"`

	// Title Display title for this local delivery option
	Title string `json:"title"`

	// Totals Cost breakdown for this fulfillment option
	Totals []Total `json:"totals"`

	// Type Fulfillment type discriminator
	Type FulfillmentOptionLocalDeliveryType `json:"type"`
}

FulfillmentOptionLocalDelivery Local delivery fulfillment option with delivery address and scheduling details

type FulfillmentOptionLocalDeliveryType

type FulfillmentOptionLocalDeliveryType string

FulfillmentOptionLocalDeliveryType Fulfillment type discriminator

const (
	FulfillmentOptionLocalDeliveryTypeLocalDelivery FulfillmentOptionLocalDeliveryType = "local_delivery"
)

Defines values for FulfillmentOptionLocalDeliveryType.

func (FulfillmentOptionLocalDeliveryType) Valid

Valid indicates whether the value is a known member of the FulfillmentOptionLocalDeliveryType enum.

type FulfillmentOptionPickup

type FulfillmentOptionPickup struct {
	// Description Additional details about this pickup option
	Description *string `json:"description,omitempty"`

	// Id Unique identifier for this fulfillment option
	Id string `json:"id"`

	// Location Pickup location details
	Location struct {
		// Address Physical address for shipping, billing, or pickup locations
		Address Address `json:"address"`

		// Instructions Special pickup instructions
		Instructions *string `json:"instructions,omitempty"`

		// Name Location name
		Name string `json:"name"`

		// Phone Location phone number
		Phone *string `json:"phone,omitempty"`
	} `json:"location"`

	// PickupBy RFC 3339 timestamp by which order must be picked up
	PickupBy *time.Time `json:"pickup_by,omitempty"`

	// PickupType Type of pickup method
	PickupType *FulfillmentOptionPickupPickupType `json:"pickup_type,omitempty"`

	// ReadyBy RFC 3339 timestamp when order will be ready for pickup
	ReadyBy *time.Time `json:"ready_by,omitempty"`

	// Title Display title for this pickup option
	Title string `json:"title"`

	// Totals Cost breakdown for this fulfillment option
	Totals []Total `json:"totals"`

	// Type Fulfillment type discriminator
	Type FulfillmentOptionPickupType `json:"type"`
}

FulfillmentOptionPickup In-store or curbside pickup fulfillment option with pickup location details

type FulfillmentOptionPickupPickupType

type FulfillmentOptionPickupPickupType string

FulfillmentOptionPickupPickupType Type of pickup method

const (
	Curbside FulfillmentOptionPickupPickupType = "curbside"
	InStore  FulfillmentOptionPickupPickupType = "in_store"
	Locker   FulfillmentOptionPickupPickupType = "locker"
)

Defines values for FulfillmentOptionPickupPickupType.

func (FulfillmentOptionPickupPickupType) Valid

Valid indicates whether the value is a known member of the FulfillmentOptionPickupPickupType enum.

type FulfillmentOptionPickupType

type FulfillmentOptionPickupType string

FulfillmentOptionPickupType Fulfillment type discriminator

const (
	FulfillmentOptionPickupTypePickup FulfillmentOptionPickupType = "pickup"
)

Defines values for FulfillmentOptionPickupType.

func (FulfillmentOptionPickupType) Valid

Valid indicates whether the value is a known member of the FulfillmentOptionPickupType enum.

type FulfillmentOptionShipping

type FulfillmentOptionShipping struct {
	// Carrier Shipping carrier name (e.g., 'USPS', 'FedEx')
	Carrier *string `json:"carrier,omitempty"`

	// Description Additional details about this shipping option
	Description *string `json:"description,omitempty"`

	// EarliestDeliveryTime RFC 3339 timestamp for earliest expected delivery
	EarliestDeliveryTime *time.Time `json:"earliest_delivery_time,omitempty"`

	// Id Unique identifier for this fulfillment option
	Id string `json:"id"`

	// LatestDeliveryTime RFC 3339 timestamp for latest expected delivery
	LatestDeliveryTime *time.Time `json:"latest_delivery_time,omitempty"`

	// Title Display title for this shipping option (e.g., 'Standard Shipping', 'Express')
	Title string `json:"title"`

	// Totals Cost breakdown for this fulfillment option
	Totals []Total `json:"totals"`

	// Type Fulfillment type discriminator
	Type FulfillmentOptionShippingType `json:"type"`
}

FulfillmentOptionShipping Shipping fulfillment option with carrier, service level, and delivery estimates

type FulfillmentOptionShippingType

type FulfillmentOptionShippingType string

FulfillmentOptionShippingType Fulfillment type discriminator

const (
	FulfillmentOptionShippingTypeShipping FulfillmentOptionShippingType = "shipping"
)

Defines values for FulfillmentOptionShippingType.

func (FulfillmentOptionShippingType) Valid

Valid indicates whether the value is a known member of the FulfillmentOptionShippingType enum.

type FulfillmentType

type FulfillmentType string

FulfillmentType Fulfillment method type

const (
	FulfillmentTypeDigital  FulfillmentType = "digital"
	FulfillmentTypePickup   FulfillmentType = "pickup"
	FulfillmentTypeShipping FulfillmentType = "shipping"
)

Defines values for FulfillmentType.

func (FulfillmentType) Valid

func (e FulfillmentType) Valid() bool

Valid indicates whether the value is a known member of the FulfillmentType enum.

type GetCheckoutSessionParams

type GetCheckoutSessionParams struct {
	// Authorization Bearer token for API authentication
	Authorization  Authorization   `json:"Authorization"`
	AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
	UserAgent      *UserAgent      `json:"User-Agent,omitempty"`
	RequestId      *RequestId      `json:"Request-Id,omitempty"`

	// Signature HMAC signature for webhook verification
	Signature *Signature `json:"Signature,omitempty"`

	// Timestamp RFC 3339 date-time string for request timing validation
	Timestamp  *Timestamp `json:"Timestamp,omitempty"`
	APIVersion APIVersion `json:"API-Version"`
}

GetCheckoutSessionParams defines parameters for GetCheckoutSession.

type GiftWrap

type GiftWrap struct {
	// Charge Additional charge for gift wrapping in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100)
	Charge *int `json:"charge,omitempty"`

	// Enabled Whether gift wrapping is enabled for this order
	Enabled bool `json:"enabled"`

	// Style Gift wrap style selected
	Style *GiftWrapStyle `json:"style,omitempty"`
}

GiftWrap Gift wrapping option with associated cost and customization details

type GiftWrapStyle

type GiftWrapStyle string

GiftWrapStyle Gift wrap style selected

const (
	Birthday GiftWrapStyle = "birthday"
	Elegant  GiftWrapStyle = "elegant"
	Holiday  GiftWrapStyle = "holiday"
)

Defines values for GiftWrapStyle.

func (GiftWrapStyle) Valid

func (e GiftWrapStyle) Valid() bool

Valid indicates whether the value is a known member of the GiftWrapStyle enum.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler wires ACP checkout routes to a Provider.

func NewHandler

func NewHandler(service Provider, authorizer acpauth.Authorizer, opts ...Option) *Handler

NewHandler returns a Handler that serves the ACP checkout API.

Example
package main

import (
	"context"
	"errors"
	"fmt"

	"github.com/sumup/acp/acpauth"
	"github.com/sumup/acp/acpcheckout"
)

type checkoutProvider struct{}

func (checkoutProvider) CreateSession(context.Context, acpcheckout.CheckoutSessionCreateRequest) (*acpcheckout.CheckoutSessionBase, error) {
	return nil, errors.ErrUnsupported
}

func (checkoutProvider) UpdateSession(context.Context, string, acpcheckout.CheckoutSessionUpdateRequest) (*acpcheckout.CheckoutSessionBase, error) {
	return nil, errors.ErrUnsupported
}

func (checkoutProvider) GetSession(context.Context, string) (*acpcheckout.CheckoutSessionBase, error) {
	return nil, errors.ErrUnsupported
}

func (checkoutProvider) CompleteSession(context.Context, string, acpcheckout.CheckoutSessionCompleteRequest) (acpcheckout.CheckoutSessionWithOrder, error) {
	return acpcheckout.CheckoutSessionWithOrder{}, errors.ErrUnsupported
}

func (checkoutProvider) CancelSession(context.Context, string, *acpcheckout.CancelSessionRequest) (*acpcheckout.CheckoutSessionBase, error) {
	return nil, errors.ErrUnsupported
}

func main() {
	handler := acpcheckout.NewHandler(
		checkoutProvider{},
		acpauth.StaticTokenAuthorizer("api_key_123"),
	)

	fmt.Printf("%T\n", handler)
}
Output:
*acpcheckout.Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP dispatches checkout requests to the configured ACP routes.

type IdempotencyConflict

type IdempotencyConflict = Error

IdempotencyConflict Protocol-level error returned in 4xx/5xx responses when the server cannot return a valid CheckoutSession at all (e.g. malformed request or unexpected failure). Use Error—not MessageError—when there is no valid session state to return. type semantics: invalid_request — malformed request, missing required fields, invalid JSON, or idempotency violations (codes: idempotency_key_required, idempotency_in_flight, idempotency_conflict); processing_error — unexpected server-side failure; service_unavailable — temporary unavailability.

type IdempotencyInFlight

type IdempotencyInFlight = Error

IdempotencyInFlight Protocol-level error returned in 4xx/5xx responses when the server cannot return a valid CheckoutSession at all (e.g. malformed request or unexpected failure). Use Error—not MessageError—when there is no valid session state to return. type semantics: invalid_request — malformed request, missing required fields, invalid JSON, or idempotency violations (codes: idempotency_key_required, idempotency_in_flight, idempotency_conflict); processing_error — unexpected server-side failure; service_unavailable — temporary unavailability.

type IdempotencyKey

type IdempotencyKey = string

IdempotencyKey defines model for IdempotencyKey.

type IdempotencyKeyRequired

type IdempotencyKeyRequired = Error

IdempotencyKeyRequired Protocol-level error returned in 4xx/5xx responses when the server cannot return a valid CheckoutSession at all (e.g. malformed request or unexpected failure). Use Error—not MessageError—when there is no valid session state to return. type semantics: invalid_request — malformed request, missing required fields, invalid JSON, or idempotency violations (codes: idempotency_key_required, idempotency_in_flight, idempotency_conflict); processing_error — unexpected server-side failure; service_unavailable — temporary unavailability.

type IntentTrace

type IntentTrace struct {
	// Metadata Additional structured metadata about the intent
	Metadata *map[string]interface{} `json:"metadata,omitempty"`

	// ReasonCode Reason for abandonment. This enum is extensible: servers SHOULD accept
	// unrecognized values and treat them as "other" (see RFC Section 7.2).
	// Validators SHOULD be configured for lenient enum handling.
	ReasonCode IntentTraceReasonCode `json:"reason_code"`

	// TraceSummary A generated summary of the specific objection or negotiation gap.
	TraceSummary *string `json:"trace_summary,omitempty"`
}

IntentTrace Structured reason for why a buyer action was taken, used for analytics and debugging

type IntentTraceReasonCode

type IntentTraceReasonCode string

IntentTraceReasonCode Reason for abandonment. This enum is extensible: servers SHOULD accept unrecognized values and treat them as "other" (see RFC Section 7.2). Validators SHOULD be configured for lenient enum handling.

const (
	Comparison       IntentTraceReasonCode = "comparison"
	Other            IntentTraceReasonCode = "other"
	PaymentOptions   IntentTraceReasonCode = "payment_options"
	PriceSensitivity IntentTraceReasonCode = "price_sensitivity"
	ProductFit       IntentTraceReasonCode = "product_fit"
	ReturnsPolicy    IntentTraceReasonCode = "returns_policy"
	ShippingCost     IntentTraceReasonCode = "shipping_cost"
	ShippingSpeed    IntentTraceReasonCode = "shipping_speed"
	TimingDeferred   IntentTraceReasonCode = "timing_deferred"
	TrustSecurity    IntentTraceReasonCode = "trust_security"
)

Defines values for IntentTraceReasonCode.

func (IntentTraceReasonCode) Valid

func (e IntentTraceReasonCode) Valid() bool

Valid indicates whether the value is a known member of the IntentTraceReasonCode enum.

type InterventionCapabilities

type InterventionCapabilities struct {
	// DisplayContext How the Agent presents interventions (agent only).
	DisplayContext *InterventionCapabilitiesDisplayContext `json:"display_context,omitempty"`

	// Enforcement When required interventions are enforced (seller only).
	Enforcement *InterventionCapabilitiesEnforcement `json:"enforcement,omitempty"`

	// MaxInteractionDepth Maximum depth of nested interactions the Agent can handle (agent only).
	MaxInteractionDepth *int `json:"max_interaction_depth,omitempty"`

	// MaxRedirects Maximum number of redirects the Agent can handle (agent only).
	MaxRedirects *int `json:"max_redirects,omitempty"`

	// RedirectContext How the Agent handles redirects (agent only).
	RedirectContext *InterventionCapabilitiesRedirectContext `json:"redirect_context,omitempty"`

	// Required Intervention methods required for this session (seller only).
	Required *[]InterventionCapabilitiesRequired `json:"required,omitempty"`

	// Supported Intervention types supported.
	// - Agent request: Interventions the agent can handle
	// - Seller response: Intersection of supported interventions
	Supported *[]InterventionCapabilitiesSupported `json:"supported,omitempty"`
}

InterventionCapabilities Intervention capabilities. Context-specific fields: display_context, redirect_context, max_redirects, max_interaction_depth (requests only). required, enforcement (responses only). supported field contains intersection in responses.

type InterventionCapabilitiesDisplayContext

type InterventionCapabilitiesDisplayContext string

InterventionCapabilitiesDisplayContext How the Agent presents interventions (agent only).

Defines values for InterventionCapabilitiesDisplayContext.

func (InterventionCapabilitiesDisplayContext) Valid

Valid indicates whether the value is a known member of the InterventionCapabilitiesDisplayContext enum.

type InterventionCapabilitiesEnforcement

type InterventionCapabilitiesEnforcement string

InterventionCapabilitiesEnforcement When required interventions are enforced (seller only).

const (
	Always      InterventionCapabilitiesEnforcement = "always"
	Conditional InterventionCapabilitiesEnforcement = "conditional"
	Optional    InterventionCapabilitiesEnforcement = "optional"
)

Defines values for InterventionCapabilitiesEnforcement.

func (InterventionCapabilitiesEnforcement) Valid

Valid indicates whether the value is a known member of the InterventionCapabilitiesEnforcement enum.

type InterventionCapabilitiesRedirectContext

type InterventionCapabilitiesRedirectContext string

InterventionCapabilitiesRedirectContext How the Agent handles redirects (agent only).

const (
	ExternalBrowser InterventionCapabilitiesRedirectContext = "external_browser"
	InApp           InterventionCapabilitiesRedirectContext = "in_app"
	None            InterventionCapabilitiesRedirectContext = "none"
)

Defines values for InterventionCapabilitiesRedirectContext.

func (InterventionCapabilitiesRedirectContext) Valid

Valid indicates whether the value is a known member of the InterventionCapabilitiesRedirectContext enum.

type InterventionCapabilitiesRequired

type InterventionCapabilitiesRequired string

InterventionCapabilitiesRequired defines model for InterventionCapabilities.Required.

const (
	InterventionCapabilitiesRequiredBiometric InterventionCapabilitiesRequired = "biometric"
	InterventionCapabilitiesRequiredN3ds      InterventionCapabilitiesRequired = "3ds"
)

Defines values for InterventionCapabilitiesRequired.

func (InterventionCapabilitiesRequired) Valid

Valid indicates whether the value is a known member of the InterventionCapabilitiesRequired enum.

type InterventionCapabilitiesSupported

type InterventionCapabilitiesSupported string

InterventionCapabilitiesSupported defines model for InterventionCapabilities.Supported.

const (
	InterventionCapabilitiesSupportedAddressVerification InterventionCapabilitiesSupported = "address_verification"
	InterventionCapabilitiesSupportedBiometric           InterventionCapabilitiesSupported = "biometric"
	InterventionCapabilitiesSupportedN3ds                InterventionCapabilitiesSupported = "3ds"
)

Defines values for InterventionCapabilitiesSupported.

func (InterventionCapabilitiesSupported) Valid

Valid indicates whether the value is a known member of the InterventionCapabilitiesSupported enum.

type Item

type Item struct {
	// Id Unique identifier for the item
	Id string `json:"id"`

	// Name Display name of the item
	Name *string `json:"name,omitempty"`

	// UnitAmount Price per unit in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100)
	UnitAmount *int `json:"unit_amount,omitempty"`
}

Item A purchasable item with variant options (e.g., size, color) and quantity

type LineItem

type LineItem struct {
	// AvailabilityStatus Current availability status of the item
	AvailabilityStatus *LineItemAvailabilityStatus `json:"availability_status,omitempty"`

	// AvailableQuantity Quantity currently available for purchase
	AvailableQuantity *int `json:"available_quantity,omitempty"`

	// Category Product category
	Category *string `json:"category,omitempty"`

	// CustomAttributes Custom attributes specific to this line item
	CustomAttributes *[]CustomAttribute `json:"custom_attributes,omitempty"`

	// Description Detailed description of the line item
	Description *string `json:"description,omitempty"`

	// Dimensions Physical dimensions of a product with unit of measurement
	Dimensions *DimensionsInfo `json:"dimensions,omitempty"`

	// Disclosures Legal disclosures or disclaimers for this item
	Disclosures *[]Disclosure `json:"disclosures,omitempty"`

	// DiscountDetails Line-item level discount details
	DiscountDetails *[]DiscountDetail `json:"discount_details,omitempty"`

	// FulfillableOn RFC 3339 timestamp when item becomes available for fulfillment
	FulfillableOn *time.Time `json:"fulfillable_on,omitempty"`

	// Id Unique identifier for the line item
	Id string `json:"id"`

	// Images Array of image URLs for this line item
	Images *[]string `json:"images,omitempty"`

	// Item A purchasable item with variant options (e.g., size, color) and quantity
	Item Item `json:"item"`

	// MarketplaceSellerDetails Information about a third-party seller in a marketplace model
	MarketplaceSellerDetails *MarketplaceSellerDetails `json:"marketplace_seller_details,omitempty"`

	// MaxQuantityPerOrder Maximum quantity allowed per order
	MaxQuantityPerOrder *int `json:"max_quantity_per_order,omitempty"`

	// Name Display name of the line item
	Name *string `json:"name,omitempty"`

	// ParentId Reference to parent line item for bundled products
	ParentId *string `json:"parent_id,omitempty"`

	// ProductId Merchant's product identifier
	ProductId *string `json:"product_id,omitempty"`

	// Quantity Number of units for this line item
	Quantity int `json:"quantity"`

	// Sku Stock keeping unit identifier
	Sku *string `json:"sku,omitempty"`

	// Tags Product tags or labels
	Tags *[]string `json:"tags,omitempty"`

	// TaxExempt Whether this line item is tax exempt
	TaxExempt *bool `json:"tax_exempt,omitempty"`

	// TaxExemptionReason Reason for tax exemption if applicable
	TaxExemptionReason *string `json:"tax_exemption_reason,omitempty"`

	// Totals Line-item level totals breakdown including base_amount, discount, subtotal, tax, and total
	Totals []Total `json:"totals"`

	// UnitAmount The unit price of the line item in the smallest currency unit (e.g., cents for USD)
	UnitAmount *int `json:"unit_amount,omitempty"`

	// VariantId Product variant identifier
	VariantId *string `json:"variant_id,omitempty"`

	// VariantOptions Selected product variant options (e.g., size, color)
	VariantOptions *[]VariantOption `json:"variant_options,omitempty"`

	// Weight Product weight with unit of measurement
	Weight *WeightInfo `json:"weight,omitempty"`
}

LineItem A line item in the checkout representing a product with pricing, discounts, and fulfillment details

type LineItemAvailabilityStatus

type LineItemAvailabilityStatus string

LineItemAvailabilityStatus Current availability status of the item

const (
	LineItemAvailabilityStatusBackorder  LineItemAvailabilityStatus = "backorder"
	LineItemAvailabilityStatusInStock    LineItemAvailabilityStatus = "in_stock"
	LineItemAvailabilityStatusLowStock   LineItemAvailabilityStatus = "low_stock"
	LineItemAvailabilityStatusOutOfStock LineItemAvailabilityStatus = "out_of_stock"
	LineItemAvailabilityStatusPreOrder   LineItemAvailabilityStatus = "pre_order"
)

Defines values for LineItemAvailabilityStatus.

func (LineItemAvailabilityStatus) Valid

func (e LineItemAvailabilityStatus) Valid() bool

Valid indicates whether the value is a known member of the LineItemAvailabilityStatus enum.

type LineItemReference

type LineItemReference struct {
	// Id Line item ID reference
	Id string `json:"id"`

	// Quantity Quantity in this fulfillment or adjustment
	Quantity int `json:"quantity"`
}

LineItemReference Reference to a line item with quantity, used in fulfillments and adjustments

type Link struct {
	// Title Display text for the link
	Title *string `json:"title,omitempty"`

	// Type Type of link
	Type LinkType `json:"type"`

	// Url URL destination
	Url string `json:"url"`
}

Link Hyperlink with URL, display text, and optional action semantics

type LinkType

type LinkType string

LinkType Type of link

const (
	AboutUs        LinkType = "about_us"
	ContactUs      LinkType = "contact_us"
	Faq            LinkType = "faq"
	PrivacyPolicy  LinkType = "privacy_policy"
	ReturnPolicy   LinkType = "return_policy"
	ShippingPolicy LinkType = "shipping_policy"
	Support        LinkType = "support"
	TermsOfUse     LinkType = "terms_of_use"
)

Defines values for LinkType.

func (LinkType) Valid

func (e LinkType) Valid() bool

Valid indicates whether the value is a known member of the LinkType enum.

type LoyaltyInfo

type LoyaltyInfo struct {
	// MemberSince RFC 3339 timestamp when the customer joined the loyalty program
	MemberSince *time.Time `json:"member_since,omitempty"`

	// PointsBalance Current loyalty points balance
	PointsBalance *int `json:"points_balance,omitempty"`

	// Tier Loyalty program tier level
	Tier *string `json:"tier,omitempty"`
}

LoyaltyInfo Loyalty program information including membership details and rewards balance

type MarketingConsent

type MarketingConsent struct {
	// Channel Channel matching the consent option channel.
	//
	// Examples: email, sms, whatsapp
	Channel string `json:"channel"`

	// OptedIn Whether the buyer consented to receive marketing via this channel.
	OptedIn bool `json:"opted_in"`
}

MarketingConsent Buyer's marketing consent decision for a specific channel submitted at checkout completion

type MarketingConsentOption

type MarketingConsentOption struct {
	// Channel Channel for marketing consent.
	//
	// Examples: email, sms, whatsapp
	Channel string `json:"channel"`

	// DisplayText What the buyer is consenting to receive, e.g., 'promotional emails, product launches, and exclusive offers'. Agents MAY use this to compose their own consent prompt.
	DisplayText string `json:"display_text"`

	// IsSubscribed Whether the buyer is currently subscribed to marketing via this channel. When true, agents SHOULD render the consent checkbox as pre-checked. Defaults to false if omitted.
	IsSubscribed *bool `json:"is_subscribed,omitempty"`

	// PrivacyPolicyUrl URL to the seller's privacy policy governing use of the buyer's contact information for marketing.
	PrivacyPolicyUrl string `json:"privacy_policy_url"`
}

MarketingConsentOption Seller-declared marketing consent option that specifies an available channel for which the seller must obtain the buyer's consent before sending marketing content

type MarketplaceSellerDetails

type MarketplaceSellerDetails struct {
	// Name Name of the marketplace seller or vendor
	Name string `json:"name"`
}

MarketplaceSellerDetails Information about a third-party seller in a marketplace model

type MessageError

type MessageError struct {
	// Code Error code indicating the type of error
	Code MessageErrorCode `json:"code"`

	// Content Error message text. When content_type is 'markdown', this MUST be valid CommonMark with no raw HTML. Agents MUST render using a CommonMark-compliant parser with raw HTML output disabled or sanitized.
	Content string `json:"content"`

	// ContentType Format of the error message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.
	ContentType MessageErrorContentType `json:"content_type"`

	// Param RFC 9535 JSONPath
	Param *string `json:"param,omitempty"`

	// Resolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.
	Resolution *MessageErrorResolution `json:"resolution,omitempty"`

	// Severity Severity level of this error
	Severity *MessageErrorSeverity `json:"severity,omitempty"`

	// Type Message type discriminator
	Type MessageErrorType `json:"type"`
}

MessageError Business-logic error within a valid CheckoutSession response. Used in messages[] on 2xx responses when the session is valid but has actionable issues (e.g. status "not_ready_for_payment"). The agent can respond by asking the buyer for corrections or trying alternatives. Use MessageError—not Error—when you can return a valid CheckoutSession and the problem is conversational (e.g. invalid email → code "invalid" and param "$.buyer.email"; out of stock → code "out_of_stock" and param "$.items[0]").

type MessageErrorCode

type MessageErrorCode string

MessageErrorCode Error code indicating the type of error

const (
	MessageErrorCodeAgeVerificationRequired MessageErrorCode = "age_verification_required"
	MessageErrorCodeApprovalRequired        MessageErrorCode = "approval_required"
	MessageErrorCodeConflict                MessageErrorCode = "conflict"
	MessageErrorCodeCouponExpired           MessageErrorCode = "coupon_expired"
	MessageErrorCodeCouponInvalid           MessageErrorCode = "coupon_invalid"
	MessageErrorCodeExpired                 MessageErrorCode = "expired"
	MessageErrorCodeInterventionRequired    MessageErrorCode = "intervention_required"
	MessageErrorCodeInvalid                 MessageErrorCode = "invalid"
	MessageErrorCodeLowStock                MessageErrorCode = "low_stock"
	MessageErrorCodeMaximumExceeded         MessageErrorCode = "maximum_exceeded"
	MessageErrorCodeMinimumNotMet           MessageErrorCode = "minimum_not_met"
	MessageErrorCodeMissing                 MessageErrorCode = "missing"
	MessageErrorCodeNotFound                MessageErrorCode = "not_found"
	MessageErrorCodeOutOfStock              MessageErrorCode = "out_of_stock"
	MessageErrorCodePaymentDeclined         MessageErrorCode = "payment_declined"
	MessageErrorCodeQuantityExceeded        MessageErrorCode = "quantity_exceeded"
	MessageErrorCodeRateLimited             MessageErrorCode = "rate_limited"
	MessageErrorCodeRegionRestricted        MessageErrorCode = "region_restricted"
	MessageErrorCodeRequires3ds             MessageErrorCode = "requires_3ds"
	MessageErrorCodeRequiresSignIn          MessageErrorCode = "requires_sign_in"
	MessageErrorCodeUnsupported             MessageErrorCode = "unsupported"
)

Defines values for MessageErrorCode.

func (MessageErrorCode) Valid

func (e MessageErrorCode) Valid() bool

Valid indicates whether the value is a known member of the MessageErrorCode enum.

type MessageErrorContentType

type MessageErrorContentType string

MessageErrorContentType Format of the error message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.

const (
	MessageErrorContentTypeMarkdown MessageErrorContentType = "markdown"
	MessageErrorContentTypePlain    MessageErrorContentType = "plain"
)

Defines values for MessageErrorContentType.

func (MessageErrorContentType) Valid

func (e MessageErrorContentType) Valid() bool

Valid indicates whether the value is a known member of the MessageErrorContentType enum.

type MessageErrorResolution

type MessageErrorResolution string

MessageErrorResolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.

const (
	MessageErrorResolutionRecoverable         MessageErrorResolution = "recoverable"
	MessageErrorResolutionRequiresBuyerInput  MessageErrorResolution = "requires_buyer_input"
	MessageErrorResolutionRequiresBuyerReview MessageErrorResolution = "requires_buyer_review"
)

Defines values for MessageErrorResolution.

func (MessageErrorResolution) Valid

func (e MessageErrorResolution) Valid() bool

Valid indicates whether the value is a known member of the MessageErrorResolution enum.

type MessageErrorSeverity

type MessageErrorSeverity string

MessageErrorSeverity Severity level of this error

const (
	MessageErrorSeverityCritical MessageErrorSeverity = "critical"
	MessageErrorSeverityHigh     MessageErrorSeverity = "high"
	MessageErrorSeverityInfo     MessageErrorSeverity = "info"
	MessageErrorSeverityLow      MessageErrorSeverity = "low"
	MessageErrorSeverityMedium   MessageErrorSeverity = "medium"
)

Defines values for MessageErrorSeverity.

func (MessageErrorSeverity) Valid

func (e MessageErrorSeverity) Valid() bool

Valid indicates whether the value is a known member of the MessageErrorSeverity enum.

type MessageErrorType

type MessageErrorType string

MessageErrorType Message type discriminator

const (
	MessageErrorTypeError MessageErrorType = "error"
)

Defines values for MessageErrorType.

func (MessageErrorType) Valid

func (e MessageErrorType) Valid() bool

Valid indicates whether the value is a known member of the MessageErrorType enum.

type MessageInfo

type MessageInfo struct {
	// Content Informational message text. When content_type is 'markdown', this MUST be valid CommonMark with no raw HTML. Agents MUST render using a CommonMark-compliant parser with raw HTML output disabled or sanitized.
	Content string `json:"content"`

	// ContentType Format of the message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.
	ContentType MessageInfoContentType `json:"content_type"`

	// Param RFC 9535 JSONPath
	Param *string `json:"param,omitempty"`

	// Resolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.
	Resolution *MessageInfoResolution `json:"resolution,omitempty"`

	// Severity Severity level of this informational message
	Severity *MessageInfoSeverity `json:"severity,omitempty"`

	// Type Message type discriminator
	Type MessageInfoType `json:"type"`
}

MessageInfo Informational message to display to the buyer during checkout

type MessageInfoContentType

type MessageInfoContentType string

MessageInfoContentType Format of the message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.

const (
	MessageInfoContentTypeMarkdown MessageInfoContentType = "markdown"
	MessageInfoContentTypePlain    MessageInfoContentType = "plain"
)

Defines values for MessageInfoContentType.

func (MessageInfoContentType) Valid

func (e MessageInfoContentType) Valid() bool

Valid indicates whether the value is a known member of the MessageInfoContentType enum.

type MessageInfoResolution

type MessageInfoResolution string

MessageInfoResolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.

const (
	MessageInfoResolutionRecoverable         MessageInfoResolution = "recoverable"
	MessageInfoResolutionRequiresBuyerInput  MessageInfoResolution = "requires_buyer_input"
	MessageInfoResolutionRequiresBuyerReview MessageInfoResolution = "requires_buyer_review"
)

Defines values for MessageInfoResolution.

func (MessageInfoResolution) Valid

func (e MessageInfoResolution) Valid() bool

Valid indicates whether the value is a known member of the MessageInfoResolution enum.

type MessageInfoSeverity

type MessageInfoSeverity string

MessageInfoSeverity Severity level of this informational message

const (
	MessageInfoSeverityCritical MessageInfoSeverity = "critical"
	MessageInfoSeverityHigh     MessageInfoSeverity = "high"
	MessageInfoSeverityInfo     MessageInfoSeverity = "info"
	MessageInfoSeverityLow      MessageInfoSeverity = "low"
	MessageInfoSeverityMedium   MessageInfoSeverity = "medium"
)

Defines values for MessageInfoSeverity.

func (MessageInfoSeverity) Valid

func (e MessageInfoSeverity) Valid() bool

Valid indicates whether the value is a known member of the MessageInfoSeverity enum.

type MessageInfoType

type MessageInfoType string

MessageInfoType Message type discriminator

const (
	MessageInfoTypeInfo MessageInfoType = "info"
)

Defines values for MessageInfoType.

func (MessageInfoType) Valid

func (e MessageInfoType) Valid() bool

Valid indicates whether the value is a known member of the MessageInfoType enum.

type MessageWarning

type MessageWarning struct {
	// Code Warning code indicating the type of warning
	Code MessageWarningCode `json:"code"`

	// Content Warning message text. When content_type is 'markdown', this MUST be valid CommonMark with no raw HTML. Agents MUST render using a CommonMark-compliant parser with raw HTML output disabled or sanitized.
	Content string `json:"content"`

	// ContentType Format of the warning message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.
	ContentType MessageWarningContentType `json:"content_type"`

	// Param RFC 9535 JSONPath
	Param *string `json:"param,omitempty"`

	// Resolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.
	Resolution *MessageWarningResolution `json:"resolution,omitempty"`

	// Severity Severity level of this warning
	Severity *MessageWarningSeverity `json:"severity,omitempty"`

	// Type Message type discriminator
	Type MessageWarningType `json:"type"`
}

MessageWarning Warning message to display to the buyer during checkout (non-blocking)

type MessageWarningCode

type MessageWarningCode string

MessageWarningCode Warning code indicating the type of warning

const (
	MessageWarningCodeDiscountCodeAlreadyApplied        MessageWarningCode = "discount_code_already_applied"
	MessageWarningCodeDiscountCodeCombinationDisallowed MessageWarningCode = "discount_code_combination_disallowed"
	MessageWarningCodeDiscountCodeExpired               MessageWarningCode = "discount_code_expired"
	MessageWarningCodeDiscountCodeInvalid               MessageWarningCode = "discount_code_invalid"
	MessageWarningCodeDiscountCodeMinimumNotMet         MessageWarningCode = "discount_code_minimum_not_met"
	MessageWarningCodeDiscountCodeUsageLimitReached     MessageWarningCode = "discount_code_usage_limit_reached"
	MessageWarningCodeDiscountCodeUserIneligible        MessageWarningCode = "discount_code_user_ineligible"
	MessageWarningCodeDiscountCodeUserNotLoggedIn       MessageWarningCode = "discount_code_user_not_logged_in"
	MessageWarningCodeExpiringPromotion                 MessageWarningCode = "expiring_promotion"
	MessageWarningCodeHighDemand                        MessageWarningCode = "high_demand"
	MessageWarningCodeLimitedAvailability               MessageWarningCode = "limited_availability"
	MessageWarningCodeLowStock                          MessageWarningCode = "low_stock"
	MessageWarningCodePriceChange                       MessageWarningCode = "price_change"
	MessageWarningCodeShippingDelay                     MessageWarningCode = "shipping_delay"
)

Defines values for MessageWarningCode.

func (MessageWarningCode) Valid

func (e MessageWarningCode) Valid() bool

Valid indicates whether the value is a known member of the MessageWarningCode enum.

type MessageWarningContentType

type MessageWarningContentType string

MessageWarningContentType Format of the warning message content. When set to 'markdown', content MUST conform to CommonMark (https://spec.commonmark.org/0.31.2/). Raw HTML elements MUST NOT be included. When set to 'plain', content is plain text with no formatting.

const (
	MessageWarningContentTypeMarkdown MessageWarningContentType = "markdown"
	MessageWarningContentTypePlain    MessageWarningContentType = "plain"
)

Defines values for MessageWarningContentType.

func (MessageWarningContentType) Valid

func (e MessageWarningContentType) Valid() bool

Valid indicates whether the value is a known member of the MessageWarningContentType enum.

type MessageWarningResolution

type MessageWarningResolution string

MessageWarningResolution Who resolves this message. 'recoverable': agent can fix via API. 'requires_buyer_input': buyer must provide info. 'requires_buyer_review': buyer must authorize.

const (
	MessageWarningResolutionRecoverable         MessageWarningResolution = "recoverable"
	MessageWarningResolutionRequiresBuyerInput  MessageWarningResolution = "requires_buyer_input"
	MessageWarningResolutionRequiresBuyerReview MessageWarningResolution = "requires_buyer_review"
)

Defines values for MessageWarningResolution.

func (MessageWarningResolution) Valid

func (e MessageWarningResolution) Valid() bool

Valid indicates whether the value is a known member of the MessageWarningResolution enum.

type MessageWarningSeverity

type MessageWarningSeverity string

MessageWarningSeverity Severity level of this warning

const (
	MessageWarningSeverityCritical MessageWarningSeverity = "critical"
	MessageWarningSeverityHigh     MessageWarningSeverity = "high"
	MessageWarningSeverityInfo     MessageWarningSeverity = "info"
	MessageWarningSeverityLow      MessageWarningSeverity = "low"
	MessageWarningSeverityMedium   MessageWarningSeverity = "medium"
)

Defines values for MessageWarningSeverity.

func (MessageWarningSeverity) Valid

func (e MessageWarningSeverity) Valid() bool

Valid indicates whether the value is a known member of the MessageWarningSeverity enum.

type MessageWarningType

type MessageWarningType string

MessageWarningType Message type discriminator

const (
	Warning MessageWarningType = "warning"
)

Defines values for MessageWarningType.

func (MessageWarningType) Valid

func (e MessageWarningType) Valid() bool

Valid indicates whether the value is a known member of the MessageWarningType enum.

type Option

type Option func(*config)

Option configures a Handler during construction.

func WithServeMux

func WithServeMux(mux *http.ServeMux) Option

WithServeMux registers ACP checkout routes on mux instead of creating a new http.ServeMux.

type Order

type Order struct {
	// Adjustments Post-order changes: refunds, credits, returns, disputes
	Adjustments *[]Adjustment `json:"adjustments,omitempty"`

	// CheckoutSessionId ID of the checkout session that created this order
	CheckoutSessionId string `json:"checkout_session_id"`

	// Confirmation Order confirmation details including order number and tracking information
	Confirmation *OrderConfirmation `json:"confirmation,omitempty"`

	// EstimatedDelivery Estimated delivery date range for a fulfillment option
	EstimatedDelivery *EstimatedDelivery `json:"estimated_delivery,omitempty"`

	// Fulfillments How items are being delivered (shipping, pickup, digital)
	Fulfillments *[]Fulfillment `json:"fulfillments,omitempty"`

	// Id Unique identifier for the order
	Id string `json:"id"`

	// LineItems What was ordered, with per-item fulfillment tracking
	LineItems *[]OrderLineItem `json:"line_items,omitempty"`

	// OrderNumber Human-readable order number for customer reference
	OrderNumber *string `json:"order_number,omitempty"`

	// PermalinkUrl Permanent URL where the customer can view order details
	PermalinkUrl string `json:"permalink_url"`

	// Status Order-level status. Implementations MUST accept unrecognized values gracefully. Defined values: 'created', 'confirmed', 'manual_review', 'processing', 'shipped', 'completed', 'canceled'. 'completed' means all items have been delivered/received regardless of fulfillment method. Distinct from LineItem.status 'fulfilled', which indicates the seller has dispatched the item.
	Status *string `json:"status,omitempty"`

	// Support Customer support contact information including email, phone, and URL
	Support *SupportInfo `json:"support,omitempty"`

	// Totals Order-level totals using the same Total schema as checkout. The 'total' entry is always the original charged amount. 'amount_refunded' tracks cumulative refunds.
	Totals *[]Total `json:"totals,omitempty"`

	// Type Discriminator field for webhook payloads. Always 'order' when present.
	Type *OrderType `json:"type,omitempty"`
}

Order Order returned after checkout completion. Contains order details and optional rich post-purchase tracking (line items, fulfillments, adjustments).

type OrderConfirmation

type OrderConfirmation struct {
	// ConfirmationEmailSent Whether a confirmation email has been sent
	ConfirmationEmailSent *bool `json:"confirmation_email_sent,omitempty"`

	// ConfirmationNumber Order confirmation number
	ConfirmationNumber *string `json:"confirmation_number,omitempty"`

	// InvoiceNumber Invoice number if generated
	InvoiceNumber *string `json:"invoice_number,omitempty"`

	// ReceiptUrl URL to the order receipt
	ReceiptUrl *string `json:"receipt_url,omitempty"`
}

OrderConfirmation Order confirmation details including order number and tracking information

type OrderLineItem

type OrderLineItem struct {
	// Description Product description
	Description *string `json:"description,omitempty"`

	// Id Line item identifier, used for references in fulfillments and adjustments
	Id string `json:"id"`

	// ImageUrl Product image URL
	ImageUrl *string `json:"image_url,omitempty"`

	// ProductId Catalog product ID
	ProductId *string `json:"product_id,omitempty"`

	// Quantity Quantity tracking for an order line item. Uses a 3-field model: ordered (original), current (active after cancellations/returns), fulfilled (completed).
	Quantity OrderLineItemQuantity `json:"quantity"`

	// Status Derived from quantity fields. Implementations MUST accept unrecognized values gracefully. Defined values: 'processing', 'partial', 'fulfilled', 'removed'. Rules: 'removed' if current==0, 'fulfilled' if fulfilled==current, 'partial' if 0<fulfilled<current, 'processing' otherwise.
	Status *string `json:"status,omitempty"`

	// Subtotal Line total in minor currency units (quantity.ordered * unit_price)
	Subtotal *int `json:"subtotal,omitempty"`

	// Title Product name
	Title string `json:"title"`

	// Totals Optional line-item level totals breakdown using the same Total schema as checkout. Merchants who can provide richer breakdowns MAY use this alongside or instead of unit_price/subtotal.
	Totals *[]Total `json:"totals,omitempty"`

	// UnitPrice Price per unit in minor currency units (cents)
	UnitPrice *int `json:"unit_price,omitempty"`

	// Url Product page URL
	Url *string `json:"url,omitempty"`
}

OrderLineItem Per-line-item tracking of what was ordered and fulfillment progress.

type OrderLineItemQuantity

type OrderLineItemQuantity struct {
	// Current Current active quantity on the order. May be less than ordered due to cancellations or returns. A value of 0 means the line item has been fully removed.
	Current int `json:"current"`

	// Fulfilled Quantity that has been fulfilled (shipped, picked up, or digitally delivered). Applies to all fulfillment types, not just shipping.
	Fulfilled *int `json:"fulfilled,omitempty"`

	// Ordered Quantity originally ordered by the customer
	Ordered int `json:"ordered"`
}

OrderLineItemQuantity Quantity tracking for an order line item. Uses a 3-field model: ordered (original), current (active after cancellations/returns), fulfilled (completed).

type OrderType

type OrderType string

OrderType Discriminator field for webhook payloads. Always 'order' when present.

const (
	OrderTypeOrder OrderType = "order"
)

Defines values for OrderType.

func (OrderType) Valid

func (e OrderType) Valid() bool

Valid indicates whether the value is a known member of the OrderType enum.

type Payment

type Payment struct {
	// Handlers Available payment handlers
	Handlers []PaymentHandler `json:"handlers"`
}

Payment Payment configuration with handlers

type PaymentData

type PaymentData struct {
	// ApprovalRequired Whether this payment requires approval
	ApprovalRequired *bool `json:"approval_required,omitempty"`

	// BillingAddress Physical address for shipping, billing, or pickup locations
	BillingAddress *Address `json:"billing_address,omitempty"`

	// DueDate RFC 3339 timestamp when payment is due
	DueDate *time.Time `json:"due_date,omitempty"`

	// HandlerId ID of the payment handler to use
	HandlerId *string `json:"handler_id,omitempty"`

	// Instrument Payment instrument details
	Instrument *struct {
		// Credential Payment credential
		Credential struct {
			// Token Credential token value
			Token string `json:"token"`

			// Type Credential type (e.g., spt, wallet_token)
			Type string `json:"type"`
		} `json:"credential"`

		// Type Instrument type (e.g., card, wallet_token)
		Type string `json:"type"`
	} `json:"instrument,omitempty"`

	// PaymentTerms Payment terms for B2B transactions
	PaymentTerms *PaymentDataPaymentTerms `json:"payment_terms,omitempty"`

	// PurchaseOrderNumber Purchase order number
	PurchaseOrderNumber *string `json:"purchase_order_number,omitempty"`
	// contains filtered or unexported fields
}

PaymentData Payment instrument data collected from the buyer (e.g., card details, wallet tokens)

func (PaymentData) AsPaymentData0

func (t PaymentData) AsPaymentData0() (PaymentData0, error)

AsPaymentData0 returns the union data inside the PaymentData as a PaymentData0

func (PaymentData) AsPaymentData1

func (t PaymentData) AsPaymentData1() (PaymentData1, error)

AsPaymentData1 returns the union data inside the PaymentData as a PaymentData1

func (*PaymentData) FromPaymentData0

func (t *PaymentData) FromPaymentData0(v PaymentData0) error

FromPaymentData0 overwrites any union data inside the PaymentData as the provided PaymentData0

func (*PaymentData) FromPaymentData1

func (t *PaymentData) FromPaymentData1(v PaymentData1) error

FromPaymentData1 overwrites any union data inside the PaymentData as the provided PaymentData1

func (PaymentData) MarshalJSON

func (t PaymentData) MarshalJSON() ([]byte, error)

func (*PaymentData) MergePaymentData0

func (t *PaymentData) MergePaymentData0(v PaymentData0) error

MergePaymentData0 performs a merge with any union data inside the PaymentData, using the provided PaymentData0

func (*PaymentData) MergePaymentData1

func (t *PaymentData) MergePaymentData1(v PaymentData1) error

MergePaymentData1 performs a merge with any union data inside the PaymentData, using the provided PaymentData1

func (*PaymentData) UnmarshalJSON

func (t *PaymentData) UnmarshalJSON(b []byte) error

type PaymentData0

type PaymentData0 = interface{}

PaymentData0 defines model for PaymentData.0.

type PaymentData1

type PaymentData1 = interface{}

PaymentData1 defines model for PaymentData.1.

type PaymentDataPaymentTerms

type PaymentDataPaymentTerms string

PaymentDataPaymentTerms Payment terms for B2B transactions

const (
	Immediate PaymentDataPaymentTerms = "immediate"
	Net15     PaymentDataPaymentTerms = "net_15"
	Net30     PaymentDataPaymentTerms = "net_30"
	Net60     PaymentDataPaymentTerms = "net_60"
	Net90     PaymentDataPaymentTerms = "net_90"
)

Defines values for PaymentDataPaymentTerms.

func (PaymentDataPaymentTerms) Valid

func (e PaymentDataPaymentTerms) Valid() bool

Valid indicates whether the value is a known member of the PaymentDataPaymentTerms enum.

type PaymentHandler

type PaymentHandler struct {
	// Config Handler-specific configuration
	Config map[string]interface{} `json:"config"`

	// ConfigSchema URL to JSON Schema for handler configuration
	ConfigSchema string `json:"config_schema"`

	// DisplayName Human-readable name for UI (e.g., Credit Card). Use when showing payment options to the buyer.
	DisplayName *string `json:"display_name,omitempty"`

	// Id Seller-defined handler identifier
	Id string `json:"id"`

	// InstrumentSchemas URLs to JSON Schemas for payment instruments
	InstrumentSchemas []string `json:"instrument_schemas"`

	// Name Handler name in reverse-DNS format (e.g., dev.acp.tokenized.card)
	Name string `json:"name"`

	// Psp Payment Service Provider identifier
	Psp string `json:"psp"`

	// RequiresDelegatePayment Whether this handler requires using delegate_payment API
	RequiresDelegatePayment bool `json:"requires_delegate_payment"`

	// RequiresPciCompliance Whether this handler routes PCI DSS sensitive data
	RequiresPciCompliance bool `json:"requires_pci_compliance"`

	// Spec URL to handler specification
	Spec string `json:"spec"`

	// Version Handler version in YYYY-MM-DD format
	Version string `json:"version"`
}

PaymentHandler Payment handler configuration and capabilities

type PaymentMethodObject

type PaymentMethodObject struct {
	// Brands Specific card brands/networks accepted
	Brands *[]PaymentMethodObjectBrands `json:"brands,omitempty"`

	// FundingTypes For card methods, funding types accepted
	FundingTypes *[]PaymentMethodObjectFundingTypes `json:"funding_types,omitempty"`

	// Method The payment method identifier
	Method string `json:"method"`

	// Providers Optional PSP routing information
	Providers *[]string `json:"providers,omitempty"`
}

PaymentMethodObject Payment method with additional constraints (e.g., card brands, PSP routing)

type PaymentMethodObjectBrands

type PaymentMethodObjectBrands string

PaymentMethodObjectBrands defines model for PaymentMethodObject.Brands.

const (
	PaymentMethodObjectBrandsAmex       PaymentMethodObjectBrands = "amex"
	PaymentMethodObjectBrandsDiners     PaymentMethodObjectBrands = "diners"
	PaymentMethodObjectBrandsDiscover   PaymentMethodObjectBrands = "discover"
	PaymentMethodObjectBrandsEftpos     PaymentMethodObjectBrands = "eftpos"
	PaymentMethodObjectBrandsInterac    PaymentMethodObjectBrands = "interac"
	PaymentMethodObjectBrandsJcb        PaymentMethodObjectBrands = "jcb"
	PaymentMethodObjectBrandsMastercard PaymentMethodObjectBrands = "mastercard"
	PaymentMethodObjectBrandsUnionpay   PaymentMethodObjectBrands = "unionpay"
	PaymentMethodObjectBrandsVisa       PaymentMethodObjectBrands = "visa"
)

Defines values for PaymentMethodObjectBrands.

func (PaymentMethodObjectBrands) Valid

func (e PaymentMethodObjectBrands) Valid() bool

Valid indicates whether the value is a known member of the PaymentMethodObjectBrands enum.

type PaymentMethodObjectFundingTypes

type PaymentMethodObjectFundingTypes string

PaymentMethodObjectFundingTypes defines model for PaymentMethodObject.FundingTypes.

const (
	Credit  PaymentMethodObjectFundingTypes = "credit"
	Debit   PaymentMethodObjectFundingTypes = "debit"
	Prepaid PaymentMethodObjectFundingTypes = "prepaid"
)

Defines values for PaymentMethodObjectFundingTypes.

func (PaymentMethodObjectFundingTypes) Valid

Valid indicates whether the value is a known member of the PaymentMethodObjectFundingTypes enum.

type PaymentResponse

type PaymentResponse struct {
	// Handlers Available payment handlers
	Handlers *[]map[string]interface{} `json:"handlers,omitempty"`

	// Instruments Available payment instruments
	Instruments *[]map[string]interface{} `json:"instruments,omitempty"`

	// Provider Payment provider identifier
	Provider *string `json:"provider,omitempty"`
}

PaymentResponse Payment configuration returned by the seller including accepted methods and handlers

type ProtocolVersion

type ProtocolVersion struct {
	// Version ACP protocol version in YYYY-MM-DD format.
	Version string `json:"version"`
}

ProtocolVersion Protocol metadata included in checkout responses. Indicates the ACP version.

type Provider

type Provider interface {
	// CreateSession initializes a new checkout session from items and (optionally) buyer and fulfillment info.
	// MUST return [CheckoutSessionBase] with a rich, authoritative cart state.
	CreateSession(ctx context.Context, req CheckoutSessionCreateRequest) (*CheckoutSessionBase, error)

	// UpdateSession applies changes (items, fulfillment address, fulfillment option) and returns an updated authoritative cart state.
	UpdateSession(ctx context.Context, id string, req CheckoutSessionUpdateRequest) (*CheckoutSessionBase, error)

	// GetSession returns the latest authoritative state for the checkout session.
	GetSession(ctx context.Context, id string) (*CheckoutSessionBase, error)

	// CompleteSession finalizes the checkout by applying a payment method. MUST create an order and return [CheckoutSessionWithOrder] on success.
	//
	// Agents MAY include [CheckoutSessionCompleteRequest.AffiliateAttribution] to ensure the merchant receives final attribution context.
	// Attribution is stored alongside the resulting order but not returned in the response.
	CompleteSession(ctx context.Context, id string, req CheckoutSessionCompleteRequest) (CheckoutSessionWithOrder, error)

	// CancelSession cancels a session if not already completed or canceled.
	// Agents MAY include an [CancelSessionRequest.IntentTrace] to communicate why the session is being abandoned.
	CancelSession(ctx context.Context, id string, req *CancelSessionRequest) (*CheckoutSessionBase, error)
}

Provider is implemented by business logic that owns checkout sessions.

type RejectedDiscount

type RejectedDiscount struct {
	// Code The discount code that was rejected.
	Code string `json:"code"`

	// Message Human-readable explanation of why the code was rejected.
	Message *string `json:"message,omitempty"`

	// Reason Error codes for rejected discount codes, used in messages[].code.
	Reason DiscountErrorCode `json:"reason"`
}

RejectedDiscount A discount code that could not be applied, with the reason.

type RequestId

type RequestId = string

RequestId defines model for RequestId.

type RiskSignals

type RiskSignals struct {
	// AcceptLanguage Accept-Language header from the buyer's browser
	AcceptLanguage *string `json:"accept_language,omitempty"`

	// DeviceFingerprint Device fingerprint for fraud detection
	DeviceFingerprint *string `json:"device_fingerprint,omitempty"`

	// IpAddress IP address of the buyer
	IpAddress *string `json:"ip_address,omitempty"`

	// SessionId Session identifier for the buyer
	SessionId *string `json:"session_id,omitempty"`

	// UserAgent User agent string of the buyer's browser
	UserAgent *string `json:"user_agent,omitempty"`
}

RiskSignals Risk and fraud detection signals for the checkout session

type SelectedFulfillmentOption

type SelectedFulfillmentOption struct {
	// ItemIds List of line item IDs associated with this fulfillment option
	ItemIds []string `json:"item_ids"`

	// OptionId ID of the selected fulfillment option
	OptionId string `json:"option_id"`

	// Type Type of fulfillment option selected
	Type SelectedFulfillmentOptionType `json:"type"`
}

SelectedFulfillmentOption Fulfillment option selected by the buyer for specific line items

type SelectedFulfillmentOptionType

type SelectedFulfillmentOptionType string

SelectedFulfillmentOptionType Type of fulfillment option selected

const (
	SelectedFulfillmentOptionTypeDigital       SelectedFulfillmentOptionType = "digital"
	SelectedFulfillmentOptionTypeLocalDelivery SelectedFulfillmentOptionType = "local_delivery"
	SelectedFulfillmentOptionTypePickup        SelectedFulfillmentOptionType = "pickup"
	SelectedFulfillmentOptionTypeShipping      SelectedFulfillmentOptionType = "shipping"
)

Defines values for SelectedFulfillmentOptionType.

func (SelectedFulfillmentOptionType) Valid

Valid indicates whether the value is a known member of the SelectedFulfillmentOptionType enum.

type Signature

type Signature = string

Signature defines model for Signature.

type SplitPayment

type SplitPayment struct {
	// Amount Payment amount in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100) for this split
	Amount int `json:"amount"`
}

SplitPayment Split payment configuration allowing payment across multiple methods or parties

type SupportInfo

type SupportInfo struct {
	// Email Support contact email
	Email *openapi_types.Email `json:"email,omitempty"`

	// HelpCenterUrl URL to merchant's help center
	HelpCenterUrl *string `json:"help_center_url,omitempty"`

	// Hours Support hours of operation
	Hours *string `json:"hours,omitempty"`

	// Phone Support contact phone number
	Phone *string `json:"phone,omitempty"`
}

SupportInfo Customer support contact information including email, phone, and URL

type TaxBreakdownItem

type TaxBreakdownItem struct {
	// Amount Tax amount in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100)
	Amount int `json:"amount"`

	// Jurisdiction Tax jurisdiction name (e.g., 'California State Tax', 'City of San Francisco')
	Jurisdiction string `json:"jurisdiction"`

	// Rate Tax rate as a decimal (e.g., 0.0875 for 8.75%)
	Rate float32 `json:"rate"`
}

TaxBreakdownItem Breakdown of tax amounts by type, jurisdiction, or rate

type TaxExemption

type TaxExemption struct {
	// CertificateId Unique identifier for the tax exemption certificate
	CertificateId string `json:"certificate_id"`

	// CertificateType Type of tax exemption certificate
	CertificateType TaxExemptionCertificateType `json:"certificate_type"`

	// ExemptRegions List of regions where the exemption applies (e.g., state codes)
	ExemptRegions *[]string `json:"exempt_regions,omitempty"`

	// ExpiresAt RFC 3339 timestamp when the exemption certificate expires
	ExpiresAt *time.Time `json:"expires_at,omitempty"`
}

TaxExemption Tax exemption information including exemption type and applicable regions

type TaxExemptionCertificateType

type TaxExemptionCertificateType string

TaxExemptionCertificateType Type of tax exemption certificate

const (
	ExemptOrganization TaxExemptionCertificateType = "exempt_organization"
	Government         TaxExemptionCertificateType = "government"
	Resale             TaxExemptionCertificateType = "resale"
)

Defines values for TaxExemptionCertificateType.

func (TaxExemptionCertificateType) Valid

Valid indicates whether the value is a known member of the TaxExemptionCertificateType enum.

type Timestamp

type Timestamp = time.Time

Timestamp defines model for Timestamp.

type Total

type Total struct {
	// Amount Amount in minor currency units (e.g. 100 cents for $1.00 or 100 for ¥100)
	Amount int `json:"amount"`

	// Breakdown Detailed breakdown for tax totals
	Breakdown *[]TaxBreakdownItem `json:"breakdown,omitempty"`

	// Description Additional descriptive text for this total
	Description *string `json:"description,omitempty"`

	// DisplayText Localized display text for this total
	DisplayText string `json:"display_text"`

	// PresentmentAmount Amount in presentment currency minor units if different from settlement currency
	PresentmentAmount *int `json:"presentment_amount,omitempty"`

	// Type Type of total line item
	Type TotalType `json:"type"`
}

Total Total amounts for the checkout including subtotal, discounts, tax, shipping, and final total

type TotalType

type TotalType string

TotalType Type of total line item

const (
	TotalTypeAmountRefunded  TotalType = "amount_refunded"
	TotalTypeDiscount        TotalType = "discount"
	TotalTypeFee             TotalType = "fee"
	TotalTypeFulfillment     TotalType = "fulfillment"
	TotalTypeGiftWrap        TotalType = "gift_wrap"
	TotalTypeItemsBaseAmount TotalType = "items_base_amount"
	TotalTypeItemsDiscount   TotalType = "items_discount"
	TotalTypeStoreCredit     TotalType = "store_credit"
	TotalTypeSubtotal        TotalType = "subtotal"
	TotalTypeTax             TotalType = "tax"
	TotalTypeTip             TotalType = "tip"
	TotalTypeTotal           TotalType = "total"
)

Defines values for TotalType.

func (TotalType) Valid

func (e TotalType) Valid() bool

Valid indicates whether the value is a known member of the TotalType enum.

type UpdateCheckoutSessionJSONRequestBody

type UpdateCheckoutSessionJSONRequestBody = CheckoutSessionUpdateRequest

UpdateCheckoutSessionJSONRequestBody defines body for UpdateCheckoutSession for application/json ContentType.

type UpdateCheckoutSessionParams

type UpdateCheckoutSessionParams struct {
	// IdempotencyKey Idempotency key. MUST be present on all POST requests. Opaque string, max 255 characters. UUID v4 recommended. Scoped to authenticated identity + endpoint.
	IdempotencyKey IdempotencyKey `json:"Idempotency-Key"`

	// Authorization Bearer token for API authentication
	Authorization  Authorization   `json:"Authorization"`
	AcceptLanguage *AcceptLanguage `json:"Accept-Language,omitempty"`
	UserAgent      *UserAgent      `json:"User-Agent,omitempty"`
	RequestId      *RequestId      `json:"Request-Id,omitempty"`

	// Signature HMAC signature for webhook verification
	Signature *Signature `json:"Signature,omitempty"`

	// Timestamp RFC 3339 date-time string for request timing validation
	Timestamp  *Timestamp `json:"Timestamp,omitempty"`
	APIVersion APIVersion `json:"API-Version"`
}

UpdateCheckoutSessionParams defines parameters for UpdateCheckoutSession.

type UserAgent

type UserAgent = string

UserAgent defines model for UserAgent.

type VariantOption

type VariantOption struct {
	// Name Variant attribute name (e.g., 'Size', 'Color')
	Name string `json:"name"`

	// Value Variant attribute value (e.g., 'Large', 'Blue')
	Value string `json:"value"`
}

VariantOption Represents a single variant option for a product (e.g., size, color, material)

type WeightInfo

type WeightInfo struct {
	// Unit Unit of measurement for weight
	Unit WeightInfoUnit `json:"unit"`

	// Value Numeric weight value
	Value float32 `json:"value"`
}

WeightInfo Product weight with unit of measurement

type WeightInfoUnit

type WeightInfoUnit string

WeightInfoUnit Unit of measurement for weight

const (
	G  WeightInfoUnit = "g"
	Kg WeightInfoUnit = "kg"
	Lb WeightInfoUnit = "lb"
	Oz WeightInfoUnit = "oz"
)

Defines values for WeightInfoUnit.

func (WeightInfoUnit) Valid

func (e WeightInfoUnit) Valid() bool

Valid indicates whether the value is a known member of the WeightInfoUnit enum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL