Documentation
¶
Overview ¶
Package pandadoc provides a pure-stdlib Go SDK for the PandaDoc Public API.
Index ¶
- Constants
- Variables
- func IsForbidden(err error) bool
- func IsNotFound(err error) bool
- func IsRateLimited(err error) bool
- func IsUnauthorized(err error) bool
- type APIError
- type APIListResponse
- type AppendContentLibraryItemRequest
- type AppendContentLibraryItemResponse
- type ChangeDocumentStatusRequest
- type ChangeDocumentStatusWithUploadRequest
- type Client
- type CreateDocumentEditingSessionRequest
- type CreateDocumentEditingSessionResponse
- type CreateDocumentFromUploadRequest
- type CreateDocumentSessionRequest
- type CreateDocumentSessionResponse
- type CreateProductCatalogItemRequest
- type DocumentCreateRequest
- type DocumentCreateResponse
- type DocumentDetailsResponse
- type DocumentESignDisclosure
- type DocumentESignDisclosureResponse
- type DocumentField
- type DocumentLink
- type DocumentListResponse
- type DocumentOrderBy
- type DocumentRecipient
- type DocumentRevertToDraftResponse
- type DocumentSendRequest
- type DocumentSendResponse
- type DocumentStatusCode
- type DocumentStatusResponse
- type DocumentSummary
- type DocumentTemplateReference
- type DocumentToken
- type DocumentUpdateRequest
- type DocumentsService
- type DownloadResponse
- type LinkedObject
- type ListDocumentsOptions
- type ListWebhookEventsOptions
- type ListWebhookSubscriptionsOptions
- type Logger
- type MoneyAmount
- type NamedContentBlock
- type OAuthService
- type OAuthTokenRequest
- type OAuthTokenResponse
- type Option
- func WithAPIKey(apiKey string) Option
- func WithAccessToken(token string) Option
- func WithBaseURL(baseURL string) Option
- func WithHTTPClient(client *http.Client) Option
- func WithLogger(logger Logger) Option
- func WithRetryPolicy(policy RetryPolicy) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUserAgent(userAgent string) Option
- type ProductCatalogBillingType
- type ProductCatalogItemResponse
- type ProductCatalogItemType
- type ProductCatalogSearchItem
- type ProductCatalogService
- type RawJSON
- type RawObject
- type RetryPolicy
- type SearchProductCatalogItemsOptions
- type SearchProductCatalogItemsResponse
- type TransferAllDocumentsOwnershipRequest
- type TransferDocumentOwnershipRequest
- type UpdateProductCatalogItemRequest
- type UpdateWebhookSubscriptionSharedKeyResponse
- type UserReference
- type WebhookEventDetailsResponse
- type WebhookEventItem
- type WebhookEventListResponse
- type WebhookEventsService
- type WebhookPayloadOption
- type WebhookSubscription
- type WebhookSubscriptionListResponse
- type WebhookSubscriptionRequest
- type WebhookSubscriptionsService
- type WebhookTrigger
Constants ¶
const ( // DefaultBaseURL is the default PandaDoc API base URL. DefaultBaseURL = "https://api.pandadoc.com/" // DefaultTimeout is the default HTTP timeout. DefaultTimeout = 30 * time.Second // DefaultUserAgent is the default user-agent sent to PandaDoc. DefaultUserAgent = "go-pandadoc/0.2.0" )
Variables ¶
var ( // ErrInvalidBaseURL indicates the configured API base URL is invalid. ErrInvalidBaseURL = stderrors.New("invalid base URL") // ErrNilHTTPClient indicates a nil HTTP client was provided. ErrNilHTTPClient = stderrors.New("http client cannot be nil") // ErrMissingAuthentication indicates no auth method is configured for an authenticated call. ErrMissingAuthentication = stderrors.New("missing authentication credentials") // ErrMultipleAuthenticationMethods indicates both API-Key and Bearer auth were configured. ErrMultipleAuthenticationMethods = stderrors.New("only one authentication method can be configured") // ErrEmptyPathParameter indicates a required path parameter was empty. ErrEmptyPathParameter = stderrors.New("path parameter cannot be empty") // ErrNilRequest indicates a required request payload is nil. ErrNilRequest = stderrors.New("request payload cannot be nil") // ErrNilFileReader indicates an upload request has no file reader. ErrNilFileReader = stderrors.New("file reader is required") )
Functions ¶
func IsForbidden ¶
IsForbidden returns true if err is a 403 API error.
func IsNotFound ¶
IsNotFound returns true if err is a 404 API error.
func IsRateLimited ¶
IsRateLimited returns true if err is a 429 API error.
func IsUnauthorized ¶
IsUnauthorized returns true if err is a 401 API error.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
Code string
Message string
Details any
RequestID string
RetryAfter string
RawBody string
Headers http.Header
}
APIError represents a non-2xx response from PandaDoc.
type APIListResponse ¶
type APIListResponse[T any] struct { Items []T `json:"items"` }
APIListResponse models list responses that return items.
type AppendContentLibraryItemRequest ¶
AppendContentLibraryItemRequest is a flexible append-content payload.
type AppendContentLibraryItemResponse ¶
type AppendContentLibraryItemResponse struct {
BlockMapping map[string]string `json:"block_mapping,omitempty"`
CLI RawObject `json:"cli,omitempty"`
}
AppendContentLibraryItemResponse models append-content response.
type ChangeDocumentStatusRequest ¶
type ChangeDocumentStatusRequest struct {
Status DocumentStatusCode `json:"status"`
Note string `json:"note,omitempty"`
NotifyRecipients *bool `json:"notify_recipients,omitempty"`
}
ChangeDocumentStatusRequest changes a document status.
type ChangeDocumentStatusWithUploadRequest ¶
type ChangeDocumentStatusWithUploadRequest struct {
Status DocumentStatusCode
Note string
NotifyRecipients *bool
FileField string
FileName string
File io.Reader
Fields map[string]string
}
ChangeDocumentStatusWithUploadRequest changes status with multipart payload.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the root PandaDoc SDK client.
func NewClient ¶
NewClient creates a new PandaDoc client.
If no auth option is configured, only OAuth token exchange calls are available.
func NewClientWithAPIKey ¶
NewClientWithAPIKey creates a new PandaDoc client using API-Key auth.
func NewClientWithAccessToken ¶
NewClientWithAccessToken creates a new PandaDoc client using Bearer auth.
func (*Client) Documents ¶
func (c *Client) Documents() DocumentsService
Documents exposes document-related endpoints.
func (*Client) ProductCatalog ¶
func (c *Client) ProductCatalog() ProductCatalogService
ProductCatalog exposes product-catalog endpoints.
func (*Client) WebhookEvents ¶
func (c *Client) WebhookEvents() WebhookEventsService
WebhookEvents exposes webhook-event endpoints.
func (*Client) WebhookSubscriptions ¶
func (c *Client) WebhookSubscriptions() WebhookSubscriptionsService
WebhookSubscriptions exposes webhook-subscription endpoints.
type CreateDocumentEditingSessionRequest ¶
CreateDocumentEditingSessionRequest is a flexible editing-session payload.
type CreateDocumentEditingSessionResponse ¶
type CreateDocumentEditingSessionResponse struct {
ID string `json:"id,omitempty"`
Token string `json:"token,omitempty"`
Key string `json:"key,omitempty"`
Email string `json:"email,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
DocumentID string `json:"document_id,omitempty"`
}
CreateDocumentEditingSessionResponse models editing-session response.
type CreateDocumentFromUploadRequest ¶
type CreateDocumentFromUploadRequest struct {
FileField string
FileName string
File io.Reader
Fields map[string]string
}
CreateDocumentFromUploadRequest uploads a file and creates a document.
type CreateDocumentSessionRequest ¶
CreateDocumentSessionRequest is a flexible embedded-session payload.
type CreateDocumentSessionResponse ¶
type CreateDocumentSessionResponse struct {
ID string `json:"id,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
}
CreateDocumentSessionResponse is returned by document session endpoint.
type CreateProductCatalogItemRequest ¶
CreateProductCatalogItemRequest is a flexible create payload.
type DocumentCreateRequest ¶
DocumentCreateRequest is a flexible create-document payload.
type DocumentCreateResponse ¶
type DocumentCreateResponse struct {
DocumentSummary
Links []DocumentLink `json:"links,omitempty"`
InfoMessage string `json:"info_message,omitempty"`
}
DocumentCreateResponse is returned when creating a document.
type DocumentDetailsResponse ¶
type DocumentDetailsResponse struct {
ApprovalExecution any `json:"approval_execution,omitempty"`
AutonumberingSequenceNamePrefix string `json:"autonumbering_sequence_name_prefix,omitempty"`
ContentDateModified string `json:"content_date_modified,omitempty"`
CreatedBy *UserReference `json:"created_by,omitempty"`
DateCompleted string `json:"date_completed,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateSent string `json:"date_sent,omitempty"`
ExpirationDate string `json:"expiration_date,omitempty"`
Fields []DocumentField `json:"fields,omitempty"`
FolderUUID string `json:"folder_uuid,omitempty"`
GrandTotal *MoneyAmount `json:"grand_total,omitempty"`
ID string `json:"id,omitempty"`
Images []NamedContentBlock `json:"images,omitempty"`
LinkedObjects []LinkedObject `json:"linked_objects,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Name string `json:"name,omitempty"`
Pricing RawJSON `json:"pricing,omitempty"`
Recipients []DocumentRecipient `json:"recipients,omitempty"`
RefNumber string `json:"ref_number,omitempty"`
SentBy *UserReference `json:"sent_by,omitempty"`
Status string `json:"status,omitempty"`
Tables []NamedContentBlock `json:"tables,omitempty"`
Tags []string `json:"tags,omitempty"`
Template *DocumentTemplateReference `json:"template,omitempty"`
Texts []NamedContentBlock `json:"texts,omitempty"`
Tokens []DocumentToken `json:"tokens,omitempty"`
Version string `json:"version,omitempty"`
}
DocumentDetailsResponse is returned by GET /documents/{id}/details.
type DocumentESignDisclosure ¶
type DocumentESignDisclosure struct {
IsEnabled bool `json:"is_enabled"`
CompanyName string `json:"company_name,omitempty"`
ESignDisclosureText string `json:"esign_disclosure_text,omitempty"`
}
DocumentESignDisclosure contains disclosure details.
type DocumentESignDisclosureResponse ¶
type DocumentESignDisclosureResponse struct {
Result *DocumentESignDisclosure `json:"result,omitempty"`
}
DocumentESignDisclosureResponse models e-sign disclosure settings for a document.
type DocumentField ¶
type DocumentField struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Title string `json:"title,omitempty"`
MergeField string `json:"merge_field,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
FieldID string `json:"field_id,omitempty"`
Type string `json:"type,omitempty"`
Value any `json:"value,omitempty"`
AssignedTo RawJSON `json:"assigned_to,omitempty"`
}
DocumentField represents a field entry in document details.
type DocumentLink ¶
type DocumentLink struct {
Rel string `json:"rel,omitempty"`
Href string `json:"href,omitempty"`
Type string `json:"type,omitempty"`
}
DocumentLink is a link object from create responses.
type DocumentListResponse ¶
type DocumentListResponse struct {
Results []DocumentSummary `json:"results"`
}
DocumentListResponse is returned by list/search documents endpoint.
type DocumentOrderBy ¶
type DocumentOrderBy string
DocumentOrderBy controls document list ordering.
const ( // DocumentOrderByName orders by document name. DocumentOrderByName DocumentOrderBy = "name" // DocumentOrderByDateCreated orders by creation date. DocumentOrderByDateCreated DocumentOrderBy = "date_created" // DocumentOrderByDateStatusChange orders by status change date. DocumentOrderByDateStatusChange DocumentOrderBy = "date_status_changed" // DocumentOrderByDateLastAction orders by last action date. DocumentOrderByDateLastAction DocumentOrderBy = "date_of_last_action" // DocumentOrderByDateModified orders by modification date. DocumentOrderByDateModified DocumentOrderBy = "date_modified" // DocumentOrderByDateSent orders by sent date. DocumentOrderByDateSent DocumentOrderBy = "date_sent" // DocumentOrderByDateCompleted orders by completion date. DocumentOrderByDateCompleted DocumentOrderBy = "date_completed" // DocumentOrderByDateExpiration orders by expiration date. DocumentOrderByDateExpiration DocumentOrderBy = "date_expiration" // DocumentOrderByDateDeclined orders by declined date. DocumentOrderByDateDeclined DocumentOrderBy = "date_declined" // DocumentOrderByStatus orders by status. DocumentOrderByStatus DocumentOrderBy = "status" // DocumentOrderByNameDesc orders by document name descending. DocumentOrderByNameDesc DocumentOrderBy = "-name" // DocumentOrderByDateCreatedDesc orders by creation date descending. DocumentOrderByDateCreatedDesc DocumentOrderBy = "-date_created" // DocumentOrderByStatusChangeDesc orders by status change date descending. DocumentOrderByStatusChangeDesc DocumentOrderBy = "-date_status_changed" // DocumentOrderByLastActionDesc orders by last action date descending. DocumentOrderByLastActionDesc DocumentOrderBy = "-date_of_last_action" // DocumentOrderByDateModifiedDesc orders by modification date descending. DocumentOrderByDateModifiedDesc DocumentOrderBy = "-date_modified" // DocumentOrderByDateSentDesc orders by sent date descending. DocumentOrderByDateSentDesc DocumentOrderBy = "-date_sent" // DocumentOrderByDateCompletedDes orders by completion date descending. DocumentOrderByDateCompletedDes DocumentOrderBy = "-date_completed" // DocumentOrderByDateExpirationDe orders by expiration date descending. DocumentOrderByDateExpirationDe DocumentOrderBy = "-date_expiration" // DocumentOrderByDateDeclinedDesc orders by declined date descending. DocumentOrderByDateDeclinedDesc DocumentOrderBy = "-date_declined" // DocumentOrderByStatusDesc orders by status descending. DocumentOrderByStatusDesc DocumentOrderBy = "-status" )
Document order by constants.
type DocumentRecipient ¶
type DocumentRecipient struct {
ID string `json:"id,omitempty"`
ContactID string `json:"contact_id,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Email string `json:"email,omitempty"`
Role string `json:"role,omitempty"`
RecipientType string `json:"recipient_type,omitempty"`
HasCompleted bool `json:"has_completed,omitempty"`
}
DocumentRecipient is a compact recipient payload.
type DocumentRevertToDraftResponse ¶
type DocumentRevertToDraftResponse = DocumentSummary
DocumentRevertToDraftResponse is returned by revert-to-draft endpoint.
type DocumentSendRequest ¶
DocumentSendRequest is a flexible send payload.
type DocumentSendResponse ¶
type DocumentSendResponse struct {
DocumentSummary
Recipients []DocumentRecipient `json:"recipients,omitempty"`
}
DocumentSendResponse is returned by send endpoint.
type DocumentStatusCode ¶
type DocumentStatusCode int
DocumentStatusCode is the numeric status code used in some document requests.
const ( // DocumentStatusDraft represents the draft status. DocumentStatusDraft DocumentStatusCode = 0 // DocumentStatusSent represents the sent status. DocumentStatusSent DocumentStatusCode = 1 // DocumentStatusCompleted represents the completed status. DocumentStatusCompleted DocumentStatusCode = 2 // DocumentStatusUploaded represents the uploaded status. DocumentStatusUploaded DocumentStatusCode = 3 // DocumentStatusError represents the error status. DocumentStatusError DocumentStatusCode = 4 // DocumentStatusViewed represents the viewed status. DocumentStatusViewed DocumentStatusCode = 5 // DocumentStatusWaitingApproval represents the waiting approval status. DocumentStatusWaitingApproval DocumentStatusCode = 6 // DocumentStatusApproved represents the approved status. DocumentStatusApproved DocumentStatusCode = 7 // DocumentStatusRejected represents the rejected status. DocumentStatusRejected DocumentStatusCode = 8 // DocumentStatusWaitingPay represents the waiting pay status. DocumentStatusWaitingPay DocumentStatusCode = 9 // DocumentStatusPaid represents the paid status. DocumentStatusPaid DocumentStatusCode = 10 // DocumentStatusVoided represents the voided status. DocumentStatusVoided DocumentStatusCode = 11 // DocumentStatusDeclined represents the declined status. DocumentStatusDeclined DocumentStatusCode = 12 // DocumentStatusExternalReview represents the external review status. DocumentStatusExternalReview DocumentStatusCode = 13 )
Document status code constants.
type DocumentStatusResponse ¶
type DocumentStatusResponse = DocumentSummary
DocumentStatusResponse is returned by GET /documents/{id}.
type DocumentSummary ¶
type DocumentSummary struct {
ID string `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateCompleted string `json:"date_completed,omitempty"`
ExpirationDate string `json:"expiration_date,omitempty"`
Version string `json:"version,omitempty"`
}
DocumentSummary represents core document fields used by multiple endpoints.
type DocumentTemplateReference ¶
type DocumentTemplateReference struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
}
DocumentTemplateReference is a template descriptor in details responses.
type DocumentToken ¶
type DocumentToken struct {
Name string `json:"name,omitempty"`
Value any `json:"value,omitempty"`
}
DocumentToken is a token/value pair from document details.
type DocumentUpdateRequest ¶
DocumentUpdateRequest is a flexible update-document payload.
type DocumentsService ¶
type DocumentsService interface {
List(ctx context.Context, opts *ListDocumentsOptions) (*DocumentListResponse, error)
Create(ctx context.Context, reqBody DocumentCreateRequest) (*DocumentCreateResponse, error)
CreateFromUpload(ctx context.Context, reqBody *CreateDocumentFromUploadRequest) (*DocumentCreateResponse, error)
Status(ctx context.Context, id string) (*DocumentStatusResponse, error)
Delete(ctx context.Context, id string) error
Update(ctx context.Context, id string, reqBody DocumentUpdateRequest) error
ESignDisclosure(ctx context.Context, documentID string) (*DocumentESignDisclosureResponse, error)
ChangeStatus(ctx context.Context, id string, reqBody *ChangeDocumentStatusRequest) error
ChangeStatusWithUpload(ctx context.Context, id string, reqBody *ChangeDocumentStatusWithUploadRequest) error
RevertToDraft(ctx context.Context, id string) (*DocumentRevertToDraftResponse, error)
Details(ctx context.Context, id string) (*DocumentDetailsResponse, error)
Send(ctx context.Context, id string, reqBody DocumentSendRequest) (*DocumentSendResponse, error)
CreateEditingSession(ctx context.Context, id string, reqBody CreateDocumentEditingSessionRequest) (*CreateDocumentEditingSessionResponse, error)
CreateSession(ctx context.Context, id string, reqBody CreateDocumentSessionRequest) (*CreateDocumentSessionResponse, error)
Download(ctx context.Context, id string) (*DownloadResponse, error)
DownloadProtected(ctx context.Context, id string) (*DownloadResponse, error)
TransferOwnership(ctx context.Context, id string, reqBody TransferDocumentOwnershipRequest) error
TransferAllOwnership(ctx context.Context, reqBody TransferAllDocumentsOwnershipRequest) error
MoveToFolder(ctx context.Context, id, folderID string) error
AppendContentLibraryItem(ctx context.Context, id string, reqBody AppendContentLibraryItemRequest) (*AppendContentLibraryItemResponse, error)
}
DocumentsService handles document-related PandaDoc API calls.
type DownloadResponse ¶
type DownloadResponse struct {
Body io.ReadCloser
Headers http.Header
StatusCode int
ContentType string
ContentDisposition string
ContentLength int64
}
DownloadResponse is a streaming response for binary download endpoints.
func (*DownloadResponse) Close ¶
func (d *DownloadResponse) Close() error
Close closes the response body.
type LinkedObject ¶
type LinkedObject struct {
ID string `json:"id,omitempty"`
Provider string `json:"provider,omitempty"`
EntityType string `json:"entity_type,omitempty"`
EntityID string `json:"entity_id,omitempty"`
}
LinkedObject represents a linked CRM object reference.
type ListDocumentsOptions ¶
type ListDocumentsOptions struct {
TemplateID string
FormID string
FolderUUID string
ContactID string
Count int
Page int
OrderBy DocumentOrderBy
CreatedFrom string
CreatedTo string
Deleted *bool
ID string
CompletedFrom string
CompletedTo string
MembershipID string
Metadata map[string]string
ModifiedFrom string
ModifiedTo string
Q string
Status *DocumentStatusCode
StatusNot *DocumentStatusCode
Tag string
}
ListDocumentsOptions controls list/search behavior for documents.
type ListWebhookEventsOptions ¶
type ListWebhookEventsOptions struct {
Since string
To string
Type string
HTTPStatusCode int
Error *bool
}
ListWebhookEventsOptions configures webhook event listing.
type ListWebhookSubscriptionsOptions ¶
ListWebhookSubscriptionsOptions configures webhook-subscription listing.
type Logger ¶
type Logger interface {
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Errorf(format string, args ...interface{})
}
Logger defines the logging interface used by the client.
type MoneyAmount ¶
type MoneyAmount struct {
Amount string `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
}
MoneyAmount represents an amount/currency pair.
type NamedContentBlock ¶
type NamedContentBlock struct {
Name string `json:"name,omitempty"`
}
NamedContentBlock is used by document detail payloads for image/table/text blocks.
type OAuthService ¶
type OAuthService interface {
Token(ctx context.Context, req *OAuthTokenRequest) (*OAuthTokenResponse, error)
}
OAuthService handles OAuth token operations.
type OAuthTokenRequest ¶
type OAuthTokenRequest struct {
GrantType string
ClientID string
ClientSecret string //nolint:gosec // G117: intentional OAuth credential field
Code string
RefreshToken string //nolint:gosec // G117: intentional OAuth credential field
Scope string
RedirectURI string
}
OAuthTokenRequest is used for create/refresh token operations.
type OAuthTokenResponse ¶
type OAuthTokenResponse struct {
AccessToken string `json:"access_token"` //nolint:gosec // G117: intentional OAuth credential field
RefreshToken string `json:"refresh_token,omitempty"` //nolint:gosec // G117: intentional OAuth credential field
TokenType string `json:"token_type"`
Scope string `json:"scope,omitempty"`
ExpiresIn int `json:"expires_in"`
}
OAuthTokenResponse is the OAuth access-token response.
type Option ¶
type Option func(*clientConfig) error
Option configures the client.
func WithAccessToken ¶
WithAccessToken sets OAuth Bearer auth.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithRetryPolicy ¶
func WithRetryPolicy(policy RetryPolicy) Option
WithRetryPolicy sets a custom retry policy.
func WithTimeout ¶
WithTimeout sets the HTTP timeout for requests.
func WithUserAgent ¶
WithUserAgent sets a custom User-Agent.
type ProductCatalogBillingType ¶
type ProductCatalogBillingType string
ProductCatalogBillingType is the catalog billing type enum.
const ( // ProductCatalogBillingTypeOneTime represents a one-time billing type. ProductCatalogBillingTypeOneTime ProductCatalogBillingType = "one_time" // ProductCatalogBillingTypeRecurring represents a recurring billing type. ProductCatalogBillingTypeRecurring ProductCatalogBillingType = "recurring" )
Product catalog billing type constants.
type ProductCatalogItemResponse ¶
type ProductCatalogItemResponse struct {
UUID string `json:"uuid,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
CategoryID string `json:"category_id,omitempty"`
CategoryName string `json:"category_name,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DefaultPriceConfiguration RawJSON `json:"default_price_configuration,omitempty"`
Variants RawJSON `json:"variants,omitempty"`
BundleItems RawJSON `json:"bundle_items,omitempty"`
}
ProductCatalogItemResponse is returned by create/get/update endpoints.
type ProductCatalogItemType ¶
type ProductCatalogItemType string
ProductCatalogItemType is the catalog item type enum.
const ( // ProductCatalogItemTypeRegular represents a regular catalog item. ProductCatalogItemTypeRegular ProductCatalogItemType = "regular" // ProductCatalogItemTypeBundle represents a bundle catalog item. ProductCatalogItemTypeBundle ProductCatalogItemType = "bundle" )
Product catalog item type constants.
type ProductCatalogSearchItem ¶
type ProductCatalogSearchItem struct {
UUID string `json:"uuid,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
Title string `json:"title,omitempty"`
SKU string `json:"sku,omitempty"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
BillingType string `json:"billing_type,omitempty"`
BillingCycle int `json:"billing_cycle,omitempty"`
Currency string `json:"currency,omitempty"`
CategoryID string `json:"category_id,omitempty"`
CategoryName string `json:"category_name,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateModified string `json:"date_modified,omitempty"`
PricingMethod int `json:"pricing_method,omitempty"`
BundleItemsCount int `json:"bundle_items_count,omitempty"`
ImageSrc string `json:"image_src,omitempty"`
Price *float64 `json:"price,omitempty"`
Cost *float64 `json:"cost,omitempty"`
MinTierValue *float64 `json:"min_tier_value,omitempty"`
MaxTierValue *float64 `json:"max_tier_value,omitempty"`
CustomFields RawJSON `json:"custom_fields,omitempty"`
Images RawJSON `json:"images,omitempty"`
Highlights RawJSON `json:"highlights,omitempty"`
Tiers RawJSON `json:"tiers,omitempty"`
}
ProductCatalogSearchItem is a search result entry.
type ProductCatalogService ¶
type ProductCatalogService interface {
Search(ctx context.Context, opts *SearchProductCatalogItemsOptions) (*SearchProductCatalogItemsResponse, error)
Create(ctx context.Context, reqBody CreateProductCatalogItemRequest) (*ProductCatalogItemResponse, error)
Get(ctx context.Context, itemUUID string) (*ProductCatalogItemResponse, error)
Update(ctx context.Context, itemUUID string, reqBody UpdateProductCatalogItemRequest) (*ProductCatalogItemResponse, error)
Delete(ctx context.Context, itemUUID string) error
}
ProductCatalogService handles product-catalog API operations.
type RawJSON ¶
type RawJSON = json.RawMessage
RawJSON is a helper alias for nested payloads that are intentionally untyped.
type RawObject ¶
RawObject is a flexible JSON object shape for endpoints with wide payload variance.
type RetryPolicy ¶
type RetryPolicy struct {
MaxRetries int
InitialBackoff time.Duration
MaxBackoff time.Duration
RetryOn429 bool
RetryOn5xx bool
}
RetryPolicy controls transport-level retries.
func DefaultRetryPolicy ¶
func DefaultRetryPolicy() RetryPolicy
DefaultRetryPolicy returns a safe retry policy for API clients.
type SearchProductCatalogItemsOptions ¶
type SearchProductCatalogItemsOptions struct {
Page int
PerPage int
Query string
OrderBy string
Types []ProductCatalogItemType
BillingTypes []ProductCatalogBillingType
ExcludeUUIDs []string
CategoryID string
NoCategory *bool
}
SearchProductCatalogItemsOptions controls catalog search filters.
type SearchProductCatalogItemsResponse ¶
type SearchProductCatalogItemsResponse struct {
Items []ProductCatalogSearchItem `json:"items"`
HasMoreItems bool `json:"has_more_items"`
Total int `json:"total"`
}
SearchProductCatalogItemsResponse is returned by catalog search.
type TransferAllDocumentsOwnershipRequest ¶
TransferAllDocumentsOwnershipRequest is a flexible bulk ownership transfer payload.
type TransferDocumentOwnershipRequest ¶
TransferDocumentOwnershipRequest is a flexible ownership transfer payload.
type UpdateProductCatalogItemRequest ¶
UpdateProductCatalogItemRequest is a flexible update payload.
type UpdateWebhookSubscriptionSharedKeyResponse ¶
type UpdateWebhookSubscriptionSharedKeyResponse struct {
}
UpdateWebhookSubscriptionSharedKeyResponse contains regenerated shared-key.
type UserReference ¶
type UserReference struct {
ID string `json:"id,omitempty"`
MembershipID string `json:"membership_id,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Avatar string `json:"avatar,omitempty"`
}
UserReference is a compact user descriptor used across multiple endpoints.
type WebhookEventDetailsResponse ¶
type WebhookEventDetailsResponse struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
EventTime string `json:"event_time,omitempty"`
DeliveryTime string `json:"delivery_time,omitempty"`
URL string `json:"url,omitempty"`
HTTPStatusCode int `json:"http_status_code,omitempty"`
Error bool `json:"error"`
RequestBody RawJSON `json:"request_body,omitempty"`
ResponseBody RawJSON `json:"response_body,omitempty"`
ResponseHeaders RawJSON `json:"response_headers,omitempty"`
Signature string `json:"signature,omitempty"`
}
WebhookEventDetailsResponse represents a single webhook event payload.
type WebhookEventItem ¶
type WebhookEventItem struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
HTTPStatusCode int `json:"http_status_code,omitempty"`
DeliveryTime string `json:"delivery_time,omitempty"`
Error bool `json:"error"`
}
WebhookEventItem is a compact event-list entry.
type WebhookEventListResponse ¶
type WebhookEventListResponse struct {
Items []WebhookEventItem `json:"items"`
}
WebhookEventListResponse represents webhook event pages.
type WebhookEventsService ¶
type WebhookEventsService interface {
List(ctx context.Context, opts *ListWebhookEventsOptions) (*WebhookEventListResponse, error)
Get(ctx context.Context, id string) (*WebhookEventDetailsResponse, error)
}
WebhookEventsService handles webhook-event endpoints.
type WebhookPayloadOption ¶
type WebhookPayloadOption string
WebhookPayloadOption controls additional payload sections in webhook deliveries.
const ( // WebhookPayloadMetadata includes metadata in webhook payload. WebhookPayloadMetadata WebhookPayloadOption = "metadata" // WebhookPayloadFields includes fields in webhook payload. WebhookPayloadFields WebhookPayloadOption = "fields" // WebhookPayloadProducts includes products in webhook payload. WebhookPayloadProducts WebhookPayloadOption = "products" // WebhookPayloadTokens includes tokens in webhook payload. WebhookPayloadTokens WebhookPayloadOption = "tokens" // WebhookPayloadPricing includes pricing in webhook payload. WebhookPayloadPricing WebhookPayloadOption = "pricing" )
Webhook payload option constants.
type WebhookSubscription ¶
type WebhookSubscription struct {
UUID string `json:"uuid,omitempty"`
Workspace string `json:"workspace_id,omitempty"`
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Active bool `json:"active"`
Status string `json:"status,omitempty"`
Triggers []WebhookTrigger `json:"triggers,omitempty"`
Payload []WebhookPayloadOption `json:"payload,omitempty"`
}
WebhookSubscription represents a webhook subscription item.
type WebhookSubscriptionListResponse ¶
type WebhookSubscriptionListResponse struct {
Items []WebhookSubscription `json:"items"`
}
WebhookSubscriptionListResponse lists webhook subscriptions.
type WebhookSubscriptionRequest ¶
type WebhookSubscriptionRequest struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Active *bool `json:"active,omitempty"`
Triggers []WebhookTrigger `json:"triggers,omitempty"`
Payload []WebhookPayloadOption `json:"payload,omitempty"`
}
WebhookSubscriptionRequest creates/updates webhook subscriptions.
type WebhookSubscriptionsService ¶
type WebhookSubscriptionsService interface {
List(ctx context.Context, opts *ListWebhookSubscriptionsOptions) (*WebhookSubscriptionListResponse, error)
Create(ctx context.Context, reqBody *WebhookSubscriptionRequest) (*WebhookSubscription, error)
Get(ctx context.Context, id string) (*WebhookSubscription, error)
Update(ctx context.Context, id string, reqBody *WebhookSubscriptionRequest) (*WebhookSubscription, error)
Delete(ctx context.Context, id string) error
}
WebhookSubscriptionsService handles webhook-subscription endpoints.
type WebhookTrigger ¶
type WebhookTrigger string
WebhookTrigger controls which events trigger subscription deliveries.
const ( // WebhookTriggerRecipientCompleted triggers when a recipient completes. WebhookTriggerRecipientCompleted WebhookTrigger = "recipient_completed" // WebhookTriggerDocumentUpdated triggers when a document is updated. WebhookTriggerDocumentUpdated WebhookTrigger = "document_updated" // WebhookTriggerDocumentDeleted triggers when a document is deleted. WebhookTriggerDocumentDeleted WebhookTrigger = "document_deleted" // WebhookTriggerDocumentStateChanged triggers when document state changes. WebhookTriggerDocumentStateChanged WebhookTrigger = "document_state_changed" // WebhookTriggerDocumentCreationFailed triggers when document creation fails. WebhookTriggerDocumentCreationFailed WebhookTrigger = "document_creation_failed" // WebhookTriggerDocumentCompletedPDFReady triggers when completed PDF is ready. WebhookTriggerDocumentCompletedPDFReady WebhookTrigger = "document_completed_pdf_ready" // WebhookTriggerDocumentSectionAdded triggers when a document section is added. WebhookTriggerDocumentSectionAdded WebhookTrigger = "document_section_added" // WebhookTriggerQuoteUpdated triggers when a quote is updated. WebhookTriggerQuoteUpdated WebhookTrigger = "quote_updated" // WebhookTriggerTemplateCreated triggers when a template is created. WebhookTriggerTemplateCreated WebhookTrigger = "template_created" // WebhookTriggerTemplateUpdated triggers when a template is updated. WebhookTriggerTemplateUpdated WebhookTrigger = "template_updated" // WebhookTriggerTemplateDeleted triggers when a template is deleted. WebhookTriggerTemplateDeleted WebhookTrigger = "template_deleted" // WebhookTriggerContentLibraryItemCreated triggers when content library item is created. WebhookTriggerContentLibraryItemCreated WebhookTrigger = "content_library_item_created" // WebhookTriggerContentLibraryItemCreationFail triggers when content library creation fails. WebhookTriggerContentLibraryItemCreationFail WebhookTrigger = "content_library_item_creation_failed" )
Webhook trigger constants.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
get_document_fields
command
Example: Get document details and fields from PandaDoc
|
Example: Get document details and fields from PandaDoc |
|
list_catalog
command
Example: List catalog items from PandaDoc
|
Example: List catalog items from PandaDoc |
|
list_documents
command
Example: List documents from PandaDoc
|
Example: List documents from PandaDoc |
|
internal
|
|
|
cmd/specsync
command
Package main is the specsync command that synchronizes the SDK against OpenAPI spec changes.
|
Package main is the specsync command that synchronizes the SDK against OpenAPI spec changes. |
|
spec
Package spec provides the generated operation manifest for the PandaDoc API.
|
Package spec provides the generated operation manifest for the PandaDoc API. |
