## Create a Source Use `stripe.createSource` to convert payment information collected by elements into a [Source](/api.md#sources) object that you safely pass to your server to use in an API call. See the [Sources documentation](/sources.md) for more information about sources. This method returns a `Promise` which resolves with a result object. This object has either: * `result.source`: a [Source](/api#sources) was created successfully. * `result.error`: there was an error. This includes client-side validation errors. Refer to the [API reference](/api/errors) for all possible errors. **Syntax:** `stripe.createSource(...)` - `element` (object) **required** The [Element](/js/element.md) containing payment information. If applicable, the `Element` pulls data from other elements you’ve created on the same [Elements](#elements_create) instance. - `sourceData` (object) **required** A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected. See the [Sources API](/api.md#create_source) reference for details. ### Create a Source ```js stripe .createSource(ibanElement, { type: 'sepa_debit', currency: 'eur', owner: { name: 'Jenny Rosen', }, }) .then(function(result) { // Handle result.error or result.source }); ``` ```es_next const {source, error} = await stripe.createSource( ibanElement, { type: 'sepa_debit', currency: 'eur', owner: { name: 'Jenny Rosen', }, }, ); ```