Create a Seller
This tutorial demonstrates how to set up a seller and their admin user account simultaneously using the sellerWithOwnerCreate
mutation.
If your onboarding process involves multiple stages to collect information, or if the seller admin user already exists, the sellerDataCreate
or sellerShellCreate
mutations allow you to create the seller account separately from the user. For detailed usage, refer to the API reference.
Retrieve the plan id
As part of the input to create a seller, you need the plan.id
of the marketplace agreement to assign the seller.
To get the id
, you can use the availablePlans
query:
query {
availablePlans(first: 25) {
edges {
node {
id
title
commissionType
defaultCommission
fees {
feeValue
feeType
}
granularCommissions {
commission
}
}
}
}
}
Create the seller
You need the following information to create the seller:
- The
id
of the plan to assign the seller, retrieved from step 1 - The seller company name
- The contact information for the user to create as the seller admin
The resulting seller will be created in the PENDING
state until you approve the seller.
You can optionally pass in address information when you create the seller.
If you don't set the address information, you can add this later with the sellerAddressCreate
and sellerAddressSetDefault
mutations.
- Create seller without address
- Create seller with address
The following mutation creates a seller and assigns a user account as the owner of the seller. The user will be assigned to the Seller Admin permission group.
mutation {
sellerWithOwnerCreate(
seller: { companyName: "Acme Inc.", plan: "QWdyZWVtZW50OjI=" }
user: {
firstName: "John"
lastName: "Smith"
email: "john.smith@example.com"
personalPhone: "+1-613-555-0154"
}
) {
seller {
id
status
companyName
identification
defaultCurrency
created
}
sellerErrors {
field
message
code
}
}
}
A staff member user account will be created and assigned as the owner based on the provided user
information.
The following mutation creates a seller, with a seller admin user, and passes information for both a defaultBillingAddress
and defaultShippingAddress
:
mutation {
sellerWithOwnerCreate(
seller: { companyName: "Acme Inc.", plan: "QWdyZWVtZW50OjE=" }
user: {
firstName: "John"
lastName: "Smith"
email: "john.smith@example.com"
personalPhone: "+1-613-555-0154"
}
defaultBillingAddress: {
firstName: "John"
lastName: "Smith"
companyName: "Acme Inc."
streetAddress1: "123 Maple Street"
streetAddress2: "Suite 101"
city: "Toronto"
cityArea: "Downtown"
postalCode: "M5H 2N2"
country: CA
countryArea: "ON"
phone: "1-613-555-0154"
}
defaultShippingAddress: {
firstName: "John"
lastName: "Smith"
companyName: "Acme Inc."
streetAddress1: "123 Maple Street"
streetAddress2: "Suite 101"
city: "Toronto"
cityArea: "Downtown"
postalCode: "M5H 2N2"
country: CA
countryArea: "ON"
phone: "+1-613-555-0154"
}
) {
seller {
id
companyName
owner {
firstName
email
}
identification
defaultCurrency
created
updated
status
agreementAcknowledged
pk
}
sellerErrors {
field
message
code
}
}
}
The addresses are saved to both the seller admin user and the seller account: