### Stripe Setup Intent Resource Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Examples of the `stripeSetupIntent` resource structure returned by the Sharetribe API. Shows both the raw JSON and a JavaScript object representation of the resource, including `id`, `type`, `stripeSetupIntentId`, and `clientSecret`.
```JSON
{
"data": {
"id": "5d2db7ba-f902-426b-a0a2-a94b3886a825",
"type": "stripeSetupIntent",
"attributes": {
"stripeSetupIntentId": "seti_1Ewp1XXXXXXGQQ9xoFZb4Ypn",
"clientSecret": "seti_1Ewp1SLSea1GQQ9xoFZb4Ypn_secret_foo"
}
}
}
```
```JavaScript
{
data: {
id: UUID {uuid: "5d2db7ba-f902-426b-a0a2-a94b3886a825"},
type: "stripeSetupIntent",
attributes: {
stripeSetupIntentId: "seti_1Ewp1XXXXXXGQQ9xoFZb4Ypn",
clientSecret: "seti_1Ewp1SLSea1GQQ9xoFZb4Ypn_secret_foo"
}
}
}
```
--------------------------------
### Stripe Setup Intent Creation Example Responses
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the expected JSON response structure after successfully creating a Stripe Setup Intent, showing both a raw JSON format and a JavaScript object representation of the response data, including the `stripeSetupIntentId` and `clientSecret`.
```json
{
"data": {
"id": "5d2db7ba-f902-426b-a0a2-a94b3886a825",
"type": "stripeSetupIntent",
"attributes": {
"stripeSetupIntentId": "seti_1Ewp1XXXXXXGQQ9xoFZb4Ypn",
"clientSecret": "seti_1Ewp1SLSea1GQQ9xoFZb4Ypn_secret_foo"
}
}
}
```
```javascript
// res.data
{
data: {
id: UUID {uuid: "5d2db7ba-f902-426b-a0a2-a94b3886a825"},
type: "stripeSetupIntent",
attributes: {
stripeSetupIntentId: "seti_1Ewp1XXXXXXGQQ9xoFZb4Ypn",
clientSecret: "seti_1Ewp1SLSea1GQQ9xoFZb4Ypn_secret_foo"
}
}
}
```
--------------------------------
### Query Bookings API Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Demonstrates how to initiate a query for bookings using both a direct cURL HTTP request and the Sharetribe JavaScript SDK. Both examples show how to specify the listing ID and the desired start and end date range for the query.
```bash
$ curl 'https://flex-api.sharetribe.com/v1/api/bookings/query?listingId=c6ff7190-bdf7-47a0-8a2b-e3136e74334f&start=2025-11-27T00:00:00.000Z&end=2025-12-30T00:00:00.000Z' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```javascript
sdk.bookings.query({
listingId: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f"),
start: new Date("2025-11-27T00:00:00.000Z"),
end: new Date("2025-12-30T00:00:00.000Z")
}).then(res => {
// res.data contains the response data
});
```
--------------------------------
### Example: Transition Transaction Request (Incomplete)
Source: https://www.sharetribe.com/api-reference/marketplace
An incomplete example of a request for transitioning a transaction, specifically noting an assumption of a process with daily booking. This snippet serves as a placeholder for a more complete code example.
```bash
# Example transition assiming a process with daily booking
```
--------------------------------
### cURL Example: Query Own Listings API
Source: https://www.sharetribe.com/api-reference/marketplace
A command-line example using cURL to make an authenticated GET request to the Sharetribe API for querying own listings. Requires an `ACCESS_TOKEN` for authorization.
```bash
$ curl 'https://flex-api.sharetribe.com/v1/api/own_listings/query' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Initiate Transaction via Sharetribe JavaScript SDK
Source: https://www.sharetribe.com/api-reference/marketplace
This JavaScript snippet illustrates how to use the Sharetribe SDK's `transactions.initiate` method to start a new transaction. It passes an object containing the process alias, transition, and booking parameters, similar to the cURL example, and includes an `expand` option for the response. The `.then()` block shows how to handle the successful response.
```javascript
sdk.transactions.initiate({
processAlias: "default-booking/release-1",
transition: "transition/request",
params: {
listingId: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
bookingStart: new Date("2025-04-20T00:00:00.000Z"),
bookingEnd: new Date("2025-04-22T00:00:00.000Z"),
seats: 2,
cardToken: "tok_mastercard"
}
}, {
expand: true
}).then(res => {
// res.data contains the response data
});
```
--------------------------------
### Query Availability Exceptions API Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Demonstrates how to query availability exceptions for a specific listing and time range using the `GET /v1/api/availability_exceptions/query` endpoint. Examples are provided for both cURL and the Sharetribe SDK, showing how to pass `listingId`, `start`, and `end` parameters.
```cURL
$ curl 'https://flex-api.sharetribe.com/v1/api/availability_exceptions/query?listingId=c6ff7190-bdf7-47a0-8a2b-e3136e74334f&start=2025-11-27T00:00:00.000Z&end=2025-12-30T00:00:00.000Z' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```JavaScript
sdk.availabilityExceptions.query({
listingId: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f"),
start: new Date("2025-11-27T00:00:00.000Z"),
end: new Date("2025-12-30T00:00:00.000Z")
}).then(res => {
// res.data contains the response data
});
```
--------------------------------
### Create Stripe Account Link Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
This snippet provides examples for initiating the creation of a Stripe Account Link. It includes a cURL command for direct HTTP requests and a JavaScript SDK example for programmatic integration, both sending necessary parameters like success/failure URLs and collection options.
```shell
$ curl -X POST 'https://flex-api.sharetribe.com/v1/api/stripe_account_links/create'\
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{
"failureURL": "https://www.example.com/failure",
"successURL": "https://www.example.com/success",
"type": "custom_account_verification",
"collectionOptions": { "fields": "currently_due", "future_requirements": "omit" },
}'
```
```javascript
sdk.stripeAccountLinks.create({
failureURL: "https://www.example.com/failure",
successURL: "https://www.example.com/success",
type: "custom_account_verification",
collectionOptions: { fields: "currently_due", future_requirements: "omit" },
}).then(res => {
// res.data
});
```
--------------------------------
### Retrieve Marketplace Details API Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Demonstrates how to fetch the public details of the marketplace using the `GET /v1/api/marketplace/show` endpoint. Examples are provided for both cURL and the Sharetribe JavaScript SDK, requiring an `ACCESS_TOKEN` for authorization.
```APIDOC
HTTP Request: GET /v1/api/marketplace/show
```
```cURL
$ curl 'https://flex-api.sharetribe.com/v1/api/marketplace/show' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```JavaScript
sdk.marketplace.show().then(res => {
// res.data contains the response data
});
```
--------------------------------
### Show Transaction API Endpoint and Examples
Source: https://www.sharetribe.com/api-reference/integration
Documentation for the 'Show transaction' API endpoint, including HTTP request details, cURL and JavaScript SDK examples for making the request, example JSON and JavaScript response structures, and available query parameters.
```APIDOC
GET /v1/integration_api/transactions/show
```
```bash
$ curl 'https://flex-integ-api.sharetribe.com/v1/integration_api/transactions/show?id=ef98e897-5b81-49a5-aca6-01d9759df075' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```javascript
integrationSdk.transactions.show({
id: new UUID("ef98e897-5b81-49a5-aca6-01d9759df075")
}).then(res => {
// res.data contains the response data
});
```
```json
{
"data": {
"id": "ef98e897-5b81-49a5-aca6-01d9759df075",
"type": "transaction",
"attributes": {
"createdAt": "2025-03-27T12:30:02.000Z",
"processName": "default-booking",
"processVersion": 3,
"lastTransition": "transition/request",
"lastTransitionedAt": "2025-03-27T12:30:03.100Z",
"state": "state/pending",
"payinTotal": {
"amount": 6360,
"currency": "USD"
},
"payoutTotal": {
"amount": 5724,
"currency": "USD"
},
"lineItems": [
{
"code": "line-item/day",
"quantity": 4,
"units": 2,
"seats": 2,
"reversal": false,
"unitPrice": {
"amount": 1590,
"currency": "USD"
},
"lineTotal": {
"amount": 6360,
"currency": "USD"
},
"includeFor": [
"customer",
"provider"
]
},
{
"code": "line-item/provider-commission",
"percentage": -10.0,
"reversal": false,
"unitPrice": {
"amount": 6360,
"currency": "USD"
},
"lineTotal": {
"amount": -636,
"currency": "USD"
},
"includeFor": [
"provider"
]
}
],
"protectedData": {},
"transitions": [
{
"transition": "transition/request",
"createdAt": "2025-03-27T12:30:03.100Z",
"by": "customer"
}
]
}
}
}
```
```javascript
// res.data
{
data: {
id: UUID {uuid: "ef98e897-5b81-49a5-aca6-01d9759df075"},
type: "transaction",
attributes: {
createdAt: new Date("2025-03-27T12:30:02.000Z"),
processName: "default-booking",
processVersion: 3,
lastTransition: "transition/request",
lastTransitionedAt: new Date("2025-03-27T12:30:03.100Z"),
state: "state/pending",
payinTotal: {
amount: 6360,
currency: "USD"
},
payoutTotal: {
amount: 5724,
currency: "USD"
},
lineItems: [
{
code: "line-item/day",
quantity: 4,
unit: 2,
seats: 2,
reversal: false,
unitPrice: {
amount: 1590,
currency: "USD"
},
lineTotal: {
amount: 6360,
currency: "USD"
},
includeFor: [
"customer",
"provider"
]
},
{
code: "line-item/provider-commission",
percentage: -10.0,
reversal: false,
unitPrice: {
amount: 6360,
currency: "USD"
},
lineTotal: {
amount: -636,
currency: "USD"
},
includeFor: [
"provider"
]
}
],
protectedData: {},
transitions: [
{
transition: "transition/request",
createdAt: new Date("2025-03-27T12:30:03.100Z"),
by: "customer"
}
]
}
}
}
```
```APIDOC
Query parameters for GET /v1/integration_api/transactions/show:
id:
type: string
description: The ID of the transaction.
```
--------------------------------
### Example Requests to Open a Listing
Source: https://www.sharetribe.com/api-reference/integration
Demonstrates how to open a listing using both a cURL command and the Sharetribe Integration SDK. Both examples show how to pass the listing ID and utilize the `expand` parameter to retrieve the full resource details in the response.
```bash
$ curl -X POST 'https://flex-integ-api.sharetribe.com/v1/integration_api/listings/open?expand=true' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"}'
```
```javascript
integrationSdk.listings.open({
id: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f")
}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### Update Listing Request Examples
Source: https://www.sharetribe.com/api-reference/integration
Provides examples for updating a listing using both a direct cURL command and the Sharetribe Integration SDK, demonstrating how to pass listing data and parameters.
```shell
$ curl -X POST 'https://flex-integ-api.sharetribe.com/v1/integration_api/listings/update?expand=true,include=images' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"description": "Brand new track bike.",
"privateData": {
"externalServiceId": "new-service-id-4324"
},
"publicData": {
"address": {"country": "USA"}
"category": "track",
"rules": null
},
"metadata": {
"verified": true,
"promoted": false,
"rating": 4
},
"images": [
"f8afadaa-dd4f-4536-b9a7-b405834dc25d"
]
}'
```
```javascript
integrationSdk.listings.update({
id: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f"),
description: "Brand new track bike.",
privateData: {
externalServiceId: "new-service-id-4324"
},
publicData: {
address: {
country: "USA"
},
category: "track",
rules: null
},
metadata: {
verified: true,
promoted: false,
rating: 4
},
images: [
new UUID("f8afadaa-dd4f-4536-b9a7-b405834dc25d")
]
}, {
expand: true,
include: ["images"]
}).then(res => {
// res.data
});
```
--------------------------------
### Example: Query Availability Exceptions with cURL
Source: https://www.sharetribe.com/api-reference/integration
Demonstrates how to query availability exceptions for a specific listing and time range using a direct HTTP GET request with `curl`.
```bash
$ curl 'https://flex-integ-api.sharetribe.com/v1/integration_api/availability_exceptions/query?listingId=c6ff7190-bdf7-47a0-8a2b-e3136e74334f&start=2025-11-27T00:00:00.000Z&end=2025-12-30T00:00:00.000Z' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Upload Image to Sharetribe API Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Provides practical examples for uploading images to the Sharetribe API, demonstrating both a cURL command for command-line usage and a JavaScript SDK snippet for client-side integration. Both examples show how to send image data and handle authentication.
```shell
# Upload portrait.jpg local file
$ curl -X POST 'https://flex-api.sharetribe.com/v1/api/images/upload' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-F "image=@portrait.jpg"
```
```javascript
// file is e.g. the value of an HTML element.
var file = document.getElementById('myFile').files[0];
sdk.images.upload({
image: file
}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### HTTP Request and cURL Example for Multiple Assets by Version
Source: https://www.sharetribe.com/api-reference/asset-delivery-api
Details the HTTP GET endpoint for retrieving multiple assets from the Sharetribe API by version, along with cURL examples demonstrating how to construct and execute these requests, including the use of path prefixes.
```APIDOC
GET /v1/assets/pub/[CLIENT_ID]/v/[VERSION]/[PATH_PREFIX/]?assets=ASSET1[,ASSET2,...]
```
```bash
$ curl https://cdn.st-api.com/v1/assets/pub/CLIENT_ID/v/abcd/?assets=example/asset1.json,example/asset2.json
# or using a path prefix
$ curl https://cdn.st-api.com/v1/assets/pub/CLIENT_ID/v/abcd/example/?assets=asset1.json,asset2.json
```
--------------------------------
### Reviews Resource Example Format
Source: https://www.sharetribe.com/api-reference/integration
Provides example JSON and JavaScript object representations of a `review` resource. This illustrates its typical structure and attributes, including ID, type, state, rating, content, creation timestamp, and deletion status.
```JSON
{
"data": {
"id": "81a0170a-ecc2-4fe1-9aae-e86226023717",
"type": "review",
"attributes": {
"type": "ofProvider",
"state": "public",
"rating": 5,
"content": "The bike was awesome and everything went smoothly.\n\nThanks!",
"createdAt": "2025-04-25T11:10:14.123Z",
"deleted": false
}
}
}
```
```JavaScript
{
data: {
id: UUID {uuid: "81a0170a-ecc2-4fe1-9aae-e86226023717"},
type: "review",
attributes: {
"type": "ofProvider",
"state": "public",
"rating": 5,
"content": "The bike was awesome and everything went smoothly.\n\nThanks!",
"createdAt": new Date("2025-04-25T11:10:14.123Z"),
"deleted": false
}
}
}
```
--------------------------------
### Example Requests to Close a Listing
Source: https://www.sharetribe.com/api-reference/integration
Provides practical examples for initiating a listing closure. This includes a cURL command for direct HTTP interaction and a JavaScript SDK call for programmatic integration, both demonstrating how to pass the listing ID and expand parameter.
```curl
$ curl -X POST 'https://flex-integ-api.sharetribe.com/v1/integration_api/listings/close?expand=true' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"}'
```
```javascript
integrationSdk.listings.close({
id: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f")
}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### Sharetribe Marketplace API Resource Definition and Examples
Source: https://www.sharetribe.com/api-reference/integration
Defines the structure and provides examples for the `marketplace` API resource, which represents public marketplace data. Includes attribute descriptions and JSON/JavaScript object examples for the resource format.
```APIDOC
API prefix: /v1/integration_api/marketplace/
marketplace resource format:
name: (string) The marketplace name.
description: (string) DEPRECATED: Not in use anymore. New marketplaces will always have null value. The marketplace description.
```
```JSON
{
"data": {
"id": "16c6a4b8-88ee-429b-835a-6725206cd08c",
"type": "marketplace",
"attributes": {
"name": "My Marketplace",
"description": "My marketplace"
}
}
}
```
```JavaScript
{
data: {
id: UUID {uuid: "16c6a4b8-88ee-429b-835a-6725206cd08c"},
type: "marketplace",
attributes: {
name: "My Marketplace",
description: "My marketplace"
}
}
}
```
--------------------------------
### Sharetribe Show Marketplace API Response Examples
Source: https://www.sharetribe.com/api-reference/integration
Provides example responses for the `marketplace/show` API call, illustrating the data structure received when successfully retrieving marketplace details in both JSON and JavaScript object formats.
```JSON
{
"data": {
"id": "16c6a4b8-88ee-429b-835a-6725206cd08c",
"type": "marketplace",
"attributes": {
"name": "My Marketplace",
"description": "My marketplace"
}
}
}
```
```JavaScript
// res.data
{
data: {
id: UUID {uuid: "16c6a4b8-88ee-429b-835a-6725206cd08c"},
type: "marketplace",
attributes: {
name: "My Marketplace",
description: "My marketplace"
}
}
}
```
--------------------------------
### Example: Query Users via Sharetribe Integration SDK (JavaScript)
Source: https://www.sharetribe.com/api-reference/integration
Illustrates how to programmatically query users using the Sharetribe Integration SDK in JavaScript. The example shows calling the 'users.query()' method and handling the asynchronous response to access the returned data.
```JavaScript
var userId = new UUID("3c073fae-6172-4e75-8b92-f560d58cd47c");
integrationSdk.users.query().then(res => {
// res.data contains the response data
});
```
--------------------------------
### Update Sharetribe Listing: cURL and JavaScript SDK Request Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Provides practical examples for updating a listing's details using both a direct cURL command and the Sharetribe JavaScript SDK. Both examples demonstrate how to pass the listing ID, description, private and public data, and image references to the API.
```curl
$ curl -X POST 'https://flex-api.sharetribe.com/v1/api/own_listings/update?expand=true,include=images' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"description": "Brand new track bike.",
"privateData": {
"externalServiceId": "new-service-id-4324"
},
"publicData": {
"address": {"country": "USA"}
"category": "track",
"rules": null
},
"images": [
"f8afadaa-dd4f-4536-b9a7-b405834dc25d"
]
}'
```
```javascript
sdk.ownListings.update({
id: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f"),
description: "Brand new track bike.",
privateData: {
externalServiceId: "new-service-id-4324"
},
publicData: {
address: {
country: "USA"
}
category: "track",
rules: null
},
images: [
new UUID("f8afadaa-dd4f-4536-b9a7-b405834dc25d")
]
}, {
expand: true,
include: ["images"]
}).then(res => {
// res.data
});
```
--------------------------------
### Stock Reservation Resource Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Provides example data structures for a `stockReservation` resource, including a raw JSON format and an SDK-parsed JavaScript object representation, showing its ID, type, quantity, and state.
```json
{
"data": {
"id": "2b78155f-fba6-491e-b842-d83d23ea657e",
"type": "stockReservation",
"attributes": {
"quantity": 2,
"state": "pending"
}
}
}
```
```javascript
{
data: {
id: UUID {uuid: "2b78155f-fba6-491e-b842-d83d23ea657e"},
type: "stockReservation",
attributes: {
quantity: 2,
state: "pending"
}
}
}
```
--------------------------------
### Stripe Customer Resource Example Data
Source: https://www.sharetribe.com/api-reference/marketplace
Provides example data for the `stripeCustomer` resource, demonstrating its structure with `id`, `type`, and `stripeCustomerId` attribute in both JSON and JavaScript object formats.
```json
{
"data": {
"id": "5d08c886-8016-4e84-aef7-2feabf5a97bf",
"type": "stripeCustomer",
"attributes": {
"stripeCustomerId": "cus_FHDmFZScwuoEvY"
}
}
}
```
```javascript
{
data: {
id: UUID {uuid: "5d08c886-8016-4e84-aef7-2feabf5a97bf"},
type: "stripeCustomer",
attributes: {
stripeCustomerId: "cus_FHDmFZScwuoEvY"
}
}
}
```
--------------------------------
### Sharetribe API: Stock Resource Example (JSON)
Source: https://www.sharetribe.com/api-reference/marketplace
An example JSON representation of the 'stock' API resource, showing its `id`, `type`, and `attributes` including `quantity`. This resource provides information about the available stock of a listing.
```JSON
{
"data": {
"id": "22e9df61-a655-4491-bdfc-494e95072f58",
"type": "stock",
"attributes": {
"quantity": 10
}
}
}
```
```JSON
{
data: {
id: UUID {uuid: "22e9df61-a655-4491-bdfc-494e95072f58"},
type: "stock",
attributes: {
quantity: 10
}
}
}
```
--------------------------------
### Query Stock Adjustments API Request Examples (cURL, SDK)
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates how to make a GET request to the `/v1/api/stock_adjustments/query` endpoint. Examples include a direct cURL command for an HTTP request and a JavaScript SDK call, both demonstrating how to filter stock adjustments by `listingId` and a specific time range (`start` and `end` timestamps).
```curl
$ curl 'https://flex-api.sharetribe.com/v1/api/stock_adjustments/query?listingId=c6ff7190-bdf7-47a0-8a2b-e3136e74334f&start=2021-09-07T00:00:00.000Z&end=2021-09-10T00:00:00.000Z' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```javascript
sdk.stockAdjustments.query({
listingId: new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f"),
start: new Date("2021-09-07T00:00:00.000Z"),
end: new Date("2021-09-10T00:00:00.000Z")
}).then(res => {
// res.data contains the response data
});
```
--------------------------------
### Example JSON Resource for Availability Exception
Source: https://www.sharetribe.com/api-reference/integration
Provides an example of the JSON structure for an `availabilityException` resource, detailing its ID, type, and attributes such as the number of seats, and the start and end dates of the exception.
```json
{
"data": {
"id": "34cf5423-04ee-42c7-8786-2e206ef34a9e",
"type": "availabilityException",
"attributes": {
"seats": 1,
"start": "2025-11-26T00:00:00.000Z",
"end": "2025-11-28T00:00:00.000Z"
}
}
}
```
--------------------------------
### Create Stripe Setup Intent API Call
Source: https://www.sharetribe.com/api-reference/marketplace
Demonstrates how to initiate the creation of a Stripe Setup Intent via the Sharetribe API using both a cURL command for direct HTTP request and a JavaScript SDK call. This endpoint requires an authenticated user access token and supports the `expand` parameter to retrieve the full resource.
```curl
$ curl -X POST 'https://flex-api.sharetribe.com/v1/api/stripe_setup_intents/create?expand=true' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```javascript
sdk.stripeSetupIntents.create({}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### API Documentation: Create Stripe Setup Intents Endpoint
Source: https://www.sharetribe.com/api-reference/marketplace
Detailed API documentation for the `POST /v1/api/stripe_setup_intents/create` endpoint. This section describes its purpose, authentication requirements, supported parameters, and how it facilitates creating Stripe PaymentMethods in an SCA-compatible way.
```APIDOC
Endpoint: POST /v1/api/stripe_setup_intents/create
Description: Create a new Stripe SetupIntent. The client can then use the SetupIntent to create a Stripe PaymentMethod in an SCA-compatible way using Stripe.js SDK.
Authentication: Requires authenticated user access token.
Body Parameters: None required.
Query Parameters:
expand: boolean (Optional) - If true, returns the full resource (with attributes) instead of just a reference.
```
--------------------------------
### Initialize Sharetribe Flex SDK in JavaScript
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the process of creating an instance of the Sharetribe Flex SDK in JavaScript. This setup requires a client ID and the base URL to enable subsequent API interactions.
```javascript
const sharetribeSdk = require('sharetribe-flex-sdk');
const sdk = sharetribeSdk.createInstance({
clientId: '',
baseUrl: ''
});
```
--------------------------------
### Curl Example: Get Authentication Token Details
Source: https://www.sharetribe.com/api-reference/authentication
Demonstrates how to make an HTTP GET request to the `/v1/auth/token` endpoint using `curl`. It shows the required `Authorization` header with a bearer token as input, and expects a JSON response containing token details.
```curl
$ curl -X GET 'https://flex-api.sharetribe.com/v1/auth/token'\
-H 'Accept: application/json' \
-H 'Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtYXJrZXRwbGFjZS1pZCI6IjE2YzZhNGI4LTg4ZWUtNDI5Yi04MzVhLTY3MjUyMDZjZDA4YyIsImNsaWVudC1pZCI6IjA4ZWM2OWY2LWQzN2UtNDE0ZC04M2ViLTMyNGU5NGFmZGRmMCIsInRlbmFuY3ktaWQiOiIxNmM2YTRiOC04OGVlLTQyOWItODM1YS02NzI1MjA2Y2QwOGMiLCJzY29wZSI6InVzZXIiLCJleHAiOjE1MjE0NDk0MTMsInVzZXItaWQiOiIzYzA3M2ZhZS02MTcyLTRlNzUtOGI5Mi1mNTYwZDU4Y2Q0N2MiLCJ1c2VyLXJvbGVzIjpbInVzZXIucm9sZS9wcm92aWRlciIsInVzZXIucm9sZS9jdXN0b21lciJdfQ.UQtQ9dUbyiM0x0DSKbzqBU39Ei_9UK4vfubKcIB1aS4'
```
--------------------------------
### Availability Exception Resource Example JSON
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the structure of an `availabilityException` resource, showing its ID, type, and attributes such as `seats`, `start`, and `end` times. This example is provided in both standard JSON and a JavaScript object literal format for clarity.
```JSON
{
"data": {
"id": "34cf5423-04ee-42c7-8786-2e206ef34a9e",
"type": "availabilityException",
"attributes": {
"seats": 1,
"start": "2025-11-26T00:00:00.000Z",
"end": "2025-11-28T00:00:00.000Z"
}
}
}
```
```JavaScript
{
data: {
id: UUID {uuid: "34cf5423-04ee-42c7-8786-2e206ef34a9e"},
type: "availabilityException",
attributes: {
seats: 1,
start: new Date("2025-11-26T00:00:00.000Z"),
end: new Date("2025-11-28T00:00:00.000Z")
}
}
}
```
--------------------------------
### Fetch User Details via HTTP GET with curl
Source: https://www.sharetribe.com/api-reference/integration
Illustrates how to make an HTTP GET request to the Sharetribe Integration API to retrieve user details. This snippet includes the API endpoint definition and a `curl` command example demonstrating how to call it with an ID and authentication.
```HTTP
GET /v1/integration_api/users/show
```
```bash
$ curl 'https://flex-integ-api.sharetribe.com/v1/integration_api/users/show?id=3c073fae-6172-4e75-8b92-f560d58cd47c' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Retrieve Multiple Assets by Latest Alias via HTTP GET
Source: https://www.sharetribe.com/api-reference/asset-delivery-api
Describes the HTTP GET endpoint for fetching multiple assets simultaneously. Assets are specified as a comma-separated list in the `assets` query parameter, optionally with a `PATH_PREFIX`. A cURL example demonstrates this request.
```APIDOC
GET /v1/assets/pub/[CLIENT_ID]/a/latest/[PATH_PREFIX/]?assets=ASSET1[,ASSET2,...]
```
```bash
$ curl https://cdn.st-api.com/v1/assets/pub/CLIENT_ID/a/latest/?assets=example/asset1.json,example/asset2.json
```
--------------------------------
### Stock Adjustment Creation Response Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Provides example response structures after successfully creating a stock adjustment. Includes a raw JSON response and an SDK-parsed JavaScript object representation, detailing the adjustment, listing, and current stock.
```json
{
"data": {
"id": "daec15c8-506f-40c3-828f-a1f064c06592",
"type": "stockAdjustment",
"attributes": {
"at": "2021-09-07T10:00:00.000Z",
"quantity": 2
},
"relationships": {
"ownListing": {
"data": {"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f", "type": "ownListing"}
}
}
},
"included": [
{
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"type": "ownListing",
"attributes": {...},
"relationships": {
"currentStock": {
"data": {"id": "22e9df61-a655-4491-bdfc-494e95072f58", "type": "stock"}
}
}
},
{
"id": "22e9df61-a655-4491-bdfc-494e95072f58",
"type": "stock",
"attributes": {
"quantity": 10
}
}
]
}
```
```javascript
// res.data
{
data: {
id: UUID {uuid: "daec15c8-506f-40c3-828f-a1f064c06592"},
type: "stockAdjustment",
attributes: {
at: new Date("2021-09-07T10:00:00.000Z"),
quantity: 2
},
relationships: {
ownListing: {
data: {id: UUID {uuid: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"}, type: "ownListing"}
}
}
},
included: [
{
id: UUID {uuid: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"},
type: "ownListing",
attributes: {...},
relationships: {
currentStock: {
data: {id: UUID {uuid: "22e9df61-a655-4491-bdfc-494e95072f58"}, type: "stock"}
}
}
},
{
id: UUID {uuid: "22e9df61-a655-4491-bdfc-494e95072f58"},
type: "stock",
attributes: {
quantity: 10
}
}
]
}
```
--------------------------------
### Show a Specific Listing by ID
Source: https://www.sharetribe.com/api-reference/marketplace
Demonstrates how to retrieve the public details of a specific listing using its unique identifier. This includes the HTTP GET request specification, a cURL command example, a JavaScript SDK usage example, and the expected JSON response structures.
```APIDOC
HTTP request:
GET /v1/api/listings/show
Query parameters:
id: The ID of the listing.
```
```curl
$ curl 'https://flex-api.sharetribe.com/v1/api/listings/show?id=c6ff7190-bdf7-47a0-8a2b-e3136e74334f' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
```javascript
var listingId = new UUID("c6ff7190-bdf7-47a0-8a2b-e3136e74334f");
sdk.listings.show({id: listingId}).then(res => {
// res.data contains the response data
});
```
```json
{
"data": {
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"type": "listing",
"attributes": {
"description": "7-speed Hybrid",
"deleted": false,
"geolocation": {
"lat": 40.64542,
"lng": -74.08508
},
"createdAt": "2025-03-23T08:40:24.443Z",
"state": "published",
"title": "Peugeot eT101",
"availabilityPlan": {
"type": "availability-plan/day"
},
"publicData": {
"address": {
"city": "New York",
"country": "USA",
"state": "NY",
"street": "230 Hamilton Ave"
},
"category": "road",
"gears": 22,
"rules": "This is a nice, bike! Please, be careful with it."
},
"metadata": {
"promoted": true
},
"price": {
"amount": 1590,
"currency": "USD"
}
}
}
}
```
```json
{
data: {
id: UUID {uuid: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"},
type: "listing",
attributes: {
description: "7-speed Hybrid",
deleted: false,
geolocation: LatLng {lat: 40.64542, lng: -74.08508},
createdAt: new Date("2025-03-23T08:40:24.443Z"),
state: "published",
title: "Peugeot eT101",
availabilityPlan: {
type: "availability-plan/day"
},
publicData: {
address: {
city: "New York",
country: "USA",
state: "NY",
street: "230 Hamilton Ave"
},
category: "road",
gears: 22,
rules: "This is a nice, bike! Please, be careful with it."
},
metadata: {
promoted: true
},
price: Money {amount: 1590, currency: "USD"}
}
}
}
```
--------------------------------
### Example: Process Transition Resource Structure
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the structure of a `processTransition` API resource, showing its ID, type, and attributes such as name, actor roles, actions, and required/optional parameters for a transition.
```JSON
{
"data": {
"id": "e55389df-f0e8-494d-93aa-05d2bbb975d3",
"type": "processTransition",
"attributes": {
"name": "transition/request",
"actor": [
"customer"
],
"actions": [
"tegel.action/create-booking",
"tegel.action/calculate-tx-nightly-total-price",
"tegel.action/calculate-tx-provider-commission",
"tegel.action/stripe-create-charge"
],
"params": {
"req": {
"listingId": "uuid",
"bookingStart": "timestamp",
"bookingEnd": "timestamp",
"cardToken": "string"
},
"opt": null
}
}
}
}
```
```JavaScript
{
data: {
id: UUID {uuid: "e55389df-f0e8-494d-93aa-05d2bbb975d3"},
type: "processTransition",
attributes: {
name: "transition/request",
actor: [
"customer"
],
actions: [
"tegel.action/create-booking",
"tegel.action/calculate-tx-nightly-total-price",
"tegel.action/calculate-tx-provider-commission",
"tegel.action/stripe-create-charge"
],
params: {
req: {
listingId: "uuid",
bookingStart: "timestamp",
bookingEnd: "timestamp",
cardToken: "string"
},
opt: null
}
}
}
}
```
--------------------------------
### Retrieve Single Asset by Latest Alias via HTTP GET
Source: https://www.sharetribe.com/api-reference/asset-delivery-api
Describes the HTTP GET endpoint for fetching a single asset using its path and the `latest` alias. This alias automatically points to the most recent asset tree version. A cURL example demonstrates how to construct the request.
```APIDOC
GET /v1/assets/pub/[CLIENT_ID]/a/latest/[ASSET_PATH]
```
```bash
$ curl https://cdn.st-api.com/v1/assets/pub/CLIENT_ID/a/latest/example/asset.json
```
--------------------------------
### Example Response: Retrieved Own Listing Data
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the structure and content of the data returned when successfully retrieving an own listing. Examples include the raw JSON response and its representation within a JavaScript SDK context, detailing attributes like description, geolocation, pricing, and availability.
```json
{
"data": {
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"type": "ownListing",
"attributes": {
"description": "7-speed Hybrid",
"deleted": false,
"geolocation": {
"lat": 40.64542,
"lng": -74.08508
},
"createdAt": "2025-03-23T08:40:24.443Z",
"state": "published",
"title": "Peugeot eT101",
"availabilityPlan": {
"type": "availability-plan/day",
"entries": [
{
"dayOfWeek": "mon",
"seats": 3
},
{
"dayOfWeek": "fri",
"seats": 1
}
]
},
"privateData": {
"externalServiceId": "abcd-service-id-1234"
},
"publicData": {
"address": {
"city": "New York",
"country": "USA",
"state": "NY",
"street": "230 Hamilton Ave"
},
"category": "road",
"gears": 22,
"rules": "This is a nice, bike! Please, be careful with it."
},
"metadata": {
"promoted": true
},
"price": {
"amount": 1590,
"currency": "USD"
}
}
}
}
```
```javascript
// res.data
{
data: {
id: UUID {uuid: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"},
type: "ownListing",
attributes: {
description: "7-speed Hybrid",
deleted: false,
geolocation: LatLng {lat: 40.64542, lng: -74.08508},
createdAt: new Date("2025-03-23T08:40:24.443Z"),
state: "published",
title: "Peugeot eT101",
availabilityPlan: {
type: "availability-plan/day",
entries: [
{
dayOfWeek: "mon",
seats: 3
},
{
dayOfWeek: "fri",
seats: 1
}
]
},
privateData: {
externalServiceId: "abcd-service-id-1234"
},
publicData: {
address: {
city: "New York",
country: "USA",
state: "NY",
street: "230 Hamilton Ave"
},
category: "road",
gears: 22,
rules: "This is a nice, bike! Please, be careful with it."
},
metadata: {
promoted: true
},
price: Money {amount: 1590, currency: "USD"}
}
}
}
```
--------------------------------
### Authenticate API Request with cURL
Source: https://www.sharetribe.com/api-reference/integration
This cURL example demonstrates how to make an authenticated GET request to the Sharetribe Integration API. It shows the required 'Authorization' HTTP header with a bearer access token for API access.
```curl
$ curl -X GET 'https://flex-integ-api.sharetribe.com/v1/integration_api/marketplace/show' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Example: Query Users via cURL
Source: https://www.sharetribe.com/api-reference/integration
Demonstrates how to make an authenticated HTTP GET request using cURL to the Sharetribe API's user query endpoint. It specifies the required 'Accept' and 'Authorization' headers for a successful API call.
```cURL
$ curl 'https://flex-integ-api.sharetribe.com/v1/integration_api/users/query' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Create User with Identity Provider via Sharetribe SDK
Source: https://www.sharetribe.com/api-reference/marketplace
Shows how to create a new marketplace user using the Sharetribe SDK's `currentUser.createWithIdp` method. This example provides identity provider credentials and user profile data, demonstrating the SDK's usage for API interaction.
```javascript
sdk.currentUser.createWithIdp({
idpId: "facebook",
idpClientId: "11223344",
idpToken: "aabbccdd",
email: "joe.dunphy@example.com",
firstName: "Joe",
lastName: "Dunphy",
displayName: "Dunphy Co.",
bio: "Hello, I am Joe.",
publicData: {
age: 27
},
protectedData: {
phoneNumber: "+1-202-555-5555"
},
privateData: {
discoveredServiceVia: "Twitter"
}
}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### Query Listings with Filters
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates how to search for listings using various filtering criteria, such as geographical location and custom public data attributes. This snippet provides an example of the HTTP GET request and a cURL command comment indicating search parameters.
```APIDOC
HTTP request:
GET /v1/api/listings/query
```
```curl
# Search all listings, ordered by distance from given location,
# matching only listings with `publicData.gears` less than 23
```
--------------------------------
### Create Stripe Customer using Sharetribe SDK
Source: https://www.sharetribe.com/api-reference/marketplace
JavaScript SDK example demonstrating how to create a Stripe customer. It shows how to pass the payment method ID and optional parameters like `expand` and `include` for the response.
```javascript
sdk.stripeCustomer.create({
stripePaymentMethodId: "pm_1EmfL3LSea1GQQ9xudUuun1q"
}, {
expand: true,
include: "defaultPaymentMethod"
}).then(res => {
// res.data
});
```
--------------------------------
### Show Current User Profile via HTTP GET and cURL
Source: https://www.sharetribe.com/api-reference/marketplace
Documents the Sharetribe API endpoint for retrieving the authenticated user's profile. It includes the HTTP method and path, along with a cURL command example demonstrating how to make the request with necessary authentication and content type headers. This endpoint requires an authenticated user.
```APIDOC
GET /v1/api/current_user/show
```
```cURL
$ curl 'https://flex-api.sharetribe.com/v1/api/current_user/show' \
-H 'Accept: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN'
```
--------------------------------
### Example JSON Response for Open Listing API
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the structure of a successful JSON response after opening a listing, including the listing's ID, type, and various attributes like description, geolocation, creation date, state, title, and pricing.
```json
{
"data": {
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"type": "ownListing",
"attributes": {
"description": "7-speed Hybrid",
"deleted": false,
"geolocation": {
"lat": 40.64542,
"lng": -74.08508
},
"createdAt": "2025-03-23T08:40:24.443Z",
"state": "published",
"title": "Peugeot eT101",
"availabilityPlan": null,
"privateData": {
"externalServiceId": "abcd-service-id-1234"
},
"publicData": {
"address": {
"city": "New York",
"country": "USA",
"state": "NY",
"street": "230 Hamilton Ave"
},
"category": "road",
"gears": 22,
"rules": "This is a nice, bike! Please, be careful with it."
},
"metadata": {
"promoted": true
},
"price": {
"amount": 1590,
"currency": "USD"
}
}
}
}
```
--------------------------------
### Create Listing with Sharetribe Integration SDK (JavaScript)
Source: https://www.sharetribe.com/api-reference/integration
JavaScript code demonstrating how to use the `integrationSdk.listings.create` method to programmatically create a listing, passing listing attributes and expansion options.
```javascript
integrationSdk.listings.create({
title: "Very good item",
authorId: new UUID("7966463a-1b15-4931-b056-27a546dd12bb"),
state: "published",
description: "Brand new track bike.",
geolocation: new LatLng(40.64542, -74.08508),
privateData: {
externalServiceId: "new-service-id-4324"
},
publicData: {
address: {
country: "USA"
},
category: "track",
gears: 22
},
metadata: {
verified: true,
promoted: false,
rating: 4
},
images: [
new UUID("f8afadaa-dd4f-4536-b9a7-b405834dc25d")
]
}, {
expand: true,
include: ["images"]
}).then(res => {
// res.data
});
```
--------------------------------
### Create Stripe Account API Response Examples (JSON, JavaScript)
Source: https://www.sharetribe.com/api-reference/marketplace
Presents typical successful response structures from the `create_stripe_account` API call, showing both the raw JSON format and a JavaScript object representation, detailing the user's updated Stripe connection status and profile data.
```json
{
"data": {
"id": "3c073fae-6172-4e75-8b92-f560d58cd47c",
"type": "currentUser",
"attributes": {
"banned": false,
"deleted": false,
"state": "active",
"createdAt": "2025-03-28T09:12:58.866Z",
"email": "joe.dunphy@example.com",
"emailVerified": false,
"pendingEmail": null,
"stripeConnected": true,
"stripePayoutsEnabled": true,
"stripeChargesEnabled": true,
"profile": {
"firstName": "Joe",
"lastName": "Dunphy",
"displayName": "Joe D",
"abbreviatedName": "JD",
"bio": "Hello, I am Joe.",
"publicData": {
"age": 27
},
"protectedData": {
"phoneNumber": "+1-202-555-5555"
},
"privateData": {
"discoveredServiceVia": "Twitter"
}
}
}
}
}
```
```javascript
// res.data
{
data: {
id: UUID {uuid: "3c073fae-6172-4e75-8b92-f560d58cd47c"},
type: "currentUser",
attributes: {
banned: false,
deleted: false,
state: "active",
createdAt: new Date("2025-03-28T09:12:58.866Z"),
email: "joe.dunphy@example.com",
emailVerified: false,
pendingEmail: null,
stripeConnected: true,
stripePayoutsEnabled: false,
stripeChargesEnabled: false,
profile: {
firstName: "Joe",
lastName: "Dunphy",
displayName: "Joe D",
abbreviatedName: "JD",
bio: "Hello, I am Joe.",
publicData: {
age: 27
},
protectedData: {
phoneNumber: "+1-202-555-5555"
},
privateData: {
discoveredServiceVia: "Twitter"
}
}
}
}
}
```
--------------------------------
### Listing Resource Examples
Source: https://www.sharetribe.com/api-reference/marketplace
Illustrates the structure of a `listing` resource, showcasing various attributes such as description, geolocation, creation timestamp, state, title, availability plan, public data (address, category, gears, rules), metadata, and price. Includes both strict JSON and JavaScript object literal representations.
```json
{
"data": {
"id": "c6ff7190-bdf7-47a0-8a2b-e3136e74334f",
"type": "listing",
"attributes": {
"description": "7-speed Hybrid",
"deleted": false,
"geolocation": {
"lat": 40.64542,
"lng": -74.08508
},
"createdAt": "2025-03-23T08:40:24.443Z",
"state": "published",
"title": "Peugeot eT101",
"availabilityPlan": {
"type": "availability-plan/day"
},
"publicData": {
"address": {
"city": "New York",
"country": "USA",
"state": "NY",
"street": "230 Hamilton Ave"
},
"category": "road",
"gears": 22,
"rules": "This is a nice, bike! Please, be careful with it."
},
"metadata": {
"promoted": true
},
"price": {
"amount": 1590,
"currency": "USD"
}
}
}
}
```
```json
{
data: {
id: UUID {uuid: "c6ff7190-bdf7-47a0-8a2b-e3136e74334f"},
type: "listing",
attributes: {
description: "7-speed Hybrid",
deleted: false,
geolocation: LatLng {lat: 40.64542, lng: -74.08508},
createdAt: new Date("2025-03-23T08:40:24.443Z"),
state: "published",
title: "Peugeot eT101",
availabilityPlan: {
type: "availability-plan/day"
},
publicData: {
address: {
city: "New York",
country: "USA",
state: "NY",
street: "230 Hamilton Ave"
},
category: "road",
gears: 22,
rules: "This is a nice, bike! Please, be careful with it."
},
metadata: {
promoted: true
},
price: Money {amount: 1590, currency: "USD"}
}
}
}
```
--------------------------------
### Approve User Request Examples
Source: https://www.sharetribe.com/api-reference/integration
Provides examples of how to send a request to approve a user using both cURL and the Sharetribe Integration SDK. Both examples demonstrate passing the user ID and utilizing the 'expand' parameter to retrieve the full user resource.
```shell
$ curl -X POST 'https://flex-integ-api.sharetribe.com/v1/integration_api/users/approve?expand=true' \
-H 'Accept: application/json' \
-H 'Content-type: application/json' \
-H 'Authorization: bearer ACCESS_TOKEN' \
-d '{"id": "3c073fae-6172-4e75-8b92-f560d58cd47c"}'
```
```javascript
integrationSdk.users.approve({
id: new UUID("3c073fae-6172-4e75-8b92-f560d58cd47c")
}, {
expand: true
}).then(res => {
// res.data
});
```
--------------------------------
### Create User with Sharetribe SDK (JavaScript)
Source: https://www.sharetribe.com/api-reference/marketplace
Shows how to create a new user using the Sharetribe SDK in JavaScript, providing user details as an object and handling the API response with a promise. The `expand` option is passed to retrieve the full user resource.
```javascript
sdk.currentUser.create({
email: "joe.dunphy@example.com",
password: "secret-pass",
firstName: "Joe",
lastName: "Dunphy",
displayName: "Dunphy Co.",
bio: "Hello, I am Joe.",
publicData: {
age: 27
},
protectedData: {
phoneNumber: "+1-202-555-5555"
},
privateData: {
discoveredServiceVia: "Twitter"
}
}, {
expand: true
}).then(res => {
// res.data
});
```