Skip to content
Documentation
Get started

Subscriptions

Retrieve the setup link for a subscription

POST
/v1/subscriptions/{subscriptionId}/setup
curl --request POST \
--url https://api.timbro.do/v1/subscriptions/example/setup \
--header 'Authorization: Bearer <token>'
subscriptionId
required
string
/^sub_[0-9a-hjkmnp-tv-z]{24,}$/

Subscription identity

Default Response

Media typeapplication/json
Response fields and codes
object
id
required

Subscription identity

string
/^sub_[0-9a-hjkmnp-tv-z]{24,}$/
subscriptionReference
required
string
terms
required
object
version
required
string
text
required
string
locale
required
Any of:
string
Allowed value: es
translations
required
object
es
required
string
en
required
string
customer
required
object
customerReference
required
string
>= 1 characters <= 128 characters
name
required
string
>= 1 characters <= 150 characters
email
required
string format: email
<= 254 characters
status
required
string
Allowed values: pending active past_due deferred canceled expired
amount
required

An exact decimal monetary amount.

object
currency
required

Example

DOP
string
/^[A-Z]{3}$/
value
required

Exact nonnegative decimal amount, with at most two fractional digits.

string
/^(0|[1-9][0-9]{0,15})(\.[0-9]{1,2})?$/
interval
required
object
unit
required
string
Allowed value: month
nextPaymentAt
required
Any of:
string format: date-time
setup
required
Any of:
object
url
required
Any of:
string format: uri
expiresAt
required
string format: date-time
management
required
Any of:
object
url
required
string format: uri
managementLinkEmail
required
Any of:
object
status
required
Any of:
string
Allowed value: pending
requestedAt
required
string format: date-time
deferralReason
required
Any of:
string
Allowed values: merchant_account_not_ready recurring_account_required mandate_credential_unavailable business_fiscal_binding_unavailable business_fiscal_setup_unavailable subscription_invoicing_blocked card_enrollment_incomplete other
createdAt
required
string format: date-time
canceledAt
required
Any of:
string format: date-time
payments
required
Array<object>
<= 5 items
object
id
required

Payment identity

string
/^pay_[0-9a-hjkmnp-tv-z]{24,}$/
status
required

Only succeeded, canceled, and expired are terminal. A declined attempt returns the Payment to requires_customer_action with lastDecline, so the payer can try again until the Payment expires. partially_authorized means some shares have reserved funds, authorized means every share is reserved and awaits the organizer’s capture command, capturing means capture is running, and releasing means reserved funds are being released. verifying is a real, non-terminal status; it is not an error or decline.

string
Allowed values: requires_customer_action processing partially_authorized authorized capturing partially_paid releasing verifying succeeded canceled expired
invoiceId
required
Any of:
string
customerCheckoutUrl
required
Any of:
string format: uri
periodStart
required
Any of:
string format: date-time
periodEnd
required
Any of:
string format: date-time
initiator
required
Any of:
string
Allowed value: customer
recoveryNotice
required
Any of:
object
status
required
Any of:
string
Allowed value: pending
deadline
required
Any of:
string format: date-time
problem
required
Any of:

Why a recovery notice needs attention. notice_handoff_failed is a final provider rejection; notice_handoff_unknown is a handoff whose outcome is uncertain, retried until the provider’s deduplication window ends; notice_delivery_failed is a bounce or complaint after handoff; notice_unavailable means the notice could not be prepared yet.

string
Allowed values: notice_unavailable notice_handoff_failed notice_handoff_unknown notice_delivery_failed
invoicing
Any of:

Retained Invoice instructions and recipient choice. Invoice lifecycle and access credentials are reported separately.

object
mode
required
Any of:
string
Allowed value: automatic
type
required
string
Allowed values: E31 E32 E45
recipientEmail
required
Any of:
string format: email
<= 320 characters
issuanceProblem

One RFC 9457 problem body returned on the /v1 surface.

object
code
required
string
>= 1 characters
requestId
required
string
status
required
integer format: int32
>= 400 <= 599
title
required
string
type
required
string
Allowed values: about:blank
detail
string
invoiceId

Present only when the rejected request produced a Fiscal operation.

string
issuanceBlockers

Present only when the authoritative issuance rules refused to issue.

Array<string>
Allowed values: invalid_request unsupported_protocol unsupported_rules_version invalid_resolved_facts numbering_verifier_missing numbering_mode_not_enabled document_type_not_recognized sequence_missing sequence_not_observed_on_effective_date sequence_suspended sequence_cancelled sequence_superseded sequence_exhausted sequence_conflicting sequence_document_type_mismatch sequence_rejected_by_dgii sequence_expired sequence_range_overlap fiscal_number_capacity_exhausted invalid_fiscal_number fiscal_number_outside_authorized_range fiscal_number_before_verified_floor sequence_expiration_mismatch
problems

Present only when the rejection points at a value the request carried.

Array<object>

One stable public document problem retained for a rejected admission.

object
code
required
string
message
required
string
path
required
string
buyer
discriminator: kind
object
kind
required
string
Allowed values: anonymous
governmentEligibility
Any of:
object
entityKind
required
string
Allowed value: central_government
authorityReference
required
string
>= 1 characters <= 128 characters
allowedTypes
Array<string>
Allowed values: E31 E32 E45
isTypeLocked
boolean
isBuyerLocked
boolean
revision

Increases each time the Invoice type, buyer, or government eligibility changes.

integer
>= 1
invoiceReference
string
>= 1 characters <= 128 characters
paymentsHasMore
required
boolean
paymentsNextCursor
required
Any of:
string
request-id
required
string

Identifies this request. Quote it when you contact support.