

# Connecting to Stripe in AWS Glue Studio
<a name="connecting-to-data-stripe"></a>

 Stripe is an online payment processing and credit card processing platform for businesses. The Stripe platform lets businesses accept online payments, create subscription (recurring billing) for their e-commerce, and sets up back account to receive pay outs. Stripe also supports multi-party payments in which it lets businesses to setup their marketplace and allow to collect payment and then pay out to sellers or service providers through “Connected” account. 

**Topics**
+ [AWS Glue support for Stripe](stripe-support.md)
+ [Policies containing the API operations for creating and using connections](stripe-configuring-iam-permissions.md)
+ [Configuring Stripe](stripe-configuring.md)
+ [Configuring Stripe connections](stripe-configuring-connections.md)
+ [Reading from Stripe entities](stripe-reading-from-entities.md)
+ [Stripe connection options](stripe-connection-options.md)
+ [Limitations](stripe-limitations.md)
+ [Creating a new Stripe account and configuring the client app](stripe-new-account-creation.md)

# AWS Glue support for Stripe
<a name="stripe-support"></a>

AWS Glue supports Stripe as follows:

**Supported as a source?**  
Yes. You can use AWS Glue ETL jobs to query data from Stripe.

**Supported as a target?**  
No.

**Supported Slack API versions**  
 v1. 

# Policies containing the API operations for creating and using connections
<a name="stripe-configuring-iam-permissions"></a>

 The following sample policy describes the required IAM permissions for creating and using connections. If you are creating a new role, create a policy that contains the following: 

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "glue:ListConnectionTypes",
        "glue:DescribeConnectionType",
        "glue:RefreshOAuth2Tokens",
        "glue:ListEntities",
        "glue:DescribeEntity"
      ],
      "Resource": "*"
    }
  ]
}
```

------

You can also use the following managed IAM policies to allow access:
+  [ AWSGlueServiceRole ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole) – Grants access to resources that various AWS Glue processes require to run on your behalf. These resources include AWS Glue, Amazon S3, IAM, Amazon CloudWatch Logs, and Amazon EC2. If you follow the naming convention for resources specified in this policy, AWS Glue processes have the required permissions. This policy is typically attached to roles specified when defining crawlers, jobs, and development endpoints. 
+  [ AWSGlueConsoleFullAccess ](https://console.aws.amazon.com/iam/home#policies/arn:aws:iam::aws:policy/AWSGlueConsoleFullAccess) – Grants full access to AWS Glue resources when an identity that the policy is attached to uses the AWS Management Console. If you follow the naming convention for resources specified in this policy, users have full console capabilities. This policy is typically attached to users of the AWS Glue console. 

# Configuring Stripe
<a name="stripe-configuring"></a>

Before you can use AWS Glue to transfer data from Stripe, you must meet these requirements:

## Minimum requirements
<a name="stripe-configuring-min-requirements"></a>
+  You must have a Stripe account with email and password. For more information, see [Creating a new Stripe account and configuring the client app](stripe-new-account-creation.md). 
+  Your Stripe account is enabled for API access. All use of the Stripe API is available at no additional cost. 

 If you meet these requirements, you’re ready to connect AWS Glue to your Stripe account. 

# Configuring Stripe connections
<a name="stripe-configuring-connections"></a>

 Stripe supports custom authentication. For more information on generating the required API keys for custom authorization, see [STRIPE REST API Documentation](https://docs.stripe.com/api/authentication). 

To configure a Stripe connection:

1.  In AWS Secrets Manager, create a secret with the following details. It is required to create a secret for each connection in AWS Glue. 

   1.  For customer managed connected app – Secret should contain the connected app Consumer Secret with `USER_MANAGED_CLIENT_APPLICATION_CLIENT_SECRET` as key. 

1. In AWS Glue Glue Studio, create a connection under **Data Connections** by following the steps below: 

   1. When selecting a **Connection type**, select Stripe.

   1.  Select the IAM role which AWS Glue can assume and has permissions for following actions: 

------
#### [ JSON ]

****  

      ```
      {
        "Version":"2012-10-17",		 	 	 
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "secretsmanager:DescribeSecret",
              "secretsmanager:GetSecretValue",
              "secretsmanager:PutSecretValue",
              "ec2:CreateNetworkInterface",
              "ec2:DescribeNetworkInterfaces",
              "ec2:DeleteNetworkInterface"
            ],
            "Resource": "*"
          }
        ]
      }
      ```

------

   1.  Select the `secretName` which you want to use for this connection in AWS Glue to put the tokens. 

   1.  Select the network options if you want to use your network. 

1.  Grant the IAM role associated with your AWS Glue job permission to read `secretName`. 

# Reading from Stripe entities
<a name="stripe-reading-from-entities"></a>

 **Prerequisites** 
+  A Stripe object you would like to read from. 

 **Supported entities** 


| Entity | Can be Filtered | Supports Limit | Supports Order By | Supports Select \$1 | Supports Partitioning | 
| --- | --- | --- | --- | --- | --- | 
| Balance | No | No | No | Yes | No | 
| Balance Transactions | Yes | Yes | No | Yes | Yes | 
| Charges | Yes | Yes | No | Yes | Yes | 
| Disputes | Yes | Yes | No | Yes | Yes | 
| File Links | Yes | Yes | No | Yes | Yes | 
| PaymentIntents | Yes | Yes | No | Yes | Yes | 
| SetupIntents | Yes | Yes | No | Yes | Yes | 
| Payouts | Yes | Yes | No | Yes | Yes | 
| Refunds | Yes | Yes | No | Yes | Yes | 
| Products | Yes | Yes | No | Yes | Yes | 
| Prices | Yes | Yes | No | Yes | Yes | 
| Coupons | Yes | Yes | No | Yes | Yes | 
| Promotion Codes | Yes | Yes | No | Yes | Yes | 
| Tax Codes | No | Yes | No | Yes | No | 
| Tax Rates | Yes | Yes | No | Yes | Yes | 
| Shipping Rates | Yes | Yes | No | Yes | Yes | 
| Sessions | Yes | Yes | No | Yes | Yes | 
| Credit Notes | Yes | Yes | No | Yes | Yes | 
| Customer | Yes | Yes | No | Yes | Yes | 
| Invoices | Yes | Yes | No | Yes | Yes | 
| Invoice Items | Yes | Yes | No | Yes | No | 
| Plans | Yes | Yes | No | Yes | Yes | 
| Quotes | Yes | Yes | No | Yes | No | 
| Subscriptions | Yes | Yes | No | Yes |  | 
| Subscription Items | No | Yes | No | Yes | No | 
| Subscription Schedules | Yes | Yes | No | Yes | Yes | 
| Accounts | No | Yes | No | Yes | Yes | 
| Application Fees | Yes | Yes | No | Yes | Yes | 
| Country Specs | No | Yes | No | Yes | No | 
| Transfers | Yes | Yes | No | Yes | Yes | 
| Early Fraud Warnings | Yes | Yes | No | Yes | Yes | 
| Report Types | No | No | No | Yes | No | 

 **Example** 

```
stripe_read = glueContext.create_dynamic_frame.from_options(
    connection_type="stripe",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupons",
        "API_VERSION": "v1"
    }
)
```

 **Stripe entity and field details** 


| Entity | Field | Data Type | Supported Operators | 
| --- | --- | --- | --- | 
| Balance |  |  |  | 
|  | available | List |  | 
|  | connect\$1reserved | List |  | 
|  | pending | List |  | 
|  | livemode | Boolean |  | 
|  | object | String |  | 
|  | instant\$1available | List |  | 
|  | issuing | Struct |  | 
| Balance Transactions |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer |  | 
|  | available\$1on | DateTime | =, >=, <=,<,> | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | description | String |  | 
|  | exchange\$1rate | BigDecimal |  | 
|  | fee | Integer |  | 
|  | fee\$1details | List |  | 
|  | net | Integer |  | 
|  | reporting\$1category | String |  | 
|  | source | String | = | 
|  | status | String |  | 
|  | type | String | = | 
|  | cross\$1border\$1classification | String |  | 
| Charges |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer | =, <, > | 
|  | amount\$1captured | Integer |  | 
|  | amount\$1refunded | Integer |  | 
|  | application | String |  | 
|  | application\$1fee | String |  | 
|  | application\$1fee\$1amount | Integer |  | 
|  | balance\$1transaction | String |  | 
|  | billing\$1details | Struct |  | 
|  | calculated\$1statement\$1descriptor | String |  | 
|  | captured | Boolean |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | customer | String | = | 
|  | description | String |  | 
|  | destination | String |  | 
|  | dispute | String |  | 
|  | disputed | Boolean | = | 
|  | failure\$1balance\$1transaction | String |  | 
|  | failure\$1code | String |  | 
|  | failure\$1message | String |  | 
|  | fraud\$1details | Struct |  | 
|  | invoice | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | on\$1behalf\$1of | String |  | 
|  | order | String |  | 
|  | outcome | Struct |  | 
|  | paid | Boolean |  | 
|  | payment\$1intent | String | = | 
|  | payment\$1method | String |  | 
|  | payment\$1method\$1details | Struct |  | 
|  | receipt\$1email | String |  | 
|  | receipt\$1number | String |  | 
|  | receipt\$1url | String |  | 
|  | refunded | Boolean | = | 
|  | refunds | Struct |  | 
|  | review | String |  | 
|  | shipping | Struct |  | 
|  | source | Struct |  | 
|  | source\$1transfer | String |  | 
|  | statement\$1descriptor | String |  | 
|  | statement\$1descriptor\$1suffix | String |  | 
|  | status | String |  | 
|  | transfer | String |  | 
|  | transfer\$1data | Struct |  | 
|  | transfer\$1group | String | = | 
| Disputes |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer | =, <, > | 
|  | balance\$1transaction | String |  | 
|  | balance\$1transactions | List |  | 
|  | charge | String | = | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | evidence | Struct |  | 
|  | evidence\$1details | Struct |  | 
|  | is\$1charge\$1refundable | Boolean |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | payment\$1intent | String | = | 
|  | reason | String | = | 
|  | status | String |  | 
|  | payment\$1method\$1details | Struct |  | 
| File Links |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | expired | Boolean | = | 
|  | expires\$1at | DateTime |  | 
|  | file | String | = | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | url | String |  | 
| PaymentIntents |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer |  | 
|  | amount\$1capturable | Integer |  | 
|  | amount\$1details | Struct |  | 
|  | amount\$1received | Integer |  | 
|  | application | String |  | 
|  | application\$1fee\$1amount | Integer |  | 
|  | automatic\$1payment\$1methods | Struct |  | 
|  | canceled\$1at | DateTime |  | 
|  | cancellation\$1reason | String |  | 
|  | capture\$1method | String |  | 
|  | client\$1secret | String |  | 
|  | confirmation\$1method | String |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | customer | String | = | 
|  | description | String |  | 
|  | invoice | String |  | 
|  | last\$1payment\$1error | Struct |  | 
|  | latest\$1charge | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | next\$1action | Struct |  | 
|  | on\$1behalf\$1of | String |  | 
|  | payment\$1method | String |  | 
|  | payment\$1method\$1options | Struct |  | 
|  | payment\$1method\$1types | List |  | 
|  | payment\$1method\$1configuration\$1details | Struct |  | 
|  | processing | Struct |  | 
|  | receipt\$1email | String |  | 
|  | review | String |  | 
|  | setup\$1future\$1usage | String |  | 
|  | shipping | Struct |  | 
|  | source | String |  | 
|  | statement\$1descriptor | String |  | 
|  | statement\$1descriptor\$1suffix | String |  | 
|  | status | String |  | 
|  | transfer\$1data | Struct |  | 
|  | transfer\$1group | String |  | 
| SetupIntents |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | application | String |  | 
|  | cancellation\$1reason | String |  | 
|  | client\$1secret | String |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | customer | String | = | 
|  | description | String |  | 
|  | flow\$1directions | List |  | 
|  | last\$1setup\$1error | Struct |  | 
|  | latest\$1attempt | String |  | 
|  | livemode | Boolean |  | 
|  | mandate | String |  | 
|  | metadata | Struct |  | 
|  | next\$1action | Struct |  | 
|  | on\$1behalf\$1of | String |  | 
|  | payment\$1method | String |  | 
|  | payment\$1method\$1options | Struct |  | 
|  | payment\$1method\$1types | List |  | 
|  | single\$1use\$1mandate | String |  | 
|  | status | String |  | 
|  | usage | String |  | 
|  | automatic\$1payment\$1methods | Struct |  | 
| Payouts |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer | =, <, > | 
|  | arrival\$1date | DateTime | =, >=, <=,<,> | 
|  | automatic | Boolean |  | 
|  | balance\$1transaction | String |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | description | String | = | 
|  | destination | String |  | 
|  | failure\$1balance\$1transaction | String |  | 
|  | failure\$1code | String |  | 
|  | failure\$1message | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | method | String |  | 
|  | original\$1payout | String |  | 
|  | reversed\$1by | String |  | 
|  | reconciliation\$1status | String |  | 
|  | source\$1type | String |  | 
|  | statement\$1descriptor | String |  | 
|  | status | String |  | 
|  | type | String |  | 
|  | application\$1fee | String |  | 
|  | application\$1fee\$1amount | Integer |  | 
| Refunds |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer |  | 
|  | balance\$1transaction | String |  | 
|  | charge | String | = | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | metadata | Struct |  | 
|  | destination\$1details | Struct |  | 
|  | payment\$1intent | String | = | 
|  | reason | String |  | 
|  | receipt\$1number | String |  | 
|  | source\$1transfer\$1reversal | String |  | 
|  | status | String |  | 
|  | transfer\$1reversal | String |  | 
| Products |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | attributes | List |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | default\$1price | String |  | 
|  | description | String |  | 
|  | images | List |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | name | String |  | 
|  | package\$1dimensions | Struct |  | 
|  | shippable | Boolean |  | 
|  | statement\$1descriptor | String |  | 
|  | tax\$1code | String |  | 
|  | type | String | = | 
|  | unit\$1label | String |  | 
|  | updated | DateTime |  | 
|  | url | String |  | 
|  | features | List |  | 
| Prices |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | billing\$1scheme | String |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String | = | 
|  | custom\$1unit\$1amount | Struct |  | 
|  | livemode | Boolean |  | 
|  | lookup\$1key | String |  | 
|  | metadata | Struct |  | 
|  | nickname | String |  | 
|  | product | String | = | 
|  | recurring | Struct |  | 
|  | tax\$1behavior | String |  | 
|  | tiers\$1mode | String |  | 
|  | transform\$1quantity | Struct |  | 
|  | type | String | = | 
|  | unit\$1amount | Integer |  | 
|  | unit\$1amount\$1decimal | String |  | 
| Coupons |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | amount\$1off | Integer |  | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String | = | 
|  | duration | String | = | 
|  | duration\$1in\$1months | Integer | =,<,> | 
|  | livemode | Boolean |  | 
|  | max\$1redemptions | Integer | =, <, > | 
|  | metadata | Struct |  | 
|  | name | String |  | 
|  | percent\$1off | Double | = | 
|  | redeem\$1by | DateTime | =, >=, <=, <, > | 
|  | times\$1redeemed | Integer |  | 
|  | valid | Boolean |  | 
| Promotion Codes |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | code | String | = | 
|  | coupon | Struct |  | 
|  | created | DateTime | =,>=,<=,<,> | 
|  | customer | String |  | 
|  | expires\$1at | DateTime |  | 
|  | livemode | Boolean |  | 
|  | max\$1redemptions | Integer |  | 
|  | metadata | Struct |  | 
|  | restrictions | Struct |  | 
|  | times\$1redeemed | Integer |  | 
| Tax Codes |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | description | String |  | 
|  | name | String |  | 
| Tax Rates |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | country | String |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | description | String |  | 
|  | display\$1name | String |  | 
|  | inclusive | Boolean | = | 
|  | jurisdiction | String |  | 
|  | jurisdiction\$1level | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | percentage | Double |  | 
|  | effective\$1percentage | Double |  | 
|  | state | String |  | 
|  | tax\$1type | String |  | 
| Shipping Rates |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | delivery\$1estimate | Struct |  | 
|  | display\$1name | String |  | 
|  | fixed\$1amount | Struct |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | tax\$1behavior | String |  | 
|  | tax\$1code | String |  | 
|  | type | String |  | 
| Sessions |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | after\$1expiration | Struct |  | 
|  | allow\$1promotion\$1codes | Boolean |  | 
|  | amount\$1subtotal | Integer |  | 
|  | amount\$1total | Integer |  | 
|  | automatic\$1tax | Struct |  | 
|  | billing\$1address\$1collection | String |  | 
|  | cancel\$1url | String |  | 
|  | client\$1reference\$1id | String |  | 
|  | consent | Struct |  | 
|  | consent\$1collection | Struct |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | currency | String |  | 
|  | custom\$1text | Struct |  | 
|  | customer | String |  | 
|  | customer\$1creation | String |  | 
|  | customer\$1details | Struct |  | 
|  | customer\$1email | String |  | 
|  | expires\$1at | DateTime |  | 
|  | invoice | String |  | 
|  | invoice\$1creation | Struct |  | 
|  | livemode | Boolean |  | 
|  | locale | String |  | 
|  | metadata | Struct |  | 
|  | mode | String |  | 
|  | payment\$1intent | String | = | 
|  | payment\$1link | String |  | 
|  | payment\$1method\$1collection | String |  | 
|  | payment\$1method\$1options | Struct |  | 
|  | payment\$1method\$1types | List |  | 
|  | payment\$1status | String |  | 
|  | phone\$1number\$1collection | Struct |  | 
|  | recovered\$1from | String |  | 
|  | setup\$1intent | String |  | 
|  | shipping\$1address\$1collection | Struct |  | 
|  | shipping\$1cost | Struct |  | 
|  | shipping\$1details | Struct |  | 
|  | shipping\$1options | List |  | 
|  | status | String |  | 
|  | submit\$1type | String |  | 
|  | subscription | String |  | 
|  | success\$1url | String |  | 
|  | tax\$1id\$1collection | Struct |  | 
|  | total\$1details | Struct |  | 
|  | url | String |  | 
|  | ui\$1mode | String |  | 
| Credit Notes |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | currency | String |  | 
|  | customer | String | = | 
|  | customer\$1balance\$1transaction | String |  | 
|  | discount\$1amount | Integer |  | 
|  | discount\$1amounts | List |  | 
|  | invoice | String | = | 
|  | lines | Struct |  | 
|  | livemode | Boolean |  | 
|  | memo | String |  | 
|  | metadata | Struct |  | 
|  | number | String |  | 
|  | out\$1of\$1band\$1amount | Integer |  | 
|  | pdf | String |  | 
|  | reason | String |  | 
|  | refund | String |  | 
|  | status | String |  | 
|  | subtotal | Integer |  | 
|  | subtotal\$1excluding\$1tax | Integer |  | 
|  | tax\$1amounts | List |  | 
|  | total | Integer |  | 
|  | total\$1excluding\$1tax | Integer |  | 
|  | type | String |  | 
|  | voided\$1at | DateTime |  | 
|  | amount\$1shipping | Integer |  | 
|  | effective\$1at | DateTime |  | 
|  | shipping\$1cost | Struct |  | 
| Customer |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | address | Struct |  | 
|  | balance | Integer |  | 
|  | created | DateTime |  | 
|  | currency | String | =, >=, <=, <, > | 
|  | default\$1source | String |  | 
|  | delinquent | Boolean | = | 
|  | description | String |  | 
|  | discount | Struct |  | 
|  | email | String | = | 
|  | invoice\$1prefix | String |  | 
|  | invoice\$1settings | Struct |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | name | String |  | 
|  | next\$1invoice\$1sequence | Integer |  | 
|  | phone | String |  | 
|  | preferred\$1locales | List |  | 
|  | shipping | Struct |  | 
|  | tax\$1exempt | String |  | 
|  | test\$1clock | String |  | 
| Invoices |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | account\$1country | String |  | 
|  | account\$1name | String |  | 
|  | account\$1tax\$1ids | List |  | 
|  | amount\$1due | Integer |  | 
|  | amount\$1paid | Integer |  | 
|  | amount\$1remaining | Integer |  | 
|  | application | String |  | 
|  | application\$1fee\$1amount | Integer |  | 
|  | attempt\$1count | Integer |  | 
|  | attempted | Boolean | = | 
|  | auto\$1advance | Boolean | = | 
|  | automatic\$1tax | Struct |  | 
|  | billing\$1reason | String |  | 
|  | charge | String |  | 
|  | collection\$1method | String | = | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | currency | String |  | 
|  | custom\$1fields | List |  | 
|  | customer | String | = | 
|  | customer\$1address | Struct |  | 
|  | customer\$1email | String |  | 
|  | customer\$1name | String |  | 
|  | customer\$1phone | String |  | 
|  | customer\$1shipping | Struct |  | 
|  | customer\$1tax\$1exempt | String |  | 
|  | customer\$1tax\$1ids | List |  | 
|  | default\$1payment\$1method | String |  | 
|  | default\$1source | String |  | 
|  | default\$1tax\$1rates | List |  | 
|  | description | String |  | 
|  | discount | Struct |  | 
|  | discounts | List |  | 
|  | due\$1date | DateTime | =, >=, <=, <, > | 
|  | ending\$1balance | Integer |  | 
|  | footer | String |  | 
|  | from\$1invoice | Struct |  | 
|  | hosted\$1invoice\$1url | String |  | 
|  | invoice\$1pdf | String |  | 
|  | last\$1finalization\$1error | Struct |  | 
|  | latest\$1revision | String |  | 
|  | lines | Struct |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | next\$1payment\$1attempt | DateTime |  | 
|  | number | String |  | 
|  | on\$1behalf\$1of | String |  | 
|  | paid | Boolean | = | 
|  | paid\$1out\$1of\$1band | Boolean |  | 
|  | payment\$1intent | String |  | 
|  | payment\$1settings | Struct |  | 
|  | period\$1end | DateTime | =, >=, <=, <, > | 
|  | period\$1start | DateTime | =, >=, <=, <, > | 
|  | post\$1payment\$1credit\$1notes\$1amount | Integer |  | 
|  | pre\$1payment\$1credit\$1notes\$1amount | Integer |  | 
|  | quote | String |  | 
|  | receipt\$1number | String |  | 
|  | rendering | Struct |  | 
|  | rendering\$1options | Struct |  | 
|  | starting\$1balance | Integer |  | 
|  | statement\$1descriptor | String |  | 
|  | status | String | = | 
|  | status\$1transitions | Struct |  | 
|  | subscription | String |  | 
|  | subscription\$1details | Struct |  | 
|  | subtotal | Integer | =, <, > | 
|  | subtotal\$1excluding\$1tax | Integer |  | 
|  | tax | Integer |  | 
|  | test\$1clock | String |  | 
|  | total | Integer | =, <, > | 
|  | total\$1discount\$1amounts | List |  | 
|  | total\$1excluding\$1tax | Integer |  | 
|  | total\$1tax\$1amounts | List |  | 
|  | transfer\$1data | Struct |  | 
|  | webhooks\$1delivered\$1at | DateTime |  | 
|  | automatically\$1finalizes\$1at | DateTime |  | 
|  | effective\$1at | DateTime |  | 
|  | issuer | Struct |  | 
| Invoice Items |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer | =, <, > | 
|  | currency | String |  | 
|  | customer | String | = | 
|  | date | DateTime |  | 
|  | description | String |  | 
|  | discountable | Boolean |  | 
|  | discounts | List |  | 
|  | invoice | String | = | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | period | Struct |  | 
|  | plan | Struct |  | 
|  | price | Struct |  | 
|  | proration | Boolean | = | 
|  | quantity | Integer |  | 
|  | subscription | String |  | 
|  | subscription\$1item | String |  | 
|  | tax\$1rates | List |  | 
|  | test\$1clock | String |  | 
|  | unit\$1amount | Integer |  | 
|  | unit\$1amount\$1decimal | String |  | 
| Plans |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | active | Boolean | = | 
|  | aggregate\$1usage | String |  | 
|  | amount | Integer |  | 
|  | amount\$1decimal | String |  | 
|  | billing\$1scheme | String |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | currency | String | = | 
|  | interval | String | = | 
|  | interval\$1count | Integer |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | nickname | String |  | 
|  | product | String | = | 
|  | tiers\$1mode | String |  | 
|  | transform\$1usage | Struct |  | 
|  | trial\$1period\$1days | Integer | =, <, > | 
|  | usage\$1type | String |  | 
|  | meter | String |  | 
| Quotes |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount\$1subtotal | Integer |  | 
|  | amount\$1total | Integer |  | 
|  | application | String |  | 
|  | application\$1fee\$1amount | Integer |  | 
|  | application\$1fee\$1percent | Double |  | 
|  | automatic\$1tax | Struct |  | 
|  | collection\$1method | String |  | 
|  | computed | Struct |  | 
|  | created | DateTime |  | 
|  | currency | String |  | 
|  | customer | String | = | 
|  | default\$1tax\$1rates | List |  | 
|  | description | String |  | 
|  | discounts | List |  | 
|  | expires\$1at | DateTime |  | 
|  | footer | String |  | 
|  | from\$1quote | Struct |  | 
|  | header | String |  | 
|  | invoice | String |  | 
|  | invoice\$1settings | Struct |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | number | String |  | 
|  | on\$1behalf\$1of | String |  | 
|  | status | String | = | 
|  | status\$1transitions | Struct |  | 
|  | subscription | String |  | 
|  | subscription\$1data | Struct |  | 
|  | subscription\$1schedule | String |  | 
|  | test\$1clock | String |  | 
|  | total\$1details | Struct |  | 
|  | transfer\$1data | Struct |  | 
| Subscriptions |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | application | String |  | 
|  | application\$1fee\$1percent | Double |  | 
|  | automatic\$1tax | Struct |  | 
|  | billing\$1cycle\$1anchor | DateTime |  | 
|  | billing\$1thresholds | Struct |  | 
|  | cancel\$1at | DateTime |  | 
|  | cancel\$1at\$1period\$1end | Boolean |  | 
|  | canceled\$1at | DateTime |  | 
|  | collection\$1method | String | = | 
|  | created | DateTime | =, >=, <=,<,> | 
|  | currency | String |  | 
|  | current\$1period\$1end | DateTime | =, >=, <= | 
|  | current\$1period\$1start | DateTime | =, >=, <= | 
|  | customer | String | = | 
|  | days\$1until\$1due | Integer |  | 
|  | default\$1payment\$1method | String |  | 
|  | default\$1source | String |  | 
|  | default\$1tax\$1rates | List |  | 
|  | description | String |  | 
|  | discount | Struct |  | 
|  | ended\$1at | DateTime |  | 
|  | items | Struct |  | 
|  | latest\$1invoice | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | next\$1pending\$1invoice\$1item\$1invoice | DateTime |  | 
|  | pause\$1collection | Struct |  | 
|  | payment\$1settings | Struct |  | 
|  | pending\$1invoice\$1item\$1interval | Struct |  | 
|  | pending\$1setup\$1intent | String |  | 
|  | pending\$1update | Struct |  | 
|  | plan | Struct |  | 
|  | quantity | Integer |  | 
|  | schedule | String |  | 
|  | start\$1date | DateTime |  | 
|  | status | String | = | 
|  | test\$1clock | String |  | 
|  | transfer\$1data | Struct |  | 
|  | trial\$1end | DateTime |  | 
|  | trial\$1start | DateTime |  | 
| Subscription Items |  |  |  | 
|  | Id | String |  | 
|  | object | String |  | 
|  | billing\$1thresholds | Struct |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | metadata | Struct |  | 
|  | plan | Struct |  | 
|  | price | Struct |  | 
|  | subscription | String |  | 
|  | tax\$1rates | List |  | 
|  | discounts | List |  | 
| Subscription Schedules |  |  |  | 
|  | object | String |  | 
|  | application | String |  | 
|  | canceled\$1at | DateTime |  | 
|  | completed\$1at | DateTime |  | 
|  | created | DateTime |  | 
|  | current\$1phase | Struct |  | 
|  | customer | String | = | 
|  | default\$1settings | Struct |  | 
|  | end\$1behavior | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | phases | List |  | 
|  | released\$1at | DateTime |  | 
|  | released\$1subscription | String |  | 
|  | renewal\$1interval | String |  | 
|  | status | String |  | 
|  | subscription | String |  | 
|  | test\$1clock | String |  | 
| Accounts |  |  |  | 
|  | details\$1submitted | Boolean |  | 
|  | tos\$1acceptance | Struct |  | 
|  | type | String |  | 
|  | metadata | Struct |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | default\$1currency | String |  | 
|  | capabilities | Struct |  | 
|  | charges\$1enabled | Boolean |  | 
|  | settings | Struct |  | 
|  | requirements | Struct |  | 
|  | payouts\$1enabled | Boolean |  | 
|  | future\$1requirements | Struct |  | 
|  | external\$1accounts | Struct |  | 
|  | controller | Struct |  | 
|  | country | String |  | 
|  | email | String |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | business\$1profile | Struct |  | 
|  | business\$1type | String |  | 
|  | company | Struct |  | 
| Application Fees |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | account | String |  | 
|  | amount | Integer | =, <, > | 
|  | amount\$1refunded | Integer | =, <, > | 
|  | application | String |  | 
|  | balance\$1transaction | String |  | 
|  | charge | String | = | 
|  | created | DateTime |  | 
|  | currency | String |  | 
|  | livemode | Boolean |  | 
|  | originating\$1transaction | String |  | 
|  | refunded | Boolean | = | 
|  | refunds | Struct |  | 
|  | fee\$1source | Struct |  | 
| Country Specs |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | default\$1currency | String |  | 
|  | supported\$1bank\$1account\$1currencies | Struct |  | 
|  | supported\$1payment\$1currencies | List |  | 
|  | supported\$1payment\$1methods | List |  | 
|  | supported\$1transfer\$1countries | List |  | 
|  | verification\$1fields | Struct |  | 
| Transfers |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | amount | Integer | =, <, > | 
|  | amount\$1reversed | Integer |  | 
|  | balance\$1transaction | String |  | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | currency | String | = | 
|  | description | String |  | 
|  | destination | String | = | 
|  | destination\$1payment | String |  | 
|  | livemode | Boolean |  | 
|  | metadata | Struct |  | 
|  | reversals | Struct |  | 
|  | reversed | Boolean |  | 
|  | source\$1transaction | String |  | 
|  | source\$1type | String |  | 
|  | transfer\$1group | String | = | 
| Early Fraud Warnings |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | actionable | Boolean |  | 
|  | charge | String | = | 
|  | created | DateTime | =, >=, <=, <, > | 
|  | fraud\$1type | String |  | 
|  | livemode | Boolean |  | 
|  | payment\$1intent | String | = | 
| Report Types |  |  |  | 
|  | id | String |  | 
|  | object | String |  | 
|  | data\$1available\$1end | DateTime |  | 
|  | data\$1available\$1start | DateTime |  | 
|  | default\$1columns | List |  | 
|  | livemode | Boolean |  | 
|  | name | String |  | 
|  | updated | DateTime |  | 
|  | version | Integer |  | 

 **Partitioning queries** 

 Additional spark options `PARTITION_FIELD`, `LOWER_BOUND`, `UPPER_BOUND`, `NUM_PARTITIONS` can be provided if you want to utilize concurrency in Spark. With these parameters, the original query would be split into `NUM_PARTITIONS` number of sub-queries that can be executed by spark tasks concurrently. 
+  `PARTITION_FIELD`: the name of the field to be used to partition query. 
+  `LOWER_BOUND`: an inclusive lower bound value of the chosen partition field. 

   For date, we accept the Spark date format used in Spark SQL queries. Example of valid value: `"2024-07-01T00:00:00.000Z"`. 
+  `UPPER_BOUND`: an exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`: number of partitions. 

 Entity wise partitioning field support details are captured in below table. 


| Entity Name | Partitioning Field | Data Type | 
| --- | --- | --- | 
| Balance Transactions | created | DateTime | 
| Charges | created | DateTime | 
| Disputes | created | DateTime | 
| File Links | created | DateTime | 
| PaymentIntents | created | DateTime | 
| SetupIntents | created | DateTime | 
| Payouts | created | DateTime | 
| Refunds | created | DateTime | 
| Products | created | DateTime | 
| Prices | created | DateTime | 
| Coupons | created | DateTime | 
| Promotion Codes | created | DateTime | 
| Tax Rates | created | DateTime | 
| Shipping Rates | created | DateTime | 
| Sessions | created | DateTime | 
| Credit Notes | created | DateTime | 
| Customer | created | DateTime | 
| Invoices | created | DateTime | 
| Plans | created | DateTime | 
| Subscriptions | created | DateTime | 
| Subscription Schedules | created | DateTime | 
| Accounts | created | DateTime | 
| Application Fees | created | DateTime | 
| Transfers | created | DateTime | 
| Early Fraud Warnings | created | DateTime | 

 **Example** 

```
stripe_read = glueContext.create_dynamic_frame.from_options(
    connection_type="stripe",
    connection_options={
        "connectionName": "connectionName",
        "ENTITY_NAME": "coupons",
        "API_VERSION": "v1",
        "PARTITION_FIELD": "created"
        "LOWER_BOUND": "2024-05-01T20:55:02.000Z"
        "UPPER_BOUND": "2024-07-11T20:55:02.000Z"
        "NUM_PARTITIONS": "10"
    }
)
```

# Stripe connection options
<a name="stripe-connection-options"></a>

The following are connection options for Stripe:
+  `ENTITY_NAME`(String) - (Required) Used for Read/Write. The name of your Object in Stripe. 
+  `API_VERSION`(String) - (Required) Used for Read/Write. Stripe Rest API version you want to use. Example: v1. 
+  `SELECTED_FIELDS`(List<String>) - Default: empty(SELECT \$1). Used for Read. Columns you want to select for the object. 
+  `FILTER_PREDICATE`(String) - Default: empty. Used for Read. It should be in the Spark SQL format. 
+  `QUERY`(String) - Default: empty. Used for Read. Full Spark SQL query. 
+  `PARTITION_FIELD`(String) - Used for Read. Field to be used to partition query. 
+  `LOWER_BOUND`(String)- Used for Read. An inclusive lower bound value of the chosen partition field. 
+  `UPPER_BOUND`(String) - Used for Read. An exclusive upper bound value of the chosen partition field. 
+  `NUM_PARTITIONS`(Integer) - Default: 1. Used for Read. Number of partitions for read. 

# Limitations
<a name="stripe-limitations"></a>

The following are limitations for the Stripe connector:
+  Only Field Based Partitioning supported by connector. 
+  Record Based Partitioning not supported by connector, no provision to retrieve the total count of records. 
+  Primary key datatype is String, so Id Based Partitioning does not support by connector. 

# Creating a new Stripe account and configuring the client app
<a name="stripe-new-account-creation"></a>

**Creating a Stripe account**

1. Choose on the link **https://dashboard.stripe.com/register**.

1. Enter your Email, Full name, Password & choose **Create Account**.

1. After login with account, verify the account by choosing **Open Gmail**.

1. Verify the account by clicking on the verification link received on email.

1. After clicking on verify email address, it will redirect to another page

1. After clicking on **Activate payments** to activate the account, it will redirect to Activate payments (**https://dashboard.stripe.com/welcome**) page and make sure to fill all your valid details and after that choose **Continue** button.



**Creating a Slack developer app**

1. Log in to [Stripe](https://dashboard.stripe.com/login).

1. Choose **Developers** as displayed on extreme top of the picture below.

1. Choose **API keys** under Developers.

1. Choose **Reveal test key** to get the API keys.