Operations (sample payloads)

Main operations
Copy

Create card (Advanced)
Copy

Create a card in a customer account.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"source": {
4
"object": "card",
5
"currency": "usd",
6
"number": "4242424242424242",
7
"exp_month": "12",
8
"exp_year": "2025",
9
"cvc": "123",
10
"name": "John Doe",
11
"address_city": "San Francisco",
12
"address_country": "US",
13
"address_line1": "123 Main St",
14
"address_line2": "Apt 4B",
15
"address_state": "CA",
16
"address_zip": "94105"
17
}
18
}

Sample Output

1
{
2
"id": "card_1234567890abcdef",
3
"object": "card",
4
"brand": "Visa",
5
"last4": "4242",
6
"exp_month": 12,
7
"exp_year": 2025,
8
"fingerprint": "Xt5EWLLDS7FJjR1c",
9
"funding": "credit",
10
"country": "US",
11
"name": "John Doe",
12
"address_line1": "123 Main St",
13
"address_line2": "Apt 4B",
14
"address_city": "San Francisco",
15
"address_state": "CA",
16
"address_zip": "94105",
17
"address_country": "US",
18
"cvc_check": "pass",
19
"address_line1_check": "pass",
20
"address_zip_check": "pass",
21
"tokenization_method": null,
22
"customer": "cus_1234567890abcdef",
23
"metadata": {}
24
}

Create charge
Copy

Creates a charge for a credit card or other payment source.

Sample Input

1
{
2
"amount": "1000",
3
"currency": "usd",
4
"shipping": {
5
"name": "John Doe",
6
"address": {
7
"line1": "123 Main St",
8
"city": "San Francisco",
9
"country": "US",
10
"postal_code": "94111",
11
"state": "CA"
12
}
13
},
14
"customer": "cus_1234567890abcdef",
15
"source": "card_1234567890abcdef",
16
"description": "Charge for order #1234",
17
"metadata": {
18
"order_id": "1234",
19
"product_name": "Widget"
20
},
21
"receipt_email": "john.doe@example.com",
22
"statement_descriptor_suffix": "Widget Co"
23
}

Sample Output

1
{
2
"id": "ch_1234567890abcdef",
3
"object": "charge",
4
"amount": 1000,
5
"amount_refunded": 0,
6
"application": null,
7
"application_fee": null,
8
"application_fee_amount": null,
9
"balance_transaction": "txn_1234567890abcdef",
10
"billing_details": {
11
"address": {
12
"city": "San Francisco",
13
"country": "US",
14
"line1": "123 Main St",
15
"line2": null,
16
"postal_code": "94111",
17
"state": "CA"
18
},
19
"email": "john.doe@example.com",
20
"name": "John Doe",
21
"phone": null
22
},
23
"calculated_statement_descriptor": "WIDGET CO",
24
"captured": true,
25
"created": 1623456789,
26
"currency": "usd",
27
"customer": "cus_1234567890abcdef",
28
"description": "Charge for order #1234",
29
"destination": null,
30
"dispute": null,
31
"disputed": false,
32
"failure_code": null,
33
"failure_message": null,
34
"fraud_details": {},
35
"invoice": null,
36
"livemode": false,
37
"metadata": {
38
"order_id": "1234",
39
"product_name": "Widget"
40
},
41
"on_behalf_of": null,
42
"order": null,
43
"outcome": {
44
"network_status": "approved_by_network",
45
"reason": null,
46
"risk_level": "normal",
47
"risk_score": 32,
48
"seller_message": "Payment complete.",
49
"type": "authorized"
50
},
51
"paid": true,
52
"payment_intent": "pi_1234567890abcdef",
53
"payment_method": "card_1234567890abcdef",
54
"payment_method_details": {
55
"card": {
56
"brand": "visa",
57
"checks": {
58
"address_line1_check": "pass",
59
"address_postal_code_check": "pass",
60
"cvc_check": "pass"
61
},
62
"country": "US",
63
"exp_month": 12,
64
"exp_year": 2025,
65
"fingerprint": "1234567890abcdef",
66
"funding": "credit",
67
"installments": null,
68
"last4": "4242",
69
"network": "visa",
70
"three_d_secure": null,
71
"wallet": null
72
},
73
"type": "card"
74
},
75
"receipt_email": "john.doe@example.com",
76
"receipt_number": "1234-5678",
77
"receipt_url": "https://pay.stripe.com/receipts/1234567890abcdef",
78
"refunded": false,
79
"refunds": {
80
"object": "list",
81
"data": [],
82
"has_more": false,
83
"total_count": 0,
84
"url": "/v1/charges/ch_1234567890abcdef/refunds"
85
},
86
"review": null,
87
"shipping": {
88
"address": {
89
"city": "San Francisco",
90
"country": "US",
91
"line1": "123 Main St",
92
"line2": null,
93
"postal_code": "94111",
94
"state": "CA"
95
},
96
"carrier": null,
97
"name": "John Doe",
98
"phone": null,
99
"tracking_number": null
100
},
101
"source": {
102
"id": "card_1234567890abcdef",
103
"object": "card",
104
"address_city": "San Francisco",
105
"address_country": "US",
106
"address_line1": "123 Main St",
107
"address_line1_check": "pass",
108
"address_line2": null,
109
"address_state": "CA",
110
"address_zip": "94111",
111
"address_zip_check": "pass",
112
"brand": "Visa",
113
"country": "US",
114
"customer": "cus_1234567890abcdef",
115
"cvc_check": "pass",
116
"dynamic_last4": null,
117
"exp_month": 12,
118
"exp_year": 2025,
119
"fingerprint": "1234567890abcdef",
120
"funding": "credit",
121
"last4": "4242",
122
"metadata": {},
123
"name": "John Doe",
124
"tokenization_method": null
125
},
126
"source_transfer": null,
127
"statement_descriptor": null,
128
"statement_descriptor_suffix": "Widget Co",
129
"status": "succeeded",
130
"transfer_data": null,
131
"transfer_group": null
132
}

Create coupon
Copy

Creates a new coupon.

Sample Input

1
{
2
"duration": "repeating",
3
"discount": {
4
"percent_off": 20
5
},
6
"duration_in_months": 3,
7
"id": "SUMMER20",
8
"max_redemptions": 100,
9
"redeem_by": "2023-08-31T23:59:59Z"
10
}

Sample Output

1
{
2
"duration_in_months": "3",
3
"created": 1622505600,
4
"max_redemptions": "100",
5
"livemode": false,
6
"metadata": {},
7
"times_redeemed": 0,
8
"duration": "repeating",
9
"percent_off": "20",
10
"redeem_by": 1630454399,
11
"id": "SUMMER20",
12
"valid": true,
13
"object": "coupon"
14
}

Create customer
Copy

Create a new customer.

Sample Input

1
{
2
"name": "John Doe",
3
"email": "johndoe@example.com",
4
"description": "Loyal customer since 2020",
5
"phone": "+1234567890",
6
"address": {
7
"line1": "123 Main St",
8
"city": "Anytown",
9
"country": "US",
10
"postal_code": "12345",
11
"state": "CA"
12
},
13
"shipping": {
14
"name": "John Doe",
15
"address": {
16
"line1": "456 Elm St",
17
"city": "Othertown",
18
"country": "US",
19
"postal_code": "67890",
20
"state": "NY"
21
},
22
"phone": "+1987654321"
23
},
24
"balance": 1000,
25
"coupon": "WELCOME10",
26
"invoice_settings": {
27
"custom_fields": {
28
"name": "Customer ID",
29
"value": "CUST001"
30
},
31
"footer": "Thank you for your business!"
32
},
33
"source": {
34
"object": "card",
35
"currency": "usd",
36
"number": "4242424242424242",
37
"exp_month": "12",
38
"exp_year": "2025",
39
"cvc": "123",
40
"name": "John Doe",
41
"address_line1": "123 Main St",
42
"address_city": "Anytown",
43
"address_country": "US",
44
"address_zip": "12345"
45
}
46
}

Sample Output

1
{
2
"id": "cus_1234567890abcdef",
3
"object": "customer",
4
"created": 1623456789,
5
"email": "johndoe@example.com",
6
"name": "John Doe",
7
"description": "Loyal customer since 2020",
8
"phone": "+1234567890",
9
"livemode": false,
10
"currency": "usd",
11
"default_source": "card_1234567890abcdef",
12
"delinquent": false,
13
"discount": null,
14
"invoice_prefix": "ABC123",
15
"account_balance": 1000,
16
"shipping": {
17
"name": "John Doe",
18
"address": {
19
"line1": "456 Elm St",
20
"city": "Othertown",
21
"country": "US",
22
"postal_code": "67890",
23
"state": "NY"
24
},
25
"phone": "+1987654321"
26
},
27
"sources": {
28
"object": "list",
29
"data": [
30
{
31
"id": "card_1234567890abcdef"
32
}
33
],
34
"has_more": false,
35
"total_count": 1,
36
"url": "/v1/customers/cus_1234567890abcdef/sources"
37
},
38
"subscriptions": {
39
"object": "list",
40
"data": [],
41
"has_more": false,
42
"total_count": 0,
43
"url": "/v1/customers/cus_1234567890abcdef/subscriptions"
44
},
45
"metadata": {}
46
}

Create subscription
Copy

Creates a new subscription on an existing customer.

Sample Input

1
{
2
"customer": "cus_1234567890abcdef",
3
"items": [
4
{
5
"price_options": {
6
"price": "price_1234567890abcdef"
7
},
8
"quantity": 1
9
}
10
],
11
"default_payment_method": "pm_1234567890abcdef",
12
"collection_method": "charge_automatically",
13
"trial_period_days": 14
14
}

Sample Output

1
{
2
"id": "sub_1234567890abcdef",
3
"object": "subscription",
4
"billing_cycle_anchor": 1623456789,
5
"collection_method": "charge_automatically",
6
"created": 1623456789,
7
"current_period_end": 1626048789,
8
"current_period_start": 1623456789,
9
"customer": "cus_1234567890abcdef",
10
"default_payment_method": "pm_1234567890abcdef",
11
"items": {
12
"object": "list",
13
"data": [
14
{
15
"id": "si_1234567890abcdef",
16
"object": "subscription_item",
17
"created": 1623456789,
18
"plan": {
19
"id": "price_1234567890abcdef",
20
"object": "plan",
21
"active": true,
22
"amount": 1000,
23
"currency": "usd",
24
"interval": "month",
25
"interval_count": 1,
26
"product": "prod_1234567890abcdef"
27
},
28
"price": {
29
"id": "price_1234567890abcdef",
30
"object": "price",
31
"active": true,
32
"currency": "usd",
33
"product": "prod_1234567890abcdef",
34
"recurring": {
35
"interval": "month",
36
"interval_count": 1
37
},
38
"unit_amount": 1000
39
},
40
"quantity": 1,
41
"subscription": "sub_1234567890abcdef"
42
}
43
],
44
"has_more": false,
45
"total_count": 1
46
},
47
"latest_invoice": "in_1234567890abcdef",
48
"livemode": false,
49
"metadata": {},
50
"start_date": 1623456789,
51
"status": "trialing",
52
"trial_end": 1624666389,
53
"trial_start": 1623456789
54
}

Delete card
Copy

Delete a card from a customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"card_id": "card_1234567890abcdef"
4
}

Sample Output

1
{
2
"id": "card_1234567890abcdef",
3
"object": "card",
4
"deleted": true
5
}

Delete subscription
Copy

Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription. Its subscription status will be set to canceled.

Sample Input

1
{
2
"subscription_id": "sub_1234567890abcdef",
3
"invoice_now": true,
4
"prorate": false
5
}

Sample Output

1
{
2
"id": "sub_1234567890abcdef",
3
"object": "subscription",
4
"billing": "charge_automatically",
5
"billing_cycle_anchor": 1609459200,
6
"cancel_at": 1609545600,
7
"cancel_at_period_end": false,
8
"canceled_at": 1609545600,
9
"collection_method": "charge_automatically",
10
"created": 1609372800,
11
"current_period_end": 1612051200,
12
"current_period_start": 1609459200,
13
"customer": "cus_abcdefghijklmno",
14
"days_until_due": null,
15
"default_payment_method": "pm_1234567890abcdef",
16
"default_source": null,
17
"default_tax_rates": [],
18
"ended_at": 1609545600,
19
"items": {
20
"object": "list",
21
"data": [
22
{
23
"id": "si_1234567890abcdef",
24
"object": "subscription_item",
25
"created": 1609372800,
26
"metadata": {},
27
"plan": {
28
"id": "plan_1234567890abcdef",
29
"object": "plan",
30
"active": true,
31
"amount": 1000,
32
"amount_decimal": "1000",
33
"billing_scheme": "per_unit",
34
"created": 1609286400,
35
"currency": "usd",
36
"interval": "month",
37
"interval_count": 1,
38
"livemode": false,
39
"metadata": {},
40
"nickname": "Standard Plan",
41
"product": "prod_1234567890abcdef",
42
"usage_type": "licensed"
43
},
44
"price": {
45
"id": "price_1234567890abcdef",
46
"object": "price",
47
"active": true,
48
"billing_scheme": "per_unit",
49
"created": 1609286400,
50
"currency": "usd",
51
"livemode": false,
52
"metadata": {},
53
"nickname": "Standard Price",
54
"product": "prod_1234567890abcdef",
55
"recurring": {
56
"interval": "month",
57
"interval_count": 1,
58
"usage_type": "licensed"
59
}
60
},
61
"quantity": 1,
62
"subscription": "sub_1234567890abcdef"
63
}
64
],
65
"has_more": false,
66
"total_count": 1,
67
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
68
},
69
"latest_invoice": "in_1234567890abcdef",
70
"livemode": false,
71
"metadata": {},
72
"plan": {
73
"id": "plan_1234567890abcdef",
74
"object": "plan",
75
"active": true,
76
"amount": 1000,
77
"amount_decimal": "1000",
78
"billing_scheme": "per_unit",
79
"created": 1609286400,
80
"currency": "usd",
81
"interval": "month",
82
"interval_count": 1,
83
"livemode": false,
84
"metadata": {},
85
"nickname": "Standard Plan",
86
"product": "prod_1234567890abcdef",
87
"usage_type": "licensed"
88
},
89
"quantity": 1,
90
"start": 1609459200,
91
"start_date": 1609459200,
92
"status": "canceled",
93
"transfer_data": null,
94
"trial_end": null,
95
"trial_start": null
96
}

Get card
Copy

Returns information about a card.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"card_id": "card_1234567890abcdef"
4
}

Sample Output

1
{
2
"id": "card_1234567890abcdef",
3
"object": "card",
4
"address_city": "San Francisco",
5
"address_country": "US",
6
"address_line1": "123 Main St",
7
"address_line1_check": "pass",
8
"address_line2": "Apt 4B",
9
"address_state": "CA",
10
"address_zip": "94105",
11
"address_zip_check": "pass",
12
"brand": "Visa",
13
"country": "US",
14
"customer": "cus_1234567890abcdef",
15
"cvc_check": "pass",
16
"dynamic_last4": null,
17
"exp_month": 12,
18
"exp_year": 2025,
19
"fingerprint": "Xt5EWLLDS7FJjR1c",
20
"funding": "credit",
21
"last4": "4242",
22
"metadata": {},
23
"name": "John Doe",
24
"tokenization_method": null
25
}

Get charge
Copy

Retrieves the details of a charge that has previously been created.

Sample Input

1
{
2
"charge_id": "ch_3N2XpKHSaWXyvFpK1eAyckQm"
3
}

Sample Output

1
{
2
"id": "ch_3N2XpKHSaWXyvFpK1eAyckQm",
3
"object": "charge",
4
"amount": 2000,
5
"amount_refunded": 0,
6
"application": null,
7
"application_fee": null,
8
"application_fee_amount": null,
9
"balance_transaction": "txn_3N2XpKHSaWXyvFpK1eAyckQm",
10
"billing_details": {
11
"address": {
12
"city": "San Francisco",
13
"country": "US",
14
"line1": "123 Market St",
15
"line2": null,
16
"postal_code": "94105",
17
"state": "CA"
18
},
19
"email": "john.doe@example.com",
20
"name": "John Doe",
21
"phone": "+14155551234"
22
},
23
"calculated_statement_descriptor": "EXAMPLE INC",
24
"captured": true,
25
"created": 1620000000,
26
"currency": "usd",
27
"customer": "cus_4fdAW5ftNQow1a",
28
"description": "Example charge for product XYZ",
29
"destination": null,
30
"dispute": null,
31
"disputed": false,
32
"failure_code": null,
33
"failure_message": null,
34
"fraud_details": {},
35
"invoice": null,
36
"livemode": false,
37
"metadata": {},
38
"on_behalf_of": null,
39
"order": null,
40
"outcome": {
41
"network_status": "approved_by_network",
42
"reason": null,
43
"risk_level": "normal",
44
"risk_score": 32,
45
"seller_message": "Payment complete.",
46
"type": "authorized"
47
},
48
"paid": true,
49
"payment_intent": "pi_3N2XpKHSaWXyvFpK1eAyckQm",
50
"payment_method": "pm_1N2XpKHSaWXyvFpK1eAyckQm",
51
"payment_method_details": {
52
"card": {
53
"brand": "visa",
54
"checks": {
55
"address_line1_check": "pass",
56
"address_postal_code_check": "pass",
57
"cvc_check": "pass"
58
},
59
"country": "US",
60
"exp_month": 12,
61
"exp_year": 2025,
62
"fingerprint": "Xt5EWLLDS7FJjR1c",
63
"funding": "credit",
64
"installments": null,
65
"last4": "4242",
66
"network": "visa",
67
"three_d_secure": null,
68
"wallet": null
69
},
70
"type": "card"
71
},
72
"receipt_email": "john.doe@example.com",
73
"receipt_number": "1234-5678",
74
"receipt_url": "https://pay.stripe.com/receipts/...",
75
"refunded": false,
76
"refunds": {
77
"object": "list",
78
"data": [],
79
"has_more": false,
80
"total_count": 0,
81
"url": "/v1/charges/ch_3N2XpKHSaWXyvFpK1eAyckQm/refunds"
82
},
83
"review": null,
84
"shipping": null,
85
"source": null,
86
"source_transfer": null,
87
"statement_descriptor": null,
88
"statement_descriptor_suffix": null,
89
"status": "succeeded",
90
"transfer_data": null,
91
"transfer_group": null
92
}

Get customer
Copy

Returns information about a customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef"
3
}

Sample Output

1
{
2
"id": "cus_1234567890abcdef",
3
"object": "customer",
4
"account_balance": 0,
5
"created": 1622505600,
6
"currency": "usd",
7
"default_source": "card_1234567890abcdef",
8
"delinquent": false,
9
"description": "John Doe - Premium Customer",
10
"discount": null,
11
"email": "john.doe@example.com",
12
"invoice_prefix": "INV",
13
"livemode": false,
14
"metadata": {
15
"order_id": "ord_1234",
16
"customer_type": "premium"
17
},
18
"shipping": {
19
"address": {
20
"city": "San Francisco",
21
"country": "US",
22
"line1": "123 Main St",
23
"line2": "Apt 4B",
24
"postal_code": "94105",
25
"state": "CA"
26
},
27
"name": "John Doe",
28
"phone": "+14155551234"
29
},
30
"sources": {
31
"object": "list",
32
"data": [
33
{
34
"id": "card_1234567890abcdef"
35
}
36
],
37
"has_more": false,
38
"total_count": 1,
39
"url": "/v1/customers/cus_1234567890abcdef/sources"
40
},
41
"subscriptions": {
42
"object": "list",
43
"data": [
44
{
45
"id": "sub_1234567890abcdef",
46
"object": "subscription",
47
"application_fee_percent": null,
48
"billing": "charge_automatically",
49
"billing_cycle_anchor": 1622505600,
50
"cancel_at_period_end": false,
51
"canceled_at": null,
52
"created": 1622505600,
53
"current_period_end": 1625097600,
54
"current_period_start": 1622505600,
55
"customer": "cus_1234567890abcdef",
56
"days_until_due": null,
57
"discount": null,
58
"ended_at": null,
59
"items": {
60
"object": "list",
61
"data": [
62
{
63
"id": "si_1234567890abcdef",
64
"object": "subscription_item",
65
"created": 1622505600,
66
"metadata": {},
67
"plan": {
68
"id": "plan_1234567890abcdef",
69
"object": "plan",
70
"amount": 1999,
71
"billing_scheme": "per_unit",
72
"created": 1622419200,
73
"currency": "usd",
74
"interval": "month",
75
"interval_count": 1,
76
"livemode": false,
77
"metadata": {},
78
"nickname": "Premium Plan",
79
"product": "prod_1234567890abcdef",
80
"usage_type": "licensed"
81
},
82
"quantity": 1,
83
"subscription": "sub_1234567890abcdef"
84
}
85
],
86
"has_more": false,
87
"total_count": 1,
88
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
89
},
90
"livemode": false,
91
"metadata": {},
92
"plan": {
93
"id": "plan_1234567890abcdef",
94
"object": "plan",
95
"amount": 1999,
96
"billing_scheme": "per_unit",
97
"created": 1622419200,
98
"currency": "usd",
99
"interval": "month",
100
"interval_count": 1,
101
"livemode": false,
102
"metadata": {},
103
"nickname": "Premium Plan",
104
"product": "prod_1234567890abcdef",
105
"usage_type": "licensed"
106
},
107
"quantity": 1,
108
"start": 1622505600,
109
"status": "active",
110
"tax_percent": null,
111
"trial_end": null,
112
"trial_start": null
113
}
114
],
115
"has_more": false,
116
"total_count": 1,
117
"url": "/v1/customers/cus_1234567890abcdef/subscriptions"
118
}
119
}

Get invoice
Copy

Returns information about an invoice.

Sample Input

1
{
2
"invoice_id": "in_1234567890abcdef"
3
}

Sample Output

1
{
2
"id": "in_1234567890abcdef",
3
"object": "invoice",
4
"account_country": "US",
5
"account_name": "My Company",
6
"amount_due": 10000,
7
"amount_paid": 10000,
8
"amount_remaining": 0,
9
"attempt_count": 1,
10
"attempted": true,
11
"auto_advance": true,
12
"billing": "charge_automatically",
13
"billing_reason": "subscription_cycle",
14
"charge": {
15
"id": "ch_1234567890abcdef"
16
},
17
"closed": true,
18
"collection_method": "charge_automatically",
19
"created": 1623456789,
20
"currency": "usd",
21
"customer": "cus_1234567890abcdef",
22
"customer_address": {
23
"city": "San Francisco",
24
"country": "US",
25
"line1": "123 Main St",
26
"line2": "Apt 4B",
27
"postal_code": "94105",
28
"state": "CA"
29
},
30
"customer_email": "customer@example.com",
31
"customer_name": "John Doe",
32
"customer_phone": "+14155551234",
33
"customer_shipping": {
34
"address": {
35
"city": "San Francisco",
36
"country": "US",
37
"line1": "123 Main St",
38
"line2": "Apt 4B",
39
"postal_code": "94105",
40
"state": "CA"
41
},
42
"name": "John Doe",
43
"phone": "+14155551234"
44
},
45
"customer_tax_exempt": "none",
46
"customer_tax_ids": [],
47
"date": 1623456789,
48
"description": "Subscription renewal",
49
"discount": null,
50
"discounts": [],
51
"due_date": null,
52
"ending_balance": 0,
53
"finalized_at": 1623456789,
54
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_123456789/inv_1234567890abcdef",
55
"invoice_pdf": "https://pay.stripe.com/invoice/acct_123456789/inv_1234567890abcdef/pdf",
56
"lines": {
57
"object": "list",
58
"data": [
59
{
60
"id": "il_1234567890abcdef",
61
"object": "line_item",
62
"amount": 10000,
63
"currency": "usd",
64
"description": "1 × My Product (at $100.00 / month)",
65
"discountable": true,
66
"livemode": false,
67
"metadata": {},
68
"period": {
69
"end": 1626048789,
70
"start": 1623456789
71
},
72
"plan": {
73
"id": "plan_1234567890abcdef",
74
"object": "plan",
75
"active": true,
76
"amount": 10000,
77
"currency": "usd",
78
"interval": "month",
79
"interval_count": 1,
80
"livemode": false,
81
"metadata": {},
82
"nickname": "Monthly Plan",
83
"product": "prod_1234567890abcdef"
84
},
85
"price": {
86
"id": "price_1234567890abcdef",
87
"object": "price",
88
"active": true,
89
"currency": "usd",
90
"metadata": {},
91
"nickname": "Monthly Price",
92
"product": "prod_1234567890abcdef",
93
"recurring": {
94
"interval": "month",
95
"interval_count": 1
96
},
97
"type": "recurring",
98
"unit_amount": 10000
99
},
100
"proration": false,
101
"quantity": 1,
102
"subscription": "sub_1234567890abcdef",
103
"subscription_item": "si_1234567890abcdef",
104
"tax_amounts": [],
105
"tax_rates": [],
106
"type": "subscription"
107
}
108
],
109
"has_more": false,
110
"total_count": 1
111
},
112
"livemode": false,
113
"metadata": {},
114
"number": "INV-0001",
115
"paid": true,
116
"payment_intent": {
117
"id": "pi_1234567890abcdef"
118
},
119
"period_end": 1623456789,
120
"period_start": 1620864789,
121
"receipt_number": null,
122
"starting_balance": 0,
123
"status": "paid",
124
"subscription": "sub_1234567890abcdef",
125
"subtotal": 10000,
126
"tax": 0,
127
"total": 10000,
128
"total_discount_amounts": [],
129
"total_tax_amounts": []
130
}

Get plan
Copy

Returns information about a plan.

Sample Input

1
{
2
"plan_id": "plan_H1xjKPtDvQSLVN"
3
}

Sample Output

1
{
2
"id": "plan_H1xjKPtDvQSLVN",
3
"object": "plan",
4
"amount": 2000,
5
"billing_scheme": "per_unit",
6
"created": 1610123456,
7
"currency": "usd",
8
"interval": "month",
9
"interval_count": 1,
10
"livemode": false,
11
"metadata": {},
12
"nickname": "Premium Monthly",
13
"product": "prod_H1xjKPtDvQSLVN",
14
"tiers": null,
15
"tiers_mode": null,
16
"transform_usage": null,
17
"trial_period_days": null,
18
"usage_type": "licensed"
19
}

Get product
Copy

Returns information about a product.

Sample Input

1
{
2
"product_id": "prod_1234567890abcdef"
3
}

Sample Output

1
{
2
"id": "prod_1234567890abcdef",
3
"object": "product",
4
"active": true,
5
"attributes": [
6
"size",
7
"color"
8
],
9
"caption": "Comfortable cotton t-shirt",
10
"created": 1622505600,
11
"deactivate_on": [],
12
"description": "A high-quality, 100% cotton t-shirt available in various sizes and colors.",
13
"images": [
14
"https://example.com/images/tshirt_front.jpg",
15
"https://example.com/images/tshirt_back.jpg"
16
],
17
"livemode": false,
18
"metadata": {
19
"category": "apparel",
20
"season": "summer"
21
},
22
"name": "Cotton T-Shirt",
23
"package_dimensions": {
24
"height": 5,
25
"length": 12,
26
"weight": 200,
27
"width": 8
28
},
29
"shippable": true,
30
"skus": {
31
"object": "list",
32
"data": [
33
{
34
"id": "sku_1234567890abcdef"
35
},
36
{
37
"id": "sku_0987654321fedcba"
38
}
39
],
40
"has_more": false,
41
"total_count": 2,
42
"url": "/v1/skus?product=prod_1234567890abcdef"
43
},
44
"statement_descriptor": "EXAMPLE STORE",
45
"type": "good",
46
"unit_label": "shirt",
47
"updated": 1622592000,
48
"url": "https://example.com/products/cotton-tshirt"
49
}

Get subscription
Copy

Returns information about a subscription.

Sample Input

1
{
2
"subscription_id": "sub_1234567890abcdef"
3
}

Sample Output

1
{
2
"id": "sub_1234567890abcdef",
3
"object": "subscription",
4
"application_fee_percent": null,
5
"billing": "charge_automatically",
6
"billing_cycle_anchor": 1623456789,
7
"billing_thresholds": null,
8
"cancel_at": null,
9
"cancel_at_period_end": false,
10
"canceled_at": null,
11
"collection_method": "charge_automatically",
12
"created": 1623456789,
13
"current_period_end": 1626048789,
14
"current_period_start": 1623456789,
15
"customer": "cus_1234567890abcdef",
16
"days_until_due": null,
17
"default_payment_method": "pm_1234567890abcdef",
18
"default_source": null,
19
"default_tax_rates": [],
20
"discount": null,
21
"ended_at": null,
22
"invoice_customer_balance_settings": {
23
"consume_applied_balance_on_void": true
24
},
25
"items": {
26
"object": "list",
27
"data": [
28
{
29
"id": "si_1234567890abcdef",
30
"object": "subscription_item",
31
"billing_thresholds": null,
32
"created": 1623456789,
33
"metadata": {},
34
"plan": {
35
"id": "plan_1234567890abcdef",
36
"object": "plan",
37
"active": true,
38
"aggregate_usage": null,
39
"amount": 2000,
40
"amount_decimal": "2000",
41
"billing_scheme": "per_unit",
42
"created": 1623456789,
43
"currency": "usd",
44
"interval": "month",
45
"interval_count": 1,
46
"livemode": false,
47
"metadata": {},
48
"nickname": "Premium Plan",
49
"product": "prod_1234567890abcdef",
50
"tiers": null,
51
"tiers_mode": null,
52
"transform_usage": null,
53
"trial_period_days": null,
54
"usage_type": "licensed"
55
},
56
"price": {
57
"id": "price_1234567890abcdef",
58
"object": "price",
59
"active": true,
60
"billing_scheme": "per_unit",
61
"created": 1623456789,
62
"currency": "usd",
63
"livemode": false,
64
"lookup_key": null,
65
"metadata": {},
66
"nickname": null,
67
"product": "prod_1234567890abcdef",
68
"recurring": {
69
"aggregate_usage": null,
70
"interval": "month",
71
"interval_count": 1,
72
"trial_period_days": null,
73
"usage_type": "licensed"
74
},
75
"tiers_mode": null,
76
"transform_quantity": null,
77
"type": "recurring",
78
"unit_amount": 2000,
79
"unit_amount_decimal": "2000"
80
},
81
"quantity": 1,
82
"subscription": "sub_1234567890abcdef",
83
"tax_rates": []
84
}
85
],
86
"has_more": false,
87
"total_count": 1,
88
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
89
},
90
"latest_invoice": "in_1234567890abcdef",
91
"livemode": false,
92
"metadata": {},
93
"next_pending_invoice_item_invoice": null,
94
"pause_collection": null,
95
"pending_invoice_item_interval": null,
96
"pending_setup_intent": null,
97
"pending_update": null,
98
"plan": {
99
"id": "plan_1234567890abcdef",
100
"object": "plan",
101
"active": true,
102
"aggregate_usage": null,
103
"amount": 2000,
104
"amount_decimal": "2000",
105
"billing_scheme": "per_unit",
106
"created": 1623456789,
107
"currency": "usd",
108
"interval": "month",
109
"interval_count": 1,
110
"livemode": false,
111
"metadata": {},
112
"nickname": "Premium Plan",
113
"product": "prod_1234567890abcdef",
114
"tiers": null,
115
"tiers_mode": null,
116
"transform_usage": null,
117
"trial_period_days": null,
118
"usage_type": "licensed"
119
},
120
"quantity": 1,
121
"schedule": null,
122
"start": 1623456789,
123
"start_date": 1623456789,
124
"status": "active",
125
"tax_percent": null,
126
"transfer_data": null,
127
"trial_end": null,
128
"trial_start": null
129
}

Get subscription item
Copy

Returns information about a subscription item.

Sample Input

1
{
2
"subscription_item_id": "si_1234567890abcdef"
3
}

Sample Output

1
{
2
"id": "si_1234567890abcdef",
3
"object": "subscription_item",
4
"billing_thresholds": {
5
"usage_gte": "1000"
6
},
7
"created": 1623456789,
8
"metadata": {},
9
"plan": {
10
"id": "plan_9876543210fedcba",
11
"object": "plan",
12
"active": true,
13
"aggregate_usage": null,
14
"amount": 2000,
15
"amount_decimal": "2000",
16
"billing_scheme": "per_unit",
17
"created": 1623400000,
18
"currency": "usd",
19
"interval": "month",
20
"interval_count": 1,
21
"livemode": false,
22
"metadata": {},
23
"nickname": "Premium Plan",
24
"product": "prod_1234567890abcdef",
25
"tiers": null,
26
"tiers_mode": null,
27
"transform_usage": null,
28
"trial_period_days": null,
29
"usage_type": "licensed"
30
},
31
"price": {
32
"id": "price_1234567890abcdef",
33
"object": "price",
34
"active": true,
35
"billing_scheme": "per_unit",
36
"created": 1623400000,
37
"currency": "usd",
38
"livemode": false,
39
"lookup_key": null,
40
"metadata": {},
41
"nickname": "Premium Price",
42
"product": "prod_1234567890abcdef",
43
"recurring": {
44
"aggregate_usage": null,
45
"interval": "month",
46
"interval_count": 1,
47
"trial_period_days": null,
48
"usage_type": "licensed"
49
},
50
"tiers_mode": null,
51
"transform_quantity": null,
52
"type": "recurring",
53
"unit_amount": 2000,
54
"unit_amount_decimal": "2000"
55
},
56
"quantity": 1,
57
"subscription": "sub_9876543210fedcba",
58
"tax_rates": []
59
}

Get upcoming invoice
Copy

You can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discount that is applicable to the customer.

Sample Input

1
{
2
"customer": "cus_1234567890abcdef",
3
"subscription": "sub_1234567890abcdef",
4
"subscription_items": [
5
{
6
"id": "si_1234567890abcdef",
7
"quantity": 2,
8
"price_options": {
9
"price": "price_1234567890abcdef"
10
}
11
}
12
]
13
}

Sample Output

1
{
2
"object": "invoice",
3
"account_country": "US",
4
"account_name": "My Company",
5
"amount_due": 5000,
6
"amount_paid": 0,
7
"amount_remaining": 5000,
8
"attempt_count": 0,
9
"attempted": false,
10
"billing": "charge_automatically",
11
"billing_reason": "subscription_update",
12
"collection_method": "charge_automatically",
13
"created": 1623456789,
14
"currency": "usd",
15
"customer": "cus_1234567890abcdef",
16
"customer_email": "customer@example.com",
17
"customer_name": "John Doe",
18
"customer_phone": "+1234567890",
19
"customer_tax_exempt": "none",
20
"date": 1623456789,
21
"default_payment_method": "pm_1234567890abcdef",
22
"description": "Subscription update",
23
"lines": {
24
"object": "list",
25
"data": [
26
{
27
"id": "il_1234567890abcdef",
28
"object": "line_item",
29
"amount": 5000,
30
"currency": "usd",
31
"description": "1 × My Product (at $50.00 / month)",
32
"discountable": true,
33
"livemode": false,
34
"period": {
35
"end": 1626048789,
36
"start": 1623456789
37
},
38
"plan": {
39
"id": "plan_1234567890abcdef",
40
"object": "plan",
41
"active": true,
42
"amount": 5000,
43
"currency": "usd",
44
"interval": "month",
45
"interval_count": 1,
46
"product": "prod_1234567890abcdef"
47
},
48
"price": {
49
"id": "price_1234567890abcdef",
50
"object": "price",
51
"active": true,
52
"currency": "usd",
53
"product": "prod_1234567890abcdef",
54
"recurring": {
55
"interval": "month",
56
"interval_count": 1
57
},
58
"unit_amount": 5000
59
},
60
"proration": false,
61
"quantity": 1,
62
"subscription": "sub_1234567890abcdef",
63
"subscription_item": "si_1234567890abcdef",
64
"type": "subscription"
65
}
66
],
67
"has_more": false,
68
"total_count": 1
69
},
70
"livemode": false,
71
"metadata": {},
72
"number": "IN1234-0001",
73
"paid": false,
74
"payment_intent": "pi_1234567890abcdef",
75
"period_end": 1626048789,
76
"period_start": 1623456789,
77
"status": "draft",
78
"subscription": "sub_1234567890abcdef",
79
"subtotal": 5000,
80
"tax": 0,
81
"total": 5000
82
}

List balance transactions by customer
Copy

Return a list of transactions that updated the customer's balances.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"limit": 3,
4
"starting_after": "txn_1234567890abcdef",
5
"ending_before": "txn_9876543210fedcba"
6
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "txn_1H2G3F4E5D6C7B8A9",
6
"object": "balance_transaction",
7
"amount": 5000,
8
"created": 1623456789,
9
"credit_note": null,
10
"currency": "usd",
11
"customer": "cus_1234567890abcdef",
12
"description": "Payment for Invoice #INV-001",
13
"ending_balance": 10000,
14
"invoice": "in_1A2B3C4D5E6F7G8H9",
15
"livemode": false,
16
"metadata": {
17
"order_id": "ORD-12345"
18
},
19
"type": "payment"
20
},
21
{
22
"id": "txn_2I3J4K5L6M7N8O9P0",
23
"object": "balance_transaction",
24
"amount": -1000,
25
"created": 1623457890,
26
"credit_note": "cn_1X2Y3Z4A5B6C7D8E9",
27
"currency": "usd",
28
"customer": "cus_1234567890abcdef",
29
"description": "Refund for Invoice #INV-001",
30
"ending_balance": 9000,
31
"invoice": "in_1A2B3C4D5E6F7G8H9",
32
"livemode": false,
33
"metadata": {
34
"order_id": "ORD-12345"
35
},
36
"type": "refund"
37
},
38
{
39
"id": "txn_3Q4R5S6T7U8V9W0X1",
40
"object": "balance_transaction",
41
"amount": 7500,
42
"created": 1623458901,
43
"credit_note": null,
44
"currency": "usd",
45
"customer": "cus_1234567890abcdef",
46
"description": "Payment for Invoice #INV-002",
47
"ending_balance": 16500,
48
"invoice": "in_2B3C4D5E6F7G8H9I0",
49
"livemode": false,
50
"metadata": {
51
"order_id": "ORD-67890"
52
},
53
"type": "payment"
54
}
55
],
56
"has_more": true,
57
"url": "/v1/customers/cus_1234567890abcdef/balance_transactions"
58
}

List bank accounts by customer
Copy

Return a list of the bank accounts stored on the customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"limit": 3,
4
"starting_after": "ba_9876543210fedcba"
5
}

Sample Output

1
{
2
"object": "list",
3
"url": "/v1/customers/cus_1234567890abcdef/sources",
4
"has_more": true,
5
"data": [
6
{
7
"id": "ba_1H2I3J4K5L6M7N8O9P",
8
"object": "bank_account",
9
"account_holder_name": "John Doe",
10
"account_holder_type": "individual",
11
"bank_name": "STRIPE TEST BANK",
12
"country": "US",
13
"currency": "usd",
14
"customer": "cus_1234567890abcdef",
15
"fingerprint": "1JWtPxqbdX5Gamtc",
16
"last4": "6789",
17
"metadata": {
18
"order_id": "6735"
19
},
20
"routing_number": "110000000",
21
"status": "verified"
22
},
23
{
24
"id": "ba_9Q8R7S6T5U4V3W2X1Y",
25
"object": "bank_account",
26
"account_holder_name": "Jane Smith",
27
"account_holder_type": "individual",
28
"bank_name": "STRIPE TEST BANK",
29
"country": "US",
30
"currency": "usd",
31
"customer": "cus_1234567890abcdef",
32
"fingerprint": "2KXtQyrcfY6Hbnud",
33
"last4": "4321",
34
"metadata": {},
35
"routing_number": "110000000",
36
"status": "verified"
37
},
38
{
39
"id": "ba_0A1B2C3D4E5F6G7H8I",
40
"object": "bank_account",
41
"account_holder_name": "Acme Corp",
42
"account_holder_type": "company",
43
"bank_name": "STRIPE TEST BANK",
44
"country": "US",
45
"currency": "usd",
46
"customer": "cus_1234567890abcdef",
47
"fingerprint": "3LYuTzsdgX7Ibpve",
48
"last4": "9012",
49
"metadata": {
50
"department": "finance"
51
},
52
"routing_number": "110000000",
53
"status": "verified"
54
}
55
]
56
}

List cards by customers
Copy

Returns a list of cards belonging to a customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"limit": 3,
4
"starting_after": "card_9876543210fedcba",
5
"ending_before": "card_abcdef1234567890"
6
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "card_1234567890abcdef",
6
"object": "card",
7
"address_city": "San Francisco",
8
"address_country": "US",
9
"address_line1": "123 Main St",
10
"address_line1_check": "pass",
11
"address_line2": "Apt 4B",
12
"address_state": "CA",
13
"address_zip": "94105",
14
"address_zip_check": "pass",
15
"brand": "Visa",
16
"country": "US",
17
"customer": "cus_1234567890abcdef",
18
"cvc_check": "pass",
19
"dynamic_last4": null,
20
"exp_month": 12,
21
"exp_year": 2025,
22
"fingerprint": "abcdefghijklmnop",
23
"funding": "credit",
24
"last4": "4242",
25
"metadata": {
26
"A": "Custom metadata value"
27
},
28
"name": "John Doe",
29
"tokenization_method": null
30
},
31
{
32
"id": "card_2345678901bcdefg",
33
"object": "card",
34
"address_city": "New York",
35
"address_country": "US",
36
"address_line1": "456 Broadway",
37
"address_line1_check": "pass",
38
"address_line2": null,
39
"address_state": "NY",
40
"address_zip": "10013",
41
"address_zip_check": "pass",
42
"brand": "Mastercard",
43
"country": "US",
44
"customer": "cus_1234567890abcdef",
45
"cvc_check": "pass",
46
"dynamic_last4": null,
47
"exp_month": 6,
48
"exp_year": 2024,
49
"fingerprint": "qrstuvwxyz123456",
50
"funding": "debit",
51
"last4": "5678",
52
"metadata": {},
53
"name": "Jane Smith",
54
"tokenization_method": null
55
}
56
],
57
"has_more": true,
58
"url": "/v1/customers/cus_1234567890abcdef/cards"
59
}

List charges
Copy

Retrieves a list of charges. The charges are returned in sorted order, with the most recent charges appearing first.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z",
5
"lt": "2023-04-01T00:00:00Z"
6
},
7
"limit": 50,
8
"starting_after": "ch_9876543210fedcba"
9
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "ch_1234567890abcdef",
6
"object": "charge",
7
"amount": 2000,
8
"amount_refunded": 0,
9
"application": null,
10
"application_fee": null,
11
"balance_transaction": "txn_1234567890abcdef",
12
"captured": true,
13
"created": 1677609600,
14
"currency": "usd",
15
"customer": "cus_1234567890abcdef",
16
"description": "Payment for order #1234",
17
"destination": null,
18
"dispute": null,
19
"failure_code": null,
20
"failure_message": null,
21
"fraud_details": {},
22
"invoice": null,
23
"livemode": false,
24
"metadata": {},
25
"on_behalf_of": null,
26
"order": null,
27
"outcome": {
28
"network_status": "approved_by_network",
29
"reason": null,
30
"risk_level": "normal",
31
"seller_message": "Payment complete.",
32
"type": "authorized"
33
},
34
"paid": true,
35
"receipt_email": "customer@example.com",
36
"receipt_number": null,
37
"refunded": false,
38
"refunds": {
39
"object": "list",
40
"data": [],
41
"has_more": false,
42
"total_count": 0,
43
"url": "/v1/charges/ch_1234567890abcdef/refunds"
44
},
45
"review": null,
46
"shipping": null,
47
"source": {
48
"id": "card_1234567890abcdef",
49
"object": "card",
50
"brand": "visa",
51
"country": "US",
52
"customer": "cus_1234567890abcdef",
53
"exp_month": 12,
54
"exp_year": 2024,
55
"fingerprint": "1234567890abcdef",
56
"funding": "credit",
57
"last4": "4242",
58
"name": "John Doe",
59
"address_city": null,
60
"address_country": null,
61
"address_line1": null,
62
"address_line1_check": null,
63
"address_line2": null,
64
"address_state": null,
65
"address_zip": null,
66
"address_zip_check": null,
67
"cvc_check": "pass",
68
"metadata": {}
69
},
70
"statement_descriptor": null,
71
"status": "succeeded",
72
"transfer_group": null
73
}
74
],
75
"has_more": true,
76
"url": "/v1/charges"
77
}

List coupons
Copy

Returns a list of coupons.

Sample Input

1
{
2
"created": {
3
"gte": "2023-01-01T00:00:00Z",
4
"lt": "2023-07-01T00:00:00Z"
5
},
6
"limit": 3,
7
"starting_after": "coup_1234567890abcdef"
8
}

Sample Output

1
{
2
"object": "list",
3
"url": "/v1/coupons",
4
"has_more": true,
5
"data": [
6
{
7
"id": "SUMMER2023",
8
"object": "coupon",
9
"amount_off": null,
10
"created": 1672531200,
11
"currency": null,
12
"duration": "repeating",
13
"duration_in_months": 3,
14
"livemode": false,
15
"max_redemptions": 1000,
16
"metadata": {},
17
"percent_off": 20,
18
"redeem_by": 1693526400,
19
"times_redeemed": 150,
20
"valid": true
21
},
22
{
23
"id": "NEWCUSTOMER",
24
"object": "coupon",
25
"amount_off": 1000,
26
"created": 1675209600,
27
"currency": "usd",
28
"duration": "once",
29
"duration_in_months": null,
30
"livemode": true,
31
"max_redemptions": null,
32
"metadata": {
33
"campaign": "email_blast"
34
},
35
"percent_off": null,
36
"redeem_by": null,
37
"times_redeemed": 75,
38
"valid": true
39
},
40
{
41
"id": "LOYALTY10",
42
"object": "coupon",
43
"amount_off": null,
44
"created": 1677888000,
45
"currency": null,
46
"duration": "forever",
47
"duration_in_months": null,
48
"livemode": true,
49
"max_redemptions": null,
50
"metadata": {},
51
"percent_off": 10,
52
"redeem_by": null,
53
"times_redeemed": 500,
54
"valid": true
55
}
56
]
57
}

List customers
Copy

Return a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

Sample Input

1
{
2
"email": "john.doe@example.com",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z"
5
},
6
"limit": 2
7
}

Sample Output

1
{
2
"object": "list",
3
"url": "/v1/customers",
4
"has_more": true,
5
"data": [
6
{
7
"id": "cus_Nl2EmKxYT8O9vJ",
8
"object": "customer",
9
"address": {
10
"city": "San Francisco",
11
"country": "US",
12
"line1": "123 Main St",
13
"line2": "Apt 4B",
14
"postal_code": "94105",
15
"state": "CA"
16
},
17
"balance": 0,
18
"created": 1672531200,
19
"currency": "usd",
20
"default_source": "card_1N2EmKxYT8O9vJ3m4n5o6p7q",
21
"delinquent": false,
22
"description": "John Doe - Premium Customer",
23
"discount": null,
24
"email": "john.doe@example.com",
25
"invoice_prefix": "INV",
26
"invoice_settings": {
27
"custom_fields": null,
28
"default_payment_method": "pm_1N2EmKxYT8O9vJ3m4n5o6p7q",
29
"footer": "Thank you for your business!"
30
},
31
"livemode": false,
32
"metadata": {
33
"customer_type": "premium"
34
},
35
"name": "John Doe",
36
"next_invoice_sequence": 1001,
37
"phone": "+14155551234",
38
"preferred_locales": [
39
"en-US"
40
],
41
"shipping": {
42
"address": {
43
"city": "San Francisco",
44
"country": "US",
45
"line1": "123 Main St",
46
"line2": "Apt 4B",
47
"postal_code": "94105",
48
"state": "CA"
49
},
50
"name": "John Doe",
51
"phone": "+14155551234"
52
},
53
"sources": {
54
"object": "list",
55
"data": [
56
{
57
"id": "card_1N2EmKxYT8O9vJ3m4n5o6p7q"
58
}
59
],
60
"has_more": false,
61
"url": "/v1/customers/cus_Nl2EmKxYT8O9vJ/sources"
62
},
63
"subscriptions": {
64
"object": "list",
65
"data": [
66
{
67
"id": "sub_1N2EmKxYT8O9vJ3m4n5o6p7q"
68
}
69
],
70
"has_more": false,
71
"url": "/v1/customers/cus_Nl2EmKxYT8O9vJ/subscriptions"
72
},
73
"tax_exempt": "none",
74
"tax_ids": {
75
"object": "list",
76
"data": [],
77
"has_more": false,
78
"url": "/v1/customers/cus_Nl2EmKxYT8O9vJ/tax_ids"
79
}
80
},
81
{
82
"id": "cus_Ol3FnLyZU9P0wK",
83
"object": "customer",
84
"address": {
85
"city": "New York",
86
"country": "US",
87
"line1": "456 Broadway",
88
"line2": null,
89
"postal_code": "10013",
90
"state": "NY"
91
},
92
"balance": 0,
93
"created": 1673136000,
94
"currency": "usd",
95
"default_source": "card_1O3FnLyZU9P0wK4n5o6p7q8r",
96
"delinquent": false,
97
"description": "Jane Smith - Standard Customer",
98
"discount": null,
99
"email": "jane.smith@example.com",
100
"invoice_prefix": "INV",
101
"invoice_settings": {
102
"custom_fields": null,
103
"default_payment_method": "pm_1O3FnLyZU9P0wK4n5o6p7q8r",
104
"footer": null
105
},
106
"livemode": false,
107
"metadata": {
108
"customer_type": "standard"
109
},
110
"name": "Jane Smith",
111
"next_invoice_sequence": 1001,
112
"phone": "+12125551234",
113
"preferred_locales": [
114
"en-US"
115
],
116
"shipping": null,
117
"sources": {
118
"object": "list",
119
"data": [
120
{
121
"id": "card_1O3FnLyZU9P0wK4n5o6p7q8r"
122
}
123
],
124
"has_more": false,
125
"url": "/v1/customers/cus_Ol3FnLyZU9P0wK/sources"
126
},
127
"subscriptions": {
128
"object": "list",
129
"data": [],
130
"has_more": false,
131
"url": "/v1/customers/cus_Ol3FnLyZU9P0wK/subscriptions"
132
},
133
"tax_exempt": "none",
134
"tax_ids": {
135
"object": "list",
136
"data": [],
137
"has_more": false,
138
"url": "/v1/customers/cus_Ol3FnLyZU9P0wK/tax_ids"
139
}
140
}
141
]
142
}

List files
Copy

Return a list of the files that your account has access to.

Sample Input

1
{
2
"purpose": "dispute_evidence",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z",
5
"lt": "2023-06-01T00:00:00Z"
6
},
7
"limit": 10,
8
"starting_after": "file_1234567890abcdef"
9
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "file_1H2G3F4E5D6C7B8A9",
6
"object": "file",
7
"created": 1622505600,
8
"expires_at": 1654041600,
9
"filename": "dispute_evidence_001.pdf",
10
"purpose": "dispute_evidence",
11
"size": 1024000,
12
"title": "Dispute Evidence for Case #12345",
13
"type": "pdf",
14
"url": "https://files.stripe.com/v1/files/file_1H2G3F4E5D6C7B8A9/contents"
15
},
16
{
17
"id": "file_9A8B7C6D5E4F3G2H1",
18
"object": "file",
19
"created": 1623110400,
20
"expires_at": 1654646400,
21
"filename": "dispute_evidence_002.jpg",
22
"purpose": "dispute_evidence",
23
"size": 2048000,
24
"title": "Dispute Evidence for Case #67890",
25
"type": "jpg",
26
"url": "https://files.stripe.com/v1/files/file_9A8B7C6D5E4F3G2H1/contents"
27
}
28
],
29
"has_more": true,
30
"url": "/v1/files"
31
}

List invoice items
Copy

Return a list of invoice items.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"invoice_id": "in_1234567890abcdef",
4
"created": {
5
"gte": "2023-01-01T00:00:00Z",
6
"lt": "2023-12-31T23:59:59Z"
7
},
8
"pending": true,
9
"starting_after": "ii_1234567890abcdef",
10
"ending_before": "ii_0987654321fedcba",
11
"limit": 50
12
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "ii_1234567890abcdef",
6
"object": "invoiceitem",
7
"amount": 2000,
8
"currency": "usd",
9
"customer": "cus_1234567890abcdef",
10
"date": 1672531200,
11
"description": "Premium subscription - January 2023",
12
"discountable": true,
13
"discounts": [],
14
"invoice": "in_1234567890abcdef",
15
"livemode": false,
16
"metadata": {
17
"order_id": "ord_1234567890"
18
},
19
"period": {
20
"start": 1672531200,
21
"end": 1675209600
22
},
23
"plan": "plan_premium_monthly",
24
"price": {
25
"id": "price_1234567890abcdef",
26
"object": "price",
27
"active": true,
28
"billing_scheme": "per_unit",
29
"created": 1672531200,
30
"currency": "usd",
31
"livemode": false,
32
"lookup_key": null,
33
"metadata": {},
34
"nickname": "Premium Monthly",
35
"product": "prod_1234567890abcdef",
36
"recurring": "monthly",
37
"tiers_mode": null,
38
"transform_quantity": null,
39
"type": "recurring",
40
"unit_amount": 2000,
41
"unit_amount_decimal": "2000"
42
},
43
"proration": false,
44
"quantity": 1,
45
"subscription": "sub_1234567890abcdef",
46
"tax_rates": [],
47
"unit_amount": 2000,
48
"unit_amount_decimal": "2000"
49
}
50
],
51
"has_more": true,
52
"url": "/v1/invoiceitems"
53
}

List invoice's line items
Copy

Returns a list of line items for a given invoice.

Sample Input

1
{
2
"invoice_id": "in_1234567890abcdef",
3
"limit": 50,
4
"starting_after": "il_1234567890abcdef"
5
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "il_1234567890abcdef",
6
"object": "line_item",
7
"amount": 2000,
8
"currency": "usd",
9
"description": "Monthly subscription",
10
"discount_amounts": [],
11
"discountable": true,
12
"discounts": [],
13
"livemode": false,
14
"metadata": {},
15
"period": {
16
"end": 1625097600,
17
"start": 1622505600
18
},
19
"plan": {
20
"id": "plan_1234567890abcdef",
21
"object": "plan",
22
"active": true,
23
"aggregate_usage": null,
24
"amount": 2000,
25
"amount_decimal": "2000",
26
"billing_scheme": "per_unit",
27
"created": 1620000000,
28
"currency": "usd",
29
"interval": "month",
30
"interval_count": 1,
31
"livemode": false,
32
"metadata": {},
33
"nickname": "Standard Plan",
34
"product": "prod_1234567890abcdef",
35
"tiers": null,
36
"tiers_mode": null,
37
"transform_usage": null,
38
"trial_period_days": null,
39
"usage_type": "licensed"
40
},
41
"price": {
42
"id": "price_1234567890abcdef",
43
"object": "price",
44
"active": true,
45
"billing_scheme": "per_unit",
46
"created": 1620000000,
47
"currency": "usd",
48
"livemode": false,
49
"lookup_key": null,
50
"metadata": {},
51
"nickname": "Standard Price",
52
"product": "prod_1234567890abcdef",
53
"recurring": {
54
"aggregate_usage": null,
55
"interval": "month",
56
"interval_count": 1,
57
"trial_period_days": null,
58
"usage_type": "licensed"
59
},
60
"tiers_mode": null,
61
"transform_quantity": null,
62
"type": "recurring",
63
"unit_amount": 2000,
64
"unit_amount_decimal": "2000"
65
},
66
"proration": false,
67
"quantity": 1,
68
"subscription": "sub_1234567890abcdef",
69
"subscription_item": "si_1234567890abcdef",
70
"tax_amounts": [],
71
"tax_rates": [],
72
"type": "subscription",
73
"unique_id": "il_1234567890abcdef",
74
"unique_line_item_id": "sli_1234567890abcdef"
75
}
76
],
77
"has_more": true,
78
"url": "/v1/invoices/in_1234567890abcdef/lines"
79
}

List invoices
Copy

Return a list of invoices from your Stripe account, based on criteria of your choosing.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"subscription_id": "sub_9876543210fedcba",
4
"status": "open",
5
"collection_method": "charge_automatically",
6
"created": {
7
"gte": "2023-01-01T00:00:00Z",
8
"lt": "2023-12-31T23:59:59Z"
9
},
10
"due_date": {
11
"gt": "2023-06-01T00:00:00Z"
12
},
13
"limit": 10
14
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "in_1234567890abcdef",
6
"object": "invoice",
7
"account_country": "US",
8
"account_name": "My Company",
9
"amount_due": 10000,
10
"amount_paid": 0,
11
"amount_remaining": 10000,
12
"attempt_count": 0,
13
"attempted": false,
14
"auto_advance": true,
15
"billing_reason": "subscription_cycle",
16
"collection_method": "charge_automatically",
17
"created": 1625097600,
18
"currency": "usd",
19
"customer": "cus_1234567890abcdef",
20
"customer_email": "customer@example.com",
21
"customer_name": "John Doe",
22
"due_date": 1627776000,
23
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_123456789/inv_1234567890abcdef",
24
"invoice_pdf": "https://pay.stripe.com/invoice/acct_123456789/inv_1234567890abcdef/pdf",
25
"lines": {
26
"object": "list",
27
"data": [
28
{
29
"id": "il_1234567890abcdef",
30
"object": "line_item",
31
"amount": 10000,
32
"currency": "usd",
33
"description": "1 × My Product (at $100.00 / month)",
34
"discountable": true,
35
"livemode": false,
36
"period": {
37
"end": 1627776000,
38
"start": 1625097600
39
},
40
"plan": {
41
"id": "plan_1234567890abcdef",
42
"object": "plan",
43
"active": true,
44
"amount": 10000,
45
"currency": "usd",
46
"interval": "month",
47
"interval_count": 1,
48
"product": "prod_1234567890abcdef"
49
},
50
"proration": false,
51
"quantity": 1,
52
"subscription": "sub_9876543210fedcba",
53
"type": "subscription"
54
}
55
],
56
"has_more": false,
57
"total_count": 1,
58
"url": "/v1/invoices/in_1234567890abcdef/lines"
59
},
60
"livemode": false,
61
"metadata": {},
62
"number": "INV-0001",
63
"paid": false,
64
"payment_intent": "pi_1234567890abcdef",
65
"period_end": 1625097600,
66
"period_start": 1622505600,
67
"status": "open",
68
"subscription": "sub_9876543210fedcba",
69
"subtotal": 10000,
70
"total": 10000
71
}
72
],
73
"has_more": false,
74
"url": "/v1/invoices"
75
}

List orders
Copy

Return a list of your orders.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"status": "paid",
4
"created": {
5
"gte": "2023-01-01T00:00:00Z",
6
"lt": "2023-07-01T00:00:00Z"
7
},
8
"order_ids": [
9
"or_1234567890abcdef",
10
"or_0987654321fedcba"
11
],
12
"order_status_transitions": {
13
"paid": {
14
"gte": "2023-01-15T00:00:00Z"
15
}
16
},
17
"limit": 50
18
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "or_1234567890abcdef",
6
"object": "order",
7
"amount": 10000,
8
"amount_returned": 0,
9
"application": null,
10
"application_fee": null,
11
"charge": "ch_1234567890abcdef",
12
"created": 1674172800,
13
"currency": "usd",
14
"customer": "cus_1234567890abcdef",
15
"email": "customer@example.com",
16
"items": [
17
{
18
"object": "order_item",
19
"amount": 10000,
20
"currency": "usd",
21
"description": "T-shirt",
22
"parent": "sku_1234567890abcdef",
23
"quantity": 2,
24
"type": "sku"
25
}
26
],
27
"livemode": false,
28
"metadata": {
29
"order_source": "website"
30
},
31
"returns": {
32
"object": "list",
33
"data": [],
34
"has_more": false,
35
"total_count": 0,
36
"url": "/v1/order_returns?order=or_1234567890abcdef"
37
},
38
"selected_shipping_method": "standard",
39
"shipping": {
40
"address": {
41
"city": "San Francisco",
42
"country": "US",
43
"line1": "123 Market St",
44
"line2": null,
45
"postal_code": "94105",
46
"state": "CA"
47
},
48
"carrier": "USPS",
49
"name": "John Doe",
50
"phone": "+14155551234",
51
"tracking_number": 9.4001e+21
52
},
53
"shipping_methods": [
54
{
55
"id": "standard",
56
"amount": 500,
57
"currency": "usd",
58
"delivery_estimate": "3-5 business days",
59
"description": "Standard Shipping"
60
}
61
],
62
"status": "paid",
63
"status_transitions": {
64
"canceled": null,
65
"fulfiled": null,
66
"paid": 1674259200,
67
"returned": null
68
},
69
"updated": 1674259200
70
}
71
],
72
"has_more": false,
73
"url": "/v1/orders?customer=cus_1234567890abcdef&status=paid&created[gte]=1672531200&created[lt]=1688169600&limit=50"
74
}

List payment intents
Copy

Return a list of payment intents.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z",
5
"lt": "2023-04-01T00:00:00Z"
6
},
7
"ending_before": "pi_1234567890abcdef",
8
"starting_after": "pi_0987654321fedcba",
9
"limit": 50
10
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "pi_1234567890abcdef",
6
"object": "payment_intent",
7
"amount": 2000,
8
"amount_capturable": 0,
9
"amount_received": 2000,
10
"application": null,
11
"application_fee_amount": null,
12
"canceled_at": null,
13
"cancellation_reason": null,
14
"capture_method": "automatic",
15
"charges": {
16
"object": "list",
17
"data": [
18
{
19
"id": "ch_1234567890abcdef",
20
"object": "charge",
21
"amount": 2000,
22
"amount_captured": 2000,
23
"amount_refunded": 0,
24
"application": null,
25
"application_fee": null,
26
"application_fee_amount": null,
27
"balance_transaction": "txn_1234567890abcdef",
28
"billing_details": {
29
"address": {
30
"city": "San Francisco",
31
"country": "US",
32
"line1": "123 Main St",
33
"line2": null,
34
"postal_code": "94111",
35
"state": "CA"
36
},
37
"email": "john@example.com",
38
"name": "John Doe",
39
"phone": "+14155551234"
40
},
41
"calculated_statement_descriptor": "ACME INC",
42
"captured": true,
43
"created": 1617235200,
44
"currency": "usd",
45
"customer": "cus_1234567890abcdef",
46
"description": "Payment for order #1234",
47
"destination": null,
48
"dispute": null,
49
"disputed": false,
50
"failure_code": null,
51
"failure_message": null,
52
"fraud_details": {},
53
"invoice": null,
54
"livemode": false,
55
"metadata": {
56
"order_id": "1234"
57
},
58
"on_behalf_of": null,
59
"order": null,
60
"outcome": {
61
"network_status": "approved_by_network",
62
"reason": null,
63
"risk_level": "normal",
64
"risk_score": 32,
65
"seller_message": "Payment complete.",
66
"type": "authorized"
67
},
68
"paid": true,
69
"payment_intent": "pi_1234567890abcdef",
70
"payment_method": "pm_1234567890abcdef",
71
"payment_method_details": {
72
"card": {
73
"brand": "visa",
74
"checks": {
75
"address_line1_check": "pass",
76
"address_postal_code_check": "pass",
77
"cvc_check": "pass"
78
},
79
"country": "US",
80
"exp_month": 12,
81
"exp_year": 2024,
82
"fingerprint": "1234567890abcdef",
83
"funding": "credit",
84
"installments": null,
85
"last4": "4242",
86
"network": "visa",
87
"three_d_secure": null,
88
"wallet": null
89
},
90
"type": "card"
91
},
92
"receipt_email": "john@example.com",
93
"receipt_number": null,
94
"receipt_url": "https://pay.stripe.com/receipts/...",
95
"refunded": false,
96
"refunds": {
97
"object": "list",
98
"data": [],
99
"has_more": false,
100
"total_count": 0,
101
"url": "/v1/charges/ch_1234567890abcdef/refunds"
102
},
103
"review": null,
104
"shipping": null,
105
"source": null,
106
"source_transfer": null,
107
"statement_descriptor": null,
108
"statement_descriptor_suffix": null,
109
"status": "succeeded",
110
"transfer_data": null,
111
"transfer_group": null
112
}
113
],
114
"has_more": false,
115
"total_count": 1,
116
"url": "/v1/charges?payment_intent=pi_1234567890abcdef"
117
},
118
"client_secret": "pi_1234567890abcdef_secret_1234567890abcdef",
119
"confirmation_method": "automatic",
120
"created": 1617235200,
121
"currency": "usd",
122
"customer": "cus_1234567890abcdef",
123
"description": "Payment for order #1234",
124
"invoice": null,
125
"last_payment_error": null,
126
"livemode": false,
127
"metadata": {
128
"order_id": "1234"
129
},
130
"next_action": null,
131
"on_behalf_of": null,
132
"payment_method": "pm_1234567890abcdef",
133
"payment_method_options": {
134
"card": {
135
"installments": null,
136
"network": null,
137
"request_three_d_secure": "automatic"
138
}
139
},
140
"payment_method_types": [
141
"card"
142
],
143
"receipt_email": "john@example.com",
144
"review": null,
145
"setup_future_usage": null,
146
"shipping": null,
147
"source": null,
148
"statement_descriptor": null,
149
"statement_descriptor_suffix": null,
150
"status": "succeeded",
151
"transfer_data": null,
152
"transfer_group": null
153
}
154
],
155
"has_more": true,
156
"url": "/v1/payment_intents"
157
}

List payment methods
Copy

Return a list of payment methods for a given customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"type": "card",
4
"limit": 3
5
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "pm_1234567890abcdef",
6
"object": "payment_method",
7
"billing_details": {
8
"address": {
9
"city": "San Francisco",
10
"country": "US",
11
"line1": "123 Main St",
12
"line2": "Apt 4B",
13
"postal_code": "94105",
14
"state": "CA"
15
},
16
"email": "john.doe@example.com",
17
"name": "John Doe",
18
"phone": "+14155551234"
19
},
20
"card": {
21
"brand": "visa",
22
"checks": {
23
"address_line1_check": "pass",
24
"address_postal_code_check": "pass",
25
"cvc_check": "pass"
26
},
27
"country": "US",
28
"exp_month": 12,
29
"exp_year": 2025,
30
"fingerprint": "abcdefghijklmnop",
31
"funding": "credit",
32
"generated_from": {},
33
"last4": "4242",
34
"networks": {
35
"available": [
36
"visa"
37
],
38
"preferred": "visa"
39
},
40
"three_d_secure_usage": {
41
"supported": true
42
},
43
"wallet": {}
44
},
45
"created": 1619827200,
46
"customer": "cus_1234567890abcdef",
47
"livemode": false,
48
"metadata": {
49
"A": "Custom metadata value"
50
},
51
"type": "card"
52
},
53
{
54
"id": "pm_0987654321zyxwvu",
55
"object": "payment_method",
56
"billing_details": {
57
"address": {
58
"city": "New York",
59
"country": "US",
60
"line1": "456 Broadway",
61
"line2": null,
62
"postal_code": "10013",
63
"state": "NY"
64
},
65
"email": "jane.smith@example.com",
66
"name": "Jane Smith",
67
"phone": "+12125551234"
68
},
69
"card": {
70
"brand": "mastercard",
71
"checks": {
72
"address_line1_check": "pass",
73
"address_postal_code_check": "pass",
74
"cvc_check": "pass"
75
},
76
"country": "US",
77
"exp_month": 6,
78
"exp_year": 2024,
79
"fingerprint": "qrstuvwxyz123456",
80
"funding": "debit",
81
"generated_from": {},
82
"last4": "5678",
83
"networks": {
84
"available": [
85
"mastercard"
86
],
87
"preferred": "mastercard"
88
},
89
"three_d_secure_usage": {
90
"supported": true
91
},
92
"wallet": {}
93
},
94
"created": 1619740800,
95
"customer": "cus_1234567890abcdef",
96
"livemode": false,
97
"metadata": {},
98
"type": "card"
99
}
100
],
101
"has_more": false,
102
"url": "/v1/customers/cus_1234567890abcdef/payment_methods"
103
}

List persons by account
Copy

Return a list of people associated with the account's legal entity.

Sample Input

1
{
2
"account_id": "acct_1234567890abcdef",
3
"relationship": {
4
"director": true,
5
"executive": true,
6
"owner": true,
7
"representative": false
8
},
9
"ending_before": "person_abcdefghijklmnop",
10
"starting_after": "person_qrstuvwxyz123456",
11
"limit": 50
12
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "person_1234567890abcdef",
6
"object": "person",
7
"account": "acct_1234567890abcdef",
8
"address": {
9
"city": "San Francisco",
10
"country": "US",
11
"line1": "123 Market St",
12
"line2": "Suite 100",
13
"postal_code": "94105",
14
"state": "CA"
15
},
16
"created": 1622505600,
17
"dob": {
18
"day": 15,
19
"month": 5,
20
"year": 1980
21
},
22
"email": "john.doe@example.com",
23
"first_name": "John",
24
"id_number_provided": true,
25
"last_name": "Doe",
26
"metadata": {
27
"employee_id": "EMP001"
28
},
29
"relationship": {
30
"director": true,
31
"executive": true,
32
"owner": true,
33
"percent_ownership": 25,
34
"representative": false,
35
"title": "CEO"
36
},
37
"requirements": {
38
"currently_due": [],
39
"errors": [],
40
"eventually_due": [],
41
"past_due": [],
42
"pending_verification": []
43
},
44
"ssn_last_4_provided": true,
45
"verification": {
46
"additional_document": {
47
"back": null,
48
"details": null,
49
"details_code": null,
50
"front": null
51
},
52
"details": null,
53
"details_code": null,
54
"document": {
55
"back": "file_back_1234567890abcdef",
56
"details": null,
57
"details_code": null,
58
"front": "file_front_1234567890abcdef"
59
},
60
"status": "verified"
61
}
62
}
63
],
64
"has_more": false,
65
"url": "/v1/accounts/acct_1234567890abcdef/persons"
66
}

List plans
Copy

Returns a list of plans in your Stripe account.

Sample Input

1
{
2
"product_id": "prod_1234567890abcdef",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z",
5
"lt": "2023-06-01T00:00:00Z"
6
},
7
"ending_before": "plan_9876543210fedcba",
8
"starting_after": "plan_abcdef1234567890",
9
"limit": 50
10
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "plan_1234567890abcdef",
6
"object": "plan",
7
"active": true,
8
"aggregate_usage": null,
9
"amount": 1999,
10
"amount_decimal": "1999",
11
"billing_scheme": "per_unit",
12
"created": 1622505600,
13
"currency": "usd",
14
"interval": "month",
15
"interval_count": 1,
16
"livemode": false,
17
"metadata": {},
18
"nickname": "Pro Plan",
19
"product": "prod_1234567890abcdef",
20
"tiers": null,
21
"tiers_mode": null,
22
"transform_usage": null,
23
"trial_period_days": 14,
24
"usage_type": "licensed"
25
},
26
{
27
"id": "plan_0987654321fedcba",
28
"object": "plan",
29
"active": true,
30
"aggregate_usage": null,
31
"amount": 9900,
32
"amount_decimal": "9900",
33
"billing_scheme": "per_unit",
34
"created": 1625097600,
35
"currency": "usd",
36
"interval": "year",
37
"interval_count": 1,
38
"livemode": false,
39
"metadata": {},
40
"nickname": "Annual Plan",
41
"product": "prod_1234567890abcdef",
42
"tiers": null,
43
"tiers_mode": null,
44
"transform_usage": null,
45
"trial_period_days": 30,
46
"usage_type": "licensed"
47
}
48
],
49
"has_more": true,
50
"url": "/v1/plans"
51
}

List products
Copy

Return a list of products. The products are returned sorted by creation date, with the most recently created products appearing first.

Sample Input

1
{
2
"active": true,
3
"shippable": true,
4
"type": "good",
5
"url": "https://example.com/product",
6
"product_ids": [
7
"prod_123",
8
"prod_456"
9
],
10
"created": {
11
"gte": "2023-01-01T00:00:00Z",
12
"lt": "2023-12-31T23:59:59Z"
13
},
14
"ending_before": "prod_789",
15
"starting_after": "prod_012",
16
"limit": 50
17
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "prod_123ABC",
6
"object": "product",
7
"active": true,
8
"attributes": [
9
"size",
10
"color"
11
],
12
"caption": "Comfortable cotton t-shirt",
13
"created": 1672531200,
14
"deactivate_on": [],
15
"description": "A high-quality cotton t-shirt available in various sizes and colors.",
16
"images": [
17
"https://example.com/images/tshirt_front.jpg",
18
"https://example.com/images/tshirt_back.jpg"
19
],
20
"livemode": true,
21
"metadata": {
22
"category": "apparel"
23
},
24
"name": "Cotton T-Shirt",
25
"package_dimensions": {
26
"height": 5,
27
"length": 10,
28
"weight": 200,
29
"width": 8
30
},
31
"shippable": true,
32
"type": "good",
33
"updated": 1688140800,
34
"url": "https://example.com/product/cotton-tshirt"
35
},
36
{
37
"id": "prod_456DEF",
38
"object": "product",
39
"active": true,
40
"attributes": [
41
"material"
42
],
43
"caption": "Durable leather wallet",
44
"created": 1675209600,
45
"deactivate_on": [],
46
"description": "A stylish and durable leather wallet with multiple card slots.",
47
"images": [
48
"https://example.com/images/wallet_open.jpg",
49
"https://example.com/images/wallet_closed.jpg"
50
],
51
"livemode": true,
52
"metadata": {
53
"category": "accessories"
54
},
55
"name": "Leather Wallet",
56
"package_dimensions": {
57
"height": 2,
58
"length": 9,
59
"weight": 100,
60
"width": 4
61
},
62
"shippable": true,
63
"type": "good",
64
"updated": 1688227200,
65
"url": "https://example.com/product/leather-wallet"
66
}
67
],
68
"has_more": true,
69
"url": "/v1/products"
70
}

List setup intents
Copy

Return a list of setup intents.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"payment_method": "pm_1234567890abcdef",
4
"created": {
5
"gte": "2023-01-01T00:00:00Z",
6
"lt": "2023-12-31T23:59:59Z"
7
},
8
"ending_before": "si_1234567890abcdef",
9
"starting_after": "si_0987654321fedcba",
10
"limit": 50
11
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "seti_1234567890abcdef",
6
"object": "setup_intent",
7
"application": "ca_1234567890abcdef",
8
"cancellation_reason": null,
9
"client_secret": "seti_1234567890abcdef_secret_1234567890abcdef",
10
"created": 1672531200,
11
"customer": "cus_1234567890abcdef",
12
"description": "Setup for subscription",
13
"last_setup_error": null,
14
"latest_attempt": null,
15
"livemode": false,
16
"mandate": null,
17
"metadata": {
18
"order_id": "order_123"
19
},
20
"next_action": null,
21
"on_behalf_of": null,
22
"payment_method": "pm_1234567890abcdef",
23
"payment_method_options": {
24
"card": {
25
"request_three_d_secure": "automatic"
26
}
27
},
28
"payment_method_types": [
29
"card"
30
],
31
"single_use_mandate": null,
32
"status": "succeeded",
33
"usage": "off_session"
34
}
35
],
36
"has_more": true,
37
"url": "/v1/setup_intents"
38
}

List subscription items
Copy

Returns a list of subscription items for a given subscription.

Sample Input

1
{
2
"subscription_id": "sub_1234567890abcdef",
3
"limit": 3,
4
"starting_after": "si_1234567890abcdef"
5
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "si_1JKLMNOPQRSTUVWXYZabcd",
6
"object": "subscription_item",
7
"billing_thresholds": {
8
"usage_gte": "1000"
9
},
10
"created": 1634567890,
11
"metadata": {},
12
"plan": {
13
"id": "plan_1234567890abcdef",
14
"object": "plan",
15
"active": true,
16
"aggregate_usage": null,
17
"amount": 2000,
18
"amount_decimal": "2000",
19
"billing_scheme": "per_unit",
20
"created": 1623456789,
21
"currency": "usd",
22
"interval": "month",
23
"interval_count": 1,
24
"livemode": false,
25
"metadata": {},
26
"nickname": "Premium Plan",
27
"product": "prod_1234567890abcdef",
28
"tiers": null,
29
"tiers_mode": null,
30
"transform_usage": null,
31
"trial_period_days": null,
32
"usage_type": "licensed"
33
},
34
"price": {
35
"id": "price_1234567890abcdef",
36
"object": "price",
37
"active": true,
38
"billing_scheme": "per_unit",
39
"created": 1623456789,
40
"currency": "usd",
41
"livemode": false,
42
"lookup_key": null,
43
"metadata": {},
44
"nickname": "Premium Price",
45
"product": "prod_1234567890abcdef",
46
"recurring": {
47
"aggregate_usage": null,
48
"interval": "month",
49
"interval_count": 1,
50
"trial_period_days": null,
51
"usage_type": "licensed"
52
},
53
"tiers_mode": null,
54
"transform_quantity": null,
55
"type": "recurring",
56
"unit_amount": 2000,
57
"unit_amount_decimal": "2000"
58
},
59
"quantity": 1,
60
"subscription": "sub_1234567890abcdef",
61
"tax_rates": []
62
},
63
{
64
"id": "si_2JKLMNOPQRSTUVWXYZabcd",
65
"object": "subscription_item",
66
"billing_thresholds": null,
67
"created": 1634567891,
68
"metadata": {},
69
"plan": {
70
"id": "plan_2345678901bcdefg",
71
"object": "plan",
72
"active": true,
73
"aggregate_usage": null,
74
"amount": 500,
75
"amount_decimal": "500",
76
"billing_scheme": "per_unit",
77
"created": 1623456790,
78
"currency": "usd",
79
"interval": "month",
80
"interval_count": 1,
81
"livemode": false,
82
"metadata": {},
83
"nickname": "Add-on Plan",
84
"product": "prod_2345678901bcdefg",
85
"tiers": null,
86
"tiers_mode": null,
87
"transform_usage": null,
88
"trial_period_days": null,
89
"usage_type": "licensed"
90
},
91
"price": {
92
"id": "price_2345678901bcdefg",
93
"object": "price",
94
"active": true,
95
"billing_scheme": "per_unit",
96
"created": 1623456790,
97
"currency": "usd",
98
"livemode": false,
99
"lookup_key": null,
100
"metadata": {},
101
"nickname": "Add-on Price",
102
"product": "prod_2345678901bcdefg",
103
"recurring": {
104
"aggregate_usage": null,
105
"interval": "month",
106
"interval_count": 1,
107
"trial_period_days": null,
108
"usage_type": "licensed"
109
},
110
"tiers_mode": null,
111
"transform_quantity": null,
112
"type": "recurring",
113
"unit_amount": 500,
114
"unit_amount_decimal": "500"
115
},
116
"quantity": 2,
117
"subscription": "sub_1234567890abcdef",
118
"tax_rates": []
119
}
120
],
121
"has_more": true,
122
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
123
}

List subscription schedules
Copy

Retrieve the list of your subscription schedules.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"created": {
4
"gte": "2023-01-01T00:00:00Z"
5
},
6
"canceled_at": {
7
"lt": "2023-06-01T00:00:00Z"
8
},
9
"scheduled": true,
10
"limit": 10
11
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "sub_sched_1234567890abcdef",
6
"object": "subscription_schedule",
7
"canceled_at": null,
8
"completed_at": null,
9
"created": 1672531200,
10
"current_phase": null,
11
"customer": "cus_1234567890abcdef",
12
"default_settings": {
13
"application_fee_percent": null,
14
"billing_cycle_anchor": "automatic",
15
"billing_thresholds": null,
16
"collection_method": "charge_automatically",
17
"default_payment_method": null,
18
"default_source": null,
19
"invoice_settings": null,
20
"transfer_data": null
21
},
22
"end_behavior": "release",
23
"livemode": false,
24
"metadata": {
25
"order_id": "ord_987654321"
26
},
27
"phases": [
28
{
29
"add_invoice_items": [],
30
"application_fee_percent": null,
31
"billing_cycle_anchor": "automatic",
32
"billing_thresholds": null,
33
"collection_method": null,
34
"coupon": null,
35
"default_payment_method": null,
36
"default_tax_rates": [],
37
"end_date": 1688169600,
38
"invoice_settings": null,
39
"plans": [
40
{
41
"billing_thresholds": null,
42
"plan": "plan_9876543210fedcba",
43
"price": "price_1234567890abcdef",
44
"quantity": 1,
45
"tax_rates": []
46
}
47
],
48
"prorate": true,
49
"proration_behavior": "create_prorations",
50
"start_date": 1672531200,
51
"tax_percent": null,
52
"transfer_data": null,
53
"trial_end": null
54
}
55
],
56
"released_at": null,
57
"released_subscription": null,
58
"renewal_interval": null,
59
"status": "not_started",
60
"subscription": null
61
}
62
],
63
"has_more": false,
64
"url": "/v1/subscription_schedules"
65
}

List subscriptions
Copy

Return a list of subscriptions in your Stripe account.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"price": "price_9876543210fedcba",
4
"status": "active",
5
"collection_method": "charge_automatically",
6
"created": {
7
"gte": "2023-01-01T00:00:00Z"
8
},
9
"current_period_start": {
10
"gt": "2023-06-01T00:00:00Z"
11
},
12
"current_period_end": {
13
"lt": "2023-12-31T23:59:59Z"
14
},
15
"limit": 10
16
}

Sample Output

1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "sub_1234567890abcdef",
6
"object": "subscription",
7
"application_fee_percent": null,
8
"billing_cycle_anchor": 1625097600,
9
"billing_thresholds": null,
10
"cancel_at": null,
11
"cancel_at_period_end": false,
12
"canceled_at": null,
13
"collection_method": "charge_automatically",
14
"created": 1625097600,
15
"current_period_end": 1656633600,
16
"current_period_start": 1625097600,
17
"customer": "cus_1234567890abcdef",
18
"days_until_due": null,
19
"default_payment_method": "pm_1234567890abcdef",
20
"default_source": null,
21
"default_tax_rates": [],
22
"discount": null,
23
"ended_at": null,
24
"items": {
25
"object": "list",
26
"data": [
27
{
28
"id": "si_1234567890abcdef",
29
"object": "subscription_item",
30
"billing_thresholds": null,
31
"created": 1625097600,
32
"metadata": {},
33
"plan": {
34
"id": "plan_1234567890abcdef",
35
"object": "plan",
36
"active": true,
37
"aggregate_usage": null,
38
"amount": 1999,
39
"amount_decimal": "1999",
40
"billing_scheme": "per_unit",
41
"created": 1625097600,
42
"currency": "usd",
43
"interval": "month",
44
"interval_count": 1,
45
"livemode": false,
46
"metadata": {},
47
"nickname": "Monthly Plan",
48
"product": "prod_1234567890abcdef",
49
"tiers": null,
50
"tiers_mode": null,
51
"transform_usage": null,
52
"trial_period_days": null,
53
"usage_type": "licensed"
54
},
55
"price": {
56
"id": "price_9876543210fedcba",
57
"object": "price",
58
"active": true,
59
"billing_scheme": "per_unit",
60
"created": 1625097600,
61
"currency": "usd",
62
"livemode": false,
63
"lookup_key": null,
64
"metadata": {},
65
"nickname": "Monthly Price",
66
"product": "prod_1234567890abcdef",
67
"recurring": {
68
"aggregate_usage": null,
69
"interval": "month",
70
"interval_count": 1,
71
"trial_period_days": null,
72
"usage_type": "licensed"
73
},
74
"tiers_mode": null,
75
"transform_quantity": null,
76
"type": "recurring",
77
"unit_amount": 1999,
78
"unit_amount_decimal": "1999"
79
},
80
"quantity": 1,
81
"subscription": "sub_1234567890abcdef",
82
"tax_rates": []
83
}
84
],
85
"has_more": false,
86
"total_count": 1,
87
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
88
},
89
"latest_invoice": "in_1234567890abcdef",
90
"livemode": false,
91
"metadata": {},
92
"next_pending_invoice_item_invoice": null,
93
"pause_collection": null,
94
"pending_invoice_item_interval": null,
95
"pending_setup_intent": null,
96
"pending_update": null,
97
"plan": {
98
"id": "plan_1234567890abcdef",
99
"object": "plan",
100
"active": true,
101
"aggregate_usage": null,
102
"amount": 1999,
103
"amount_decimal": "1999",
104
"billing_scheme": "per_unit",
105
"created": 1625097600,
106
"currency": "usd",
107
"interval": "month",
108
"interval_count": 1,
109
"livemode": false,
110
"metadata": {},
111
"nickname": "Monthly Plan",
112
"product": "prod_1234567890abcdef",
113
"tiers": null,
114
"tiers_mode": null,
115
"transform_usage": null,
116
"trial_period_days": null,
117
"usage_type": "licensed"
118
},
119
"quantity": 1,
120
"schedule": null,
121
"start_date": 1625097600,
122
"status": "active",
123
"tax_percent": null,
124
"transfer_data": null,
125
"trial_end": null,
126
"trial_start": null
127
}
128
],
129
"has_more": false,
130
"url": "/v1/subscriptions"
131
}

List tax IDs by customer
Copy

Return a list of tax IDs for a customer.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"limit": 10,
4
"starting_after": "txr_1234567890abcdef",
5
"ending_before": "txr_0987654321fedcba"
6
}

Sample Output

1
{
2
"object": "list",
3
"url": "/v1/customers/cus_1234567890abcdef/tax_ids",
4
"has_more": false,
5
"data": [
6
{
7
"id": "txi_1234567890abcdef",
8
"object": "tax_id",
9
"country": "US",
10
"created": 1634567890,
11
"customer": "cus_1234567890abcdef",
12
"livemode": false,
13
"type": "us_ein",
14
"value": "12-3456789",
15
"verification": {
16
"status": "verified",
17
"verified_address": "123 Main St, Anytown, USA",
18
"verified_name": "Sample Company Inc."
19
}
20
},
21
{
22
"id": "txi_0987654321fedcba",
23
"object": "tax_id",
24
"country": "GB",
25
"created": 1634567891,
26
"customer": "cus_1234567890abcdef",
27
"livemode": false,
28
"type": "gb_vat",
29
"value": "GB123456789",
30
"verification": {
31
"status": "pending",
32
"verified_address": null,
33
"verified_name": null
34
}
35
}
36
]
37
}

Pay invoice
Copy

Attempt payment on an invoice.

Sample Input

1
{
2
"invoice_id": "in_1234567890abcdef",
3
"source": "src_1234567890abcdef",
4
"forgive": false
5
}

Sample Output

1
{
2
"id": "in_1234567890abcdef",
3
"object": "invoice",
4
"account_country": "US",
5
"account_name": "My Company",
6
"amount_due": 10000,
7
"amount_paid": 10000,
8
"amount_remaining": 0,
9
"attempt_count": 1,
10
"attempted": true,
11
"auto_advance": true,
12
"billing_reason": "manual",
13
"charge": "ch_1234567890abcdef",
14
"collection_method": "charge_automatically",
15
"created": 1634567890,
16
"currency": "usd",
17
"customer": "cus_1234567890abcdef",
18
"customer_email": "customer@example.com",
19
"customer_name": "John Doe",
20
"date": 1634567890,
21
"default_source": "src_1234567890abcdef",
22
"description": "Invoice for October services",
23
"hosted_invoice_url": "https://invoice.stripe.com/i/acct_1234567890abcdef/invst_1234567890abcdef",
24
"invoice_pdf": "https://pay.stripe.com/invoice/acct_1234567890abcdef/invst_1234567890abcdef/pdf",
25
"lines": {
26
"data": [
27
{
28
"id": "il_1234567890abcdef",
29
"object": "line_item",
30
"amount": 10000,
31
"currency": "usd",
32
"description": "Monthly subscription",
33
"discountable": true,
34
"livemode": false,
35
"metadata": {},
36
"period": {
37
"end": 1637246290,
38
"start": 1634567890
39
},
40
"price": {
41
"id": "price_1234567890abcdef",
42
"object": "price",
43
"active": true,
44
"billing_scheme": "per_unit",
45
"created": 1634567890,
46
"currency": "usd",
47
"livemode": false,
48
"lookup_key": null,
49
"metadata": {},
50
"nickname": null,
51
"product": "prod_1234567890abcdef",
52
"recurring": {
53
"aggregate_usage": null,
54
"interval": "month",
55
"interval_count": 1,
56
"usage_type": "licensed"
57
},
58
"type": "recurring",
59
"unit_amount": 10000,
60
"unit_amount_decimal": "10000"
61
},
62
"proration": false,
63
"quantity": 1,
64
"subscription": "sub_1234567890abcdef",
65
"tax_amounts": [],
66
"tax_rates": []
67
}
68
],
69
"has_more": false,
70
"object": "list",
71
"url": "/v1/invoices/in_1234567890abcdef/lines"
72
},
73
"livemode": false,
74
"metadata": {},
75
"number": "INV-0001",
76
"paid": true,
77
"payment_intent": "pi_1234567890abcdef",
78
"period_end": 1634567890,
79
"period_start": 1631889490,
80
"receipt_number": null,
81
"starting_balance": 0,
82
"status": "paid",
83
"subtotal": 10000,
84
"tax": 0,
85
"total": 10000,
86
"total_discount_amounts": [],
87
"total_tax_amounts": []
88
}

Raw HTTP request (advanced)
Copy

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.

Sample Input

1
{
2
"method": "POST",
3
"url": {
4
"endpoint": "/v1/customers"
5
},
6
"headers": [
7
{
8
"key": "Content-Type",
9
"value": "application/x-www-form-urlencoded"
10
}
11
],
12
"body": {
13
"form_urlencoded": {
14
"email": "john.doe@example.com",
15
"name": "John Doe",
16
"description": "New customer"
17
}
18
},
19
"include_raw_body": false,
20
"parse_response": "true"
21
}

Sample Output

1
{
2
"response": {
3
"status_code": 200,
4
"headers": {
5
"server": "nginx",
6
"date": "Wed, 21 Jul 2023 12:34:56 GMT",
7
"content-type": "application/json",
8
"content-length": "1234",
9
"connection": "keep-alive",
10
"stripe-version": "2023-07-14",
11
"access-control-allow-origin": "*",
12
"access-control-allow-methods": "GET, POST, HEAD, OPTIONS, DELETE",
13
"access-control-allow-headers": "Authorization, Content-Type, Stripe-Version",
14
"access-control-expose-headers": "Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required",
15
"access-control-max-age": "300",
16
"cache-control": "no-cache, no-store",
17
"request-id": "req_1234567890abcdef",
18
"stripe-should-retry": "false",
19
"strict-transport-security": "max-age=31556926; includeSubDomains; preload"
20
},
21
"body": {
22
"id": "cus_1234567890abcdef",
23
"object": "customer",
24
"created": 1689945296,
25
"email": "john.doe@example.com",
26
"livemode": false,
27
"name": "John Doe",
28
"description": "New customer",
29
"preferred_locales": []
30
}
31
}
32
}

Update card
Copy

Update card information.

Sample Input

1
{
2
"card_id": "card_1Abc2DEFghIJklMN",
3
"customer_id": "cus_1OPqRsTuVwXyZ",
4
"name": "John Doe",
5
"address_city": "San Francisco",
6
"address_country": "US",
7
"address_line1": "123 Main St",
8
"address_line2": "Apt 4B",
9
"address_state": "CA",
10
"address_zip": "94105",
11
"exp_month": "12",
12
"exp_year": "2025"
13
}

Sample Output

1
{
2
"id": "card_1Abc2DEFghIJklMN",
3
"object": "card",
4
"brand": "Visa",
5
"last4": "4242",
6
"exp_month": 12,
7
"exp_year": 2025,
8
"name": "John Doe",
9
"address_line1": "123 Main St",
10
"address_line2": "Apt 4B",
11
"address_city": "San Francisco",
12
"address_state": "CA",
13
"address_zip": "94105",
14
"address_country": "US",
15
"country": "US",
16
"customer": "cus_1OPqRsTuVwXyZ",
17
"fingerprint": "Xt5EWLLDS7FJjR1c",
18
"funding": "credit",
19
"cvc_check": "pass",
20
"address_line1_check": "pass",
21
"address_zip_check": "pass",
22
"tokenization_method": null,
23
"dynamic_last4": null,
24
"metadata": {}
25
}

Update customer
Copy

Update customer information.

Sample Input

1
{
2
"customer_id": "cus_1234567890abcdef",
3
"name": "John Doe",
4
"email": "johndoe@example.com",
5
"phone": "+1 555-123-4567",
6
"description": "Loyal customer since 2020",
7
"address": {
8
"line1": "123 Main St",
9
"line2": "Apt 4B",
10
"city": "New York",
11
"state": "NY",
12
"postal_code": "10001",
13
"country": "US"
14
},
15
"shipping": {
16
"name": "John Doe",
17
"address": {
18
"line1": "456 Elm St",
19
"line2": "Suite 789",
20
"city": "Los Angeles",
21
"state": "CA",
22
"postal_code": "90001",
23
"country": "US"
24
},
25
"phone": "+1 555-987-6543"
26
},
27
"balance": 1000,
28
"coupon": "SUMMER2023",
29
"default_source": "card_1234567890abcdef",
30
"invoice_settings": {
31
"custom_fields": {
32
"name": "Account Manager",
33
"value": "Jane Smith"
34
},
35
"default_payment_method": "pm_1234567890abcdef",
36
"footer": "Thank you for your business!"
37
},
38
"source": {
39
"object": "card",
40
"number": "4242424242424242",
41
"exp_month": "12",
42
"exp_year": "2025",
43
"cvc": "123",
44
"name": "John Doe",
45
"address_line1": "123 Main St",
46
"address_city": "New York",
47
"address_state": "NY",
48
"address_zip": "10001",
49
"address_country": "US"
50
},
51
"promotion_code": "PROMO2023"
52
}

Sample Output

1
{
2
"id": "cus_1234567890abcdef",
3
"object": "customer",
4
"created": 1623456789,
5
"email": "johndoe@example.com",
6
"name": "John Doe",
7
"description": "Loyal customer since 2020",
8
"phone": "+1 555-123-4567",
9
"livemode": false,
10
"default_source": "card_1234567890abcdef",
11
"currency": "usd",
12
"account_balance": 1000,
13
"delinquent": false,
14
"discount": null,
15
"invoice_prefix": "ABC123",
16
"shipping": {
17
"name": "John Doe",
18
"address": {
19
"line1": "456 Elm St",
20
"line2": "Suite 789",
21
"city": "Los Angeles",
22
"state": "CA",
23
"postal_code": "90001",
24
"country": "US"
25
},
26
"phone": "+1 555-987-6543"
27
},
28
"sources": {
29
"object": "list",
30
"data": [
31
{
32
"id": "card_1234567890abcdef"
33
}
34
],
35
"has_more": false,
36
"total_count": 1,
37
"url": "/v1/customers/cus_1234567890abcdef/sources"
38
},
39
"subscriptions": {
40
"object": "list",
41
"data": [],
42
"has_more": false,
43
"total_count": 0,
44
"url": "/v1/customers/cus_1234567890abcdef/subscriptions"
45
},
46
"metadata": {}
47
}

Update subscription
Copy

Updates a new subscription on an existing customer.

Sample Input

1
{
2
"subscription_id": "sub_1234567890abcdef",
3
"items": [
4
{
5
"id": "si_1234567890abcdef",
6
"quantity": 2,
7
"billing_thresholds": {
8
"usage_gte": "1000"
9
},
10
"price_options": {
11
"price": "price_1234567890abcdef"
12
}
13
}
14
],
15
"default_payment_method": "pm_1234567890abcdef",
16
"billing_cycle_anchor": "now",
17
"coupon": "SUMMER2023",
18
"collection_method": "charge_automatically",
19
"days_until_due": 30,
20
"proration_behavior": "create_prorations",
21
"trial_end": "2023-08-31T23:59:59Z"
22
}

Sample Output

1
{
2
"id": "sub_1234567890abcdef",
3
"object": "subscription",
4
"billing_cycle_anchor": 1627776000,
5
"collection_method": "charge_automatically",
6
"created": 1625184000,
7
"current_period_end": 1630368000,
8
"current_period_start": 1627776000,
9
"customer": "cus_1234567890abcdef",
10
"days_until_due": 30,
11
"default_payment_method": "pm_1234567890abcdef",
12
"items": {
13
"object": "list",
14
"data": [
15
{
16
"id": "si_1234567890abcdef",
17
"object": "subscription_item",
18
"billing_thresholds": {
19
"usage_gte": 1000
20
},
21
"created": 1625184000,
22
"metadata": {},
23
"plan": {
24
"id": "plan_1234567890abcdef",
25
"object": "plan",
26
"active": true,
27
"amount": 2000,
28
"amount_decimal": "2000",
29
"billing_scheme": "per_unit",
30
"created": 1625097600,
31
"currency": "usd",
32
"interval": "month",
33
"interval_count": 1,
34
"livemode": false,
35
"metadata": {},
36
"nickname": "Professional Plan",
37
"product": "prod_1234567890abcdef",
38
"usage_type": "licensed"
39
},
40
"price": {
41
"id": "price_1234567890abcdef",
42
"object": "price",
43
"active": true,
44
"billing_scheme": "per_unit",
45
"created": 1625097600,
46
"currency": "usd",
47
"livemode": false,
48
"metadata": {},
49
"nickname": "Professional Plan Monthly",
50
"product": "prod_1234567890abcdef",
51
"recurring": {
52
"interval": "month",
53
"interval_count": 1,
54
"usage_type": "licensed"
55
},
56
"type": "recurring",
57
"unit_amount": 2000,
58
"unit_amount_decimal": "2000"
59
},
60
"quantity": 2,
61
"subscription": "sub_1234567890abcdef",
62
"tax_rates": []
63
}
64
],
65
"has_more": false,
66
"total_count": 1,
67
"url": "/v1/subscription_items?subscription=sub_1234567890abcdef"
68
},
69
"latest_invoice": "in_1234567890abcdef",
70
"livemode": false,
71
"metadata": {},
72
"status": "active",
73
"trial_end": 1630454399
74
}

DDL operations
Copy

List charges (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "ch_1NcXYzABCDEF1234567890",
5
"object": "charge",
6
"amount": 2000,
7
"amount_captured": 2000,
8
"amount_refunded": 0,
9
"application": null,
10
"application_fee": null,
11
"application_fee_amount": null,
12
"balance_transaction": "txn_1NcXYzABCDEF1234567890",
13
"billing_details": {
14
"address": {
15
"city": "San Francisco",
16
"country": "US",
17
"line1": "123 Main St",
18
"line2": null,
19
"postal_code": "94111",
20
"state": "CA"
21
},
22
"email": "customer@example.com",
23
"name": "John Doe",
24
"phone": "+14155551234"
25
},
26
"calculated_statement_descriptor": "EXAMPLE INC",
27
"captured": true,
28
"created": 1628097123,
29
"currency": "usd",
30
"customer": "cus_ABCDEFGHIJK12345",
31
"description": "Example charge",
32
"destination": null,
33
"dispute": null,
34
"disputed": false,
35
"failure_code": null,
36
"failure_message": null,
37
"fraud_details": {},
38
"invoice": null,
39
"livemode": false,
40
"metadata": {},
41
"on_behalf_of": null,
42
"order": null,
43
"outcome": {
44
"network_status": "approved_by_network",
45
"reason": null,
46
"risk_level": "normal",
47
"seller_message": "Payment complete.",
48
"type": "authorized"
49
},
50
"paid": true,
51
"payment_intent": "pi_ABCDEFGHIJK12345",
52
"payment_method": "pm_ABCDEFGHIJK12345",
53
"payment_method_details": {
54
"card": {
55
"brand": "visa",
56
"checks": {
57
"address_line1_check": "pass",
58
"address_postal_code_check": "pass",
59
"cvc_check": "pass"
60
},
61
"country": "US",
62
"exp_month": 12,
63
"exp_year": 2025,
64
"fingerprint": "ABCDEFGHIJK12345",
65
"funding": "credit",
66
"installments": null,
67
"last4": "4242",
68
"network": "visa",
69
"three_d_secure": null,
70
"wallet": null
71
},
72
"type": "card"
73
},
74
"receipt_email": "customer@example.com",
75
"receipt_number": null,
76
"receipt_url": "https://pay.stripe.com/receipts/...",
77
"refunded": false,
78
"refunds": {
79
"object": "list",
80
"data": [],
81
"has_more": false,
82
"total_count": 0,
83
"url": "/v1/charges/ch_1NcXYzABCDEF1234567890/refunds"
84
},
85
"review": null,
86
"shipping": null,
87
"source": null,
88
"source_transfer": null,
89
"statement_descriptor": null,
90
"statement_descriptor_suffix": null,
91
"status": "succeeded",
92
"transfer_data": null,
93
"transfer_group": null
94
}
95
],
96
"has_more": false,
97
"url": "/v1/charges"
98
}

List currency codes (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"value": "USD",
4
"label": "United States Dollar (USD)"
5
},
6
{
7
"value": "EUR",
8
"label": "Euro (EUR)"
9
},
10
{
11
"value": "GBP",
12
"label": "British Pound (GBP)"
13
},
14
{
15
"value": "JPY",
16
"label": "Japanese Yen (JPY)"
17
},
18
{
19
"value": "CAD",
20
"label": "Canadian Dollar (CAD)"
21
},
22
{
23
"value": "AUD",
24
"label": "Australian Dollar (AUD)"
25
},
26
{
27
"value": "CHF",
28
"label": "Swiss Franc (CHF)"
29
},
30
{
31
"value": "CNY",
32
"label": "Chinese Yuan (CNY)"
33
},
34
{
35
"value": "INR",
36
"label": "Indian Rupee (INR)"
37
},
38
{
39
"value": "MXN",
40
"label": "Mexican Peso (MXN)"
41
}
42
]

List customers (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "cus_1234567890abcdef",
5
"object": "customer",
6
"address": null,
7
"balance": 0,
8
"created": 1622505600,
9
"currency": "usd",
10
"default_source": null,
11
"delinquent": false,
12
"description": "Customer for example@email.com",
13
"discount": null,
14
"email": "example@email.com",
15
"invoice_prefix": "1234ABCD",
16
"livemode": false,
17
"metadata": {},
18
"name": "John Doe",
19
"phone": null,
20
"preferred_locales": [],
21
"shipping": null,
22
"tax_exempt": "none"
23
},
24
{
25
"id": "cus_0987654321zyxwvu",
26
"object": "customer",
27
"address": {
28
"city": "San Francisco",
29
"country": "US",
30
"line1": "123 Main St",
31
"line2": null,
32
"postal_code": "94105",
33
"state": "CA"
34
},
35
"balance": -500,
36
"created": 1622592000,
37
"currency": "usd",
38
"default_source": "card_1234567890abcdef",
39
"delinquent": false,
40
"description": "Customer for jane@example.com",
41
"discount": null,
42
"email": "jane@example.com",
43
"invoice_prefix": "5678EFGH",
44
"livemode": false,
45
"metadata": {
46
"order_id": "6789",
47
"customer_type": "premium"
48
},
49
"name": "Jane Smith",
50
"phone": "+14155551234",
51
"preferred_locales": [
52
"en",
53
"es"
54
],
55
"shipping": {
56
"address": {
57
"city": "San Francisco",
58
"country": "US",
59
"line1": "456 Oak St",
60
"line2": "Apt 7",
61
"postal_code": "94108",
62
"state": "CA"
63
},
64
"name": "Jane Smith",
65
"phone": "+14155551234"
66
},
67
"tax_exempt": "none"
68
}
69
],
70
"has_more": false,
71
"url": "/v1/customers"
72
}

List invoices (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "in_1234567890abcdef",
5
"object": "invoice",
6
"account_country": "US",
7
"account_name": "Acme Corp",
8
"amount_due": 10000,
9
"amount_paid": 0,
10
"amount_remaining": 10000,
11
"attempt_count": 0,
12
"auto_advance": true,
13
"billing_reason": "manual",
14
"charge": null,
15
"collection_method": "send_invoice",
16
"created": 1634567890,
17
"currency": "usd",
18
"customer": "cus_1234567890abcdef",
19
"customer_email": "john.doe@example.com",
20
"customer_name": "John Doe",
21
"description": null,
22
"due_date": 1635177600,
23
"lines": {
24
"object": "list",
25
"data": [
26
{
27
"id": "il_1234567890abcdef",
28
"object": "line_item",
29
"amount": 10000,
30
"currency": "usd",
31
"description": "Professional services",
32
"discountable": true,
33
"livemode": false,
34
"metadata": {},
35
"period": {
36
"end": 1634567890,
37
"start": 1631975890
38
},
39
"price": {
40
"id": "price_1234567890abcdef",
41
"object": "price",
42
"active": true,
43
"currency": "usd",
44
"product": "prod_1234567890abcdef",
45
"unit_amount": 10000,
46
"type": "one_time"
47
},
48
"proration": false,
49
"quantity": 1,
50
"subscription": null,
51
"tax_amounts": [],
52
"tax_rates": [],
53
"type": "invoiceitem"
54
}
55
],
56
"has_more": false,
57
"total_count": 1,
58
"url": "/v1/invoices/in_1234567890abcdef/lines"
59
},
60
"livemode": false,
61
"metadata": {},
62
"number": "INV-0001",
63
"paid": false,
64
"payment_intent": null,
65
"period_end": 1634567890,
66
"period_start": 1631975890,
67
"post_payment_credit_notes_amount": 0,
68
"pre_payment_credit_notes_amount": 0,
69
"receipt_number": null,
70
"starting_balance": 0,
71
"status": "draft",
72
"subscription": null,
73
"subtotal": 10000,
74
"tax": null,
75
"total": 10000,
76
"total_discount_amounts": [],
77
"total_tax_amounts": [],
78
"transfer_data": null,
79
"webhooks_delivered_at": null
80
}
81
],
82
"has_more": false,
83
"url": "/v1/invoices"
84
}

List orders (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "or_1NcXYZABCDEFGHIJKLMNOP",
5
"object": "order",
6
"amount": 5000,
7
"amount_returned": 0,
8
"currency": "usd",
9
"customer": "cus_ABCDEFghijklmn",
10
"email": "customer@example.com",
11
"items": [
12
{
13
"object": "order_item",
14
"amount": 5000,
15
"currency": "usd",
16
"description": "T-shirt",
17
"parent": "sk_ABCDEFGHIJKLMNOP",
18
"quantity": 1,
19
"type": "sku"
20
}
21
],
22
"status": "paid",
23
"created": 1628097600,
24
"updated": 1628097600
25
},
26
{
27
"id": "or_2NcXYZABCDEFGHIJKLMNOP",
28
"object": "order",
29
"amount": 7500,
30
"amount_returned": 0,
31
"currency": "usd",
32
"customer": "cus_QRSTUVwxyz12345",
33
"email": "anothercustomer@example.com",
34
"items": [
35
{
36
"object": "order_item",
37
"amount": 7500,
38
"currency": "usd",
39
"description": "Hoodie",
40
"parent": "sk_QRSTUVWXYZ123456",
41
"quantity": 1,
42
"type": "sku"
43
}
44
],
45
"status": "paid",
46
"created": 1628184000,
47
"updated": 1628184000
48
}
49
],
50
"has_more": false,
51
"url": "/v1/orders"
52
}

List plans (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "plan_H1Jk8sXlKm",
5
"object": "plan",
6
"active": true,
7
"aggregate_usage": null,
8
"amount": 1999,
9
"amount_decimal": "1999",
10
"billing_scheme": "per_unit",
11
"created": 1610123456,
12
"currency": "usd",
13
"interval": "month",
14
"interval_count": 1,
15
"livemode": false,
16
"metadata": {},
17
"nickname": "Pro Plan",
18
"product": "prod_H1Jk8sXlKm",
19
"tiers_mode": null,
20
"transform_usage": null,
21
"trial_period_days": null,
22
"usage_type": "licensed"
23
},
24
{
25
"id": "plan_G2Lm9tYnLo",
26
"object": "plan",
27
"active": true,
28
"aggregate_usage": null,
29
"amount": 4999,
30
"amount_decimal": "4999",
31
"billing_scheme": "per_unit",
32
"created": 1609987654,
33
"currency": "usd",
34
"interval": "month",
35
"interval_count": 1,
36
"livemode": false,
37
"metadata": {},
38
"nickname": "Enterprise Plan",
39
"product": "prod_G2Lm9tYnLo",
40
"tiers_mode": null,
41
"transform_usage": null,
42
"trial_period_days": 14,
43
"usage_type": "licensed"
44
}
45
],
46
"has_more": false,
47
"url": "/v1/plans"
48
}

List products (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "prod_1234567890abcdef",
5
"object": "product",
6
"active": true,
7
"created": 1622505600,
8
"description": "Premium T-shirt",
9
"images": [
10
"https://example.com/t-shirt-image.jpg"
11
],
12
"livemode": false,
13
"metadata": {
14
"color": "blue",
15
"size": "medium"
16
},
17
"name": "Premium T-shirt",
18
"package_dimensions": null,
19
"shippable": true,
20
"statement_descriptor": null,
21
"tax_code": "txcd_20010000",
22
"type": "good",
23
"unit_label": null,
24
"updated": 1622505600,
25
"url": null
26
},
27
{
28
"id": "prod_0987654321zyxwvu",
29
"object": "product",
30
"active": true,
31
"created": 1622592000,
32
"description": "Deluxe Hoodie",
33
"images": [
34
"https://example.com/hoodie-image.jpg"
35
],
36
"livemode": false,
37
"metadata": {
38
"color": "black",
39
"size": "large"
40
},
41
"name": "Deluxe Hoodie",
42
"package_dimensions": null,
43
"shippable": true,
44
"statement_descriptor": null,
45
"tax_code": "txcd_20010000",
46
"type": "good",
47
"unit_label": null,
48
"updated": 1622592000,
49
"url": null
50
}
51
],
52
"has_more": false,
53
"url": "/v1/products"
54
}

List subscriptions (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"id": "sub_1JKLMNOPQRSTUVWXYZabcd",
5
"object": "subscription",
6
"application_fee_percent": null,
7
"billing_cycle_anchor": 1625097600,
8
"billing_thresholds": null,
9
"cancel_at": null,
10
"cancel_at_period_end": false,
11
"canceled_at": null,
12
"collection_method": "charge_automatically",
13
"created": 1625097600,
14
"current_period_end": 1627776000,
15
"current_period_start": 1625097600,
16
"customer": "cus_ABCDEFGHIJKLMNop",
17
"days_until_due": null,
18
"default_payment_method": null,
19
"default_source": null,
20
"default_tax_rates": [],
21
"discount": null,
22
"ended_at": null,
23
"items": {
24
"object": "list",
25
"data": [
26
{
27
"id": "si_ABCDEFGHIJKLMNop",
28
"object": "subscription_item",
29
"billing_thresholds": null,
30
"created": 1625097600,
31
"metadata": {},
32
"price": {
33
"id": "price_1ABCDEFGHIJKLMNop",
34
"object": "price",
35
"active": true,
36
"billing_scheme": "per_unit",
37
"created": 1625097500,
38
"currency": "usd",
39
"livemode": false,
40
"lookup_key": null,
41
"metadata": {},
42
"nickname": null,
43
"product": "prod_ABCDEFGHIJKLMNop",
44
"recurring": {
45
"aggregate_usage": null,
46
"interval": "month",
47
"interval_count": 1,
48
"usage_type": "licensed"
49
},
50
"tax_behavior": "unspecified",
51
"tiers_mode": null,
52
"transform_quantity": null,
53
"type": "recurring",
54
"unit_amount": 1999,
55
"unit_amount_decimal": "1999"
56
},
57
"quantity": 1,
58
"subscription": "sub_1JKLMNOPQRSTUVWXYZabcd",
59
"tax_rates": []
60
}
61
],
62
"has_more": false,
63
"url": "/v1/subscription_items?subscription=sub_1JKLMNOPQRSTUVWXYZabcd"
64
},
65
"latest_invoice": "in_1ABCDEFGHIJKLMNop",
66
"livemode": false,
67
"metadata": {},
68
"next_pending_invoice_item_invoice": null,
69
"pause_collection": null,
70
"pending_invoice_item_interval": null,
71
"pending_setup_intent": null,
72
"pending_update": null,
73
"schedule": null,
74
"start_date": 1625097600,
75
"status": "active",
76
"transfer_data": null,
77
"trial_end": null,
78
"trial_start": null
79
}
80
],
81
"has_more": false,
82
"url": "/v1/subscriptions"
83
}