curl --request POST \
--url https://api.apostra.com/api/v2/accounts/create-child \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Nike",
"customerRole": "BUYER"
}
'import requests
url = "https://api.apostra.com/api/v2/accounts/create-child"
payload = {
"name": "Nike",
"customerRole": "BUYER"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Nike', customerRole: 'BUYER'})
};
fetch('https://api.apostra.com/api/v2/accounts/create-child', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {},
"customer": {},
"customers": [
{}
],
"showTosBox": true,
"canAcceptTos": true,
"hasContract": true,
"latestTosVersion": "<string>",
"convertedFromStandalone": true,
"tosUpdate": {
"action": "notice",
"changeLevel": "PATCH",
"acceptedVersion": "<string>",
"targetVersion": "<string>",
"deadline": "2023-11-07T05:31:56Z",
"termsUrl": "<string>",
"changesUrl": "<string>"
},
"organizationContractMissing": true
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Create account
Create a Buyer or Seller account under an organization. From a standalone account, this creates an organization and attaches both accounts; the caller must explicitly confirm those consequences. Requires administrator authority.
curl --request POST \
--url https://api.apostra.com/api/v2/accounts/create-child \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Nike",
"customerRole": "BUYER"
}
'import requests
url = "https://api.apostra.com/api/v2/accounts/create-child"
payload = {
"name": "Nike",
"customerRole": "BUYER"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Nike', customerRole: 'BUYER'})
};
fetch('https://api.apostra.com/api/v2/accounts/create-child', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {},
"customer": {},
"customers": [
{}
],
"showTosBox": true,
"canAcceptTos": true,
"hasContract": true,
"latestTosVersion": "<string>",
"convertedFromStandalone": true,
"tosUpdate": {
"action": "notice",
"changeLevel": "PATCH",
"acceptedVersion": "<string>",
"targetVersion": "<string>",
"deadline": "2023-11-07T05:31:56Z",
"termsUrl": "<string>",
"changesUrl": "<string>"
},
"organizationContractMissing": true
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"details": {}
}
}Body
Request body for creating a Buyer, Seller, or Developer account
Seller Accounts only: the seller product the new storefront starts with, LISTING_ONLY ("Just list") or AGENTIC_MEDIA_COMPANY ("Create an AMC account"). When omitted, it follows the organization's accepted plan: AGENTIC_MEDIA_COMPANY on an Agentic Media Company plan, otherwise LISTING_ONLY, including for a Free organization. A value you send is kept as given and is refused with 409 Conflict when the plan does not cover it. It decides which seller plans the organization is offered and can be changed later in Settings.
LISTING_ONLY, AGENTIC_MEDIA_COMPANY "LISTING_ONLY"
Required only for a fresh account creation from a standalone account. Must be true after presenting that the operation creates an organization container, attaches the standalone account to it, moves contract and billing authority to the organization, makes the confirmer an organization administrator, preserves account-only membership boundaries, applies account-specific standing before inherited organization standing, and requires a dedicated migration for detachment. Omission or false returns 409 Conflict. Callers already managed by an organization should omit this field.
true
Versioned synthetic source recipes to attach when accountMode is DEMO.
1 - 3 elementssample-publisher-display, sample-publisher-ctv, sample-retail-media [
"sample-publisher-display",
"sample-publisher-ctv",
"sample-retail-media"
]
Seller capability profile applied only to the active Demo Storefront lease.
seller-sources/listing-only, seller-sources/listing-distribution, seller-sources/merchandising, seller-sources/merchandising-distribution "seller-sources/merchandising-distribution"
Response
Create account
Full user context scoped to the newly created account