Checkout

Once a Cart is ready to checkout, you can easily convert your Cart to an Order. The Cart will remain and can be modified and checked out again if required.

Once a successful Checkout is completed, the response will contain the order.

We'll automatically delete carts 7 days after they were last updated.

There are a number of actions that happen to your inventory when checking out and paying for an order. For more information please be sure to evaluate our detailed article explaining the processes.

With Customer ID

POST https://api.moltin.com/v2/carts/:reference/checkout

You can checkout a Cart with an existing customer ID

Request Body

NameTypeDescription

customer.id

string

The ID of the customer

billing_address.first_name

string

First name of the billing recipient

billing_address.last_name

string

Last name of the billing recipient

billing_address.company_name

string

Company name of the billing recipient

billing_address.line_1

string

First line of the billing address

billing_address.line_2

string

Second line of the billing address

billing_address.postcode

string

Postcode of the billing address

bililng_address.county

string

County / state / region of the billing address

billing_address.country

string

Country of the billing address

shipping_address.first_name

string

First name of the shipping recipient

shipping_address.last_name

string

Last name of the shipping recipient

shipping_address.phone_number

string

Phone number of the shipping recipient

shipping_address.company_name

string

Company of the shipping recipient

shipping_address.line_1

string

First line of the shipping address

shipping_address.line_2

string

Second line of the shipping address

shipping_address.city

string

City of the shipping address

shipping_address.postcode

string

Post code of the shipping address

shipping_address.county

string

County / state/ region of the shipping address

shipping_address.country

string

Country of the shipping address

shipping_address.instructions

string

Shipping instructions

{
    "data": {
        "type": "order",
        "id": "c79a24c1-d639-4ac7-9eb5-3565efd9c84b",
        "status": "incomplete",
        "payment": "unpaid",
        "shipping": "unfulfilled",
        "customer": {
            "name": "Ron Swanson",
            "email": "ronswanson@example.com"
        },
        "shipping_address": {
            "first_name": "Ron",
            "last_name": "Swanson",
            "phone_number": "",
            "company_name": "Moltin",
            "line_1": "British India House",
            "line_2": "15 Carliol Square",
            "city": "Newcastle upon Tyne",
            "postcode": "NE1 6UF",
            "county": "Tyne & Wear",
            "country": "UK",
            "instructions": ""
        },
        "billing_address": {
            "first_name": "Ron",
            "last_name": "Swanson",
            "company_name": "Moltin",
            "line_1": "British India House",
            "line_2": "15 Carliol Square",
            "city": "Newcastle upon Tyne",
            "postcode": "NE1 6UF",
            "county": "Tyne & Wear",
            "country": "UK"
        },
        "links": {},
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 47500,
                    "currency": "USD",
                    "formatted": "$475.00"
                },
                "without_tax": {
                    "amount": 47500,
                    "currency": "USD",
                    "formatted": "$475.00"
                }
            },
            "timestamps": {
                "created_at": "2018-05-09T09:53:16.045565913Z",
                "updated_at": "2018-05-09T09:53:16.045566558Z"
            }
        },
        "relationships": {
            "items": {
                "data": [
                    {
                        "type": "item",
                        "id": "5ff8e482-da0b-4c43-b9ae-a13d384f10bd"
                    }
                ]
            }
        }
    },
    "included": {
        "items": [
            {
                "type": "order_item",
                "id": "5ff8e482-da0b-4c43-b9ae-a13d384f10bd",
                "quantity": 1,
                "product_id": "047e3569-6889-4feb-9a22-1de5722a1a54",
                "name": "Deck Shoe",
                "sku": "deck-shoe-001",
                "unit_price": {
                    "amount": 47500,
                    "currency": "USD",
                    "includes_tax": true
                },
                "value": {
                    "amount": 47500,
                    "currency": "USD",
                    "includes_tax": true
                },
                "links": {},
                "meta": {
                    "display_price": {
                        "with_tax": {
                            "unit": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            },
                            "value": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            }
                        },
                        "without_tax": {
                            "unit": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            },
                            "value": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            }
                        },
                        "tax": {
                            "unit": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            }
                        }
                    },
                    "timestamps": {
                        "created_at": "2019-05-31T15:54:02Z",
                        "updated_at": "2019-05-31T15:54:02Z"
                    }
                },
                "relationships": {
                    "cart_item": {
                        "data": {
                            "type": "cart_item",
                            "id": "4265f5f8-b616-45d6-90cf-d4d797777d72"
                        }
                    }
                }
            }
        ]
    }
}
curl -X POST https://api.moltin.com/v2/carts/:reference/checkout \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
       "data": {
         "customer": {
           "id": "c8c1c511-beef-4812-9b7a-9f92c587217c"
         },
         "billing_address": {
           "first_name": "John",
           "last_name": "Doe",
           "company_name": "Moltin",
           "line_1": "2nd Floor British India House",
           "line_2": "15 Carliol Square",
           "city": "Newcastle upon Tyne",
           "postcode": "NE1 6UF",
           "county": "Tyne & Wear",
           "country": "UK"
         },
         "shipping_address": {
           "first_name": "John",
           "last_name": "Doe",
           "phone_number": "(555) 555-1234",
           "company_name": "Moltin",
           "line_1": "2nd Floor British India House",
           "line_2": "15 Carliol Square",
           "city": "Newcastle upon Tyne",
           "postcode": "NE1 6UF",
           "county": "Tyne & Wear",
           "country": "UK",
           "instructions": "Leave in porch"
         }
       }
    }'

With Customer object

POST https://api.moltin.com/v2/carts/:reference/checkout

You can checkout a Cart with an associated customer name and email.

Path Parameters

NameTypeDescription

reference

string

The reference for the cart to checkout

Headers

NameTypeDescription

Authorization

string

The Bearer token to grant access to the API

Request Body

NameTypeDescription

customer.email

string

Customer email address

customer.name

string

Full name of the customer

billing_address.first_name

string

First name of the billing recipient

billing_address.last_name

string

Last name of the billing recipient

billing_address.company_name

string

Company name of the billing recipient

billing_address.line_1

string

First line of the billing address

billing_address.line_2

string

Second line of the billing address

billing_address.city

string

/city of the billing address

billing_address.postcode

string

Postcode of the billing address

billing_address.county

string

County / state / region of the shipping address

billing_address.country

string

Country of the billing address

shipping_address.first_name

string

First name of the shipping recipient

shipping_address.last_name

string

Last name of the shipping recipient

shipping_address.company_name

string

Company name of the shipping recipient

shipping_address.phone_number

string

Phone number of the shipping recipient

shipping_address.line_1

string

First line of the shipping address

shipping_address.line_2

string

Second line of the shipping address

shipping_address.city

string

City of the shipping address

shipping_address.postcode

string

Postcode of the shipping address

shipping_address.county

string

County / state / region of the shipping address

shipping_address.country

string

Country of the shipping address

shipping_address.instructions

string

Shipping instructions

{
    "data": {
        "type": "order",
        "id": "5a9b6d0a-3e88-43d5-a12e-e5dedbac517d",
        "status": "incomplete",
        "payment": "unpaid",
        "shipping": "unfulfilled",
        "customer": {
            "name": "Ron Swanson",
            "email": "ronswanson@example.com"
        },
        "shipping_address": {
            "first_name": "Ron",
            "last_name": "Swanson",
            "phone_number": "",
            "company_name": "Moltin",
            "line_1": "British India House",
            "line_2": "15 Carliol Square",
            "city": "Newcastle upon Tyne",
            "postcode": "NE1 6UF",
            "county": "Tyne & Wear",
            "country": "UK",
            "instructions": ""
        },
        "billing_address": {
            "first_name": "Ron",
            "last_name": "Swanson",
            "company_name": "Moltin",
            "line_1": "British India House",
            "line_2": "15 Carliol Square",
            "city": "Newcastle upon Tyne",
            "postcode": "NE1 6UF",
            "county": "Tyne & Wear",
            "country": "UK"
        },
        "links": {},
        "meta": {
            "display_price": {
                "with_tax": {
                    "amount": 47500,
                    "currency": "USD",
                    "formatted": "$475.00"
                },
                "without_tax": {
                    "amount": 47500,
                    "currency": "USD",
                    "formatted": "$475.00"
                },
                "tax": {
                    "amount": 0,
                    "currency": "",
                    "formatted": ""
                }
            },
            "timestamps": {
                "created_at": "2018-05-09T09:53:16.045565913Z",
                "updated_at": "2018-05-09T09:53:16.045566558Z"
            }
        },
        "relationships": {
            "items": {
                "data": [
                    {
                        "type": "item",
                        "id": "5ff8e482-da0b-4c43-b9ae-a13d384f10bd"
                    }
                ]
            }
        }
    },
    "included": {
        "items": [
            {
                "type": "order_item",
                "id": "5ff8e482-da0b-4c43-b9ae-a13d384f10bd",
                "quantity": 1,
                "product_id": "047e3569-6889-4feb-9a22-1de5722a1a54",
                "name": "Deck Shoe",
                "sku": "deck-shoe-001",
                "unit_price": {
                    "amount": 47500,
                    "currency": "USD",
                    "includes_tax": true
                },
                "value": {
                    "amount": 47500,
                    "currency": "USD",
                    "includes_tax": true
                },
                "links": {},
                "meta": {
                    "display_price": {
                        "with_tax": {
                            "unit": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            },
                            "value": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            }
                        },
                        "without_tax": {
                            "unit": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            },
                            "value": {
                                "amount": 47500,
                                "currency": "USD",
                                "formatted": "$475.00"
                            }
                        },
                        "tax": {
                            "unit": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            },
                            "value": {
                                "amount": 0,
                                "currency": "USD",
                                "formatted": "$0.00"
                            }
                        }
                    },
                    "timestamps": {
                        "created_at": "2019-05-31T15:54:02Z",
                        "updated_at": "2019-05-31T15:54:02Z"
                    }
                },
                "relationships": {
                    "cart_item": {
                        "data": {
                            "type": "cart_item",
                            "id": "4265f5f8-b616-45d6-90cf-d4d797777d72"
                        }
                    }
                }
            }
        ]
    }
}
curl -X POST https://api.moltin.com/v2/carts/:reference/checkout \
     -H "Authorization: Bearer XXXX" \
     -H "Content-Type: application/json" \
     -d $'{
       "data": {
         "customer": {
           "email": "john@moltin.com",
           "name": "John Doe"
         },
         "billing_address": {
           "first_name": "John",
           "last_name": "Doe",
           "company_name": "Moltin",
           "line_1": "2nd Floor British India House",
           "line_2": "15 Carliol Square",
           "city": "Newcastle upon Tyne",
           "postcode": "NE1 6UF",
           "county": "Tyne & Wear",
           "country": "UK"
         },
         "shipping_address": {
           "first_name": "John",
           "last_name": "Doe",
           "company_name": "Moltin",
           "phone_number": "(555) 555-1234",
           "line_1": "2nd Floor British India House",
           "line_2": "15 Carliol Square",
           "city": "Newcastle upon Tyne",
           "postcode": "NE1 6UF",
           "county": "Tyne & Wear",
           "country": "UK",
           "instructions": "Leave in porch"
         }
       }
    }'

Next steps

Once a Cart has been converted to an Order using either of the methods above, you will most likely want to capture payment for order.

pagePaying for an order

Last updated