@timbro/invoices 0.8.2 → 0.9.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -258
- package/dist/admin.d.ts +44 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +16 -0
- package/dist/certificate-custody-import.d.ts +4 -2
- package/dist/certificate-custody-import.d.ts.map +1 -1
- package/dist/certificate-custody-import.js +1 -1
- package/dist/collection.d.ts +1 -1
- package/dist/collection.js +4 -4
- package/dist/fiscal-engine-runtime.manifest.json +16 -16
- package/dist/fiscal-engine-runtime.provenance.json +17 -17
- package/dist/generated/hosted/index.d.ts +4 -0
- package/dist/generated/hosted/index.d.ts.map +1 -0
- package/dist/generated/hosted/index.js +3 -0
- package/dist/generated/hosted/sdk.gen.d.ts +106 -0
- package/dist/generated/hosted/sdk.gen.d.ts.map +1 -0
- package/dist/generated/hosted/sdk.gen.js +1049 -0
- package/dist/generated/hosted/types.gen.d.ts +2425 -0
- package/dist/generated/hosted/types.gen.d.ts.map +1 -0
- package/dist/generated/hosted/types.gen.js +2 -0
- package/dist/generated/hosted/zod.gen.d.ts +1772 -0
- package/dist/generated/hosted/zod.gen.d.ts.map +1 -0
- package/dist/generated/hosted/zod.gen.js +2269 -0
- package/dist/generated/index.d.ts +3 -3
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -2
- package/dist/generated/invoice-api-contract.d.ts +6348 -0
- package/dist/generated/invoice-api-contract.d.ts.map +1 -0
- package/dist/generated/invoice-api-contract.js +11004 -0
- package/dist/generated/problem-catalog.d.ts.map +1 -1
- package/dist/generated/problem-catalog.js +9 -3
- package/dist/generated/sdk.gen.d.ts +70 -38
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.js +1261 -251
- package/dist/generated/types.gen.d.ts +4349 -2686
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/generated/zod.gen.d.ts +53878 -22744
- package/dist/generated/zod.gen.d.ts.map +1 -1
- package/dist/generated/zod.gen.js +5733 -665
- package/dist/generated-operation-client.d.ts +1 -0
- package/dist/generated-operation-client.d.ts.map +1 -1
- package/dist/generated-operation-client.js +3 -2
- package/dist/generated-problem.d.ts +1 -1
- package/dist/generated-problem.d.ts.map +1 -1
- package/dist/generated-problem.js +4 -4
- package/dist/index.d.ts +8 -37
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -12
- package/dist/{fiscal-error.d.ts → invoice-error.d.ts} +10 -9
- package/dist/invoice-error.d.ts.map +1 -0
- package/dist/{fiscal-error.js → invoice-error.js} +7 -4
- package/dist/invoice-hosted-controls.d.ts +62 -0
- package/dist/invoice-hosted-controls.d.ts.map +1 -0
- package/dist/invoice-hosted-controls.js +188 -0
- package/dist/invoice-receipt.d.ts +10 -0
- package/dist/invoice-receipt.d.ts.map +1 -0
- package/dist/invoice-receipt.js +49 -0
- package/dist/invoice-replacement.d.ts +8 -0
- package/dist/invoice-replacement.d.ts.map +1 -0
- package/dist/invoice-replacement.js +18 -0
- package/dist/invoice.d.ts +94 -0
- package/dist/invoice.d.ts.map +1 -0
- package/dist/invoice.js +251 -0
- package/dist/printed-representation.d.ts +0 -1
- package/dist/printed-representation.d.ts.map +1 -1
- package/dist/printed-representation.js +3 -3
- package/dist/problem-contract.d.ts +17 -114
- package/dist/problem-contract.d.ts.map +1 -1
- package/dist/public-case.d.ts +1 -1
- package/dist/received-documents.d.ts +13 -12
- package/dist/received-documents.d.ts.map +1 -1
- package/dist/received-documents.js +26 -20
- package/dist/source-connection.d.ts +5 -5
- package/dist/source-connection.d.ts.map +1 -1
- package/dist/source-connection.js +8 -9
- package/dist/stamp-server-http-transport.js +6 -6
- package/dist/timbro-client.d.ts +5 -37
- package/dist/timbro-client.d.ts.map +1 -1
- package/dist/timbro-client.js +4 -20
- package/dist/timbro_fiscal_engine_bg.wasm +0 -0
- package/dist/transport-contract.d.ts +1 -1
- package/dist/transport-contract.d.ts.map +1 -1
- package/dist/webhook-delivery.js +1 -1
- package/dist/webhook-event.d.ts +124 -842
- package/dist/webhook-event.d.ts.map +1 -1
- package/dist/webhook-event.js +3 -1
- package/dist/webhook-registration.d.ts +1 -2
- package/dist/webhook-registration.d.ts.map +1 -1
- package/dist/webhook-registration.js +1 -2
- package/dist/webhook-replay.d.ts +1 -2
- package/dist/webhook-replay.d.ts.map +1 -1
- package/dist/webhook-replay.js +3 -4
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +2 -2
- package/package.json +26 -16
- package/dist/fiscal-delivery.d.ts +0 -12
- package/dist/fiscal-delivery.d.ts.map +0 -1
- package/dist/fiscal-delivery.js +0 -45
- package/dist/fiscal-error.d.ts.map +0 -1
- package/dist/fiscal-receipt.d.ts +0 -19
- package/dist/fiscal-receipt.d.ts.map +0 -1
- package/dist/fiscal-receipt.js +0 -66
|
@@ -0,0 +1,2425 @@
|
|
|
1
|
+
export type ClientOptions = {
|
|
2
|
+
baseUrl: "https://api.timbro.do" | (string & {});
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* MerchantBusinessFiscalSetup
|
|
6
|
+
*
|
|
7
|
+
* Timbro's view of electronic invoicing provisioning, or why it cannot be read.
|
|
8
|
+
*/
|
|
9
|
+
export type MerchantBusinessFiscalSetup = MerchantBusinessFiscalSetupUnavailable | MerchantBusinessFiscalSetupAvailable;
|
|
10
|
+
/**
|
|
11
|
+
* MerchantBusinessFiscalSetupUnavailable
|
|
12
|
+
*/
|
|
13
|
+
export type MerchantBusinessFiscalSetupUnavailable = {
|
|
14
|
+
status: "unavailable";
|
|
15
|
+
cause: "timbro_unreachable";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* MerchantBusinessFiscalSetupAvailable
|
|
19
|
+
*/
|
|
20
|
+
export type MerchantBusinessFiscalSetupAvailable = {
|
|
21
|
+
status: "available";
|
|
22
|
+
binding: MerchantBusinessFiscalBinding;
|
|
23
|
+
legalIssuer: MerchantBusinessLegalIssuer;
|
|
24
|
+
signingCertificate: MerchantBusinessSigningCertificate;
|
|
25
|
+
/**
|
|
26
|
+
* MerchantBusinessTestFiscalDocument
|
|
27
|
+
*
|
|
28
|
+
* The TesteCF document DGII must accept for this RNC and certificate.
|
|
29
|
+
*/
|
|
30
|
+
testFiscalDocument: {
|
|
31
|
+
status: "not_sent";
|
|
32
|
+
} | {
|
|
33
|
+
status: "processing";
|
|
34
|
+
id: string;
|
|
35
|
+
documentType: "31" | "32" | "33" | "34" | "41" | "43" | "44" | "45" | "46" | "47";
|
|
36
|
+
} | {
|
|
37
|
+
status: "accepted";
|
|
38
|
+
id: string;
|
|
39
|
+
documentType: "31" | "32" | "33" | "34" | "41" | "43" | "44" | "45" | "46" | "47";
|
|
40
|
+
} | {
|
|
41
|
+
status: "rejected";
|
|
42
|
+
id: string;
|
|
43
|
+
documentType: "31" | "32" | "33" | "34" | "41" | "43" | "44" | "45" | "46" | "47";
|
|
44
|
+
reason: "timbro_rejected" | "authority_rejected";
|
|
45
|
+
messages: Array<string>;
|
|
46
|
+
} | {
|
|
47
|
+
status: "operator_required";
|
|
48
|
+
id: string;
|
|
49
|
+
documentType: "31" | "32" | "33" | "34" | "41" | "43" | "44" | "45" | "46" | "47";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* MerchantBusinessFiscalBinding
|
|
54
|
+
*
|
|
55
|
+
* The Timbro Organization, Legal issuer, Source connection, and webhook.
|
|
56
|
+
*/
|
|
57
|
+
export type MerchantBusinessFiscalBinding = {
|
|
58
|
+
status: "unbound";
|
|
59
|
+
} | {
|
|
60
|
+
status: "provisioning";
|
|
61
|
+
} | {
|
|
62
|
+
status: "bound";
|
|
63
|
+
webhookSecret: "sealed" | "pending";
|
|
64
|
+
} | {
|
|
65
|
+
status: "failed";
|
|
66
|
+
} | {
|
|
67
|
+
status: "conflict";
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* MerchantBusinessLegalIssuer
|
|
71
|
+
*
|
|
72
|
+
* Whether Timbro holds every profile field the hosted Legal issuer requires.
|
|
73
|
+
*/
|
|
74
|
+
export type MerchantBusinessLegalIssuer = {
|
|
75
|
+
status: "missing";
|
|
76
|
+
} | {
|
|
77
|
+
status: "incomplete";
|
|
78
|
+
} | {
|
|
79
|
+
status: "complete";
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* MerchantBusinessSigningCertificate
|
|
83
|
+
*
|
|
84
|
+
* The certificate Timbro's custody holds for the Legal issuer.
|
|
85
|
+
*/
|
|
86
|
+
export type MerchantBusinessSigningCertificate = {
|
|
87
|
+
status: "missing";
|
|
88
|
+
} | {
|
|
89
|
+
status: "active";
|
|
90
|
+
sha256: string;
|
|
91
|
+
signerSerialNumber: string;
|
|
92
|
+
notBefore: string;
|
|
93
|
+
notAfter: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* MerchantBusinessLiveFiscalSetup
|
|
97
|
+
*
|
|
98
|
+
* Production binding and custody facts. These do not establish DGII production qualification.
|
|
99
|
+
*/
|
|
100
|
+
export type MerchantBusinessLiveFiscalSetup = MerchantBusinessFiscalSetupUnavailable | MerchantBusinessLiveFiscalSetupAvailable;
|
|
101
|
+
/**
|
|
102
|
+
* MerchantBusinessLiveFiscalSetupAvailable
|
|
103
|
+
*/
|
|
104
|
+
export type MerchantBusinessLiveFiscalSetupAvailable = {
|
|
105
|
+
status: "available";
|
|
106
|
+
binding: MerchantBusinessFiscalBinding;
|
|
107
|
+
legalIssuer: MerchantBusinessLegalIssuer;
|
|
108
|
+
signingCertificate: MerchantBusinessSigningCertificate;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Problem
|
|
112
|
+
*
|
|
113
|
+
* RFC 9457 problem details. Every failure of this API is one of these, and each operation narrows `code` to the subset it can emit.
|
|
114
|
+
*/
|
|
115
|
+
export type Problem = {
|
|
116
|
+
/**
|
|
117
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
118
|
+
*/
|
|
119
|
+
code: "merchant_authentication_unavailable" | "platform_test_profile_unavailable" | "merchant_fiscal_binding_unavailable" | "merchant_fiscal_setup_unavailable" | "merchant_contact_email_confirmation_required" | "merchant_service_scope_required" | "merchant_business_address_required" | "merchant_business_contact_required" | "merchant_business_location_official_codes_required" | "merchant_business_details_invalid" | "merchant_current_payment_methods_required" | "merchant_current_sales_channels_required" | "merchant_existing_card_service_not_applicable" | "merchant_existing_card_service_other_provider_name_invalid" | "merchant_existing_card_service_other_provider_name_not_allowed" | "merchant_existing_card_service_other_provider_name_required" | "merchant_existing_card_service_providers_exclusive_choice" | "merchant_existing_card_service_providers_required" | "merchant_existing_card_service_required" | "merchant_location_catalog_changed" | "merchant_location_catalog_unavailable" | "merchant_location_selection_invalid" | "merchant_payment_methods_not_applicable" | "merchant_sales_channels_exclusive_choice" | "merchant_sales_channels_not_applicable" | "merchant_business_type_not_applicable" | "merchant_charge_timing_not_applicable" | "merchant_charge_timing_required" | "merchant_payment_methods_exclusive_choice" | "merchant_session_missing" | "merchant_guest_notice_acceptance_required" | "merchant_workspace_organization_required" | "merchant_onboarding_revision_conflict" | "merchant_checkout_policy_revision_conflict" | "merchant_business_already_claimed" | "merchant_business_attachment_conflict" | "merchant_business_identity_required" | "merchant_business_not_member" | "merchant_business_revision_conflict" | "merchant_business_capabilities_required" | "merchant_fiscal_setup_incomplete" | "merchant_payment_setup_assessment_incomplete" | "merchant_certificate_conflict" | "merchant_test_fiscal_document_blocked" | "merchant_dgii_assistance_not_applicable" | "merchant_dgii_assistance_notes_invalid" | "parameter_missing" | "parameter_invalid" | "provider_not_available" | "currency_not_supported" | "amount_below_minimum" | "amount_above_maximum" | "checkout_reference_invalid" | "checkout_reference_expired" | "fiscal_buyer_tax_id_invalid" | "fiscal_lines_required" | "payment_split_invalid" | "submission_token_invalid" | "submission_token_expired" | "request_body_malformed" | "collection_cursor_invalid" | "webhook_replay_scope_invalid" | "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "payer_session_missing" | "operation_not_permitted" | "invoice_delivery_not_permitted" | "journey_scope_mismatch" | "journey_report_timeout" | "merchant_fiscal_binding_conflict" | "live_mode_not_enabled" | "origin_not_allowed" | "payer_step_up_required" | "certificate_handoff_person_mismatch" | "route_not_found" | "api_key_not_found" | "payment_not_found" | "payment_reference_conflict" | "refund_reference_conflict" | "payment_reference_invalid" | "refund_reference_invalid" | "payment_tax_required" | "payment_tax_invalid" | "payment_items_invalid" | "payment_totals_mismatch" | "payment_invoice_item_fields_required" | "payments_contract_migration_required" | "merchant_payments_api_paused" | "refund_not_found" | "refund_invoice_not_ready" | "refund_invoice_not_accepted" | "refund_invoice_mismatch" | "refund_invoice_conflict" | "payment_part_not_found" | "payment_split_not_found" | "fiscal_document_not_found" | "merchant_account_not_found" | "merchant_account_card_capability_not_found" | "merchant_business_not_found" | "agent_client_not_found" | "connected_agent_not_found" | "certificate_handoff_not_found" | "webhook_endpoint_not_found" | "webhook_event_not_found" | "three_ds_not_found" | "payer_not_found" | "saved_card_not_found" | "payer_credential_not_found" | "payer_purchase_not_found" | "payer_fiscal_profile_not_found" | "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "api_key_retired" | "payment_method_already_in_progress" | "payment_not_payable" | "refund_not_allowed" | "refund_already_exists" | "payment_awaiting_verification" | "payment_attempt_invalid" | "payment_attempt_mismatch" | "payment_attempt_stale" | "payment_method_mismatch" | "provider_response_invalid" | "decline_not_retryable" | "checkout_window_closed" | "payment_not_editable" | "payment_cancel_not_allowed" | "payment_cancellation_pending" | "invoicing_locked" | "source_identity_conflict" | "refund_source_identity_conflict" | "refund_payment_not_captured" | "refund_exceeds_captured" | "refund_allocation_not_found" | "refund_allocation_conflict" | "refund_allocation_ledger_unavailable" | "fiscal_buyer_required" | "fiscal_artifact_not_ready" | "payment_invoice_not_ready" | "payment_invoice_not_allowed" | "invoice_reference_stale" | "fiscal_delivery_not_ready" | "payment_split_not_allowed" | "payment_split_exists" | "payment_split_locked" | "payment_split_not_capturable" | "payment_split_not_expired" | "payment_split_not_renewable" | "payment_split_complete" | "payment_split_part_required" | "payment_part_not_payable" | "webhook_endpoint_deleted" | "webhook_endpoint_suspended" | "three_ds_binding_mismatch" | "payer_enrollment_unavailable" | "payer_claim_unavailable" | "payer_claim_conflict" | "payer_claim_proof_invalid" | "payer_delivery_address_unavailable" | "payer_fiscal_profile_unavailable" | "certificate_handoff_used" | "receipt_retention_elapsed" | "certificate_handoff_expired" | "request_body_too_large" | "unsupported_media_type" | "merchant_account_not_ready" | "merchant_checkout_policy_invalid" | "merchant_account_provider_mismatch" | "merchant_account_identity_mismatch" | "merchant_profile_incomplete" | "payment_description_required" | "sale_amount_invalid" | "credential_storage_unavailable" | "refund_credentials_unavailable" | "refund_provider_unavailable" | "refund_provider_reference_unavailable" | "provider_not_eligible" | "no_eligible_provider" | "currency_not_supported_by_provider" | "currency_not_supported_for_fiscal_document" | "fiscal_total_mismatch" | "fiscal_line_total_invalid" | "fiscal_line_legal_tip_invalid" | "fiscal_document_kind_not_allowed" | "fiscal_document_kind_unsupported" | "fiscal_government_eligibility_required" | "fiscal_government_eligibility_not_allowed" | "certificate_p12_password_invalid" | "certificate_pkcs12_invalid" | "certificate_not_supported" | "taxpayer_unregistered" | "taxpayer_inactive" | "voluntary_tip_currency_mismatch" | "voluntary_tip_not_allowed_for_split" | "voluntary_tip_not_available" | "voluntary_tip_exceeds_maximum" | "refund_tip_amount_invalid" | "refund_tip_allocation_unknown" | "refund_amount_invalid" | "refund_currency_mismatch" | "payer_fiscal_profile_invalid" | "rate_limit_exceeded" | "internal_error" | "provider_unavailable" | "provider_rejected_request" | "taxpayer_directory_unavailable" | "fiscal_artifact_retrieval_unavailable" | "fiscal_delivery_unavailable" | "journey_marks_unavailable" | "contact_request_delivery_unavailable" | "unauthenticated" | "invalid_login" | "email_already_registered" | "organization_slug_taken" | "organization_not_found" | "hosted_tenant_conflict" | "insufficient_role" | "service_role_not_permitted" | "invalid_fiscal_identity" | "invalid_certificate_custody_signer_identity" | "custody_certificate_malformed" | "custody_certificate_not_yet_valid" | "custody_certificate_expired" | "custody_p12_work_limit_exceeded" | "custody_signature_algorithm_unsupported" | "custody_certificate_trust_profile_unsupported" | "custody_certificate_chain_untrusted" | "custody_certificate_purpose_unsupported" | "legal_issuer_already_registered" | "onboarding_legal_issuer_identity_conflict" | "legal_issuer_profile_incomplete" | "legal_issuer_not_found" | "invitation_invalid" | "invitation_expired" | "already_a_member" | "environment_not_active" | "certificate_custody_binding_not_found" | "certificate_custody_binding_conflict" | "certificate_custody_certificate_version_not_active" | "source_connection_not_found" | "source_connection_not_connected" | "source_provider_unavailable" | "source_provider_authorization_required" | "source_provider_installation_disabled" | "source_provider_installation_removed" | "source_provider_scope_insufficient" | "source_provider_target_access_removed" | "source_provider_throttled" | "source_provider_outcome_unknown" | "source_provider_authorization_not_found" | "source_provider_authorization_conflict" | "source_provider_installation_request_invalid" | "source_provider_installation_request_expired" | "source_provider_installation_callback_replayed" | "source_connection_creation_conflict" | "source_connection_activation_conflict" | "source_connection_activation_verification_rejected" | "delegated_authorization_verifier_forbidden" | "invalid_credential" | "credential_revoked" | "issuer_not_authorized" | "missing_idempotency_key" | "invalid_idempotency_key" | "request_too_large" | "request_body_timeout" | "malformed_json" | "invalid_request" | "invalid_collection_query" | "invalid_collection_cursor" | "document_type_not_enabled" | "fiscal_intent_rejected" | "idempotency_key_conflict" | "fiscal_number_already_used" | "fiscal_number_authorization_changed" | "fiscal_number_authorization_source_record_conflict" | "source_version_stale" | "source_predecessor_conflict" | "source_history_requires_reconciliation" | "source_content_conflict" | "source_action_conflict" | "source_command_conflict" | "invoice_reference_conflict" | "invoice_totals_mismatch" | "printed_representation_profile_conflict" | "source_record_already_fiscalized" | "source_operation_pending" | "source_outcome_unknown" | "authority_rejected_replacement" | "correction_target_unsettled" | "unsupported_printed_representation_profile" | "affected_fiscal_operation_unsupported" | "fiscal_issuance_blocked" | "fiscal_operation_not_found" | "invoice_not_found" | "fiscal_artifact_not_found" | "fiscal_artifact_unverified" | "fiscal_artifact_unavailable" | "invoice_receipt_not_found" | "invoice_receipt_not_ready" | "invoice_receipt_unavailable" | "fiscal_delivery_not_found" | "fiscal_delivery_outcome_conflict" | "webhook_endpoint_registration_conflict" | "invalid_replay_scope" | "webhook_destination_not_allowed" | "unsigned_document_schema_invalid" | "signed_document_schema_invalid" | "custody_unavailable" | "received_document_not_found" | "commercial_response_motive_invalid" | "commercial_response_decision_conflict" | "method_not_allowed";
|
|
120
|
+
detail?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Present only when the rejected request produced a Fiscal operation.
|
|
123
|
+
*/
|
|
124
|
+
invoiceId?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Present only when the authoritative issuance rules refused to issue.
|
|
127
|
+
*/
|
|
128
|
+
issuanceBlockers?: Array<"invalid_request" | "unsupported_protocol" | "unsupported_rules_version" | "invalid_resolved_facts" | "numbering_verifier_missing" | "numbering_mode_not_enabled" | "document_type_not_recognized" | "authorization_missing" | "authorization_not_observed_on_effective_date" | "authorization_suspended" | "authorization_cancelled" | "authorization_superseded" | "authorization_exhausted" | "authorization_conflicting" | "authorization_document_type_mismatch" | "central_assignment_requires_verified_authorization" | "authorization_expired" | "authorization_range_overlap" | "fiscal_number_capacity_exhausted" | "invalid_fiscal_number" | "fiscal_number_outside_authorized_range" | "fiscal_number_before_verified_floor" | "sequence_expiration_mismatch">;
|
|
129
|
+
/**
|
|
130
|
+
* Present only when the rejection points at a value the request carried.
|
|
131
|
+
*/
|
|
132
|
+
problems?: Array<{
|
|
133
|
+
code: string;
|
|
134
|
+
message: string;
|
|
135
|
+
path: string;
|
|
136
|
+
}>;
|
|
137
|
+
requestId: string;
|
|
138
|
+
status: number;
|
|
139
|
+
title: string;
|
|
140
|
+
type: "about:blank";
|
|
141
|
+
};
|
|
142
|
+
export type RetrieveBusinessData = {
|
|
143
|
+
body?: never;
|
|
144
|
+
path?: never;
|
|
145
|
+
query?: never;
|
|
146
|
+
url: "/v1/business";
|
|
147
|
+
};
|
|
148
|
+
export type RetrieveBusinessErrors = {
|
|
149
|
+
/**
|
|
150
|
+
* The request could not be understood.
|
|
151
|
+
*/
|
|
152
|
+
400: Problem & {
|
|
153
|
+
status: 400;
|
|
154
|
+
/**
|
|
155
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
156
|
+
*/
|
|
157
|
+
code: "parameter_invalid";
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* The credential is missing, malformed, or no longer valid.
|
|
161
|
+
*/
|
|
162
|
+
401: Problem & {
|
|
163
|
+
status: 401;
|
|
164
|
+
/**
|
|
165
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
166
|
+
*/
|
|
167
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* The credential is valid but not permitted to perform this operation.
|
|
171
|
+
*/
|
|
172
|
+
403: Problem & {
|
|
173
|
+
status: 403;
|
|
174
|
+
/**
|
|
175
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
176
|
+
*/
|
|
177
|
+
code: "operation_not_permitted";
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
181
|
+
*/
|
|
182
|
+
404: Problem & {
|
|
183
|
+
status: 404;
|
|
184
|
+
/**
|
|
185
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
186
|
+
*/
|
|
187
|
+
code: "merchant_business_not_found";
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
191
|
+
*/
|
|
192
|
+
500: Problem & {
|
|
193
|
+
status: 500;
|
|
194
|
+
/**
|
|
195
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
196
|
+
*/
|
|
197
|
+
code: "internal_error";
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
export type RetrieveBusinessError = RetrieveBusinessErrors[keyof RetrieveBusinessErrors];
|
|
201
|
+
export type RetrieveBusinessResponses = {
|
|
202
|
+
/**
|
|
203
|
+
* MerchantBusiness
|
|
204
|
+
*
|
|
205
|
+
* The business the credential selects, its capabilities, and the requirements that remain.
|
|
206
|
+
*/
|
|
207
|
+
200: {
|
|
208
|
+
object: "merchant_business";
|
|
209
|
+
id: string;
|
|
210
|
+
rnc: string;
|
|
211
|
+
legalName: string;
|
|
212
|
+
revision: number;
|
|
213
|
+
capabilities: {
|
|
214
|
+
payments: {
|
|
215
|
+
requested: boolean;
|
|
216
|
+
test: {
|
|
217
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
218
|
+
};
|
|
219
|
+
live: {
|
|
220
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
invoices: {
|
|
224
|
+
requested: boolean;
|
|
225
|
+
test: {
|
|
226
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
227
|
+
};
|
|
228
|
+
live: {
|
|
229
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
fiscalDetails: {
|
|
234
|
+
commercialName: string | null;
|
|
235
|
+
address: string | null;
|
|
236
|
+
location: {
|
|
237
|
+
placeId: string;
|
|
238
|
+
catalogReleaseId: string;
|
|
239
|
+
municipalityCode: string | null;
|
|
240
|
+
name: string;
|
|
241
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
242
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
243
|
+
/**
|
|
244
|
+
* The places that contain the selected one, outermost first.
|
|
245
|
+
*/
|
|
246
|
+
ancestors: Array<{
|
|
247
|
+
placeId: string;
|
|
248
|
+
name: string;
|
|
249
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
250
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
251
|
+
}>;
|
|
252
|
+
} | null;
|
|
253
|
+
phone: string | null;
|
|
254
|
+
email: string | null;
|
|
255
|
+
defaultIncomeType: string | null;
|
|
256
|
+
};
|
|
257
|
+
paymentsProfile: {
|
|
258
|
+
displayName: string;
|
|
259
|
+
statementDescriptor: string;
|
|
260
|
+
/**
|
|
261
|
+
* MerchantPermanentAddress
|
|
262
|
+
*
|
|
263
|
+
* The selling merchant's permanent business address.
|
|
264
|
+
*/
|
|
265
|
+
permanentAddress: {
|
|
266
|
+
line1: string;
|
|
267
|
+
line2?: string;
|
|
268
|
+
city: string;
|
|
269
|
+
province?: string;
|
|
270
|
+
postalCode?: string;
|
|
271
|
+
countryCode: string;
|
|
272
|
+
};
|
|
273
|
+
supportEmail: string;
|
|
274
|
+
supportPhone: string;
|
|
275
|
+
/**
|
|
276
|
+
* MerchantDeliveryPolicy
|
|
277
|
+
*
|
|
278
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
279
|
+
*/
|
|
280
|
+
deliveryPolicy: {
|
|
281
|
+
kind: "not_offered";
|
|
282
|
+
} | {
|
|
283
|
+
kind: "merchant_managed";
|
|
284
|
+
summary: string;
|
|
285
|
+
url?: string;
|
|
286
|
+
};
|
|
287
|
+
} | null;
|
|
288
|
+
invoicing: {
|
|
289
|
+
test: MerchantBusinessFiscalSetup;
|
|
290
|
+
live: MerchantBusinessLiveFiscalSetup;
|
|
291
|
+
};
|
|
292
|
+
requirements: Array<{
|
|
293
|
+
code: "capabilities_required" | "commercial_name_required" | "address_required" | "location_required" | "phone_required" | "default_income_type_required" | "contact_email_verification_required" | "fiscal_details_rejected" | "taxpayer_registration_required" | "signing_certificate_required" | "signing_certificate_expiring" | "test_fiscal_document_rejected" | "test_fiscal_document_pending" | "test_fiscal_document_send_pending" | "fiscal_binding_pending" | "legal_issuer_sync_pending" | "fiscal_setup_unavailable" | "fiscal_binding_conflict" | "fiscal_issuer_rejected" | "test_fiscal_document_operator_required" | "payments_profile_required" | "test_payments_unavailable" | "merchant_account_required" | "merchant_account_disabled" | "active_credential_required" | "credential_material_invalid" | "test_live_mode_mismatch" | "callback_configuration_failed" | "callback_configuration_required" | "connectivity_check_failed" | "connectivity_check_required" | "provider_qualification_failed" | "provider_qualification_required" | "provider_adapter_unavailable";
|
|
294
|
+
owner: "merchant" | "dgii" | "timbro" | "provider" | "operator";
|
|
295
|
+
blocks: Array<"payments" | "invoices">;
|
|
296
|
+
mode?: "test" | "live";
|
|
297
|
+
/**
|
|
298
|
+
* JSON Pointer into this representation the requirement names.
|
|
299
|
+
*/
|
|
300
|
+
field?: string;
|
|
301
|
+
errors?: Array<{
|
|
302
|
+
code: string;
|
|
303
|
+
message: string;
|
|
304
|
+
}>;
|
|
305
|
+
}>;
|
|
306
|
+
onboardingUrl: string;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
export type RetrieveBusinessResponse = RetrieveBusinessResponses[keyof RetrieveBusinessResponses];
|
|
310
|
+
export type UpdateBusinessData = {
|
|
311
|
+
/**
|
|
312
|
+
* MerchantBusinessUpdateRequest
|
|
313
|
+
*
|
|
314
|
+
* Each member the request carries replaces that member of the business.
|
|
315
|
+
*/
|
|
316
|
+
body: {
|
|
317
|
+
expectedRevision?: number;
|
|
318
|
+
capabilities?: {
|
|
319
|
+
payments?: {
|
|
320
|
+
requested: boolean;
|
|
321
|
+
};
|
|
322
|
+
invoices?: {
|
|
323
|
+
requested: boolean;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
fiscalDetails?: {
|
|
327
|
+
commercialName?: string;
|
|
328
|
+
address?: string;
|
|
329
|
+
location?: {
|
|
330
|
+
placeId: string;
|
|
331
|
+
catalogReleaseId: string;
|
|
332
|
+
} | {
|
|
333
|
+
/**
|
|
334
|
+
* An official e-CF municipality code, resolved to its place in the active location catalog release. A province code is refused.
|
|
335
|
+
*/
|
|
336
|
+
municipalityCode: string;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* A Dominican business number in E.164 format.
|
|
340
|
+
*/
|
|
341
|
+
phone?: string;
|
|
342
|
+
defaultIncomeType?: "01" | "02" | "03" | "04" | "05" | "06";
|
|
343
|
+
};
|
|
344
|
+
/**
|
|
345
|
+
* MerchantBusinessPaymentsProfile
|
|
346
|
+
*
|
|
347
|
+
* Payer-facing support, address, and delivery terms. The legal name and RNC are the business's.
|
|
348
|
+
*/
|
|
349
|
+
paymentsProfile?: {
|
|
350
|
+
displayName: string;
|
|
351
|
+
statementDescriptor: string;
|
|
352
|
+
/**
|
|
353
|
+
* MerchantPermanentAddress
|
|
354
|
+
*
|
|
355
|
+
* The selling merchant's permanent business address.
|
|
356
|
+
*/
|
|
357
|
+
permanentAddress: {
|
|
358
|
+
line1: string;
|
|
359
|
+
line2?: string;
|
|
360
|
+
city: string;
|
|
361
|
+
province?: string;
|
|
362
|
+
postalCode?: string;
|
|
363
|
+
countryCode: string;
|
|
364
|
+
};
|
|
365
|
+
supportEmail: string;
|
|
366
|
+
supportPhone: string;
|
|
367
|
+
/**
|
|
368
|
+
* MerchantDeliveryPolicy
|
|
369
|
+
*
|
|
370
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
371
|
+
*/
|
|
372
|
+
deliveryPolicy: {
|
|
373
|
+
kind: "not_offered";
|
|
374
|
+
} | {
|
|
375
|
+
kind: "merchant_managed";
|
|
376
|
+
summary: string;
|
|
377
|
+
url?: string;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
path?: never;
|
|
382
|
+
query?: never;
|
|
383
|
+
url: "/v1/business";
|
|
384
|
+
};
|
|
385
|
+
export type UpdateBusinessErrors = {
|
|
386
|
+
/**
|
|
387
|
+
* The request could not be understood.
|
|
388
|
+
*/
|
|
389
|
+
400: Problem & {
|
|
390
|
+
status: 400;
|
|
391
|
+
/**
|
|
392
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
393
|
+
*/
|
|
394
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* The credential is missing, malformed, or no longer valid.
|
|
398
|
+
*/
|
|
399
|
+
401: Problem & {
|
|
400
|
+
status: 401;
|
|
401
|
+
/**
|
|
402
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
403
|
+
*/
|
|
404
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* The credential is valid but not permitted to perform this operation.
|
|
408
|
+
*/
|
|
409
|
+
403: Problem & {
|
|
410
|
+
status: 403;
|
|
411
|
+
/**
|
|
412
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
413
|
+
*/
|
|
414
|
+
code: "operation_not_permitted";
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
418
|
+
*/
|
|
419
|
+
404: Problem & {
|
|
420
|
+
status: 404;
|
|
421
|
+
/**
|
|
422
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
423
|
+
*/
|
|
424
|
+
code: "merchant_business_not_found";
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
428
|
+
*/
|
|
429
|
+
409: Problem & {
|
|
430
|
+
status: 409;
|
|
431
|
+
/**
|
|
432
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
433
|
+
*/
|
|
434
|
+
code: "merchant_business_revision_conflict" | "merchant_business_capabilities_required" | "merchant_business_identity_required" | "merchant_business_address_required" | "merchant_business_location_official_codes_required" | "merchant_business_details_invalid" | "merchant_contact_email_confirmation_required" | "merchant_guest_notice_acceptance_required" | "merchant_location_catalog_changed" | "merchant_location_selection_invalid";
|
|
435
|
+
};
|
|
436
|
+
/**
|
|
437
|
+
* The request body is larger than this endpoint accepts.
|
|
438
|
+
*/
|
|
439
|
+
413: Problem & {
|
|
440
|
+
status: 413;
|
|
441
|
+
/**
|
|
442
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
443
|
+
*/
|
|
444
|
+
code: "request_body_too_large";
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* The request body carries a content type this endpoint does not accept.
|
|
448
|
+
*/
|
|
449
|
+
415: Problem & {
|
|
450
|
+
status: 415;
|
|
451
|
+
/**
|
|
452
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
453
|
+
*/
|
|
454
|
+
code: "unsupported_media_type";
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
458
|
+
*/
|
|
459
|
+
500: Problem & {
|
|
460
|
+
status: 500;
|
|
461
|
+
/**
|
|
462
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
463
|
+
*/
|
|
464
|
+
code: "internal_error";
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* A required service is temporarily unavailable. Retry with the same reference or command identity.
|
|
468
|
+
*/
|
|
469
|
+
503: Problem & {
|
|
470
|
+
status: 503;
|
|
471
|
+
/**
|
|
472
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
473
|
+
*/
|
|
474
|
+
code: "merchant_location_catalog_unavailable";
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
export type UpdateBusinessError = UpdateBusinessErrors[keyof UpdateBusinessErrors];
|
|
478
|
+
export type UpdateBusinessResponses = {
|
|
479
|
+
/**
|
|
480
|
+
* MerchantBusiness
|
|
481
|
+
*
|
|
482
|
+
* The business the credential selects, its capabilities, and the requirements that remain.
|
|
483
|
+
*/
|
|
484
|
+
200: {
|
|
485
|
+
object: "merchant_business";
|
|
486
|
+
id: string;
|
|
487
|
+
rnc: string;
|
|
488
|
+
legalName: string;
|
|
489
|
+
revision: number;
|
|
490
|
+
capabilities: {
|
|
491
|
+
payments: {
|
|
492
|
+
requested: boolean;
|
|
493
|
+
test: {
|
|
494
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
495
|
+
};
|
|
496
|
+
live: {
|
|
497
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
invoices: {
|
|
501
|
+
requested: boolean;
|
|
502
|
+
test: {
|
|
503
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
504
|
+
};
|
|
505
|
+
live: {
|
|
506
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
};
|
|
510
|
+
fiscalDetails: {
|
|
511
|
+
commercialName: string | null;
|
|
512
|
+
address: string | null;
|
|
513
|
+
location: {
|
|
514
|
+
placeId: string;
|
|
515
|
+
catalogReleaseId: string;
|
|
516
|
+
municipalityCode: string | null;
|
|
517
|
+
name: string;
|
|
518
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
519
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
520
|
+
/**
|
|
521
|
+
* The places that contain the selected one, outermost first.
|
|
522
|
+
*/
|
|
523
|
+
ancestors: Array<{
|
|
524
|
+
placeId: string;
|
|
525
|
+
name: string;
|
|
526
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
527
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
528
|
+
}>;
|
|
529
|
+
} | null;
|
|
530
|
+
phone: string | null;
|
|
531
|
+
email: string | null;
|
|
532
|
+
defaultIncomeType: string | null;
|
|
533
|
+
};
|
|
534
|
+
paymentsProfile: {
|
|
535
|
+
displayName: string;
|
|
536
|
+
statementDescriptor: string;
|
|
537
|
+
/**
|
|
538
|
+
* MerchantPermanentAddress
|
|
539
|
+
*
|
|
540
|
+
* The selling merchant's permanent business address.
|
|
541
|
+
*/
|
|
542
|
+
permanentAddress: {
|
|
543
|
+
line1: string;
|
|
544
|
+
line2?: string;
|
|
545
|
+
city: string;
|
|
546
|
+
province?: string;
|
|
547
|
+
postalCode?: string;
|
|
548
|
+
countryCode: string;
|
|
549
|
+
};
|
|
550
|
+
supportEmail: string;
|
|
551
|
+
supportPhone: string;
|
|
552
|
+
/**
|
|
553
|
+
* MerchantDeliveryPolicy
|
|
554
|
+
*
|
|
555
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
556
|
+
*/
|
|
557
|
+
deliveryPolicy: {
|
|
558
|
+
kind: "not_offered";
|
|
559
|
+
} | {
|
|
560
|
+
kind: "merchant_managed";
|
|
561
|
+
summary: string;
|
|
562
|
+
url?: string;
|
|
563
|
+
};
|
|
564
|
+
} | null;
|
|
565
|
+
invoicing: {
|
|
566
|
+
test: MerchantBusinessFiscalSetup;
|
|
567
|
+
live: MerchantBusinessLiveFiscalSetup;
|
|
568
|
+
};
|
|
569
|
+
requirements: Array<{
|
|
570
|
+
code: "capabilities_required" | "commercial_name_required" | "address_required" | "location_required" | "phone_required" | "default_income_type_required" | "contact_email_verification_required" | "fiscal_details_rejected" | "taxpayer_registration_required" | "signing_certificate_required" | "signing_certificate_expiring" | "test_fiscal_document_rejected" | "test_fiscal_document_pending" | "test_fiscal_document_send_pending" | "fiscal_binding_pending" | "legal_issuer_sync_pending" | "fiscal_setup_unavailable" | "fiscal_binding_conflict" | "fiscal_issuer_rejected" | "test_fiscal_document_operator_required" | "payments_profile_required" | "test_payments_unavailable" | "merchant_account_required" | "merchant_account_disabled" | "active_credential_required" | "credential_material_invalid" | "test_live_mode_mismatch" | "callback_configuration_failed" | "callback_configuration_required" | "connectivity_check_failed" | "connectivity_check_required" | "provider_qualification_failed" | "provider_qualification_required" | "provider_adapter_unavailable";
|
|
571
|
+
owner: "merchant" | "dgii" | "timbro" | "provider" | "operator";
|
|
572
|
+
blocks: Array<"payments" | "invoices">;
|
|
573
|
+
mode?: "test" | "live";
|
|
574
|
+
/**
|
|
575
|
+
* JSON Pointer into this representation the requirement names.
|
|
576
|
+
*/
|
|
577
|
+
field?: string;
|
|
578
|
+
errors?: Array<{
|
|
579
|
+
code: string;
|
|
580
|
+
message: string;
|
|
581
|
+
}>;
|
|
582
|
+
}>;
|
|
583
|
+
onboardingUrl: string;
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
export type UpdateBusinessResponse = UpdateBusinessResponses[keyof UpdateBusinessResponses];
|
|
587
|
+
export type ConfigureInvoicingData = {
|
|
588
|
+
/**
|
|
589
|
+
* MerchantBusinessConfigureInvoicingRequest
|
|
590
|
+
*/
|
|
591
|
+
body: {
|
|
592
|
+
mode: "test" | "live";
|
|
593
|
+
};
|
|
594
|
+
headers: {
|
|
595
|
+
"idempotency-key": string;
|
|
596
|
+
};
|
|
597
|
+
path?: never;
|
|
598
|
+
query?: never;
|
|
599
|
+
url: "/v1/business/configure-invoicing";
|
|
600
|
+
};
|
|
601
|
+
export type ConfigureInvoicingErrors = {
|
|
602
|
+
/**
|
|
603
|
+
* The request could not be understood.
|
|
604
|
+
*/
|
|
605
|
+
400: Problem & {
|
|
606
|
+
status: 400;
|
|
607
|
+
/**
|
|
608
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
609
|
+
*/
|
|
610
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* The credential is missing, malformed, or no longer valid.
|
|
614
|
+
*/
|
|
615
|
+
401: Problem & {
|
|
616
|
+
status: 401;
|
|
617
|
+
/**
|
|
618
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
619
|
+
*/
|
|
620
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
621
|
+
};
|
|
622
|
+
/**
|
|
623
|
+
* The credential is valid but not permitted to perform this operation.
|
|
624
|
+
*/
|
|
625
|
+
403: Problem & {
|
|
626
|
+
status: 403;
|
|
627
|
+
/**
|
|
628
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
629
|
+
*/
|
|
630
|
+
code: "operation_not_permitted";
|
|
631
|
+
};
|
|
632
|
+
/**
|
|
633
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
634
|
+
*/
|
|
635
|
+
404: Problem & {
|
|
636
|
+
status: 404;
|
|
637
|
+
/**
|
|
638
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
639
|
+
*/
|
|
640
|
+
code: "merchant_business_not_found";
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
644
|
+
*/
|
|
645
|
+
409: Problem & {
|
|
646
|
+
status: 409;
|
|
647
|
+
/**
|
|
648
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
649
|
+
*/
|
|
650
|
+
code: "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "merchant_fiscal_setup_incomplete";
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* The request body is larger than this endpoint accepts.
|
|
654
|
+
*/
|
|
655
|
+
413: Problem & {
|
|
656
|
+
status: 413;
|
|
657
|
+
/**
|
|
658
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
659
|
+
*/
|
|
660
|
+
code: "request_body_too_large";
|
|
661
|
+
};
|
|
662
|
+
/**
|
|
663
|
+
* The request body carries a content type this endpoint does not accept.
|
|
664
|
+
*/
|
|
665
|
+
415: Problem & {
|
|
666
|
+
status: 415;
|
|
667
|
+
/**
|
|
668
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
669
|
+
*/
|
|
670
|
+
code: "unsupported_media_type";
|
|
671
|
+
};
|
|
672
|
+
/**
|
|
673
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
674
|
+
*/
|
|
675
|
+
500: Problem & {
|
|
676
|
+
status: 500;
|
|
677
|
+
/**
|
|
678
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
679
|
+
*/
|
|
680
|
+
code: "internal_error";
|
|
681
|
+
};
|
|
682
|
+
/**
|
|
683
|
+
* A required service is temporarily unavailable. Retry with the same reference or command identity.
|
|
684
|
+
*/
|
|
685
|
+
503: Problem & {
|
|
686
|
+
status: 503;
|
|
687
|
+
/**
|
|
688
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
689
|
+
*/
|
|
690
|
+
code: "merchant_fiscal_setup_unavailable";
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
export type ConfigureInvoicingError = ConfigureInvoicingErrors[keyof ConfigureInvoicingErrors];
|
|
694
|
+
export type ConfigureInvoicingResponses = {
|
|
695
|
+
/**
|
|
696
|
+
* MerchantBusinessConfigureInvoicingResponse
|
|
697
|
+
*
|
|
698
|
+
* Default Response
|
|
699
|
+
*/
|
|
700
|
+
201: {
|
|
701
|
+
object: "merchant_business_invoicing_setup";
|
|
702
|
+
mode: "test" | "live";
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
export type ConfigureInvoicingResponse = ConfigureInvoicingResponses[keyof ConfigureInvoicingResponses];
|
|
706
|
+
export type ImportSigningCertificateData = {
|
|
707
|
+
/**
|
|
708
|
+
* MerchantBusinessSigningCertificateRequest
|
|
709
|
+
*/
|
|
710
|
+
body: {
|
|
711
|
+
mode: "test" | "live";
|
|
712
|
+
certificateP12Base64: string;
|
|
713
|
+
password: string;
|
|
714
|
+
};
|
|
715
|
+
path?: never;
|
|
716
|
+
query?: never;
|
|
717
|
+
url: "/v1/business/import-signing-certificate";
|
|
718
|
+
};
|
|
719
|
+
export type ImportSigningCertificateErrors = {
|
|
720
|
+
/**
|
|
721
|
+
* The request could not be understood.
|
|
722
|
+
*/
|
|
723
|
+
400: Problem & {
|
|
724
|
+
status: 400;
|
|
725
|
+
/**
|
|
726
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
727
|
+
*/
|
|
728
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* The credential is missing, malformed, or no longer valid.
|
|
732
|
+
*/
|
|
733
|
+
401: Problem & {
|
|
734
|
+
status: 401;
|
|
735
|
+
/**
|
|
736
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
737
|
+
*/
|
|
738
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
739
|
+
};
|
|
740
|
+
/**
|
|
741
|
+
* The credential is valid but not permitted to perform this operation.
|
|
742
|
+
*/
|
|
743
|
+
403: Problem & {
|
|
744
|
+
status: 403;
|
|
745
|
+
/**
|
|
746
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
747
|
+
*/
|
|
748
|
+
code: "operation_not_permitted";
|
|
749
|
+
};
|
|
750
|
+
/**
|
|
751
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
752
|
+
*/
|
|
753
|
+
404: Problem & {
|
|
754
|
+
status: 404;
|
|
755
|
+
/**
|
|
756
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
757
|
+
*/
|
|
758
|
+
code: "merchant_business_not_found";
|
|
759
|
+
};
|
|
760
|
+
/**
|
|
761
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
762
|
+
*/
|
|
763
|
+
409: Problem & {
|
|
764
|
+
status: 409;
|
|
765
|
+
/**
|
|
766
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
767
|
+
*/
|
|
768
|
+
code: "merchant_certificate_conflict" | "merchant_fiscal_setup_incomplete";
|
|
769
|
+
};
|
|
770
|
+
/**
|
|
771
|
+
* The request body is larger than this endpoint accepts.
|
|
772
|
+
*/
|
|
773
|
+
413: Problem & {
|
|
774
|
+
status: 413;
|
|
775
|
+
/**
|
|
776
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
777
|
+
*/
|
|
778
|
+
code: "request_body_too_large";
|
|
779
|
+
};
|
|
780
|
+
/**
|
|
781
|
+
* The request body carries a content type this endpoint does not accept.
|
|
782
|
+
*/
|
|
783
|
+
415: Problem & {
|
|
784
|
+
status: 415;
|
|
785
|
+
/**
|
|
786
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
787
|
+
*/
|
|
788
|
+
code: "unsupported_media_type";
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* The request is well-formed but cannot be carried out.
|
|
792
|
+
*/
|
|
793
|
+
422: Problem & {
|
|
794
|
+
status: 422;
|
|
795
|
+
/**
|
|
796
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
797
|
+
*/
|
|
798
|
+
code: "certificate_pkcs12_invalid" | "certificate_not_supported" | "certificate_p12_password_invalid";
|
|
799
|
+
};
|
|
800
|
+
/**
|
|
801
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
802
|
+
*/
|
|
803
|
+
500: Problem & {
|
|
804
|
+
status: 500;
|
|
805
|
+
/**
|
|
806
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
807
|
+
*/
|
|
808
|
+
code: "internal_error";
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* A required service is temporarily unavailable. Retry with the same reference or command identity.
|
|
812
|
+
*/
|
|
813
|
+
503: Problem & {
|
|
814
|
+
status: 503;
|
|
815
|
+
/**
|
|
816
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
817
|
+
*/
|
|
818
|
+
code: "merchant_fiscal_setup_unavailable";
|
|
819
|
+
};
|
|
820
|
+
};
|
|
821
|
+
export type ImportSigningCertificateError = ImportSigningCertificateErrors[keyof ImportSigningCertificateErrors];
|
|
822
|
+
export type ImportSigningCertificateResponses = {
|
|
823
|
+
/**
|
|
824
|
+
* MerchantBusiness
|
|
825
|
+
*
|
|
826
|
+
* The business the credential selects, its capabilities, and the requirements that remain.
|
|
827
|
+
*/
|
|
828
|
+
200: {
|
|
829
|
+
object: "merchant_business";
|
|
830
|
+
id: string;
|
|
831
|
+
rnc: string;
|
|
832
|
+
legalName: string;
|
|
833
|
+
revision: number;
|
|
834
|
+
capabilities: {
|
|
835
|
+
payments: {
|
|
836
|
+
requested: boolean;
|
|
837
|
+
test: {
|
|
838
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
839
|
+
};
|
|
840
|
+
live: {
|
|
841
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
invoices: {
|
|
845
|
+
requested: boolean;
|
|
846
|
+
test: {
|
|
847
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
848
|
+
};
|
|
849
|
+
live: {
|
|
850
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
fiscalDetails: {
|
|
855
|
+
commercialName: string | null;
|
|
856
|
+
address: string | null;
|
|
857
|
+
location: {
|
|
858
|
+
placeId: string;
|
|
859
|
+
catalogReleaseId: string;
|
|
860
|
+
municipalityCode: string | null;
|
|
861
|
+
name: string;
|
|
862
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
863
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
864
|
+
/**
|
|
865
|
+
* The places that contain the selected one, outermost first.
|
|
866
|
+
*/
|
|
867
|
+
ancestors: Array<{
|
|
868
|
+
placeId: string;
|
|
869
|
+
name: string;
|
|
870
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
871
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
872
|
+
}>;
|
|
873
|
+
} | null;
|
|
874
|
+
phone: string | null;
|
|
875
|
+
email: string | null;
|
|
876
|
+
defaultIncomeType: string | null;
|
|
877
|
+
};
|
|
878
|
+
paymentsProfile: {
|
|
879
|
+
displayName: string;
|
|
880
|
+
statementDescriptor: string;
|
|
881
|
+
/**
|
|
882
|
+
* MerchantPermanentAddress
|
|
883
|
+
*
|
|
884
|
+
* The selling merchant's permanent business address.
|
|
885
|
+
*/
|
|
886
|
+
permanentAddress: {
|
|
887
|
+
line1: string;
|
|
888
|
+
line2?: string;
|
|
889
|
+
city: string;
|
|
890
|
+
province?: string;
|
|
891
|
+
postalCode?: string;
|
|
892
|
+
countryCode: string;
|
|
893
|
+
};
|
|
894
|
+
supportEmail: string;
|
|
895
|
+
supportPhone: string;
|
|
896
|
+
/**
|
|
897
|
+
* MerchantDeliveryPolicy
|
|
898
|
+
*
|
|
899
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
900
|
+
*/
|
|
901
|
+
deliveryPolicy: {
|
|
902
|
+
kind: "not_offered";
|
|
903
|
+
} | {
|
|
904
|
+
kind: "merchant_managed";
|
|
905
|
+
summary: string;
|
|
906
|
+
url?: string;
|
|
907
|
+
};
|
|
908
|
+
} | null;
|
|
909
|
+
invoicing: {
|
|
910
|
+
test: MerchantBusinessFiscalSetup;
|
|
911
|
+
live: MerchantBusinessLiveFiscalSetup;
|
|
912
|
+
};
|
|
913
|
+
requirements: Array<{
|
|
914
|
+
code: "capabilities_required" | "commercial_name_required" | "address_required" | "location_required" | "phone_required" | "default_income_type_required" | "contact_email_verification_required" | "fiscal_details_rejected" | "taxpayer_registration_required" | "signing_certificate_required" | "signing_certificate_expiring" | "test_fiscal_document_rejected" | "test_fiscal_document_pending" | "test_fiscal_document_send_pending" | "fiscal_binding_pending" | "legal_issuer_sync_pending" | "fiscal_setup_unavailable" | "fiscal_binding_conflict" | "fiscal_issuer_rejected" | "test_fiscal_document_operator_required" | "payments_profile_required" | "test_payments_unavailable" | "merchant_account_required" | "merchant_account_disabled" | "active_credential_required" | "credential_material_invalid" | "test_live_mode_mismatch" | "callback_configuration_failed" | "callback_configuration_required" | "connectivity_check_failed" | "connectivity_check_required" | "provider_qualification_failed" | "provider_qualification_required" | "provider_adapter_unavailable";
|
|
915
|
+
owner: "merchant" | "dgii" | "timbro" | "provider" | "operator";
|
|
916
|
+
blocks: Array<"payments" | "invoices">;
|
|
917
|
+
mode?: "test" | "live";
|
|
918
|
+
/**
|
|
919
|
+
* JSON Pointer into this representation the requirement names.
|
|
920
|
+
*/
|
|
921
|
+
field?: string;
|
|
922
|
+
errors?: Array<{
|
|
923
|
+
code: string;
|
|
924
|
+
message: string;
|
|
925
|
+
}>;
|
|
926
|
+
}>;
|
|
927
|
+
onboardingUrl: string;
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
export type ImportSigningCertificateResponse = ImportSigningCertificateResponses[keyof ImportSigningCertificateResponses];
|
|
931
|
+
export type IssueTestInvoiceData = {
|
|
932
|
+
/**
|
|
933
|
+
* MerchantBusinessTestFiscalDocumentRequest
|
|
934
|
+
*/
|
|
935
|
+
body: {
|
|
936
|
+
documentType?: "31" | "32" | "41" | "43" | "44" | "45" | "46" | "47";
|
|
937
|
+
};
|
|
938
|
+
path?: never;
|
|
939
|
+
query?: never;
|
|
940
|
+
url: "/v1/business/issue-test-invoice";
|
|
941
|
+
};
|
|
942
|
+
export type IssueTestInvoiceErrors = {
|
|
943
|
+
/**
|
|
944
|
+
* The request could not be understood.
|
|
945
|
+
*/
|
|
946
|
+
400: Problem & {
|
|
947
|
+
status: 400;
|
|
948
|
+
/**
|
|
949
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
950
|
+
*/
|
|
951
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
952
|
+
};
|
|
953
|
+
/**
|
|
954
|
+
* The credential is missing, malformed, or no longer valid.
|
|
955
|
+
*/
|
|
956
|
+
401: Problem & {
|
|
957
|
+
status: 401;
|
|
958
|
+
/**
|
|
959
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
960
|
+
*/
|
|
961
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* The credential is valid but not permitted to perform this operation.
|
|
965
|
+
*/
|
|
966
|
+
403: Problem & {
|
|
967
|
+
status: 403;
|
|
968
|
+
/**
|
|
969
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
970
|
+
*/
|
|
971
|
+
code: "operation_not_permitted";
|
|
972
|
+
};
|
|
973
|
+
/**
|
|
974
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
975
|
+
*/
|
|
976
|
+
404: Problem & {
|
|
977
|
+
status: 404;
|
|
978
|
+
/**
|
|
979
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
980
|
+
*/
|
|
981
|
+
code: "merchant_business_not_found";
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
985
|
+
*/
|
|
986
|
+
409: Problem & {
|
|
987
|
+
status: 409;
|
|
988
|
+
/**
|
|
989
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
990
|
+
*/
|
|
991
|
+
code: "merchant_fiscal_setup_incomplete" | "merchant_test_fiscal_document_blocked";
|
|
992
|
+
};
|
|
993
|
+
/**
|
|
994
|
+
* The request body is larger than this endpoint accepts.
|
|
995
|
+
*/
|
|
996
|
+
413: Problem & {
|
|
997
|
+
status: 413;
|
|
998
|
+
/**
|
|
999
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1000
|
+
*/
|
|
1001
|
+
code: "request_body_too_large";
|
|
1002
|
+
};
|
|
1003
|
+
/**
|
|
1004
|
+
* The request body carries a content type this endpoint does not accept.
|
|
1005
|
+
*/
|
|
1006
|
+
415: Problem & {
|
|
1007
|
+
status: 415;
|
|
1008
|
+
/**
|
|
1009
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1010
|
+
*/
|
|
1011
|
+
code: "unsupported_media_type";
|
|
1012
|
+
};
|
|
1013
|
+
/**
|
|
1014
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1015
|
+
*/
|
|
1016
|
+
500: Problem & {
|
|
1017
|
+
status: 500;
|
|
1018
|
+
/**
|
|
1019
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1020
|
+
*/
|
|
1021
|
+
code: "internal_error";
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
1024
|
+
* A required service is temporarily unavailable. Retry with the same reference or command identity.
|
|
1025
|
+
*/
|
|
1026
|
+
503: Problem & {
|
|
1027
|
+
status: 503;
|
|
1028
|
+
/**
|
|
1029
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1030
|
+
*/
|
|
1031
|
+
code: "merchant_fiscal_setup_unavailable";
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
export type IssueTestInvoiceError = IssueTestInvoiceErrors[keyof IssueTestInvoiceErrors];
|
|
1035
|
+
export type IssueTestInvoiceResponses = {
|
|
1036
|
+
/**
|
|
1037
|
+
* MerchantBusiness
|
|
1038
|
+
*
|
|
1039
|
+
* The business the credential selects, its capabilities, and the requirements that remain.
|
|
1040
|
+
*/
|
|
1041
|
+
200: {
|
|
1042
|
+
object: "merchant_business";
|
|
1043
|
+
id: string;
|
|
1044
|
+
rnc: string;
|
|
1045
|
+
legalName: string;
|
|
1046
|
+
revision: number;
|
|
1047
|
+
capabilities: {
|
|
1048
|
+
payments: {
|
|
1049
|
+
requested: boolean;
|
|
1050
|
+
test: {
|
|
1051
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1052
|
+
};
|
|
1053
|
+
live: {
|
|
1054
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1055
|
+
};
|
|
1056
|
+
};
|
|
1057
|
+
invoices: {
|
|
1058
|
+
requested: boolean;
|
|
1059
|
+
test: {
|
|
1060
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1061
|
+
};
|
|
1062
|
+
live: {
|
|
1063
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1064
|
+
};
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
fiscalDetails: {
|
|
1068
|
+
commercialName: string | null;
|
|
1069
|
+
address: string | null;
|
|
1070
|
+
location: {
|
|
1071
|
+
placeId: string;
|
|
1072
|
+
catalogReleaseId: string;
|
|
1073
|
+
municipalityCode: string | null;
|
|
1074
|
+
name: string;
|
|
1075
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
1076
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
1077
|
+
/**
|
|
1078
|
+
* The places that contain the selected one, outermost first.
|
|
1079
|
+
*/
|
|
1080
|
+
ancestors: Array<{
|
|
1081
|
+
placeId: string;
|
|
1082
|
+
name: string;
|
|
1083
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
1084
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
1085
|
+
}>;
|
|
1086
|
+
} | null;
|
|
1087
|
+
phone: string | null;
|
|
1088
|
+
email: string | null;
|
|
1089
|
+
defaultIncomeType: string | null;
|
|
1090
|
+
};
|
|
1091
|
+
paymentsProfile: {
|
|
1092
|
+
displayName: string;
|
|
1093
|
+
statementDescriptor: string;
|
|
1094
|
+
/**
|
|
1095
|
+
* MerchantPermanentAddress
|
|
1096
|
+
*
|
|
1097
|
+
* The selling merchant's permanent business address.
|
|
1098
|
+
*/
|
|
1099
|
+
permanentAddress: {
|
|
1100
|
+
line1: string;
|
|
1101
|
+
line2?: string;
|
|
1102
|
+
city: string;
|
|
1103
|
+
province?: string;
|
|
1104
|
+
postalCode?: string;
|
|
1105
|
+
countryCode: string;
|
|
1106
|
+
};
|
|
1107
|
+
supportEmail: string;
|
|
1108
|
+
supportPhone: string;
|
|
1109
|
+
/**
|
|
1110
|
+
* MerchantDeliveryPolicy
|
|
1111
|
+
*
|
|
1112
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
1113
|
+
*/
|
|
1114
|
+
deliveryPolicy: {
|
|
1115
|
+
kind: "not_offered";
|
|
1116
|
+
} | {
|
|
1117
|
+
kind: "merchant_managed";
|
|
1118
|
+
summary: string;
|
|
1119
|
+
url?: string;
|
|
1120
|
+
};
|
|
1121
|
+
} | null;
|
|
1122
|
+
invoicing: {
|
|
1123
|
+
test: MerchantBusinessFiscalSetup;
|
|
1124
|
+
live: MerchantBusinessLiveFiscalSetup;
|
|
1125
|
+
};
|
|
1126
|
+
requirements: Array<{
|
|
1127
|
+
code: "capabilities_required" | "commercial_name_required" | "address_required" | "location_required" | "phone_required" | "default_income_type_required" | "contact_email_verification_required" | "fiscal_details_rejected" | "taxpayer_registration_required" | "signing_certificate_required" | "signing_certificate_expiring" | "test_fiscal_document_rejected" | "test_fiscal_document_pending" | "test_fiscal_document_send_pending" | "fiscal_binding_pending" | "legal_issuer_sync_pending" | "fiscal_setup_unavailable" | "fiscal_binding_conflict" | "fiscal_issuer_rejected" | "test_fiscal_document_operator_required" | "payments_profile_required" | "test_payments_unavailable" | "merchant_account_required" | "merchant_account_disabled" | "active_credential_required" | "credential_material_invalid" | "test_live_mode_mismatch" | "callback_configuration_failed" | "callback_configuration_required" | "connectivity_check_failed" | "connectivity_check_required" | "provider_qualification_failed" | "provider_qualification_required" | "provider_adapter_unavailable";
|
|
1128
|
+
owner: "merchant" | "dgii" | "timbro" | "provider" | "operator";
|
|
1129
|
+
blocks: Array<"payments" | "invoices">;
|
|
1130
|
+
mode?: "test" | "live";
|
|
1131
|
+
/**
|
|
1132
|
+
* JSON Pointer into this representation the requirement names.
|
|
1133
|
+
*/
|
|
1134
|
+
field?: string;
|
|
1135
|
+
errors?: Array<{
|
|
1136
|
+
code: string;
|
|
1137
|
+
message: string;
|
|
1138
|
+
}>;
|
|
1139
|
+
}>;
|
|
1140
|
+
onboardingUrl: string;
|
|
1141
|
+
};
|
|
1142
|
+
/**
|
|
1143
|
+
* MerchantBusiness
|
|
1144
|
+
*
|
|
1145
|
+
* The business the credential selects, its capabilities, and the requirements that remain.
|
|
1146
|
+
*/
|
|
1147
|
+
202: {
|
|
1148
|
+
object: "merchant_business";
|
|
1149
|
+
id: string;
|
|
1150
|
+
rnc: string;
|
|
1151
|
+
legalName: string;
|
|
1152
|
+
revision: number;
|
|
1153
|
+
capabilities: {
|
|
1154
|
+
payments: {
|
|
1155
|
+
requested: boolean;
|
|
1156
|
+
test: {
|
|
1157
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1158
|
+
};
|
|
1159
|
+
live: {
|
|
1160
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1161
|
+
};
|
|
1162
|
+
};
|
|
1163
|
+
invoices: {
|
|
1164
|
+
requested: boolean;
|
|
1165
|
+
test: {
|
|
1166
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1167
|
+
};
|
|
1168
|
+
live: {
|
|
1169
|
+
status: "active" | "pending" | "inactive" | "unavailable";
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
fiscalDetails: {
|
|
1174
|
+
commercialName: string | null;
|
|
1175
|
+
address: string | null;
|
|
1176
|
+
location: {
|
|
1177
|
+
placeId: string;
|
|
1178
|
+
catalogReleaseId: string;
|
|
1179
|
+
municipalityCode: string | null;
|
|
1180
|
+
name: string;
|
|
1181
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
1182
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
1183
|
+
/**
|
|
1184
|
+
* The places that contain the selected one, outermost first.
|
|
1185
|
+
*/
|
|
1186
|
+
ancestors: Array<{
|
|
1187
|
+
placeId: string;
|
|
1188
|
+
name: string;
|
|
1189
|
+
kind: "country" | "region" | "national_district" | "province" | "municipality" | "municipal_district" | "urban_zone" | "section" | "barrio" | "paraje" | "subbarrio";
|
|
1190
|
+
qualityStatus: "verified" | "provisional" | "conflicted";
|
|
1191
|
+
}>;
|
|
1192
|
+
} | null;
|
|
1193
|
+
phone: string | null;
|
|
1194
|
+
email: string | null;
|
|
1195
|
+
defaultIncomeType: string | null;
|
|
1196
|
+
};
|
|
1197
|
+
paymentsProfile: {
|
|
1198
|
+
displayName: string;
|
|
1199
|
+
statementDescriptor: string;
|
|
1200
|
+
/**
|
|
1201
|
+
* MerchantPermanentAddress
|
|
1202
|
+
*
|
|
1203
|
+
* The selling merchant's permanent business address.
|
|
1204
|
+
*/
|
|
1205
|
+
permanentAddress: {
|
|
1206
|
+
line1: string;
|
|
1207
|
+
line2?: string;
|
|
1208
|
+
city: string;
|
|
1209
|
+
province?: string;
|
|
1210
|
+
postalCode?: string;
|
|
1211
|
+
countryCode: string;
|
|
1212
|
+
};
|
|
1213
|
+
supportEmail: string;
|
|
1214
|
+
supportPhone: string;
|
|
1215
|
+
/**
|
|
1216
|
+
* MerchantDeliveryPolicy
|
|
1217
|
+
*
|
|
1218
|
+
* Whether the merchant offers delivery and the terms a payer needs before paying.
|
|
1219
|
+
*/
|
|
1220
|
+
deliveryPolicy: {
|
|
1221
|
+
kind: "not_offered";
|
|
1222
|
+
} | {
|
|
1223
|
+
kind: "merchant_managed";
|
|
1224
|
+
summary: string;
|
|
1225
|
+
url?: string;
|
|
1226
|
+
};
|
|
1227
|
+
} | null;
|
|
1228
|
+
invoicing: {
|
|
1229
|
+
test: MerchantBusinessFiscalSetup;
|
|
1230
|
+
live: MerchantBusinessLiveFiscalSetup;
|
|
1231
|
+
};
|
|
1232
|
+
requirements: Array<{
|
|
1233
|
+
code: "capabilities_required" | "commercial_name_required" | "address_required" | "location_required" | "phone_required" | "default_income_type_required" | "contact_email_verification_required" | "fiscal_details_rejected" | "taxpayer_registration_required" | "signing_certificate_required" | "signing_certificate_expiring" | "test_fiscal_document_rejected" | "test_fiscal_document_pending" | "test_fiscal_document_send_pending" | "fiscal_binding_pending" | "legal_issuer_sync_pending" | "fiscal_setup_unavailable" | "fiscal_binding_conflict" | "fiscal_issuer_rejected" | "test_fiscal_document_operator_required" | "payments_profile_required" | "test_payments_unavailable" | "merchant_account_required" | "merchant_account_disabled" | "active_credential_required" | "credential_material_invalid" | "test_live_mode_mismatch" | "callback_configuration_failed" | "callback_configuration_required" | "connectivity_check_failed" | "connectivity_check_required" | "provider_qualification_failed" | "provider_qualification_required" | "provider_adapter_unavailable";
|
|
1234
|
+
owner: "merchant" | "dgii" | "timbro" | "provider" | "operator";
|
|
1235
|
+
blocks: Array<"payments" | "invoices">;
|
|
1236
|
+
mode?: "test" | "live";
|
|
1237
|
+
/**
|
|
1238
|
+
* JSON Pointer into this representation the requirement names.
|
|
1239
|
+
*/
|
|
1240
|
+
field?: string;
|
|
1241
|
+
errors?: Array<{
|
|
1242
|
+
code: string;
|
|
1243
|
+
message: string;
|
|
1244
|
+
}>;
|
|
1245
|
+
}>;
|
|
1246
|
+
onboardingUrl: string;
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
export type IssueTestInvoiceResponse = IssueTestInvoiceResponses[keyof IssueTestInvoiceResponses];
|
|
1250
|
+
export type IssueInvoiceKeyData = {
|
|
1251
|
+
/**
|
|
1252
|
+
* MerchantBusinessInvoiceKeyRequest
|
|
1253
|
+
*/
|
|
1254
|
+
body: {
|
|
1255
|
+
mode: "test" | "live";
|
|
1256
|
+
};
|
|
1257
|
+
headers: {
|
|
1258
|
+
"idempotency-key": string;
|
|
1259
|
+
};
|
|
1260
|
+
path?: never;
|
|
1261
|
+
query?: never;
|
|
1262
|
+
url: "/v1/business/issue-invoice-key";
|
|
1263
|
+
};
|
|
1264
|
+
export type IssueInvoiceKeyErrors = {
|
|
1265
|
+
/**
|
|
1266
|
+
* The request could not be understood.
|
|
1267
|
+
*/
|
|
1268
|
+
400: Problem & {
|
|
1269
|
+
status: 400;
|
|
1270
|
+
/**
|
|
1271
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1272
|
+
*/
|
|
1273
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
1274
|
+
};
|
|
1275
|
+
/**
|
|
1276
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1277
|
+
*/
|
|
1278
|
+
401: Problem & {
|
|
1279
|
+
status: 401;
|
|
1280
|
+
/**
|
|
1281
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1282
|
+
*/
|
|
1283
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired" | "merchant_session_missing";
|
|
1284
|
+
};
|
|
1285
|
+
/**
|
|
1286
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1287
|
+
*/
|
|
1288
|
+
403: Problem & {
|
|
1289
|
+
status: 403;
|
|
1290
|
+
/**
|
|
1291
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1292
|
+
*/
|
|
1293
|
+
code: "operation_not_permitted";
|
|
1294
|
+
};
|
|
1295
|
+
/**
|
|
1296
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
1297
|
+
*/
|
|
1298
|
+
404: Problem & {
|
|
1299
|
+
status: 404;
|
|
1300
|
+
/**
|
|
1301
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1302
|
+
*/
|
|
1303
|
+
code: "merchant_business_not_found";
|
|
1304
|
+
};
|
|
1305
|
+
/**
|
|
1306
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
1307
|
+
*/
|
|
1308
|
+
409: Problem & {
|
|
1309
|
+
status: 409;
|
|
1310
|
+
/**
|
|
1311
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1312
|
+
*/
|
|
1313
|
+
code: "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "merchant_fiscal_setup_incomplete";
|
|
1314
|
+
};
|
|
1315
|
+
/**
|
|
1316
|
+
* The request body is larger than this endpoint accepts.
|
|
1317
|
+
*/
|
|
1318
|
+
413: Problem & {
|
|
1319
|
+
status: 413;
|
|
1320
|
+
/**
|
|
1321
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1322
|
+
*/
|
|
1323
|
+
code: "request_body_too_large";
|
|
1324
|
+
};
|
|
1325
|
+
/**
|
|
1326
|
+
* The request body carries a content type this endpoint does not accept.
|
|
1327
|
+
*/
|
|
1328
|
+
415: Problem & {
|
|
1329
|
+
status: 415;
|
|
1330
|
+
/**
|
|
1331
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1332
|
+
*/
|
|
1333
|
+
code: "unsupported_media_type";
|
|
1334
|
+
};
|
|
1335
|
+
/**
|
|
1336
|
+
* The request is well-formed but cannot be carried out.
|
|
1337
|
+
*/
|
|
1338
|
+
422: Problem & {
|
|
1339
|
+
status: 422;
|
|
1340
|
+
/**
|
|
1341
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1342
|
+
*/
|
|
1343
|
+
code: "credential_storage_unavailable";
|
|
1344
|
+
};
|
|
1345
|
+
/**
|
|
1346
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1347
|
+
*/
|
|
1348
|
+
500: Problem & {
|
|
1349
|
+
status: 500;
|
|
1350
|
+
/**
|
|
1351
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1352
|
+
*/
|
|
1353
|
+
code: "internal_error";
|
|
1354
|
+
};
|
|
1355
|
+
/**
|
|
1356
|
+
* A required service is temporarily unavailable. Retry with the same reference or command identity.
|
|
1357
|
+
*/
|
|
1358
|
+
503: Problem & {
|
|
1359
|
+
status: 503;
|
|
1360
|
+
/**
|
|
1361
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1362
|
+
*/
|
|
1363
|
+
code: "merchant_fiscal_setup_unavailable";
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
export type IssueInvoiceKeyError = IssueInvoiceKeyErrors[keyof IssueInvoiceKeyErrors];
|
|
1367
|
+
export type IssueInvoiceKeyResponses = {
|
|
1368
|
+
/**
|
|
1369
|
+
* MerchantBusinessInvoiceKey
|
|
1370
|
+
*
|
|
1371
|
+
* The ERP Source key, returned once and replayed only through the same idempotency key.
|
|
1372
|
+
*/
|
|
1373
|
+
201: {
|
|
1374
|
+
object: "merchant_business_invoice_key";
|
|
1375
|
+
key: string;
|
|
1376
|
+
invoiceOrigin: string;
|
|
1377
|
+
};
|
|
1378
|
+
};
|
|
1379
|
+
export type IssueInvoiceKeyResponse = IssueInvoiceKeyResponses[keyof IssueInvoiceKeyResponses];
|
|
1380
|
+
export type ListWebhookEndpointsData = {
|
|
1381
|
+
body?: never;
|
|
1382
|
+
path?: never;
|
|
1383
|
+
query?: {
|
|
1384
|
+
/**
|
|
1385
|
+
* Rows on one page.
|
|
1386
|
+
*/
|
|
1387
|
+
limit?: number;
|
|
1388
|
+
/**
|
|
1389
|
+
* The `nextCursor` of the previous page. A cursor belongs to the list, tenant, mode, and filter set that minted it.
|
|
1390
|
+
*/
|
|
1391
|
+
cursor?: string;
|
|
1392
|
+
};
|
|
1393
|
+
url: "/v1/webhook-endpoints";
|
|
1394
|
+
};
|
|
1395
|
+
export type ListWebhookEndpointsErrors = {
|
|
1396
|
+
/**
|
|
1397
|
+
* The request could not be understood.
|
|
1398
|
+
*/
|
|
1399
|
+
400: Problem & {
|
|
1400
|
+
status: 400;
|
|
1401
|
+
/**
|
|
1402
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1403
|
+
*/
|
|
1404
|
+
code: "parameter_invalid" | "collection_cursor_invalid";
|
|
1405
|
+
};
|
|
1406
|
+
/**
|
|
1407
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1408
|
+
*/
|
|
1409
|
+
401: Problem & {
|
|
1410
|
+
status: 401;
|
|
1411
|
+
/**
|
|
1412
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1413
|
+
*/
|
|
1414
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
1415
|
+
};
|
|
1416
|
+
/**
|
|
1417
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1418
|
+
*/
|
|
1419
|
+
403: Problem & {
|
|
1420
|
+
status: 403;
|
|
1421
|
+
/**
|
|
1422
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1423
|
+
*/
|
|
1424
|
+
code: "operation_not_permitted";
|
|
1425
|
+
};
|
|
1426
|
+
/**
|
|
1427
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1428
|
+
*/
|
|
1429
|
+
500: Problem & {
|
|
1430
|
+
status: 500;
|
|
1431
|
+
/**
|
|
1432
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1433
|
+
*/
|
|
1434
|
+
code: "internal_error";
|
|
1435
|
+
};
|
|
1436
|
+
};
|
|
1437
|
+
export type ListWebhookEndpointsError = ListWebhookEndpointsErrors[keyof ListWebhookEndpointsErrors];
|
|
1438
|
+
export type ListWebhookEndpointsResponses = {
|
|
1439
|
+
/**
|
|
1440
|
+
* WebhookEndpointListPage
|
|
1441
|
+
*
|
|
1442
|
+
* One page of webhook endpoints, newest first.
|
|
1443
|
+
*/
|
|
1444
|
+
200: {
|
|
1445
|
+
object: "list";
|
|
1446
|
+
data: Array<{
|
|
1447
|
+
/**
|
|
1448
|
+
* Webhook endpoint identifier.
|
|
1449
|
+
*/
|
|
1450
|
+
id: string;
|
|
1451
|
+
object: "webhook_endpoint";
|
|
1452
|
+
url: string;
|
|
1453
|
+
/**
|
|
1454
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
1455
|
+
*/
|
|
1456
|
+
enabledEvents: Array<string>;
|
|
1457
|
+
/**
|
|
1458
|
+
* WebhookEndpointStatus
|
|
1459
|
+
*
|
|
1460
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
1461
|
+
*/
|
|
1462
|
+
status: "active" | "suspended" | "deleted";
|
|
1463
|
+
/**
|
|
1464
|
+
* When the current signing secret was issued.
|
|
1465
|
+
*/
|
|
1466
|
+
secretCreatedAt: string;
|
|
1467
|
+
/**
|
|
1468
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
1469
|
+
*/
|
|
1470
|
+
previousSecretExpiresAt: string | null;
|
|
1471
|
+
createdAt: string;
|
|
1472
|
+
}>;
|
|
1473
|
+
/**
|
|
1474
|
+
* True when a further page follows this one.
|
|
1475
|
+
*/
|
|
1476
|
+
hasMore: boolean;
|
|
1477
|
+
/**
|
|
1478
|
+
* Send as `cursor` to read the next page, or `null` on the last page.
|
|
1479
|
+
*/
|
|
1480
|
+
nextCursor: string | null;
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
export type ListWebhookEndpointsResponse = ListWebhookEndpointsResponses[keyof ListWebhookEndpointsResponses];
|
|
1484
|
+
export type CreateWebhookEndpointData = {
|
|
1485
|
+
/**
|
|
1486
|
+
* CreateWebhookEndpointRequest
|
|
1487
|
+
*/
|
|
1488
|
+
body: {
|
|
1489
|
+
/**
|
|
1490
|
+
* HTTPS endpoint that receives signed events.
|
|
1491
|
+
*/
|
|
1492
|
+
url: string;
|
|
1493
|
+
/**
|
|
1494
|
+
* WebhookEventType
|
|
1495
|
+
*
|
|
1496
|
+
* Domain events that the gateway can deliver to a merchant endpoint.
|
|
1497
|
+
*/
|
|
1498
|
+
enabledEvents: Array<"payment.succeeded" | "payment.canceled" | "payment.expired" | "payment.operator_required" | "refund.operator_required" | "refund.invoiceAttached" | "invoice.accepted" | "invoice.rejected" | "invoice.operatorRequired" | "invoice.ready">;
|
|
1499
|
+
};
|
|
1500
|
+
headers: {
|
|
1501
|
+
"idempotency-key": string;
|
|
1502
|
+
};
|
|
1503
|
+
path?: never;
|
|
1504
|
+
query?: never;
|
|
1505
|
+
url: "/v1/webhook-endpoints";
|
|
1506
|
+
};
|
|
1507
|
+
export type CreateWebhookEndpointErrors = {
|
|
1508
|
+
/**
|
|
1509
|
+
* The request could not be understood.
|
|
1510
|
+
*/
|
|
1511
|
+
400: Problem & {
|
|
1512
|
+
status: 400;
|
|
1513
|
+
/**
|
|
1514
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1515
|
+
*/
|
|
1516
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed";
|
|
1517
|
+
};
|
|
1518
|
+
/**
|
|
1519
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1520
|
+
*/
|
|
1521
|
+
401: Problem & {
|
|
1522
|
+
status: 401;
|
|
1523
|
+
/**
|
|
1524
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1525
|
+
*/
|
|
1526
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
1527
|
+
};
|
|
1528
|
+
/**
|
|
1529
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1530
|
+
*/
|
|
1531
|
+
403: Problem & {
|
|
1532
|
+
status: 403;
|
|
1533
|
+
/**
|
|
1534
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1535
|
+
*/
|
|
1536
|
+
code: "operation_not_permitted";
|
|
1537
|
+
};
|
|
1538
|
+
/**
|
|
1539
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
1540
|
+
*/
|
|
1541
|
+
409: Problem & {
|
|
1542
|
+
status: 409;
|
|
1543
|
+
/**
|
|
1544
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1545
|
+
*/
|
|
1546
|
+
code: "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "webhook_endpoint_deleted";
|
|
1547
|
+
};
|
|
1548
|
+
/**
|
|
1549
|
+
* The request body is larger than this endpoint accepts.
|
|
1550
|
+
*/
|
|
1551
|
+
413: Problem & {
|
|
1552
|
+
status: 413;
|
|
1553
|
+
/**
|
|
1554
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1555
|
+
*/
|
|
1556
|
+
code: "request_body_too_large";
|
|
1557
|
+
};
|
|
1558
|
+
/**
|
|
1559
|
+
* The request body carries a content type this endpoint does not accept.
|
|
1560
|
+
*/
|
|
1561
|
+
415: Problem & {
|
|
1562
|
+
status: 415;
|
|
1563
|
+
/**
|
|
1564
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1565
|
+
*/
|
|
1566
|
+
code: "unsupported_media_type";
|
|
1567
|
+
};
|
|
1568
|
+
/**
|
|
1569
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1570
|
+
*/
|
|
1571
|
+
500: Problem & {
|
|
1572
|
+
status: 500;
|
|
1573
|
+
/**
|
|
1574
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1575
|
+
*/
|
|
1576
|
+
code: "internal_error";
|
|
1577
|
+
};
|
|
1578
|
+
};
|
|
1579
|
+
export type CreateWebhookEndpointError = CreateWebhookEndpointErrors[keyof CreateWebhookEndpointErrors];
|
|
1580
|
+
export type CreateWebhookEndpointResponses = {
|
|
1581
|
+
/**
|
|
1582
|
+
* WebhookEndpointWithSecret
|
|
1583
|
+
*
|
|
1584
|
+
* The endpoint and its new signing secret. Store the secret securely.
|
|
1585
|
+
*/
|
|
1586
|
+
201: {
|
|
1587
|
+
/**
|
|
1588
|
+
* Webhook endpoint identifier.
|
|
1589
|
+
*/
|
|
1590
|
+
id: string;
|
|
1591
|
+
object: "webhook_endpoint";
|
|
1592
|
+
url: string;
|
|
1593
|
+
/**
|
|
1594
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
1595
|
+
*/
|
|
1596
|
+
enabledEvents: Array<string>;
|
|
1597
|
+
/**
|
|
1598
|
+
* WebhookEndpointStatus
|
|
1599
|
+
*
|
|
1600
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
1601
|
+
*/
|
|
1602
|
+
status: "active" | "suspended" | "deleted";
|
|
1603
|
+
/**
|
|
1604
|
+
* When the current signing secret was issued.
|
|
1605
|
+
*/
|
|
1606
|
+
secretCreatedAt: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
1609
|
+
*/
|
|
1610
|
+
previousSecretExpiresAt: string | null;
|
|
1611
|
+
createdAt: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* Signing secret in the Standard Webhooks whsec_ form. Returned only when it is issued.
|
|
1614
|
+
*/
|
|
1615
|
+
secret: string;
|
|
1616
|
+
};
|
|
1617
|
+
};
|
|
1618
|
+
export type CreateWebhookEndpointResponse = CreateWebhookEndpointResponses[keyof CreateWebhookEndpointResponses];
|
|
1619
|
+
export type DeleteWebhookEndpointData = {
|
|
1620
|
+
body?: never;
|
|
1621
|
+
path: {
|
|
1622
|
+
/**
|
|
1623
|
+
* Webhook endpoint to operate on.
|
|
1624
|
+
*/
|
|
1625
|
+
webhookEndpointId: string;
|
|
1626
|
+
};
|
|
1627
|
+
query?: never;
|
|
1628
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}";
|
|
1629
|
+
};
|
|
1630
|
+
export type DeleteWebhookEndpointErrors = {
|
|
1631
|
+
/**
|
|
1632
|
+
* The request could not be understood.
|
|
1633
|
+
*/
|
|
1634
|
+
400: Problem & {
|
|
1635
|
+
status: 400;
|
|
1636
|
+
/**
|
|
1637
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1638
|
+
*/
|
|
1639
|
+
code: "parameter_invalid";
|
|
1640
|
+
};
|
|
1641
|
+
/**
|
|
1642
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1643
|
+
*/
|
|
1644
|
+
401: Problem & {
|
|
1645
|
+
status: 401;
|
|
1646
|
+
/**
|
|
1647
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1648
|
+
*/
|
|
1649
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
1650
|
+
};
|
|
1651
|
+
/**
|
|
1652
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1653
|
+
*/
|
|
1654
|
+
403: Problem & {
|
|
1655
|
+
status: 403;
|
|
1656
|
+
/**
|
|
1657
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1658
|
+
*/
|
|
1659
|
+
code: "operation_not_permitted";
|
|
1660
|
+
};
|
|
1661
|
+
/**
|
|
1662
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
1663
|
+
*/
|
|
1664
|
+
404: Problem & {
|
|
1665
|
+
status: 404;
|
|
1666
|
+
/**
|
|
1667
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1668
|
+
*/
|
|
1669
|
+
code: "webhook_endpoint_not_found";
|
|
1670
|
+
};
|
|
1671
|
+
/**
|
|
1672
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1673
|
+
*/
|
|
1674
|
+
500: Problem & {
|
|
1675
|
+
status: 500;
|
|
1676
|
+
/**
|
|
1677
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1678
|
+
*/
|
|
1679
|
+
code: "internal_error";
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
export type DeleteWebhookEndpointError = DeleteWebhookEndpointErrors[keyof DeleteWebhookEndpointErrors];
|
|
1683
|
+
export type DeleteWebhookEndpointResponses = {
|
|
1684
|
+
/**
|
|
1685
|
+
* Default Response
|
|
1686
|
+
*/
|
|
1687
|
+
204: void;
|
|
1688
|
+
};
|
|
1689
|
+
export type DeleteWebhookEndpointResponse = DeleteWebhookEndpointResponses[keyof DeleteWebhookEndpointResponses];
|
|
1690
|
+
export type RetrieveWebhookEndpointData = {
|
|
1691
|
+
body?: never;
|
|
1692
|
+
path: {
|
|
1693
|
+
/**
|
|
1694
|
+
* Webhook endpoint to operate on.
|
|
1695
|
+
*/
|
|
1696
|
+
webhookEndpointId: string;
|
|
1697
|
+
};
|
|
1698
|
+
query?: never;
|
|
1699
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}";
|
|
1700
|
+
};
|
|
1701
|
+
export type RetrieveWebhookEndpointErrors = {
|
|
1702
|
+
/**
|
|
1703
|
+
* The request could not be understood.
|
|
1704
|
+
*/
|
|
1705
|
+
400: Problem & {
|
|
1706
|
+
status: 400;
|
|
1707
|
+
/**
|
|
1708
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1709
|
+
*/
|
|
1710
|
+
code: "parameter_invalid";
|
|
1711
|
+
};
|
|
1712
|
+
/**
|
|
1713
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1714
|
+
*/
|
|
1715
|
+
401: Problem & {
|
|
1716
|
+
status: 401;
|
|
1717
|
+
/**
|
|
1718
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1719
|
+
*/
|
|
1720
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
1721
|
+
};
|
|
1722
|
+
/**
|
|
1723
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1724
|
+
*/
|
|
1725
|
+
403: Problem & {
|
|
1726
|
+
status: 403;
|
|
1727
|
+
/**
|
|
1728
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1729
|
+
*/
|
|
1730
|
+
code: "operation_not_permitted";
|
|
1731
|
+
};
|
|
1732
|
+
/**
|
|
1733
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
1734
|
+
*/
|
|
1735
|
+
404: Problem & {
|
|
1736
|
+
status: 404;
|
|
1737
|
+
/**
|
|
1738
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1739
|
+
*/
|
|
1740
|
+
code: "webhook_endpoint_not_found";
|
|
1741
|
+
};
|
|
1742
|
+
/**
|
|
1743
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1744
|
+
*/
|
|
1745
|
+
500: Problem & {
|
|
1746
|
+
status: 500;
|
|
1747
|
+
/**
|
|
1748
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1749
|
+
*/
|
|
1750
|
+
code: "internal_error";
|
|
1751
|
+
};
|
|
1752
|
+
};
|
|
1753
|
+
export type RetrieveWebhookEndpointError = RetrieveWebhookEndpointErrors[keyof RetrieveWebhookEndpointErrors];
|
|
1754
|
+
export type RetrieveWebhookEndpointResponses = {
|
|
1755
|
+
/**
|
|
1756
|
+
* WebhookEndpoint
|
|
1757
|
+
*
|
|
1758
|
+
* A merchant endpoint configured to receive authenticated domain events.
|
|
1759
|
+
*/
|
|
1760
|
+
200: {
|
|
1761
|
+
/**
|
|
1762
|
+
* Webhook endpoint identifier.
|
|
1763
|
+
*/
|
|
1764
|
+
id: string;
|
|
1765
|
+
object: "webhook_endpoint";
|
|
1766
|
+
url: string;
|
|
1767
|
+
/**
|
|
1768
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
1769
|
+
*/
|
|
1770
|
+
enabledEvents: Array<string>;
|
|
1771
|
+
/**
|
|
1772
|
+
* WebhookEndpointStatus
|
|
1773
|
+
*
|
|
1774
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
1775
|
+
*/
|
|
1776
|
+
status: "active" | "suspended" | "deleted";
|
|
1777
|
+
/**
|
|
1778
|
+
* When the current signing secret was issued.
|
|
1779
|
+
*/
|
|
1780
|
+
secretCreatedAt: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
1783
|
+
*/
|
|
1784
|
+
previousSecretExpiresAt: string | null;
|
|
1785
|
+
createdAt: string;
|
|
1786
|
+
};
|
|
1787
|
+
};
|
|
1788
|
+
export type RetrieveWebhookEndpointResponse = RetrieveWebhookEndpointResponses[keyof RetrieveWebhookEndpointResponses];
|
|
1789
|
+
export type ListWebhookDeliveriesData = {
|
|
1790
|
+
body?: never;
|
|
1791
|
+
path: {
|
|
1792
|
+
/**
|
|
1793
|
+
* Webhook endpoint to operate on.
|
|
1794
|
+
*/
|
|
1795
|
+
webhookEndpointId: string;
|
|
1796
|
+
};
|
|
1797
|
+
query?: {
|
|
1798
|
+
/**
|
|
1799
|
+
* Rows on one page.
|
|
1800
|
+
*/
|
|
1801
|
+
limit?: number;
|
|
1802
|
+
/**
|
|
1803
|
+
* The `nextCursor` of the previous page. A cursor belongs to the list, tenant, mode, and filter set that minted it.
|
|
1804
|
+
*/
|
|
1805
|
+
cursor?: string;
|
|
1806
|
+
/**
|
|
1807
|
+
* WebhookDeliveryState
|
|
1808
|
+
*
|
|
1809
|
+
* A pending delivery waits for its next attempt, a processing one is in flight, a delivered one was accepted, and a dead-lettered one is never attempted again.
|
|
1810
|
+
*/
|
|
1811
|
+
state?: Array<"pending" | "processing" | "delivered" | "dead_lettered">;
|
|
1812
|
+
/**
|
|
1813
|
+
* Admits the deliveries whose event happened at or after this instant.
|
|
1814
|
+
*/
|
|
1815
|
+
occurredAfter?: string;
|
|
1816
|
+
/**
|
|
1817
|
+
* Admits the deliveries whose event happened at or before this instant.
|
|
1818
|
+
*/
|
|
1819
|
+
occurredBefore?: string;
|
|
1820
|
+
};
|
|
1821
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}/deliveries";
|
|
1822
|
+
};
|
|
1823
|
+
export type ListWebhookDeliveriesErrors = {
|
|
1824
|
+
/**
|
|
1825
|
+
* The request could not be understood.
|
|
1826
|
+
*/
|
|
1827
|
+
400: Problem & {
|
|
1828
|
+
status: 400;
|
|
1829
|
+
/**
|
|
1830
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1831
|
+
*/
|
|
1832
|
+
code: "parameter_invalid" | "collection_cursor_invalid";
|
|
1833
|
+
};
|
|
1834
|
+
/**
|
|
1835
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1836
|
+
*/
|
|
1837
|
+
401: Problem & {
|
|
1838
|
+
status: 401;
|
|
1839
|
+
/**
|
|
1840
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1841
|
+
*/
|
|
1842
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
1843
|
+
};
|
|
1844
|
+
/**
|
|
1845
|
+
* The credential is valid but not permitted to perform this operation.
|
|
1846
|
+
*/
|
|
1847
|
+
403: Problem & {
|
|
1848
|
+
status: 403;
|
|
1849
|
+
/**
|
|
1850
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1851
|
+
*/
|
|
1852
|
+
code: "operation_not_permitted";
|
|
1853
|
+
};
|
|
1854
|
+
/**
|
|
1855
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
1856
|
+
*/
|
|
1857
|
+
404: Problem & {
|
|
1858
|
+
status: 404;
|
|
1859
|
+
/**
|
|
1860
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1861
|
+
*/
|
|
1862
|
+
code: "webhook_endpoint_not_found";
|
|
1863
|
+
};
|
|
1864
|
+
/**
|
|
1865
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
1866
|
+
*/
|
|
1867
|
+
500: Problem & {
|
|
1868
|
+
status: 500;
|
|
1869
|
+
/**
|
|
1870
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1871
|
+
*/
|
|
1872
|
+
code: "internal_error";
|
|
1873
|
+
};
|
|
1874
|
+
};
|
|
1875
|
+
export type ListWebhookDeliveriesError = ListWebhookDeliveriesErrors[keyof ListWebhookDeliveriesErrors];
|
|
1876
|
+
export type ListWebhookDeliveriesResponses = {
|
|
1877
|
+
/**
|
|
1878
|
+
* WebhookDeliveryListPage
|
|
1879
|
+
*
|
|
1880
|
+
* One page of deliveries for one webhook endpoint, newest first.
|
|
1881
|
+
*/
|
|
1882
|
+
200: {
|
|
1883
|
+
object: "list";
|
|
1884
|
+
data: Array<{
|
|
1885
|
+
/**
|
|
1886
|
+
* Delivery identifier. A replay of the same event is a new one.
|
|
1887
|
+
*/
|
|
1888
|
+
id: string;
|
|
1889
|
+
object: "webhook_delivery";
|
|
1890
|
+
/**
|
|
1891
|
+
* WebhookEventId
|
|
1892
|
+
*
|
|
1893
|
+
* A Gateway event id or the canonical UUID of a native Invoice event.
|
|
1894
|
+
*/
|
|
1895
|
+
eventId: string | string;
|
|
1896
|
+
/**
|
|
1897
|
+
* The retained event type, including events from earlier contracts.
|
|
1898
|
+
*/
|
|
1899
|
+
eventType: string;
|
|
1900
|
+
/**
|
|
1901
|
+
* WebhookDeliveryState
|
|
1902
|
+
*
|
|
1903
|
+
* A pending delivery waits for its next attempt, a processing one is in flight, a delivered one was accepted, and a dead-lettered one is never attempted again.
|
|
1904
|
+
*/
|
|
1905
|
+
state: "pending" | "processing" | "delivered" | "dead_lettered";
|
|
1906
|
+
/**
|
|
1907
|
+
* Attempts already spent.
|
|
1908
|
+
*/
|
|
1909
|
+
attemptCount: number;
|
|
1910
|
+
/**
|
|
1911
|
+
* When the next attempt is due. Meaningless once the state is terminal.
|
|
1912
|
+
*/
|
|
1913
|
+
nextAttemptAt: string;
|
|
1914
|
+
/**
|
|
1915
|
+
* HTTP status of the last attempt, or null when no response arrived.
|
|
1916
|
+
*/
|
|
1917
|
+
lastStatusCode: number | null;
|
|
1918
|
+
/**
|
|
1919
|
+
* Why the delivery ended, or null while it is still being attempted.
|
|
1920
|
+
*/
|
|
1921
|
+
resultCode: "delivered" | "attempt_budget_exhausted" | "delivery_deadline_exceeded" | null;
|
|
1922
|
+
/**
|
|
1923
|
+
* Bounded, printable prefix of what the endpoint answered, or null when no response arrived.
|
|
1924
|
+
*/
|
|
1925
|
+
lastResponseExcerpt: string | null;
|
|
1926
|
+
/**
|
|
1927
|
+
* The replay that queued this delivery, or null for the original fan-out.
|
|
1928
|
+
*/
|
|
1929
|
+
replayId: string | null;
|
|
1930
|
+
/**
|
|
1931
|
+
* When the event happened.
|
|
1932
|
+
*/
|
|
1933
|
+
occurredAt: string;
|
|
1934
|
+
/**
|
|
1935
|
+
* When this delivery was queued.
|
|
1936
|
+
*/
|
|
1937
|
+
createdAt: string;
|
|
1938
|
+
}>;
|
|
1939
|
+
/**
|
|
1940
|
+
* True when a further page follows this one.
|
|
1941
|
+
*/
|
|
1942
|
+
hasMore: boolean;
|
|
1943
|
+
/**
|
|
1944
|
+
* Send as `cursor` to read the next page, or `null` on the last page.
|
|
1945
|
+
*/
|
|
1946
|
+
nextCursor: string | null;
|
|
1947
|
+
};
|
|
1948
|
+
};
|
|
1949
|
+
export type ListWebhookDeliveriesResponse = ListWebhookDeliveriesResponses[keyof ListWebhookDeliveriesResponses];
|
|
1950
|
+
export type ReplayWebhookEventsData = {
|
|
1951
|
+
/**
|
|
1952
|
+
* ReplayWebhookEventsRequest
|
|
1953
|
+
*
|
|
1954
|
+
* The events to send again: either up to 100 event ids, or an occurredAfter and occurredBefore window of at most seven days that selects at most 100 events. A body naming both, or an incomplete window, answers webhook_replay_scope_invalid with a pointer at the property at fault.
|
|
1955
|
+
*/
|
|
1956
|
+
body: {
|
|
1957
|
+
/**
|
|
1958
|
+
* WebhookEventId
|
|
1959
|
+
*
|
|
1960
|
+
* A Gateway event id or the canonical UUID of a native Invoice event.
|
|
1961
|
+
*/
|
|
1962
|
+
eventIds?: Array<string | string>;
|
|
1963
|
+
/**
|
|
1964
|
+
* Selects the events that happened at or after this instant.
|
|
1965
|
+
*/
|
|
1966
|
+
occurredAfter?: string;
|
|
1967
|
+
/**
|
|
1968
|
+
* Selects the events that happened at or before this instant.
|
|
1969
|
+
*/
|
|
1970
|
+
occurredBefore?: string;
|
|
1971
|
+
};
|
|
1972
|
+
headers: {
|
|
1973
|
+
"idempotency-key": string;
|
|
1974
|
+
};
|
|
1975
|
+
path: {
|
|
1976
|
+
/**
|
|
1977
|
+
* Webhook endpoint to operate on.
|
|
1978
|
+
*/
|
|
1979
|
+
webhookEndpointId: string;
|
|
1980
|
+
};
|
|
1981
|
+
query?: never;
|
|
1982
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}/replays";
|
|
1983
|
+
};
|
|
1984
|
+
export type ReplayWebhookEventsErrors = {
|
|
1985
|
+
/**
|
|
1986
|
+
* The request could not be understood.
|
|
1987
|
+
*/
|
|
1988
|
+
400: Problem & {
|
|
1989
|
+
status: 400;
|
|
1990
|
+
/**
|
|
1991
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
1992
|
+
*/
|
|
1993
|
+
code: "parameter_invalid" | "parameter_missing" | "request_body_malformed" | "webhook_replay_scope_invalid";
|
|
1994
|
+
};
|
|
1995
|
+
/**
|
|
1996
|
+
* The credential is missing, malformed, or no longer valid.
|
|
1997
|
+
*/
|
|
1998
|
+
401: Problem & {
|
|
1999
|
+
status: 401;
|
|
2000
|
+
/**
|
|
2001
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2002
|
+
*/
|
|
2003
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
2004
|
+
};
|
|
2005
|
+
/**
|
|
2006
|
+
* The credential is valid but not permitted to perform this operation.
|
|
2007
|
+
*/
|
|
2008
|
+
403: Problem & {
|
|
2009
|
+
status: 403;
|
|
2010
|
+
/**
|
|
2011
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2012
|
+
*/
|
|
2013
|
+
code: "operation_not_permitted";
|
|
2014
|
+
};
|
|
2015
|
+
/**
|
|
2016
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
2017
|
+
*/
|
|
2018
|
+
404: Problem & {
|
|
2019
|
+
status: 404;
|
|
2020
|
+
/**
|
|
2021
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2022
|
+
*/
|
|
2023
|
+
code: "webhook_endpoint_not_found" | "webhook_event_not_found";
|
|
2024
|
+
};
|
|
2025
|
+
/**
|
|
2026
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
2027
|
+
*/
|
|
2028
|
+
409: Problem & {
|
|
2029
|
+
status: 409;
|
|
2030
|
+
/**
|
|
2031
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2032
|
+
*/
|
|
2033
|
+
code: "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "webhook_endpoint_deleted" | "webhook_endpoint_suspended";
|
|
2034
|
+
};
|
|
2035
|
+
/**
|
|
2036
|
+
* The request body is larger than this endpoint accepts.
|
|
2037
|
+
*/
|
|
2038
|
+
413: Problem & {
|
|
2039
|
+
status: 413;
|
|
2040
|
+
/**
|
|
2041
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2042
|
+
*/
|
|
2043
|
+
code: "request_body_too_large";
|
|
2044
|
+
};
|
|
2045
|
+
/**
|
|
2046
|
+
* The request body carries a content type this endpoint does not accept.
|
|
2047
|
+
*/
|
|
2048
|
+
415: Problem & {
|
|
2049
|
+
status: 415;
|
|
2050
|
+
/**
|
|
2051
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2052
|
+
*/
|
|
2053
|
+
code: "unsupported_media_type";
|
|
2054
|
+
};
|
|
2055
|
+
/**
|
|
2056
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
2057
|
+
*/
|
|
2058
|
+
500: Problem & {
|
|
2059
|
+
status: 500;
|
|
2060
|
+
/**
|
|
2061
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2062
|
+
*/
|
|
2063
|
+
code: "internal_error";
|
|
2064
|
+
};
|
|
2065
|
+
};
|
|
2066
|
+
export type ReplayWebhookEventsError = ReplayWebhookEventsErrors[keyof ReplayWebhookEventsErrors];
|
|
2067
|
+
export type ReplayWebhookEventsResponses = {
|
|
2068
|
+
/**
|
|
2069
|
+
* WebhookReplay
|
|
2070
|
+
*
|
|
2071
|
+
* A request to send stored events to one endpoint again. Each queued delivery repeats the original event id and is signed with a fresh webhook-timestamp.
|
|
2072
|
+
*/
|
|
2073
|
+
201: {
|
|
2074
|
+
/**
|
|
2075
|
+
* Replay identifier, carried by every delivery it queued.
|
|
2076
|
+
*/
|
|
2077
|
+
id: string;
|
|
2078
|
+
object: "webhook_replay";
|
|
2079
|
+
/**
|
|
2080
|
+
* The endpoint the deliveries were queued for.
|
|
2081
|
+
*/
|
|
2082
|
+
webhookEndpointId: string;
|
|
2083
|
+
/**
|
|
2084
|
+
* How many deliveries this replay queued.
|
|
2085
|
+
*/
|
|
2086
|
+
deliveryCount: number;
|
|
2087
|
+
createdAt: string;
|
|
2088
|
+
};
|
|
2089
|
+
};
|
|
2090
|
+
export type ReplayWebhookEventsResponse = ReplayWebhookEventsResponses[keyof ReplayWebhookEventsResponses];
|
|
2091
|
+
export type RotateWebhookEndpointSecretData = {
|
|
2092
|
+
body?: never;
|
|
2093
|
+
headers: {
|
|
2094
|
+
"idempotency-key": string;
|
|
2095
|
+
};
|
|
2096
|
+
path: {
|
|
2097
|
+
/**
|
|
2098
|
+
* Webhook endpoint to operate on.
|
|
2099
|
+
*/
|
|
2100
|
+
webhookEndpointId: string;
|
|
2101
|
+
};
|
|
2102
|
+
query?: never;
|
|
2103
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}/rotate-secret";
|
|
2104
|
+
};
|
|
2105
|
+
export type RotateWebhookEndpointSecretErrors = {
|
|
2106
|
+
/**
|
|
2107
|
+
* The request could not be understood.
|
|
2108
|
+
*/
|
|
2109
|
+
400: Problem & {
|
|
2110
|
+
status: 400;
|
|
2111
|
+
/**
|
|
2112
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2113
|
+
*/
|
|
2114
|
+
code: "parameter_invalid" | "parameter_missing";
|
|
2115
|
+
};
|
|
2116
|
+
/**
|
|
2117
|
+
* The credential is missing, malformed, or no longer valid.
|
|
2118
|
+
*/
|
|
2119
|
+
401: Problem & {
|
|
2120
|
+
status: 401;
|
|
2121
|
+
/**
|
|
2122
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2123
|
+
*/
|
|
2124
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
2125
|
+
};
|
|
2126
|
+
/**
|
|
2127
|
+
* The credential is valid but not permitted to perform this operation.
|
|
2128
|
+
*/
|
|
2129
|
+
403: Problem & {
|
|
2130
|
+
status: 403;
|
|
2131
|
+
/**
|
|
2132
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2133
|
+
*/
|
|
2134
|
+
code: "operation_not_permitted";
|
|
2135
|
+
};
|
|
2136
|
+
/**
|
|
2137
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
2138
|
+
*/
|
|
2139
|
+
404: Problem & {
|
|
2140
|
+
status: 404;
|
|
2141
|
+
/**
|
|
2142
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2143
|
+
*/
|
|
2144
|
+
code: "webhook_endpoint_not_found";
|
|
2145
|
+
};
|
|
2146
|
+
/**
|
|
2147
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
2148
|
+
*/
|
|
2149
|
+
409: Problem & {
|
|
2150
|
+
status: 409;
|
|
2151
|
+
/**
|
|
2152
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2153
|
+
*/
|
|
2154
|
+
code: "idempotency_key_reused" | "idempotency_request_in_progress" | "idempotency_key_expired" | "webhook_endpoint_deleted";
|
|
2155
|
+
};
|
|
2156
|
+
/**
|
|
2157
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
2158
|
+
*/
|
|
2159
|
+
500: Problem & {
|
|
2160
|
+
status: 500;
|
|
2161
|
+
/**
|
|
2162
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2163
|
+
*/
|
|
2164
|
+
code: "internal_error";
|
|
2165
|
+
};
|
|
2166
|
+
};
|
|
2167
|
+
export type RotateWebhookEndpointSecretError = RotateWebhookEndpointSecretErrors[keyof RotateWebhookEndpointSecretErrors];
|
|
2168
|
+
export type RotateWebhookEndpointSecretResponses = {
|
|
2169
|
+
/**
|
|
2170
|
+
* WebhookEndpointWithSecret
|
|
2171
|
+
*
|
|
2172
|
+
* The endpoint and its new signing secret. Store the secret securely.
|
|
2173
|
+
*/
|
|
2174
|
+
200: {
|
|
2175
|
+
/**
|
|
2176
|
+
* Webhook endpoint identifier.
|
|
2177
|
+
*/
|
|
2178
|
+
id: string;
|
|
2179
|
+
object: "webhook_endpoint";
|
|
2180
|
+
url: string;
|
|
2181
|
+
/**
|
|
2182
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
2183
|
+
*/
|
|
2184
|
+
enabledEvents: Array<string>;
|
|
2185
|
+
/**
|
|
2186
|
+
* WebhookEndpointStatus
|
|
2187
|
+
*
|
|
2188
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
2189
|
+
*/
|
|
2190
|
+
status: "active" | "suspended" | "deleted";
|
|
2191
|
+
/**
|
|
2192
|
+
* When the current signing secret was issued.
|
|
2193
|
+
*/
|
|
2194
|
+
secretCreatedAt: string;
|
|
2195
|
+
/**
|
|
2196
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
2197
|
+
*/
|
|
2198
|
+
previousSecretExpiresAt: string | null;
|
|
2199
|
+
createdAt: string;
|
|
2200
|
+
/**
|
|
2201
|
+
* Signing secret in the Standard Webhooks whsec_ form. Returned only when it is issued.
|
|
2202
|
+
*/
|
|
2203
|
+
secret: string;
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
export type RotateWebhookEndpointSecretResponse = RotateWebhookEndpointSecretResponses[keyof RotateWebhookEndpointSecretResponses];
|
|
2207
|
+
export type SuspendWebhookEndpointData = {
|
|
2208
|
+
body?: never;
|
|
2209
|
+
path: {
|
|
2210
|
+
/**
|
|
2211
|
+
* Webhook endpoint to operate on.
|
|
2212
|
+
*/
|
|
2213
|
+
webhookEndpointId: string;
|
|
2214
|
+
};
|
|
2215
|
+
query?: never;
|
|
2216
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}/suspend";
|
|
2217
|
+
};
|
|
2218
|
+
export type SuspendWebhookEndpointErrors = {
|
|
2219
|
+
/**
|
|
2220
|
+
* The request could not be understood.
|
|
2221
|
+
*/
|
|
2222
|
+
400: Problem & {
|
|
2223
|
+
status: 400;
|
|
2224
|
+
/**
|
|
2225
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2226
|
+
*/
|
|
2227
|
+
code: "parameter_invalid";
|
|
2228
|
+
};
|
|
2229
|
+
/**
|
|
2230
|
+
* The credential is missing, malformed, or no longer valid.
|
|
2231
|
+
*/
|
|
2232
|
+
401: Problem & {
|
|
2233
|
+
status: 401;
|
|
2234
|
+
/**
|
|
2235
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2236
|
+
*/
|
|
2237
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
2238
|
+
};
|
|
2239
|
+
/**
|
|
2240
|
+
* The credential is valid but not permitted to perform this operation.
|
|
2241
|
+
*/
|
|
2242
|
+
403: Problem & {
|
|
2243
|
+
status: 403;
|
|
2244
|
+
/**
|
|
2245
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2246
|
+
*/
|
|
2247
|
+
code: "operation_not_permitted";
|
|
2248
|
+
};
|
|
2249
|
+
/**
|
|
2250
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
2251
|
+
*/
|
|
2252
|
+
404: Problem & {
|
|
2253
|
+
status: 404;
|
|
2254
|
+
/**
|
|
2255
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2256
|
+
*/
|
|
2257
|
+
code: "webhook_endpoint_not_found";
|
|
2258
|
+
};
|
|
2259
|
+
/**
|
|
2260
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
2261
|
+
*/
|
|
2262
|
+
409: Problem & {
|
|
2263
|
+
status: 409;
|
|
2264
|
+
/**
|
|
2265
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2266
|
+
*/
|
|
2267
|
+
code: "webhook_endpoint_deleted";
|
|
2268
|
+
};
|
|
2269
|
+
/**
|
|
2270
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
2271
|
+
*/
|
|
2272
|
+
500: Problem & {
|
|
2273
|
+
status: 500;
|
|
2274
|
+
/**
|
|
2275
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2276
|
+
*/
|
|
2277
|
+
code: "internal_error";
|
|
2278
|
+
};
|
|
2279
|
+
};
|
|
2280
|
+
export type SuspendWebhookEndpointError = SuspendWebhookEndpointErrors[keyof SuspendWebhookEndpointErrors];
|
|
2281
|
+
export type SuspendWebhookEndpointResponses = {
|
|
2282
|
+
/**
|
|
2283
|
+
* WebhookEndpoint
|
|
2284
|
+
*
|
|
2285
|
+
* A merchant endpoint configured to receive authenticated domain events.
|
|
2286
|
+
*/
|
|
2287
|
+
200: {
|
|
2288
|
+
/**
|
|
2289
|
+
* Webhook endpoint identifier.
|
|
2290
|
+
*/
|
|
2291
|
+
id: string;
|
|
2292
|
+
object: "webhook_endpoint";
|
|
2293
|
+
url: string;
|
|
2294
|
+
/**
|
|
2295
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
2296
|
+
*/
|
|
2297
|
+
enabledEvents: Array<string>;
|
|
2298
|
+
/**
|
|
2299
|
+
* WebhookEndpointStatus
|
|
2300
|
+
*
|
|
2301
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
2302
|
+
*/
|
|
2303
|
+
status: "active" | "suspended" | "deleted";
|
|
2304
|
+
/**
|
|
2305
|
+
* When the current signing secret was issued.
|
|
2306
|
+
*/
|
|
2307
|
+
secretCreatedAt: string;
|
|
2308
|
+
/**
|
|
2309
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
2310
|
+
*/
|
|
2311
|
+
previousSecretExpiresAt: string | null;
|
|
2312
|
+
createdAt: string;
|
|
2313
|
+
};
|
|
2314
|
+
};
|
|
2315
|
+
export type SuspendWebhookEndpointResponse = SuspendWebhookEndpointResponses[keyof SuspendWebhookEndpointResponses];
|
|
2316
|
+
export type ReactivateWebhookEndpointData = {
|
|
2317
|
+
body?: never;
|
|
2318
|
+
path: {
|
|
2319
|
+
/**
|
|
2320
|
+
* Webhook endpoint to operate on.
|
|
2321
|
+
*/
|
|
2322
|
+
webhookEndpointId: string;
|
|
2323
|
+
};
|
|
2324
|
+
query?: never;
|
|
2325
|
+
url: "/v1/webhook-endpoints/{webhookEndpointId}/reactivate";
|
|
2326
|
+
};
|
|
2327
|
+
export type ReactivateWebhookEndpointErrors = {
|
|
2328
|
+
/**
|
|
2329
|
+
* The request could not be understood.
|
|
2330
|
+
*/
|
|
2331
|
+
400: Problem & {
|
|
2332
|
+
status: 400;
|
|
2333
|
+
/**
|
|
2334
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2335
|
+
*/
|
|
2336
|
+
code: "parameter_invalid";
|
|
2337
|
+
};
|
|
2338
|
+
/**
|
|
2339
|
+
* The credential is missing, malformed, or no longer valid.
|
|
2340
|
+
*/
|
|
2341
|
+
401: Problem & {
|
|
2342
|
+
status: 401;
|
|
2343
|
+
/**
|
|
2344
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2345
|
+
*/
|
|
2346
|
+
code: "api_key_missing" | "api_key_invalid" | "checkout_token_invalid" | "checkout_token_expired";
|
|
2347
|
+
};
|
|
2348
|
+
/**
|
|
2349
|
+
* The credential is valid but not permitted to perform this operation.
|
|
2350
|
+
*/
|
|
2351
|
+
403: Problem & {
|
|
2352
|
+
status: 403;
|
|
2353
|
+
/**
|
|
2354
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2355
|
+
*/
|
|
2356
|
+
code: "operation_not_permitted";
|
|
2357
|
+
};
|
|
2358
|
+
/**
|
|
2359
|
+
* No endpoint serves this method and path, or no resource with this identifier exists within the caller's scope.
|
|
2360
|
+
*/
|
|
2361
|
+
404: Problem & {
|
|
2362
|
+
status: 404;
|
|
2363
|
+
/**
|
|
2364
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2365
|
+
*/
|
|
2366
|
+
code: "webhook_endpoint_not_found";
|
|
2367
|
+
};
|
|
2368
|
+
/**
|
|
2369
|
+
* The request conflicts with the current state of the resource or with a previous request using the same Idempotency-Key.
|
|
2370
|
+
*/
|
|
2371
|
+
409: Problem & {
|
|
2372
|
+
status: 409;
|
|
2373
|
+
/**
|
|
2374
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2375
|
+
*/
|
|
2376
|
+
code: "webhook_endpoint_deleted";
|
|
2377
|
+
};
|
|
2378
|
+
/**
|
|
2379
|
+
* The request could not complete. Recover by the retained resource reference or retry with the same command identity.
|
|
2380
|
+
*/
|
|
2381
|
+
500: Problem & {
|
|
2382
|
+
status: 500;
|
|
2383
|
+
/**
|
|
2384
|
+
* Stable machine-readable code. Branch on this, never on `title`.
|
|
2385
|
+
*/
|
|
2386
|
+
code: "internal_error";
|
|
2387
|
+
};
|
|
2388
|
+
};
|
|
2389
|
+
export type ReactivateWebhookEndpointError = ReactivateWebhookEndpointErrors[keyof ReactivateWebhookEndpointErrors];
|
|
2390
|
+
export type ReactivateWebhookEndpointResponses = {
|
|
2391
|
+
/**
|
|
2392
|
+
* WebhookEndpoint
|
|
2393
|
+
*
|
|
2394
|
+
* A merchant endpoint configured to receive authenticated domain events.
|
|
2395
|
+
*/
|
|
2396
|
+
200: {
|
|
2397
|
+
/**
|
|
2398
|
+
* Webhook endpoint identifier.
|
|
2399
|
+
*/
|
|
2400
|
+
id: string;
|
|
2401
|
+
object: "webhook_endpoint";
|
|
2402
|
+
url: string;
|
|
2403
|
+
/**
|
|
2404
|
+
* The retained subscription configuration, including event types from earlier contracts.
|
|
2405
|
+
*/
|
|
2406
|
+
enabledEvents: Array<string>;
|
|
2407
|
+
/**
|
|
2408
|
+
* WebhookEndpointStatus
|
|
2409
|
+
*
|
|
2410
|
+
* An active endpoint receives deliveries, a suspended one holds them until it is reactivated, and a deleted one never receives another.
|
|
2411
|
+
*/
|
|
2412
|
+
status: "active" | "suspended" | "deleted";
|
|
2413
|
+
/**
|
|
2414
|
+
* When the current signing secret was issued.
|
|
2415
|
+
*/
|
|
2416
|
+
secretCreatedAt: string;
|
|
2417
|
+
/**
|
|
2418
|
+
* When the previous signing secret stops signing deliveries, or null outside a rotation grace window.
|
|
2419
|
+
*/
|
|
2420
|
+
previousSecretExpiresAt: string | null;
|
|
2421
|
+
createdAt: string;
|
|
2422
|
+
};
|
|
2423
|
+
};
|
|
2424
|
+
export type ReactivateWebhookEndpointResponse = ReactivateWebhookEndpointResponses[keyof ReactivateWebhookEndpointResponses];
|
|
2425
|
+
//# sourceMappingURL=types.gen.d.ts.map
|