curl --request POST \
--url https://api.confiopagos.com/v1/stores/{store}/subscription-plans/{plan}/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"email": "buyer@example.com",
"phoneNumber": "+573215786325",
"firstName": "Santiago",
"lastName": "García"
},
"firstChargeAmountCents": 3000000,
"redirectUri": "https://example.com/subscription-status"
}
'{
"name": "stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ/subscriptions/01JNRVWWHH68E76V3TMFFT6GHJ",
"status": "PENDING_ACCEPTANCE",
"buyer": {
"email": "buyer@example.com",
"phoneNumber": "+573215786325",
"firstName": "Santiago",
"lastName": "García"
},
"createTime": "2024-01-15T10:30:00Z",
"firstChargeAmountCents": 3000000,
"redirectUri": "https://example.com/subscription-status",
"acceptanceUrl": "https://checkout.confiopagos.com/s/abc123token",
"acceptanceTokenExpiresAt": "2024-01-22T10:30:00Z",
"currentPeriodStart": "2024-01-15T10:30:00Z",
"currentPeriodEnd": "2024-02-15T10:30:00Z",
"nextBillingTime": "2024-02-15T10:30:00Z"
}Subscribe a buyer to a plan. This generates an acceptance link that the buyer must use to confirm and set up their payment method.
curl --request POST \
--url https://api.confiopagos.com/v1/stores/{store}/subscription-plans/{plan}/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"buyer": {
"email": "buyer@example.com",
"phoneNumber": "+573215786325",
"firstName": "Santiago",
"lastName": "García"
},
"firstChargeAmountCents": 3000000,
"redirectUri": "https://example.com/subscription-status"
}
'{
"name": "stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ/subscriptions/01JNRVWWHH68E76V3TMFFT6GHJ",
"status": "PENDING_ACCEPTANCE",
"buyer": {
"email": "buyer@example.com",
"phoneNumber": "+573215786325",
"firstName": "Santiago",
"lastName": "García"
},
"createTime": "2024-01-15T10:30:00Z",
"firstChargeAmountCents": 3000000,
"redirectUri": "https://example.com/subscription-status",
"acceptanceUrl": "https://checkout.confiopagos.com/s/abc123token",
"acceptanceTokenExpiresAt": "2024-01-22T10:30:00Z",
"currentPeriodStart": "2024-01-15T10:30:00Z",
"currentPeriodEnd": "2024-02-15T10:30:00Z",
"nextBillingTime": "2024-02-15T10:30:00Z"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
"01G65Z755AFWAKHE12NY0CQ9FH"
"01JNRVWWHH68E76V3TMFFT6GHJ"
Successfully created subscription.
Subscription's resource name
"stores/01JNRRDZDPH40DB2YRW329BFXM/subscription-plans/01JNRVWWHH68E76V3TMFFT6GHJ/subscriptions/01JNRVWWHH68E76V3TMFFT6GHJ"
Subscription status
PENDING_ACCEPTANCE, ACTIVE, TRIALING, PAST_DUE, CANCELED, EXPIRED, SUSPENDED "PENDING_ACCEPTANCE"
Buyer information
Show child attributes
Creation timestamp
"2024-01-15T10:30:00Z"
Optional first charge amount in cents (only for the first charge)
3000000
Optional redirect URI after subscription payment
"https://example.com/subscription-status"
URL for buyer to accept the subscription (only available when status is PENDING_ACCEPTANCE)
"https://checkout.confiopagos.com/s/abc123token"
Expiration time of the acceptance token
"2024-01-22T10:30:00Z"
Start of current billing period
"2024-01-15T10:30:00Z"
End of current billing period
"2024-02-15T10:30:00Z"
Next billing date
"2024-02-15T10:30:00Z"