gws (plan, mailboxes). collectionMethod PAYMENT_LINK is not supported on this endpoint yet. For the full end-to-end flow, see the Google Workspace creation flow guide.409 - the domain is not registered and nothing is charged.201 comes back with gws.status: "provisioning".domain.nameservers (returned as gws.dns):nameservers, the default): the domain is on our nameservers and the Workspace records (verification TXT, MX, DKIM) are written for you. Nothing to do.nameservers): you run DNS. Create the zone at your DNS host, then: (1) on workspace.txt.ready, add the verification TXT, MX and SPF records from its dnsRecords (also in GET /gws) and call POST /dns-propagation-checks with purpose: "domain_verification"; (2) on workspace.dkim.ready, add the DKIM record and call POST /dns-propagation-checks with purpose: "dkim". Setup waits on you - nothing times out - and the seats are already charged, so add the records promptly.data.domain; mailbox.ready carries the mailbox. See the Webhooks section for the envelope, signature check and retries.| Event | When it fires | What to do |
|---|---|---|
domain.order.success / domain.order.failed | The registration outcome - the same result this call returns, useful if your request timed out. On domain.order.failed the seats are refunded along with the domain, and no workspace events follow. | - |
workspace.provisioned | The Google Workspace subscription is active at Google. Mailboxes are not usable yet. | - |
workspace.txt.ready | Manual DNS only. The verification record is issued; data.dnsRecords holds the verification TXT, MX and SPF records. | Add them at your DNS host, then call POST /dns-propagation-checks with purpose: "domain_verification". |
workspace.txt.propagated | The verification record is live and Google domain verification is running. Both DNS modes. | - |
workspace.dkim.ready | Manual DNS only. The DKIM record is issued, in data.dnsRecords. | Add it, then call POST /dns-propagation-checks with purpose: "dkim". |
workspace.dkim.propagated | The DKIM record is live. Both DNS modes. | - |
mailbox.ready | Once per mailbox - the admin first, then each of the others - when it is active, carrying its credentials (the same fields as GET /mailboxes). | The workspace is ready to use once every mailbox you ordered has fired this. |
workspace.txt.failed | A DNS record was not seen live within 4 days of the check starting. The workspace keeps billing. | Fix the record, then call POST /dns-propagation-checks again. |
workspace.failed | Google setup failed. The seats are refunded to your wallet and the workspace is cancelled; the domain stays registered. | - |
gws.status "refunded" or "failed", no workspace events follow: the seats were already refunded, or never charged. To poll instead of (or as well as) listening, use GET /gws?userId=&domain=: the workspace is listed under orderedWithDomain until it exists, then under workspaces with its status and dnsRecords, and GET /mailboxes for each mailbox.200 with orderStatus "FAILED" and gws.status: "refunded" - both the domain and the seats go back to your wallet. If the domain registers but the workspace cannot be created, the seats are refunded and the domain is kept.domains:write and gws:write, and Google Workspace must be enabled on your account. Strongly recommended: send an Idempotency-Key header - see POST /domain/register for why.curl --location 'https://api.resellerstack.ai/api/v1/domain/register-with-gws' \
--header 'idempotency-key;' \
--header 'rs-x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": {
"domainName": "acme-mail.com",
"years": 1,
"premiumPrice": 14.99,
"autoRenew": true,
"privacyEnabled": true
},
"userId": "b2a1c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
"newCustomer": {
"email": "jane.doe@acme.com",
"firstName": "Jane",
"lastName": "Doe",
"company": "Acme Corp",
"addressLineOne": "123 Market St",
"addressLineTwo": "Suite 400",
"addressLineThree": "Attn: Accounts Payable",
"city": "San Francisco",
"state": "CA",
"country": "US",
"postalCode": "94103",
"phoneCc": "+1",
"phone": "5551234567"
},
"collectionMethod": "MANUAL",
"gws": {
"planType": "MONTHLY",
"autoRenew": true,
"orgName": "Acme Inc",
"mailboxes": [
{
"username": "jane",
"firstName": "Jane",
"lastName": "Doe",
"password": "Correct-Horse-9"
}
]
}
}'{
"status": 200,
"message": "Domain registration failed",
"data": {
"cartOrderId": "9c8b7a6d-5e4f-4a3b-9c8d-1e2f3a4b5c6d",
"orderId": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"domainName": "acme-mail.com",
"orderStatus": "FAILED",
"error": "Domain name already registered",
"registeredOn": null,
"expireOn": null,
"gws": {
"requestId": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
"status": "refunded",
"seats": 2,
"planType": "MONTHLY",
"dns": "automatic",
"error": "Domain name already registered"
}
}
}