-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Description
Request to Subscription Povider to create subscription
curl --location 'https://site/api/v2/customers/AzyUM7UusAXA7mMT/subscription_for_items'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Basic ='
--data-urlencode 'billing_address%5Bline1%5D=PO Box 9999'
--data-urlencode 'billing_address%5Bcity%5D=Walnut'
--data-urlencode 'billing_address%5Bzip%5D=91789'
--data-urlencode 'billing_address%5Bcountry%5D=US'
--data-urlencode 'subscription_items%5Bitem_price_id%5D%5B0%5D=cbdemo_enterprise-suite-monthly'
--data-urlencode 'auto_collection=off'
Response from Subscription Provider
{
"subscription": {
"id": "AzyvCyUut31wPEoY",
"billing_period": 1,
"billing_period_unit": "month",
"auto_collection": "off",
"customer_id": "AzyUM7UusAXA7mMT",
"status": "active",
"current_term_start": 1756123927,
"current_term_end": 1758802327,
"next_billing_at": 1758802327,
"created_at": 1756123927,
"started_at": 1756123927,
"activated_at": 1756123927,
"updated_at": 1756123927,
"has_scheduled_changes": false,
"channel": "web",
"resource_version": 1756123927399,
"deleted": false,
"object": "subscription",
"currency_code": "INR",
"subscription_items": [
{
"item_price_id": "cbdemo_enterprise-suite-monthly",
"item_type": "plan",
"quantity": 1,
"unit_price": 14100,
"amount": 14100,
"free_quantity": 0,
"object": "subscription_item"
}
],
"due_invoices_count": 1,
"due_since": 1756123927,
"total_dues": 14100,
"mrr": 0,
"has_scheduled_advance_invoices": false
},
"customer": {
"id": "AzyUM7UusAXA7mMT",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"auto_collection": "on",
"net_term_days": 0,
"allow_direct_debit": false,
"created_at": 1756110939,
"taxability": "taxable",
"updated_at": 1756110939,
"locale": "fr-CA",
"pii_cleared": "active",
"channel": "web",
"resource_version": 1756110939077,
"deleted": false,
"object": "customer",
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"line1": "PO Box 9999",
"city": "Walnut",
"state_code": "CA",
"state": "California",
"country": "US",
"zip": "91789",
"validation_status": "not_validated",
"object": "billing_address"
},
"card_status": "no_card",
"promotional_credits": 0,
"refundable_credits": 0,
"excess_payments": 0,
"unbilled_charges": 0,
"preferred_currency_code": "INR",
"mrr": 0
},
"invoice": {
"id": "48",
"customer_id": "AzyUM7UusAXA7mMT",
"subscription_id": "AzyvCyUut31wPEoY",
"recurring": true,
"status": "payment_due",
"date": 1756123927,
"due_date": 1756123927,
"net_term_days": 0,
"price_type": "tax_exclusive",
"exchange_rate": 1.0,
"total": 14100,
"amount_due": 14100,
"amount_adjusted": 0,
"amount_paid": 0,
"write_off_amount": 0,
"credits_applied": 0,
"updated_at": 1756123927,
"resource_version": 1756123927364,
"deleted": false,
"object": "invoice",
"first_invoice": true,
"amount_to_collect": 14100,
"round_off_amount": 0,
"new_sales_amount": 14100,
"has_advance_charges": false,
"currency_code": "INR",
"base_currency_code": "INR",
"generated_at": 1756123927,
"is_gifted": false,
"term_finalized": true,
"channel": "web",
"tax": 0,
"line_items": [
{
"id": "li_AzyvCyUut31yqEoa",
"date_from": 1756123927,
"date_to": 1758802327,
"unit_amount": 14100,
"quantity": 1,
"amount": 14100,
"pricing_model": "flat_fee",
"is_taxed": false,
"tax_amount": 0,
"object": "line_item",
"subscription_id": "AzyvCyUut31wPEoY",
"customer_id": "AzyUM7UusAXA7mMT",
"description": "Enterprise Suite Monthly",
"entity_type": "plan_item_price",
"entity_id": "cbdemo_enterprise-suite-monthly",
"tax_exempt_reason": "tax_not_configured",
"discount_amount": 0,
"item_level_discount_amount": 0
}
],
"sub_total": 14100,
"linked_payments": [],
"applied_credits": [],
"adjustment_credit_notes": [],
"issued_credit_notes": [],
"linked_orders": [],
"dunning_attempts": [],
"billing_address": {
"first_name": "John",
"last_name": "Doe",
"line1": "PO Box 9999",
"city": "Walnut",
"state_code": "CA",
"state": "California",
"country": "US",
"zip": "91789",
"validation_status": "not_validated",
"object": "billing_address"
},
"site_details_at_creation": {
"timezone": "Asia/Calcutta"
}
}
}
Metadata
Metadata
Assignees
Labels
No labels