This documentation describes how to test your CloudCore API and CloudSignal integrations.
Before the testing can start a few configurations have to be in place, each described here.
Create a CloudCore API Interface - This is the core interface for all order and quote requests. It provides you with a unique API key, which links the order to the specific account.
Login to the admin dashboard and go to 'CloudCore API Interfaces'. We already created one for you when you created the Cloudprinter.com account, you just need to get the API key from there.
Here is how it looks:
Create a CloudSignal Webhooks - This is the configuration for the service for sending signals back to your system. When you create a new webhooks configuration you choose which signal types you want to subscribe on.
The configuration page looks like this:
There are a few points to note:
Having a CloudCore API Interface in Sandbox mode makes the integration tests easier. Here are a few of the reasons:
You now have setup all the basic elements needed to post the first Sandbox order. We often see that developers start with Postman or cURL to get the first order through. That is also perfectly fine and makes it easiest for you. This is all about getting the first order accepted by the API.
The JSON to post to the Cloudprinter Core API is documented here - Cloudprinter Core API
A few of the common issues to check if the order was not accepted:
When you get a HTTP status code 201 back the order has been created. You can go to the admin dashboard and see the order as well. Do a number of these test orders to get more familiar with the Cloudprinter Core API.
For each order that gets processed, a number of signals are generated. You can follow the latest signals in the admin dashboard under "CloudSignal Webhooks" and "Logs" in the menu.
Signal logs look like this:
Each of the fields are described here:
Field | Description |
---|---|
Account | The name of the account the signal belongs to |
Attempts | The number of delivery attempts the Cloudprinter.com system has made |
Response | The HTTP response code from your signal endpoint on the latest delivery attempt |
State | A textual description of the state the signal is in |
Created | Date and time when the signal was created |
Sent | Date and time when the signal was delivered successfully |
For each signal you can Cancel or Resend:
If you didn't receive the signals in the first attempt, the CloudSignal sender service will push the signal again. 100 attempts will be made before giving up. The time between attempts will be increase after each attempt.
Cloudprinter.com has a predefined test checklist we recommend all clients to follow. It ensure that all aspects of the integration are tested in an easy and structured way.
Preconditions:
Standard test cases:
Step | Description |
---|---|
1 | Check configurations, make sure you have a CloudCore API Interface with mode set to Sandbox. Make sure you have a CloudSignal Webhooks configuration. |
2 | Post a regular book order if you support books. Specify required options, like paper type and total pages. Use the shipping level cp_postal. Check that the order is accepted by the API and that you can see it in the admin panel. |
3 | Signals for the step 2 order will be generated when the order is getting processed. This starts normally within a few minutes. The signals are pushed to the configured CloudSignal Webhooks. Check the delivery status of the signals in your own system, and check the CloudSignals Logs in the admin dashboard. The signals must be delivered to your system and be in state "Delivered" in the log. |
4 | Post a multi item order with minimum of 2 items. Check that the order was accepted by the API and that signals was created and pushed to your system. |
5 | Post a reorder, meaning a regular order with reorder information on the item level. Make reference back to a one of the previous orders, set the reorder cause and reorder description. See more information on reorders here. |
6 | Post orders with products of all different product categories you support. As with the previous tests make check the status of the order and signals in the admin dashboard. |
7 | Failed order post handling - Set an invalid product reference and post the order. The result will be a HTTP status response 400. Your system must check on the HTTP response code and in cases where HTTP status code 201 is not returned your system must handle that. We suggest to raise an alarm. If a HTTP status 5xx was returned, Cloudprinter has a temporary issue and order post must be retried. |
Optional test cases:
Step | Description |
---|---|
A | Request a product list. This step is optional as the product and option reference codes can be found in the admin dashboard. |
B | Request product details. This step is optional as detailed information on the products can be found in the admin dashboard. Product details provide detailed information on the product, available options and pricing. |
C | Request an order quote with one item. The quote request will return the order price and shipping options. Check that the order is accepted by the API. See quote docs here |
D | Post an order with the quote hash from one of the shipping options in step 10. No shipping level should be specified as that is included in the shipping hash. |
E | Request an order list to get the status for the last placed orders. |
Before you can go live you have to complete the setup of your account, so we know your invoice information, subscription mode, payment information etc.
In the admin panel under 'My Organization' and 'Organization' you can edit your basic organization data. Make sure your basic company information is correct and that the invoicing information has been set.
In the admin panel under 'My Organization' and 'Payment' you can setup the payment for the products/services we provide. When setting up the credit card information your monthly subscription will also start. Both the subscription fee and the product/service cost are charged on this same credit card.
The name of your account is used by default as the sender name (consignor) on the shipping label of your orders. Set the account name so it reflects the brand the end-customers knows. The account name is updated under 'My Organization' and 'Accounts'.
Change the mode on the CloudCore API Interface to Live mode and place a real payed order for end-to-end delivery test. Remember to set a real address this time, as the order will be produced and shipped to this address.