Documentation

 Back to top

CHECKOUT API

This documentation is a public approach of Tapbuy API. It allows retailers and publishers to sell products through the Tapbuy express checkout solution.

Our API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website client-side code). JSON is returned by all API responses, including errors.

To make the API as explorable as possible, accounts have test mode and live mode API keys. There is no “switch” for changing between modes, just use the appropriate key to perform a live or test operation. Requests made with test mode credentials will be performed within a sandbox environment.

Endpoint

https://api.tapbuy.io/:version/:api_endpoint

  • Attributes

    • version: 2016-07-01 (string) - Ask for a specific version by prefixing the route with the version value
    • api_endpoint: oauth/token (string) - Endpoint to GET or POST request
  • Technical information

    • supported protocol: https
    • exchange formats: json
    • encoding: UTF-8

Guides

Versioning

The current version is 2016-07-01. Read our API upgrades guide to see our API changelog and to learn more about backwards compatibility.

All requests will use your account API settings, unless you override the API version. The changelog lists every available version. Note that events generated by API requests will always be structured according to your account API version.

To set the API version on a specific request:

  • insert it in the URL as described in the Endpoint section

  • or send a Tapbuy-API-Version header

The priority is given to the URL parameter.

Example header:

Tapbuy-API-Version: 2016-07-01

You can visit your Backend to upgrade your API version. As a precaution, use API versioning to test a new API version before committing to an upgrade.

Context

The API works in a retailer or publisher context. If you use the API as a publisher, you will have to specify a retailer ID for the following methods:

  • /payment-methods

  • /retailer/terms

  • /customer/register

  • /customer/login

Example:

Tapbuy-Retailer-Id: 1

This value can be found in your Tapbuy backend interface.

Guest mode

Some methods support a guest mode. This allows an end-user to add products to his cart without being logged-in for example. Then if he logs in or registers, the guest cart will automatically be given to the connected user.

Usual steps:

  • Add a product to the cart, the response will contain the guest_id to use in next calls

  • The user can interact with the cart by adding, removing products for example

  • To access to the checkout methods (they need an access_token type2) the user has to log in or register. Simply give the guest_id parameter and the cart content will be associated to the connected user.

  • Use the access_token for any next API call

To start a guest mode, you must call the /cart/add-product with the following header:

Authorization: Bearer {access_token - type1}

It will return a guest_id.

The guest_id parameter has to be included in the request headers:

Tapbuy-Guest-Id: 1

Simply use it with the following methods:

  • /cart/add-product

  • /cart/detail

  • /cart/update-product-quantity

  • /cart/remove-product

  • /cart/add-voucher

  • /cart/remove-voucher

Then to merge the guest cart with a connected customer:

  • /customer/register

  • /customer/login

The user will now be able to access to the checkout methods with the access_token type2 returned.

Pagination

All top-level API resources have support for bulk fetches via “list” API methods. For instance you can list products or list customers. These list API methods share a common structure, taking at least these three parameters: limit, offset, and total.

  • Attributes

    • limit: 10 (number) - A limit on the number of items to be returned, between 1 and 100, default is 25.
    • offset: 0 (number) - The offset from the first item to list from.
    • total: 2 (number) - The total number of items that could be returned.
  • Pagination json format

    {
      "limit": 10,
      "offset": 0,
      "total": 2,
      "items":
        [
          {
            "id": 1,
            "description": "first item"
          },
          {
            "id": 2,
            "description": "second item"
          }
        ]
    }

Errors

Tapbuy uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with Tapbuy servers (these are rare).

Not all errors map cleanly onto HTTP response codes, however. When a request is valid but does not complete successfully (e.g., an order is declined), we return a 402 error code.

  • HTTP status code summary

    • 200 - OK: Everything worked as expected.
    • 400 - Bad Request: The request was unacceptable, often due to missing a required parameter.
    • 401 - Unauthorized: No valid API key provided
    • 402 - Request Failed: The parameters were valid but the request failed.
    • 404 - Not Found: The requested resource doesn’t exist.
    • 409 - Conflict: The request conflicts with another request (perhaps due to using the same idempotent key).
    • 429 - Too Many Requests: Too many requests hit the API too quickly.
    • 500, 502, 503, 504 - Server Errors: Something went wrong on Tapbuy end.
  • Tapbuy error code list

    • Generic errors

      • api_100 : “Some parameters are missing : {parameter list}”
      • api_101 : “Unexpected error”
      • api_102 : “Missing or invalid header parameters : Tapbuy-Publisher-Id or Tapbuy-Retailer-Id”
      • api_103 : “Missing or invalid header parameter : Tapbuy-Retailer-Id”
      • api_104 : “Unsufficient permission”
    • Customer errors

      • api_200 : “Unable to log in with these credentials”
      • api_201 : “The email is already used”
      • api_202 : “The email is invalid”
      • api_203 : “The phone number is already used”
      • api_204 : “Invalid password, must be at least 6 chars long”
      • api_205 : “Billing firstname is invalid”
      • api_206 : “Billing lastname is invalid”
      • api_207 : “Billing phone number is invalid”
      • api_208 : “Billing address1 is invalid”
      • api_209 : “Billing zipcode is invalid”
      • api_210 : “Billing city is invalid”
      • api_211 : “Shipping firstname is invalid”
      • api_212 : “Shipping lastname is invalid”
      • api_213 : “Shipping phone number is invalid”
      • api_214 : “Shipping address1 is invalid”
      • api_215 : “Shipping zipcode is invalid”
      • api_216 : “Shipping city is invalid”
      • api_217 : “Could not update user password”
      • api_218 : “firstname is invalid”
      • api_219 : “lastname is invalid”
      • api_220 : “phone number is invalid”
      • api_221 : “address1 is invalid”
      • api_222 : “zipcode is invalid”
      • api_223 : “city is invalid”
      • api_224 : “address not found”
      • api_225 : “User not found”
    • Product errors

      • api_300 : “Product not found”
    • Cart errors

      • api_400 : “Invalid quantity”
      • api_401 : “Product not available”
      • api_402 : “Product out of stock”
      • api_403 : “Maximum quantity reached”
      • api_404 : “Voucher feature is not active”
      • api_405 : “The voucher code is invalid.”
      • api_406 : “Invalid type for address type (billing, shipping, both)”
      • api_407 : “The carrier is invalid.”
      • api_408 : “There is no shipping address selected for the cart.”
      • api_409 : “Carrier not found.”
      • api_410 : “Invalid relay token.”
      • api_411 : “Cart is invalid for payment.”
  • Tapbuy error json format

    {
      "success": false,
      "error_code": "api_101",
      "error_message": "Unexpected error"
    }
  • Handling errors

    Our API libraries raise exceptions for many reasons, such as a failed charge, invalid parameters, authentication errors, and network unavailability. We recommend writing code that gracefully handles all possible API exceptions.

Authentication

Resources related to client authentication that allow access to Tapbuy API. Client must register at tapbuy.io and access the Tapbuy backend in order to retrieve authentication credentials.

Here are the different types of authentication:

  • basic_auth_header

  • access_token type1, obtained with a client_credentials grant_type.

  • access_token type2, obtained with a password grant_type

The basic_auth_header must be added in the request headers with Authorization: Basic declaration. The client_id and client_secret are available in your Tapbuy backend, use them to build a basic_auth_header:

basic_auth_header = "Authorization: Basic " + Base64.encode(client_id + ":" client_secret)

The access tokens can be passed as standard request parameters (POST, GET) or in the request headers with Authorization: Bearer declaration. The access_token type2 can be used to access resources requiring an access_token type1.

The request header type is detailed for each API method.

Get an Access Token

Get an Access Token
POST/oauth/token

Returns an access_token which is passed along as a header with all future requests to authenticate the user. You must provide the Authorization: Basic {basic_auth_header} or Authorization: Bearer {access_token} header in all other requests. All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Tapbuy clients who want to use the API must get an access_token with the following grant_type:

  • client_credentials: (string) - gets an access_token for a Basic Authorization (access_token type1)

  • password: (string) - gets an access_token for an Authorization with a Bearer access_token, optional attributes username/password are needed to get a Bearer access_token (access_token type2)

  • refresh_token: (string) - provide a refresh_token to renew a Bearer access_token

Example URI

POST https://api.tapbuy.io/oauth/token
URI Parameters
HideShow
grant_type: `client_credentials`
string (required) 

The type of oAuth grant type.

username
string (optional) Example: elon@teslamotors.com

The email of the customer

password
string (optional) Example: vivaeads

The Tapbuy or retailer password of the customer

Request
HideShow
Headers
Authorization: Basic {basic_auth_header}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": "true",
  "data": {
    "access_token": "abc123",
    "expires_in": 864000,
    "token_type": "Bearer",
    "scope": "scope name"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "string"
    },
    "data": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string",
          "description": "access token"
        },
        "expires_in": {
          "type": "number",
          "description": "token expiration limit"
        },
        "token_type": {
          "type": "string",
          "description": "token type"
        },
        "scope": {
          "type": "string",
          "description": "token scope"
        }
      }
    }
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "meta": {},
  "errors": [
    {
      "status": 422,
      "code": "invalid_credentials",
      "title": "Invalid credentials"
    }
  ]
}

Products

Resources to describe real or digital goods.

Product list

Product list
GET/products

Get a list of products.

Example URI

GET https://api.tapbuy.io/products
URI Parameters
HideShow
offset
number (optional) Example: 10

Get items starting from a specific offset

limit
number (optional) Example: 25

Limit the number of items per page

filters
array (optional) Example: id_product[]=123

To get only specific products, filters must include pagination parameters (limit, offset)

Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "offset": 0,
  "limit": 25,
  "total": 12,
  "items": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "offset": {
      "type": "number",
      "description": "Current pagination offset"
    },
    "limit": {
      "type": "number",
      "description": "Page item count limit"
    },
    "total": {
      "type": "number",
      "description": "Total number of items that can be browsed"
    },
    "items": {
      "type": "array"
    }
  }
}

Product detail

Product detail
GET/product/:id

Returns product information (title, price, images, attributes…).

Example URI

GET https://api.tapbuy.io/product/:id
URI Parameters
HideShow
id
string (required) Example: AB12

The product identifier (id, url hash, …)

Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "name": "Awesome shirt",
  "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
  "brand_name": "FashionShirt",
  "shop_name": "FashionShirt",
  "images": [
    {
      "url": "https://product.url/img.png",
      "width": 1200,
      "height": 1200
    }
  ],
  "url": "https://product.url",
  "combinations": [
    {
      "id": 23,
      "quantity": 892,
      "price": 25.99,
      "reference": "abc123",
      "attributes": [
        {
          "id": 23,
          "group_name": "Color",
          "name": "Orange"
        }
      ]
    }
  ],
  "price": 120,
  "original_price": 130,
  "currency": "EUR",
  "quantity": 10,
  "reference": "Product Reference"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Product identifier"
    },
    "name": {
      "type": "string",
      "description": "Product name"
    },
    "short_description": {
      "type": "string",
      "description": "Product short description - HTML Allowed"
    },
    "description": {
      "type": "string",
      "description": "Product complete description - HTML Allowed"
    },
    "brand_name": {
      "type": "string",
      "description": "Brand name"
    },
    "shop_name": {
      "type": "string",
      "description": "Brand name"
    },
    "images": {
      "type": "array",
      "description": "Product images"
    },
    "url": {
      "type": "string",
      "description": "Product url"
    },
    "combinations": {
      "type": "array",
      "description": "Product available combinations"
    },
    "price": {
      "type": "number",
      "description": "Product price in € (Tax included)"
    },
    "original_price": {
      "type": "number",
      "description": "Product original price in € (Tax included)"
    },
    "currency": {
      "type": "string",
      "description": "Currency ISO code for prices"
    },
    "quantity": {
      "type": "number",
      "description": "Product Quantity"
    },
    "reference": {
      "type": "string",
      "description": "Product Reference - Should be unique"
    }
  },
  "required": [
    "id",
    "name",
    "images",
    "url",
    "combinations",
    "price",
    "currency",
    "quantity"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "name": "Awesome shirt",
  "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
  "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
  "brand_name": "FashionShirt",
  "shop_name": "FashionShirt",
  "images": [
    {
      "url": "https://product.url/img.png",
      "width": 1200,
      "height": 1200
    }
  ],
  "url": "https://product.url",
  "combinations": [
    {
      "id": 23,
      "quantity": 892,
      "price": 25.99,
      "reference": "abc123",
      "attributes": [
        {
          "id": 23,
          "group_name": "Color",
          "name": "Orange"
        }
      ]
    }
  ],
  "price": 120,
  "original_price": 130,
  "currency": "EUR",
  "quantity": 10,
  "reference": "Product Reference"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Product identifier"
    },
    "name": {
      "type": "string",
      "description": "Product name"
    },
    "short_description": {
      "type": "string",
      "description": "Product short description - HTML Allowed"
    },
    "description": {
      "type": "string",
      "description": "Product complete description - HTML Allowed"
    },
    "brand_name": {
      "type": "string",
      "description": "Brand name"
    },
    "shop_name": {
      "type": "string",
      "description": "Brand name"
    },
    "images": {
      "type": "array",
      "description": "Product images"
    },
    "url": {
      "type": "string",
      "description": "Product url"
    },
    "combinations": {
      "type": "array",
      "description": "Product available combinations"
    },
    "price": {
      "type": "number",
      "description": "Product price in € (Tax included)"
    },
    "original_price": {
      "type": "number",
      "description": "Product original price in € (Tax included)"
    },
    "currency": {
      "type": "string",
      "description": "Currency ISO code for prices"
    },
    "quantity": {
      "type": "number",
      "description": "Product Quantity"
    },
    "reference": {
      "type": "string",
      "description": "Product Reference - Should be unique"
    }
  },
  "required": [
    "id",
    "name",
    "images",
    "url",
    "combinations",
    "price",
    "currency",
    "quantity"
  ]
}

Similar products

Similar products
GET/product/:id/similar

Returns collection of Products similar to the product id sent.

Example URI

GET https://api.tapbuy.io/product/:id/similar
URI Parameters
HideShow
id
number (required) Example: 2

The product id

offset
number (optional) Example: 10

Get items starting from a specific offset

limit
number (optional) Example: 25

Limit the number of items per page

Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "offset": 0,
  "limit": 25,
  "total": 12,
  "items": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "offset": {
      "type": "number",
      "description": "Current pagination offset"
    },
    "limit": {
      "type": "number",
      "description": "Page item count limit"
    },
    "total": {
      "type": "number",
      "description": "Total number of items that can be browsed"
    },
    "items": {
      "type": "array"
    }
  }
}

Customer

Create customer

Create customer
POST/customer/register

Creates a customer and returns customer data.

Returns an access_token type2 to use in next API calls.

Example URI

POST https://api.tapbuy.io/customer/register
URI Parameters
HideShow
grant_type
string (required) Example: password
username
string (required) Example: elon@teslamotors.com
password
string (required) Example: vivaeads
firstname
string (required) Example: elon
lastname
string (required) Example: musk
phone_number
number (required) Example: 0623456789
use_billing_address_for_shipping
number (required) Example: 0

0 or 1, allows to only give the billing address fields

billing_address1
string (required) Example: `19 Bd Poissoniere
billing_address2
string (required) Example: WAI BNP Paribas
billing_postcode
string (required) Example: 75002
billing_city
string (required) Example: Paris
billing_iso_country
string (required) Example: FR
shipping_address1
string (optional) Example: 19 Bd Poissoniere
shipping_address2
string (optional) Example: WAI BNP Paribas
shipping_postcode
string (optional) Example: 75002
shipping_city
string (optional) Example: Paris
shipping_iso_country
string (optional) Example: FR
Request  Regular customer
HideShow
Headers
Authorization: Basic {basic_auth_header}
Tapbuy-Retailer-Id: {retailer_id}
Request  Merge with guest
HideShow
Headers
Authorization: Basic {basic_auth_header}
Tapbuy-Retailer-Id: {retailer_id}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "email": "elon@teslamotors.com",
  "firstname": "Elon",
  "lastname": "Musk",
  "phone": 623456789,
  "shipping_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "billing_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "oauth": {
    "access_token": "abc123",
    "expires_in": 864000,
    "token_type": "Bearer",
    "scope": "scope name",
    "refresh_token": "abc123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Customer identifier"
    },
    "email": {
      "type": "string",
      "description": "The email of the customer"
    },
    "firstname": {
      "type": "string",
      "description": "The firstname of the customer"
    },
    "lastname": {
      "type": "string",
      "description": "The lastname of the customer"
    },
    "phone": {
      "type": "number",
      "description": "Phone number"
    },
    "shipping_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The main address of the customer"
    },
    "billing_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The billing address of the customer (if different than shipping)"
    },
    "oauth": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string",
          "description": "access token"
        },
        "expires_in": {
          "type": "number",
          "description": "token expiration limit"
        },
        "token_type": {
          "type": "string",
          "description": "token type"
        },
        "scope": {
          "type": "string",
          "description": "token scope"
        },
        "refresh_token": {
          "type": "string",
          "description": "refresh token"
        }
      },
      "description": "OAuth data"
    }
  },
  "required": [
    "id",
    "email",
    "firstname",
    "lastname",
    "phone"
  ]
}

Edit customer

Edit customer
POST/customer/edit

Edits customers password and returns customer data.

Example URI

POST https://api.tapbuy.io/customer/edit
URI Parameters
HideShow
password
string (required) Example: vivaeads
Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "email": "elon@teslamotors.com",
  "firstname": "Elon",
  "lastname": "Musk",
  "phone": 623456789,
  "shipping_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "billing_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Customer identifier"
    },
    "email": {
      "type": "string",
      "description": "The email of the customer"
    },
    "firstname": {
      "type": "string",
      "description": "The firstname of the customer"
    },
    "lastname": {
      "type": "string",
      "description": "The lastname of the customer"
    },
    "phone": {
      "type": "number",
      "description": "Phone number"
    },
    "shipping_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The main address of the customer"
    },
    "billing_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The billing address of the customer (if different than shipping)"
    }
  },
  "required": [
    "id",
    "email",
    "firstname",
    "lastname",
    "phone"
  ]
}

Log customer

Log customer
POST/customer/login

Logs the customer in, updates the access_token grant_type and retrieves customer data.

Returns an access_token type2 to use in next API calls.

Example URI

POST https://api.tapbuy.io/customer/login
URI Parameters
HideShow
grant_type
string (required) Example: password

The type of oAuth grant. Always “password”

username
string (optional) Example: elon@teslamotors.com

The customer email address or phone number

password
string (optional) Example: vivaeads

The customer password

Request  Regular customer
HideShow
Headers
Authorization: Basic {basic_auth_header}
Tapbuy-Retailer-Id: {retailer_id}
Request  Merge with guest
HideShow
Headers
Authorization: Basic {basic_auth_header}
Tapbuy-Retailer-Id: {retailer_id}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "email": "elon@teslamotors.com",
  "firstname": "Elon",
  "lastname": "Musk",
  "phone": 623456789,
  "shipping_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "billing_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "oauth": {
    "access_token": "abc123",
    "expires_in": 864000,
    "token_type": "Bearer",
    "scope": "scope name",
    "refresh_token": "abc123"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Customer identifier"
    },
    "email": {
      "type": "string",
      "description": "The email of the customer"
    },
    "firstname": {
      "type": "string",
      "description": "The firstname of the customer"
    },
    "lastname": {
      "type": "string",
      "description": "The lastname of the customer"
    },
    "phone": {
      "type": "number",
      "description": "Phone number"
    },
    "shipping_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The main address of the customer"
    },
    "billing_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The billing address of the customer (if different than shipping)"
    },
    "oauth": {
      "type": "object",
      "properties": {
        "access_token": {
          "type": "string",
          "description": "access token"
        },
        "expires_in": {
          "type": "number",
          "description": "token expiration limit"
        },
        "token_type": {
          "type": "string",
          "description": "token type"
        },
        "scope": {
          "type": "string",
          "description": "token scope"
        },
        "refresh_token": {
          "type": "string",
          "description": "refresh token"
        }
      },
      "description": "OAuth data"
    }
  },
  "required": [
    "id",
    "email",
    "firstname",
    "lastname",
    "phone"
  ]
}

Forgotten password

Forgotten password
POST/customer/forgotten-password

Initiates the forgotten password process (sends the email to customer). Sometimes the email is not sent and a redirect_url is returned, it has to be loaded for the user to ask for his password.

Example URI

POST https://api.tapbuy.io/customer/forgotten-password
URI Parameters
HideShow
email
string (required) Example: elon@tesla.com

The customer email address

Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "redirect_url": null
}

Email check

Email check
GET/customer/email-check

Returns customer type from his email address : new_user (email not found), tapbuy_user, retailer_user.

Example URI

GET https://api.tapbuy.io/customer/email-check
URI Parameters
HideShow
email
string (required) Example: elon@tesla.com

The customer email address

Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "type": "new_user"
}

Retrieve customer

Retrieve customer
GET/customer

Retrieves customer data.

Example URI

GET https://api.tapbuy.io/customer
Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": "abc123",
  "email": "elon@teslamotors.com",
  "firstname": "Elon",
  "lastname": "Musk",
  "phone": 623456789,
  "shipping_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  },
  "billing_address": {
    "id": 0,
    "firstname": "elon",
    "lastname": "musk",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "post_code": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "phone_number": 623456789
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Customer identifier"
    },
    "email": {
      "type": "string",
      "description": "The email of the customer"
    },
    "firstname": {
      "type": "string",
      "description": "The firstname of the customer"
    },
    "lastname": {
      "type": "string",
      "description": "The lastname of the customer"
    },
    "phone": {
      "type": "number",
      "description": "Phone number"
    },
    "shipping_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The main address of the customer"
    },
    "billing_address": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Address identifier"
        },
        "firstname": {
          "type": "string",
          "description": "Firstname"
        },
        "lastname": {
          "type": "string",
          "description": "Lastname"
        },
        "address1": {
          "type": "string",
          "description": "Address 1"
        },
        "address2": {
          "type": "string",
          "description": "Address 2"
        },
        "post_code": {
          "type": "string",
          "description": "Post code"
        },
        "city": {
          "type": "string",
          "description": "City name"
        },
        "iso_country": {
          "type": "string",
          "description": "Country iso code"
        },
        "phone_number": {
          "type": "number",
          "description": "Phone number"
        }
      },
      "required": [
        "id",
        "firstname",
        "lastname",
        "address1",
        "post_code",
        "city",
        "iso_country",
        "phone_number"
      ],
      "description": "The billing address of the customer (if different than shipping)"
    }
  },
  "required": [
    "id",
    "email",
    "firstname",
    "lastname",
    "phone"
  ]
}

Get customer addresses

Get customer addresses
GET/customer/addresses

Returns customer addresses.

Example URI

GET https://api.tapbuy.io/customer/addresses
Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "offset": 0,
  "limit": 25,
  "total": 12,
  "items": [
    {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "offset": {
      "type": "number",
      "description": "Current pagination offset"
    },
    "limit": {
      "type": "number",
      "description": "Page item count limit"
    },
    "total": {
      "type": "number",
      "description": "Total number of items that can be browsed"
    },
    "items": {
      "type": "array"
    }
  }
}

Add customer address

Add customer address
POST/customer/addresses/create

Adds given customer address.

Example URI

POST https://api.tapbuy.io/customer/addresses/create
URI Parameters
HideShow
firstname
string (required) Example: Jean

Address firstname

lastname
string (required) Example: Valjean

Address lastname

phone_number
string (required) Example: +33699887744

Address phone

address1
string (required) Example: 10 rue de Paris

Address address1

address2
string (optional) Example: batiment B

Address address2

postcode
string (required) Example: 75000

Address postcode

city
string (required) Example: Paris

Address city

iso_country
string (required) Example: FR

Country ISO code

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 0,
  "firstname": "elon",
  "lastname": "musk",
  "address1": "1, infinite loop steet",
  "address2": "2nd floor",
  "post_code": "75002",
  "city": "Paris",
  "iso_country": "FR",
  "phone_number": 623456789
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Address identifier"
    },
    "firstname": {
      "type": "string",
      "description": "Firstname"
    },
    "lastname": {
      "type": "string",
      "description": "Lastname"
    },
    "address1": {
      "type": "string",
      "description": "Address 1"
    },
    "address2": {
      "type": "string",
      "description": "Address 2"
    },
    "post_code": {
      "type": "string",
      "description": "Post code"
    },
    "city": {
      "type": "string",
      "description": "City name"
    },
    "iso_country": {
      "type": "string",
      "description": "Country iso code"
    },
    "phone_number": {
      "type": "number",
      "description": "Phone number"
    }
  },
  "required": [
    "id",
    "firstname",
    "lastname",
    "address1",
    "post_code",
    "city",
    "iso_country",
    "phone_number"
  ]
}

Update customer address

Update customer address
POST/customer/addresses/edit

Updates given customer address.

Example URI

POST https://api.tapbuy.io/customer/addresses/edit
URI Parameters
HideShow
id
number (required) Example: 1

Address identifier

firstname
string (required) Example: Jean

Address firstname

lastname
string (required) Example: Valjean

Address lastname

phone_number
string (required) Example: +33699887744

Address phone

address1
string (required) Example: 10 rue de Paris

Address address1

address2
string (optional) Example: batiment B

Address address2

postcode
string (required) Example: 75000

Address postcode

city
string (required) Example: Paris

Address city

iso_country
string (required) Example: FR

Country ISO code

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 0,
  "firstname": "elon",
  "lastname": "musk",
  "address1": "1, infinite loop steet",
  "address2": "2nd floor",
  "post_code": "75002",
  "city": "Paris",
  "iso_country": "FR",
  "phone_number": 623456789
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Address identifier"
    },
    "firstname": {
      "type": "string",
      "description": "Firstname"
    },
    "lastname": {
      "type": "string",
      "description": "Lastname"
    },
    "address1": {
      "type": "string",
      "description": "Address 1"
    },
    "address2": {
      "type": "string",
      "description": "Address 2"
    },
    "post_code": {
      "type": "string",
      "description": "Post code"
    },
    "city": {
      "type": "string",
      "description": "City name"
    },
    "iso_country": {
      "type": "string",
      "description": "Country iso code"
    },
    "phone_number": {
      "type": "number",
      "description": "Phone number"
    }
  },
  "required": [
    "id",
    "firstname",
    "lastname",
    "address1",
    "post_code",
    "city",
    "iso_country",
    "phone_number"
  ]
}

Remove customer address

Remove customer address
POST/customer/addresses/remove

Removes given customer address.

Example URI

POST https://api.tapbuy.io/customer/addresses/remove
URI Parameters
HideShow
id
number (required) Example: 1

Address identifier

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}

Static

Get retailer terms of sale

Get retailer terms of sale
GET/retailer/terms

Gets the retailer General terms of sale, terms of use, …

Example URI

GET https://api.tapbuy.io/retailer/terms
Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Retailer-Id: {retailer_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "terms_of_use": "<p>Retailer General terms of use</p>",
  "terms_of_use_stripped": "Retailer General terms of use",
  "terms_of_sale": "<p>Retailer General terms of sale</p>",
  "terms_of_sale_stripped": "Retailer General terms of sale",
  "return_policy": "<p>Retailer return policy</p>",
  "return_policy_stripped": "Retailer return policy"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "terms_of_use": {
      "type": "string",
      "description": "The retailer General terms of use"
    },
    "terms_of_use_stripped": {
      "type": "string",
      "description": "The retailer General terms of use, without HTML tags"
    },
    "terms_of_sale": {
      "type": "string",
      "description": "The retailer General terms of sale"
    },
    "terms_of_sale_stripped": {
      "type": "string",
      "description": "The retailer General terms of sale, without HTML tags"
    },
    "return_policy": {
      "type": "string",
      "description": "The retailer return policy"
    },
    "return_policy_stripped": {
      "type": "string",
      "description": "The retailer return policy, without HTML tags"
    }
  }
}

Checkout

Checkout url to build and run in a browser/webview. At the end of the process, the result is returned to the confirm_url url + (http code depending on the error : 200 OK, 401, 403, etc).

Get carriers

Get carriers
GET/carriers

Get available carriers for current cart.

Example URI

GET https://api.tapbuy.io/carriers
Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "abc123",
    "name": "My Carrier",
    "type": "home",
    "price": 3.99,
    "delay": "2 days"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get carrier relays

Get carrier relays
GET/carriers/relays

Gets available relays for selected carrier.

Example URI

GET https://api.tapbuy.io/carriers/relays
URI Parameters
HideShow
carrier_id
number (required) Example: 1

Carrier identifier

postcode
string (optional) Example: 75000

postcode for relay location

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Name",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "postcode": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "latitude": "45.76171700",
    "longitude": "4.83341600",
    "hours": {
      "monday": "09:00 - 18:00",
      "tuesday": "09:00 - 18:00",
      "wednesday": "09:00 - 18:00",
      "thursday": "09:00 - 18:00",
      "friday": "09:00 - 18:00",
      "saturday": "09:00 - 18:00",
      "sunday": "09:00 - 18:00"
    },
    "token": "abc123"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get carrier stores

Get carrier stores
GET/carriers/stores

Gets available stores for selected carrier.

Example URI

GET https://api.tapbuy.io/carriers/stores
URI Parameters
HideShow
carrier_id
number (required) Example: 1

Carrier identifier

postcode
string (optional) Example: 75000

postcode for store location

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Name",
    "address1": "1, infinite loop steet",
    "address2": "2nd floor",
    "postcode": "75002",
    "city": "Paris",
    "iso_country": "FR",
    "latitude": "45.76171700",
    "longitude": "4.83341600",
    "hours": {
      "monday": "09:00 - 18:00",
      "tuesday": "09:00 - 18:00",
      "wednesday": "09:00 - 18:00",
      "thursday": "09:00 - 18:00",
      "friday": "09:00 - 18:00",
      "saturday": "09:00 - 18:00",
      "sunday": "09:00 - 18:00"
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Cart

Get cart detail

Get cart detail
GET/cart/detail

Gets the detailed information of current cart.

Example URI

GET https://api.tapbuy.io/cart/detail
Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Add product to cart

Add product to cart
POST/cart/add-product

Adds product to cart on current customer cart

Example URI

POST https://api.tapbuy.io/cart/add-product
URI Parameters
HideShow
product_id
number (required) Example: 12

product id

combination_id
number (optional) Example: 12

combination id

quantity
number (optional) Example: 12

quantity to add

Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Request  First guest interaction
HideShow
Headers
Authorization: Bearer {access_token - type1}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Update cart product quantity

Update cart product quantity
POST/cart/update-product-quantity

Updates a product quantity in the current cart

Example URI

POST https://api.tapbuy.io/cart/update-product-quantity
URI Parameters
HideShow
product_id
number (required) Example: 2455

Product id

combination_id
number (optional) Example: 3214

combination id

quantity
number (required) Example: 2

The new quantity for the product

Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Remove a product from cart

Remove a product from cart
POST/cart/remove-product

Removes a product from a cart.

Example URI

POST https://api.tapbuy.io/cart/remove-product
URI Parameters
HideShow
product_id
number (required) Example: 34

Product id

combination_id
number (optional) Example: 44

combination id

Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Select address for a Cart

Select address for a Cart
POST/cart/select-address

Selects an address as billing / shipping / both for current cart, returns updated current cart.

Example URI

POST https://api.tapbuy.io/cart/select-address
URI Parameters
HideShow
id
number (required) Example: 12

Address id

type
string (required) Example: billing

Address type

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Set cart carrier

Set cart carrier
POST/cart/select-carrier

Selects carrier for current cart.

Example URI

POST https://api.tapbuy.io/cart/select-carrier
URI Parameters
HideShow
carrier_id
number (required) Example: 67

Carrier id

address_id
number (required) Example: 10

Address id

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Select store

Select store
POST/cart/select-store

Selects store for current cart.

Example URI

POST https://api.tapbuy.io/cart/select-store
URI Parameters
HideShow
carrier_id
number (required) Example: 67

Carrier id

store_id
number (required) Example: 10

Store id

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Select relay

Select relay
POST/cart/select-relay

Selects relay for current cart.

Example URI

POST https://api.tapbuy.io/cart/select-relay
URI Parameters
HideShow
carrier_id
number (required) Example: 67

Carrier id

relay_token
string (required) Example: abc123

Relay token

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Add voucher

Add voucher
POST/cart/add-voucher

Adds a voucher to current cart.

Example URI

POST https://api.tapbuy.io/cart/add-voucher
URI Parameters
HideShow
code
string (required) Example: DISCOUNT20

Voucher code

Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Remove voucher

Remove voucher
POST/cart/remove-voucher

Removes a voucher from current cart

Example URI

POST https://api.tapbuy.io/cart/remove-voucher
URI Parameters
HideShow
id
number (required) Example: 10

Voucher id

Request  Logged in customer
HideShow
Headers
Authorization: Bearer {access_token - type2}
Request  Known guest
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Guest-Id: {guest_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "guest_id": 1,
  "customer": {
    "id": "abc123",
    "email": "elon@teslamotors.com",
    "firstname": "Elon",
    "lastname": "Musk",
    "phone": 623456789,
    "shipping_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    },
    "billing_address": {
      "id": 0,
      "firstname": "elon",
      "lastname": "musk",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "post_code": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "phone_number": 623456789
    }
  },
  "products": [
    {
      "id": "abc123",
      "name": "Awesome shirt",
      "short_description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>",
      "description": "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p><p>Aliquam erat volutpat.</p>",
      "brand_name": "FashionShirt",
      "shop_name": "FashionShirt",
      "images": [
        {
          "url": "https://product.url/img.png",
          "width": 1200,
          "height": 1200
        }
      ],
      "url": "https://product.url",
      "combinations": [
        {
          "id": 23,
          "quantity": 892,
          "price": 25.99,
          "reference": "abc123",
          "attributes": [
            {
              "id": 23,
              "group_name": "Color",
              "name": "Orange"
            }
          ]
        }
      ],
      "price": 120,
      "original_price": 130,
      "currency": "EUR",
      "quantity": 10,
      "reference": "Product Reference"
    }
  ],
  "vouchers": [
    {
      "id": "1",
      "code": "VOUCHER01",
      "description": "Description",
      "amount": 3.99,
      "free_shipping": true
    }
  ],
  "delivery": {
    "carrier": {
      "id": "abc123",
      "name": "My Carrier",
      "type": "home",
      "price": 3.99,
      "delay": "2 days"
    },
    "store": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      }
    },
    "relay": {
      "name": "Name",
      "address1": "1, infinite loop steet",
      "address2": "2nd floor",
      "postcode": "75002",
      "city": "Paris",
      "iso_country": "FR",
      "latitude": "45.76171700",
      "longitude": "4.83341600",
      "hours": {
        "monday": "09:00 - 18:00",
        "tuesday": "09:00 - 18:00",
        "wednesday": "09:00 - 18:00",
        "thursday": "09:00 - 18:00",
        "friday": "09:00 - 18:00",
        "saturday": "09:00 - 18:00",
        "sunday": "09:00 - 18:00"
      },
      "token": "abc123"
    }
  },
  "total_products": 1,
  "total_shipping": 1,
  "total_vouchers": 1,
  "total": 1,
  "currency": "EUR"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "guest_id": {
      "type": "number",
      "description": "User identifier to use in guest mode (with Tapbuy-Guest-Id request header)"
    },
    "customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Customer identifier"
        },
        "email": {
          "type": "string",
          "description": "The email of the customer"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the customer"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the customer"
        },
        "phone": {
          "type": "number",
          "description": "Phone number"
        },
        "shipping_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The main address of the customer"
        },
        "billing_address": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Address identifier"
            },
            "firstname": {
              "type": "string",
              "description": "Firstname"
            },
            "lastname": {
              "type": "string",
              "description": "Lastname"
            },
            "address1": {
              "type": "string",
              "description": "Address 1"
            },
            "address2": {
              "type": "string",
              "description": "Address 2"
            },
            "post_code": {
              "type": "string",
              "description": "Post code"
            },
            "city": {
              "type": "string",
              "description": "City name"
            },
            "iso_country": {
              "type": "string",
              "description": "Country iso code"
            },
            "phone_number": {
              "type": "number",
              "description": "Phone number"
            }
          },
          "required": [
            "id",
            "firstname",
            "lastname",
            "address1",
            "post_code",
            "city",
            "iso_country",
            "phone_number"
          ],
          "description": "The billing address of the customer (if different than shipping)"
        }
      },
      "required": [
        "id",
        "email",
        "firstname",
        "lastname",
        "phone"
      ],
      "description": "The customer associated to cart"
    },
    "products": {
      "type": "array",
      "description": "Cart products"
    },
    "vouchers": {
      "type": "array",
      "description": "Cart vouchers"
    },
    "delivery": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Carrier identifier"
            },
            "name": {
              "type": "string",
              "description": "Carrier name"
            },
            "type": {
              "type": "string",
              "description": "Carrier delivery type (home, store, relay)"
            },
            "price": {
              "type": "number",
              "description": "Carrier sending fees"
            },
            "delay": {
              "type": "string",
              "description": "Carrier delivery delay"
            }
          },
          "required": [
            "id",
            "name",
            "type",
            "price",
            "delay"
          ],
          "description": "Selected carrier"
        },
        "store": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected store"
        },
        "relay": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "name"
            },
            "address1": {
              "type": "string",
              "description": "address line 1"
            },
            "address2": {
              "type": "string",
              "description": "address line 2"
            },
            "postcode": {
              "type": "string",
              "description": "address postcode"
            },
            "city": {
              "type": "string",
              "description": "address city"
            },
            "iso_country": {
              "type": "string",
              "description": "address country code"
            },
            "latitude": {
              "type": "string",
              "description": "latitude"
            },
            "longitude": {
              "type": "string",
              "description": "longitude"
            },
            "hours": {
              "type": "object",
              "properties": {
                "monday": {
                  "type": "string",
                  "description": "Hours for monday"
                },
                "tuesday": {
                  "type": "string",
                  "description": "Hours for tuesday"
                },
                "wednesday": {
                  "type": "string",
                  "description": "Hours for wednesday"
                },
                "thursday": {
                  "type": "string",
                  "description": "Hours for thursday"
                },
                "friday": {
                  "type": "string",
                  "description": "Hours for friday"
                },
                "saturday": {
                  "type": "string",
                  "description": "Hours for saturday"
                },
                "sunday": {
                  "type": "string",
                  "description": "Hours for sunday"
                }
              },
              "required": [
                "monday",
                "tuesday",
                "wednesday",
                "thursday",
                "friday",
                "saturday",
                "sunday"
              ],
              "description": "opening hours"
            },
            "token": {
              "type": "string",
              "description": "Relay token to be used when selecting a relay"
            }
          },
          "required": [
            "name",
            "address1",
            "address2",
            "postcode",
            "city",
            "iso_country"
          ],
          "description": "Selected relay"
        }
      }
    },
    "total_products": {
      "type": "number",
      "description": "Product total cost"
    },
    "total_shipping": {
      "type": "number",
      "description": "Shipping total cost"
    },
    "total_vouchers": {
      "type": "number",
      "description": "Voucher total price"
    },
    "total": {
      "type": "number",
      "description": "Cart total cost"
    },
    "currency": {
      "type": "string",
      "description": "Currency code"
    }
  },
  "required": [
    "total_products",
    "total_shipping",
    "total_vouchers",
    "total",
    "currency"
  ]
}

Payment methods list

Payment methods list
GET/payment-methods

Gets a list of available payment methods for retailer : creditcard, paypal.

Example URI

GET https://api.tapbuy.io/payment-methods
Request
HideShow
Headers
Authorization: Bearer {access_token - type1}
Tapbuy-Retailer-Id: {retailer_id}
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "creditcard"
]

Validate cart

Validate cart
POST/cart/validate

Validates a cart to create an order: checks cart product availability, price matching and handle cart rules. Returns the secured payment page URL (URL to load or redirect to, for the payment process), and the cart ID to use to get its validation status.

Example URI

POST https://api.tapbuy.io/cart/validate
URI Parameters
HideShow
payment_method
string (required) Example: creditcard

Payment method

redirect_url
string (optional) Example: https://my-site.com/payment-result

Url where the payment result will be posted

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "cart_id": 10,
  "payment_url": "https://www.paypal.com"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "cart_id": {
      "type": "number",
      "description": "Cart id, used to get its status"
    },
    "payment_url": {
      "type": "string",
      "description": "URL to load for payment process"
    }
  }
}

Get cart status

Get cart status
GET/cart/validation-status

Gets the status of a cart. Use the cart identifier from /cart/validate method.

Current available states are:

  • order_pending : the payment step is not complete yet

  • order_validated : same as order_pending

  • payment_processed : the payment is ok

  • retailer_error : an error occured from the retailer side

  • order_sent : the order items have been shipped

Example URI

GET https://api.tapbuy.io/cart/validation-status
URI Parameters
HideShow
cart_id
number (required) Example: 10

Cart id

Request
HideShow
Headers
Authorization: Bearer {access_token - type2}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "cart_status": "payment_processed"
}
Receive ROI estimation
Send
Login
Request a new password

Votre formulaire a été soumis. Nous revenons vers vous dans les plus brefs délais. N'hésitez pas à nous contacter si vous avez des questions, nous serons ravis d'y répondre !
L'équipe Tapbuy

Best,

The Tapbuy Team

Close

Best,

The Tapbuy Team

Close