Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
curl https://api.stripe.com/v1/customers?limit=3 \
-u STRIPE_SECRET_KEY: \
-G
CREATE PROCEDURE ChilkatSample
AS
BEGIN
DECLARE @hr int
DECLARE @iTmp0 int
DECLARE @sTmp0 nvarchar(4000)
DECLARE @rest int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Rest', @rest OUT
IF @hr <> 0
BEGIN
PRINT 'Failed to create ActiveX component'
RETURN
END
DECLARE @success int
-- URL: https://api.stripe.com/v1/customers?limit=3
DECLARE @bTls int
SELECT @bTls = 1
DECLARE @port int
SELECT @port = 443
DECLARE @bAutoReconnect int
SELECT @bAutoReconnect = 1
EXEC sp_OAMethod @rest, 'Connect', @success OUT, 'api.stripe.com', STR(@port), STR(@bTls), STR(@bAutoReconnect)
IF STR(@success) <> 1
BEGIN
EXEC sp_OAGetProperty @rest, 'ConnectFailReason', @iTmp0 OUT
PRINT 'ConnectFailReason: ' + @iTmp0
EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @rest
RETURN
END
EXEC sp_OAMethod @rest, 'SetAuthBasic', @success OUT, 'STRIPE_SECRET_KEY', ''
DECLARE @sbResponseBody int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT
EXEC sp_OAMethod @rest, 'FullRequestNoBodySb', @success OUT, 'GET', '/v1/customers?limit=3', STR(@sbResponseBody)
IF STR(@success) <> 1
BEGIN
EXEC sp_OAGetProperty @rest, 'LastErrorText', @sTmp0 OUT
PRINT @sTmp0
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @sbResponseBody
RETURN
END
DECLARE @jsonResponse int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jsonResponse OUT
EXEC sp_OAMethod @jsonResponse, 'LoadSb', @success OUT, STR(@sbResponseBody)
DECLARE @object nvarchar(4000)
DECLARE @url nvarchar(4000)
DECLARE @has_more int
DECLARE @i int
DECLARE @count_i int
DECLARE @id nvarchar(4000)
DECLARE @account_balance int
DECLARE @created int
DECLARE @currency nvarchar(4000)
DECLARE @default_source int
DECLARE @delinquent int
DECLARE @description int
DECLARE @discount int
DECLARE @email int
DECLARE @livemode int
DECLARE @shipping int
DECLARE @sourcesObject nvarchar(4000)
DECLARE @sourcesHas_more int
DECLARE @sourcesTotal_count int
DECLARE @sourcesUrl nvarchar(4000)
DECLARE @subscriptionsObject nvarchar(4000)
DECLARE @subscriptionsHas_more int
DECLARE @subscriptionsTotal_count int
DECLARE @subscriptionsUrl nvarchar(4000)
DECLARE @j int
DECLARE @count_j int
EXEC sp_OAMethod @jsonResponse, 'StringOf', @object OUT, 'object'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @url OUT, 'url'
EXEC sp_OAMethod @jsonResponse, 'BoolOf', @has_more OUT, 'has_more'
SELECT @i = 0
EXEC sp_OAMethod @jsonResponse, 'SizeOfArray', @count_i OUT, 'data'
WHILE STR(@i) < STR(@count_i)
BEGIN
EXEC sp_OASetProperty @jsonResponse, 'I', STR(@i)
EXEC sp_OAMethod @jsonResponse, 'StringOf', @id OUT, 'data[i].id'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @object OUT, 'data[i].object'
EXEC sp_OAMethod @jsonResponse, 'IntOf', @account_balance OUT, 'data[i].account_balance'
EXEC sp_OAMethod @jsonResponse, 'IntOf', @created OUT, 'data[i].created'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @currency OUT, 'data[i].currency'
EXEC sp_OAMethod @jsonResponse, 'IsNullOf', @default_source OUT, 'data[i].default_source'
EXEC sp_OAMethod @jsonResponse, 'BoolOf', @delinquent OUT, 'data[i].delinquent'
EXEC sp_OAMethod @jsonResponse, 'IsNullOf', @description OUT, 'data[i].description'
EXEC sp_OAMethod @jsonResponse, 'IsNullOf', @discount OUT, 'data[i].discount'
EXEC sp_OAMethod @jsonResponse, 'IsNullOf', @email OUT, 'data[i].email'
EXEC sp_OAMethod @jsonResponse, 'BoolOf', @livemode OUT, 'data[i].livemode'
EXEC sp_OAMethod @jsonResponse, 'IsNullOf', @shipping OUT, 'data[i].shipping'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @sourcesObject OUT, 'data[i].sources.object'
EXEC sp_OAMethod @jsonResponse, 'BoolOf', @sourcesHas_more OUT, 'data[i].sources.has_more'
EXEC sp_OAMethod @jsonResponse, 'IntOf', @sourcesTotal_count OUT, 'data[i].sources.total_count'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @sourcesUrl OUT, 'data[i].sources.url'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @subscriptionsObject OUT, 'data[i].subscriptions.object'
EXEC sp_OAMethod @jsonResponse, 'BoolOf', @subscriptionsHas_more OUT, 'data[i].subscriptions.has_more'
EXEC sp_OAMethod @jsonResponse, 'IntOf', @subscriptionsTotal_count OUT, 'data[i].subscriptions.total_count'
EXEC sp_OAMethod @jsonResponse, 'StringOf', @subscriptionsUrl OUT, 'data[i].subscriptions.url'
SELECT @j = 0
EXEC sp_OAMethod @jsonResponse, 'SizeOfArray', @count_j OUT, 'data[i].sources.data'
WHILE STR(@j) < STR(@count_j)
BEGIN
EXEC sp_OASetProperty @jsonResponse, 'J', STR(@j)
SELECT @j = STR(@j) + 1
END
SELECT @j = 0
EXEC sp_OAMethod @jsonResponse, 'SizeOfArray', @count_j OUT, 'data[i].subscriptions.data'
WHILE STR(@j) < STR(@count_j)
BEGIN
EXEC sp_OASetProperty @jsonResponse, 'J', STR(@j)
SELECT @j = STR(@j) + 1
END
SELECT @i = STR(@i) + 1
END
EXEC @hr = sp_OADestroy @rest
EXEC @hr = sp_OADestroy @sbResponseBody
EXEC @hr = sp_OADestroy @jsonResponse
END
GO
{
"object": "list",
"url": "/v1/customers",
"has_more": false,
"data": [
{
"id": "cus_CBbgVLJqv487Oq",
"object": "customer",
"account_balance": 0,
"created": 1516662781,
"currency": "usd",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": null,
"livemode": false,
"metadata": {},
"shipping": null,
"sources": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_CBbgVLJqv487Oq/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_CBbgVLJqv487Oq/subscriptions"
}
}
]
}