REST API
Search…
Cart & Checkout
Pre-alpha (under development) disclaimer
Please note that you are accessing the Pre-alpha (under development) versions of Outshifter's APIs which are in the process of being tested before their official release.
This being so, Outshifter does not give any warranties, whether express or implied, as to the suitability or usability of the APIs, its services, or any of its content. The sole purpose of the under development versions is to conduct testing and obtain feedback. Should you encounter any bugs, glitches, lack of functionality, or other problems in the Pre-alpha versions, please email us at [email protected]
The below process describes the key milestones in the checkout process flow in Outshifter. There are also additional steps that may occur along the way; however, the purpose of this instruction is to deliver a base reference for the user to work with.
Our order creation flow is as follows:
  • Cart: an object with all the items added to the cart by a potential buyer. The frontend can interact with our API to add, update or remove items.
  • Checkout Initiation: once the final customer is ready to initiate the order, an object with the cart data is needed for the checkout process. You can still update the cart at this time.
  • Shipping Methods: the way orders will be sent. E.g. postal service, click & collect.
  • Payment Method: a payment provider. E.g., Stripe, Klarna.
  • Payment: this object contains status and additional data about payment. Payments are processed by third parties.
  • Checkout Completion: once the payment succeeds, the checkout is finished.
  • Order Creation: When all the above is completed, the order will be released internally in Outshifter. OBS: the order id is created just before the payment is attempted and marked as pending.

Cart

Create a cart

Store on our database the items added to the cart by a potential buyer.
You can initiate the cart even before adding products to it, so you decide when it's more convenient for you to do it. You need to provide us though with the reference to the customer's session id that is created by you in the frontend.
post
https://api.outshifter.com/api
/cart
Create a cart
Body example:
{
"customer_session_id": "92sdj34234",
"currency": "EUR"
}

Cart items

You may want interact with the cart in the following ways:
  • add an additional item o multiple items to the cart object
  • update the quantity of an added item
  • remove an item or multiple items from the cart object

Add an item

post
https://api.outshifter.com/api
/cart/:id/item/add
Add an item to the cart
Body example:
{
"line_items": [
{
"product_id": 112232,
"variant_id": 231,
"quantity": 2,
"price_data": {
"unit_price": "323.13",
"tax": "12",
"currency": "EUR"
}
}
]
}
It is possible to add more than one item on this endpoint.

Update an item

patch
https://api.outshifter.com/api
/cart/:id/item/update/:itemId
Update a cart item
Body example:
{
"qty": 2
}

Remove an item

patch
https://api.outshifter.com/api
/cart/:id/item/delete/:itemId
Delete a cart item

Get cart information

At any time you can retrieve cart information with all the added items.
get
https://api.outshifter.com/api
/cart/:id
Get cart information by id
Below you can see a cart object response example with line items already added:
{
"cart_id": 112321203,
"customer_session_id": "92sdj34234",
"created_at": "2022-04-05T13:20:16-04:00",
"updated_at": "2022-04-05T13:20:16-04:00",
"line_items":[
{
"product_id": 112232,
"variant_id": 231,
"quantity": 2,
"price_data":{
"unit_price": "323.13",
"tax": "12",
"currency": "EUR"
}
},
{
"product_id": 112000,
"variant_id": null,
"quantity": 1,
"price_data":{
"unit_price": "100.00",
"tax": "12",
"currency": "EUR"
}
}
],
"total_amount": "1200.20",
"currency":"EUR"
}

Delete cart by id

In case you need to delete a cart, it is possible via this endpoint.
delete
https://api.outshifter.com/api
/cart/:id
Delete a cart by id

Checkout

Initiate the checkout

Once the customer proceeds to checkout in your frontend, you can create the checkout in our backend just with the cart data.
post
https://api.outshifter.com/api
/checkout
Create a checkout
Body example:
{
"cart_id": "aasd3432rfsd"
}

Checkout completion required data

You will not be able to proceed to payment without the following information:
  • personal information (name, email)
  • shipping information
  • billing information
  • payment method
  • shipping rate

Payment Methods

get
https://api.outshifter.com/api
/checkout/payment-methods
Get available payment methods for your seller id

Shipping rates

Each product in Outshifter has associated shipping options. With this endpoint you can get the total shipping cost on your frontend just by providing the selected product ids.
post
https://api.outshifter.com/api
/shipping/flat-rate
Shipping rates by product ids
An example body with two items:
{
"items": [
{
"productId": 920,
"quantity": 1
},
{
"productId": 4018,
"quantity": 1
}
],
"destination": {
"country": "NO"
},
"currency": "NOK"
}

Interacting with the checkout

Update the checkout

At any time you can update the checkout object. Maybe a user initiated the checkout with some information and then came back later and updated it, or maybe you want to store the information the customer provides in steps.
This endpoint allows you to add information or to update information that was stored in the Checkout Object.
patch
https://api.outshifter.com/api
/checkout/:id
Get checkout information by id
A body example, just adding the user name and email:
{
"shipping_address": {
"first_name": "Will",
"last_name": "Smith",
"email": "[email protected]"
}
}

Get the checkout

Retrieve the checkout object with the completed information up to that point.
get
https://api.outshifter.com/api
/checkout/:id
Get checkout information by id

Initiate payment

Once the customer has selected the payment method and completed the required personal and shipping information, the next step is to proceed to the payment.
There are two optional return urls parameters you can add:
  • "success_url": where to redirect the final customer after the payment is fulfilled on the checkout.
  • "cancel_url": where to redirect the final customer if the checkout is not completed or the go back button is pressed.
In case no return urls are provided, Outshifter creates as default its own success and cancel url where the final customer is redirected and shown the corresponding information.
patch
https://api.outshifter.com/api
/checkout/:id/payment
Initiate a checkout payment
Body example:
{
"success_url": "https://yourdomain.com?success=true`,
"cancel_url": "https://yourdomain.com?canceled=true`,
"payment_method": "Stripe",
"email": "[email protected]",
"billing_address": {
"first_name": "Will",
"last_name": "Smith",
"phone_code": "+47",
"phone": "45966288",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
},
"shipping_address": {
"first_name": "Will",
"last_name": "Smith",
"phone_code": "+47",
"phone": "45966288",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
}
}
As a response you get the checkout url you can use to redirect and allow the final customer to complete the payment. An order id is also created with pending status.
{
"checkout_url": "https://checkout.stripe.com/pay/cs_test_b1VMRSqjnNbLRfT58rDbfId4annlCVwHy8caxZJcquValgOVZIO8MZ2H99#fidkdWxOYHwnPyd1blpxYHZxWjA0SVNSbjRDa3N8bkBQRnFSQ3Y9c0sxYm1mRnRtUWlSPHV2QjB0djJ9VGpDdUx0TEt%2FRjFsQzQwRDdmRmY0XWhMVTBocTxLfGBycjddU39VNDFWN1VdXHBdNTVGQGJoc2o1QicpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPydocGlxbFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl",
"order_id": 3232
}

Retrieve payment information

Once the payment is completed, you can get just the payment information of the checkout.
get
https://api.outshifter.com/api
/checkout/:id/payment
Get payment information by checkout id
Response exemple:
{
"success_url": "https://yourdomain.com?success=true`,
"cancel_url": "https://yourdomain.com?canceled=true`,
"payment_method": "Stripe",
"email": "[email protected]",
"billing_address": {
"first_name": "Will",
"last_name": "Smith",
"phone_code": "+47",
"phone": "45966288",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
},
"shipping_address": {
"first_name": "Will",
"last_name": "Smith",
"phone_code": "+47",
"phone": "45966288",
"company": null,
"address1": "Chestnut Street 92",
"address2": "",
"city": "Louisville",
"province": "Kentucky",
"province_code": "KY",
"country": "United States",
"country_code": "US",
"zip": "40202"
},
"cart": {
"cart_id": 112321203,
"customer_session_id": "92sdj34234",
"created_at": "2022-04-05T13:20:16-04:00",
"updated_at": "2022-04-05T13:20:16-04:00",
"line_items":[
{
"product_id": 112232,
"variant_id": 231,
"quantity": 2,
"price_data":{
"unit_price": "323.13",
"tax": "12",
"currency": "EUR"
}
},
{
"product_id": 112000,
"variant_id": null,
"quantity": 1,
"price_data":{
"unit_price": "100.00",
"tax": "12",
"currency": "EUR"
}
}
],
"total_amount": "1200.20",
"currency":"EUR"
}
}

Delete a checkout

In order not to overflow the database, unfinished checkouts are deleted. Anonymous and unfinished checkouts are deleted after 60 days from the last modification.
You may also manually delete a checkout yourself:
delete
https://api.outshifter.com/api
/checkout/:id
Delete a checkout by id
Copy link
On this page
Cart
Create a cart
post
Create a cart
Cart items
post
Add an item to the cart
patch
Update a cart item
patch
Delete a cart item
Get cart information
get
Get cart information by id
Delete cart by id
delete
Delete a cart by id
Checkout
Initiate the checkout
post
Create a checkout
Checkout completion required data
get
Get available payment methods for your seller id
post
Shipping rates by product ids
Interacting with the checkout
patch
Get checkout information by id
get
Get checkout information by id
Initiate payment
patch
Initiate a checkout payment
get
Get payment information by checkout id
delete
Delete a checkout by id