Onboard a new merchant under this workspace and return a Stripe Connect URL.
const url = 'https://api.swft.co.uk/agencies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merchants';const options = { method: 'POST', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"name":"example","store_url":"https://example.com","email":"[email protected]","partner_key":"example","return_url":"https://example.com","refresh_url":"https://example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.swft.co.uk/agencies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merchants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "name": "example", "store_url": "https://example.com", "email": "[email protected]", "partner_key": "example", "return_url": "https://example.com", "refresh_url": "https://example.com" }'In one round trip: provisions a Swft merchant, opens (or reuses) a Stripe Connect Standard account on its behalf, and returns an AccountLink URL the partner can redirect their customer to. The partner controls the entire setup wizard — the merchant never has to visit a Swft dashboard. Idempotency-Key is required. Same key + same body → identical response on replay; same key + different body → 409.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body
Section titled “Request Body ”object
Optional Partnero attribution key.
Where Stripe should redirect after onboarding. Defaults to Swft’s hosted page.
Where Stripe should redirect if the AccountLink expires.
Example generated
{ "name": "example", "store_url": "https://example.com", "partner_key": "example", "return_url": "https://example.com", "refresh_url": "https://example.com"}Responses
Section titled “ Responses ”Merchant created.
object
object
object
Example generated
{ "merchant": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "store_url": "https://example.com", "api_key": "example", "api_secret": "example", "livemode": true, "created_via": "example", "created_at": "example" }, "stripe": { "account_id": "example", "onboarding_url": "https://example.com", "expires_at": 1 }}Bad request — malformed input or missing/invalid parameters.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Missing or invalid authentication.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Authenticated but not authorised (e.g. wrong workspace).
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Resource not found.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Conflict — idempotency-key reuse, duplicate resource, etc.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Rate-limited.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}Internal server error.
object
object
object
Example generated
{ "error": { "type": "https://example.com", "code": "example", "message": "example", "doc_url": "https://example.com", "request_id": "example", "param": "example", "meta": { "additionalProperty": "example" } }}