Partner API
Here is an overview of onboarding a new user and creating a site.
Overview
- Once the user is created, use the returned API credentials to authenticate as that user to perform all actions. The partner API will only allow certain actions on that user, so the user's api credentials will be required for full access.
- We make use of Stripe's hosted payment page and therefore don't directly handle payment data. When creating a site, please be prepared to redirect the user if the payment url is present in the create order api call.
- If you don't set the return url when creating a site, and the user is redirected to our payment site, the user will need to manually navigate back to your interface.
- We recommend making use of the callback portion of our create site api, otherwise you will need to continuously poll the order status api to check if the payment was successful or not.
A Note About Billing
For normal resellers who use inherited sub-accounts (default), the handling of a payment redirection will only be necessary if the account does not have an existing active subscription.
For example, if your account already has a payment relationship with CloudPress or one of it's resellers, and you create a new sub-account and WordPress site, the order process will not return any payment url. In this situations, once the order is placed, it will be immediately provisioned.
Onboarding Flow
This is an example of a brand new user. If the user already exists, you will receive an error about the email address already in use, and they will need to manually supply api credentials to continue.
sequenceDiagram
autonumber
participant P as Partner
participant C as CloudPress
P->>C: Create User
C->>P: Returns API details
Note over P,C: Use the API Token and Account ID<br/>to authenticate as the user<br/>going forward.
P->>C: Order Site
C->>P: Returns order details,<br/>including payment url.
C-->>P: Callback on order status, if required.
Note over P,C: Callback from CloudPress on the payment status.<br/>Only used when a payment is required,<br/>and if a callback was included.
API Calls used in this flow
Other Notable API Calls
Additional Sites
Once you have a user with an established account, future orders via the api will simply return the site details. The payment setup is only for brand new customers.