Introduction
Obypay public API
This documentation aims to provide all the information you need to work with our API.
Requests
Signed requests
Every request has to be signed. Please read Authenticating requests
Rate limit
You are limited to 60 requests per minute.
Beyond that limit, an HTTP 429 error code will be sent.
Extra data on demand
Some endpoints may contain extra datas.
Just add with array parameter in your request to add the extra fields you may need.
Responses
Successful responses
- implement HTTP code return status
- contain these 3 keys
- status : response HTTP status
- code : response HTTP code
- data : data requested
- contain x-location-id header
Error responses
- implement HTTP code return status
- contain these 3 keys
- status : response HTTP status
- code : response HTTP code
- errors : errors triggered
- contain x-location-id header
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer YOUR_AUTH_KEY"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
All requests must include an Accept header with the value "application/json"
The token never expires but can be revoked your Obypay backoffice.
To retrieve your token, please contact Obypay support
Administrative API
Get account data
requires authentication
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/me" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/me"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/me';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/me'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, Product in stock):
{
"status": 200,
"code": "OK",
"data": {
"location": {
"address": {
"address": "2 rue tutu",
"zipcode": "02000",
"city": "Truc",
"country": "FR"
},
"id": "LXlgVPQ6YF",
"identification": "12343",
"name": "Restaurant du coin",
"phone": "0647562364"
},
"company": {
"address": {
"address_line_1": "",
"address_line_2": "2 rue tutu",
"zipcode": "02000",
"city": "Truc",
"country": "FR"
},
"id": "65202297ad79358c12090af4",
"identification": "12345678900015",
"name": "Société Lala SARL"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Auth API
Manage your access token
Renew an existing token
requires authentication
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/auth/tokens/renew" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/auth/tokens/renew"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/auth/tokens/renew';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/auth/tokens/renew'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()
Example response (200, Token renew):
{
"status": 200,
"code": "OK",
"data": {
"token": "abcdefgh|ijklmnopqrstuvwxyz0123456789"
}
}
Example response (400, Can't delete current token):
{
"status": 400,
"code": "Bad Request",
"errors": [
"Can't delete record"
]
}
Example response (404, Unknown token):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Inventory API
Inventory
Upload full inventory
requires authentication inventory-manage
You can upload your inventory
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/inventories" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"config\": {
\"lang\": \"fr\"
},
\"modifiers\": [
{
\"id\": \"dolorem\",
\"label\": \"impedit\",
\"min\": 62,
\"max\": 90,
\"multiple\": false,
\"items\": [
{
\"id\": \"velit\",
\"label\": \"exercitationem\",
\"max\": 87,
\"prices\": [
{
\"type\": \"takeaway\",
\"value\": 7
}
]
}
]
}
],
\"containers\": [
{
\"id\": \"reiciendis\",
\"label\": \"amet\",
\"items\": []
}
],
\"pagers\": [
{
\"id\": \"ipsam\",
\"label\": \"aut\",
\"color\": \"voluptas\",
\"type\": \"all\"
}
],
\"tagsets\": [
{
\"id\": \"veniam\",
\"label\": \"temporibus\",
\"items\": [
{
\"id\": \"similique\",
\"label\": \"maiores\",
\"picture\": \"http:\\/\\/haley.info\\/aut-repellat-explicabo-qui-voluptatum-nihil-nisi\"
}
]
}
],
\"products\": [
{
\"description\": \"Qui impedit cumque ad expedita.\",
\"id\": \"deleniti\",
\"label\": \"consequatur\",
\"prices\": [
{
\"type\": \"delivery\",
\"value\": 6,
\"vat_rate\": \"w\"
}
],
\"size\": {
\"unit\": \"kg\",
\"value\": \"mcwxctjmjlcjwuf\"
},
\"types\": [],
\"level\": 4,
\"picture\": \"https:\\/\\/www.moen.org\\/molestiae-fugit-soluta-numquam-aut-rerum-veniam-vel-reiciendis\",
\"pager_id\": \"quae\",
\"tagsets\": [
{
\"id\": \"fugit\"
}
],
\"weekly_schedule\": [
{
\"day\": 3,
\"openings\": [
{
\"from\": \"33:34\",
\"to\": \"99:94\"
}
]
}
]
}
],
\"productsets\": [
{
\"id\": \"similique\",
\"label\": \"occaecati\",
\"prices\": [
{
\"type\": \"takeaway\",
\"value\": 5,
\"vat_rate\": \"g\"
}
],
\"types\": [],
\"level\": 19,
\"picture\": \"http:\\/\\/www.raynor.com\\/sit-repellat-excepturi-consequuntur-veniam\",
\"weekly_schedule\": [
{
\"day\": 1,
\"openings\": [
{
\"from\": \"50:60\",
\"to\": \"53:46\"
}
]
}
],
\"steps\": [
{
\"id\": \"ipsam\",
\"label\": \"ipsum\",
\"min\": 14,
\"max\": 1,
\"free\": 20,
\"items\": [
{
\"id\": \"sit\",
\"extra_price\": 18
}
]
}
]
}
],
\"menus\": [
{
\"id\": \"sed\",
\"label\": \"eos\",
\"families\": [
{
\"id\": \"enim\",
\"label\": \"iure\",
\"families\": [
{
\"id\": \"natus\",
\"label\": \"ratione\",
\"families\": [
{
\"id\": \"et\",
\"label\": \"magnam\",
\"items\": [
{
\"id\": \"dolor\",
\"type\": \"products\",
\"prices\": [
{
\"type\": \"takeaway\",
\"value\": 11,
\"vat_rate\": \"f\"
}
]
}
]
}
]
}
]
}
]
}
]
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/inventories"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"config": {
"lang": "fr"
},
"modifiers": [
{
"id": "dolorem",
"label": "impedit",
"min": 62,
"max": 90,
"multiple": false,
"items": [
{
"id": "velit",
"label": "exercitationem",
"max": 87,
"prices": [
{
"type": "takeaway",
"value": 7
}
]
}
]
}
],
"containers": [
{
"id": "reiciendis",
"label": "amet",
"items": []
}
],
"pagers": [
{
"id": "ipsam",
"label": "aut",
"color": "voluptas",
"type": "all"
}
],
"tagsets": [
{
"id": "veniam",
"label": "temporibus",
"items": [
{
"id": "similique",
"label": "maiores",
"picture": "http:\/\/haley.info\/aut-repellat-explicabo-qui-voluptatum-nihil-nisi"
}
]
}
],
"products": [
{
"description": "Qui impedit cumque ad expedita.",
"id": "deleniti",
"label": "consequatur",
"prices": [
{
"type": "delivery",
"value": 6,
"vat_rate": "w"
}
],
"size": {
"unit": "kg",
"value": "mcwxctjmjlcjwuf"
},
"types": [],
"level": 4,
"picture": "https:\/\/www.moen.org\/molestiae-fugit-soluta-numquam-aut-rerum-veniam-vel-reiciendis",
"pager_id": "quae",
"tagsets": [
{
"id": "fugit"
}
],
"weekly_schedule": [
{
"day": 3,
"openings": [
{
"from": "33:34",
"to": "99:94"
}
]
}
]
}
],
"productsets": [
{
"id": "similique",
"label": "occaecati",
"prices": [
{
"type": "takeaway",
"value": 5,
"vat_rate": "g"
}
],
"types": [],
"level": 19,
"picture": "http:\/\/www.raynor.com\/sit-repellat-excepturi-consequuntur-veniam",
"weekly_schedule": [
{
"day": 1,
"openings": [
{
"from": "50:60",
"to": "53:46"
}
]
}
],
"steps": [
{
"id": "ipsam",
"label": "ipsum",
"min": 14,
"max": 1,
"free": 20,
"items": [
{
"id": "sit",
"extra_price": 18
}
]
}
]
}
],
"menus": [
{
"id": "sed",
"label": "eos",
"families": [
{
"id": "enim",
"label": "iure",
"families": [
{
"id": "natus",
"label": "ratione",
"families": [
{
"id": "et",
"label": "magnam",
"items": [
{
"id": "dolor",
"type": "products",
"prices": [
{
"type": "takeaway",
"value": 11,
"vat_rate": "f"
}
]
}
]
}
]
}
]
}
]
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/inventories';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'config' => [
'lang' => 'fr',
],
'modifiers' => [
[
'id' => 'dolorem',
'label' => 'impedit',
'min' => 62,
'max' => 90,
'multiple' => false,
'items' => [
[
'id' => 'velit',
'label' => 'exercitationem',
'max' => 87,
'prices' => [
[
'type' => 'takeaway',
'value' => 7,
],
],
],
],
],
],
'containers' => [
[
'id' => 'reiciendis',
'label' => 'amet',
'items' => [],
],
],
'pagers' => [
[
'id' => 'ipsam',
'label' => 'aut',
'color' => 'voluptas',
'type' => 'all',
],
],
'tagsets' => [
[
'id' => 'veniam',
'label' => 'temporibus',
'items' => [
[
'id' => 'similique',
'label' => 'maiores',
'picture' => 'http://haley.info/aut-repellat-explicabo-qui-voluptatum-nihil-nisi',
],
],
],
],
'products' => [
[
'description' => 'Qui impedit cumque ad expedita.',
'id' => 'deleniti',
'label' => 'consequatur',
'prices' => [
[
'type' => 'delivery',
'value' => 6,
'vat_rate' => 'w',
],
],
'size' => [
'unit' => 'kg',
'value' => 'mcwxctjmjlcjwuf',
],
'types' => [],
'level' => 4,
'picture' => 'https://www.moen.org/molestiae-fugit-soluta-numquam-aut-rerum-veniam-vel-reiciendis',
'pager_id' => 'quae',
'tagsets' => [
[
'id' => 'fugit',
],
],
'weekly_schedule' => [
[
'day' => 3,
'openings' => [
[
'from' => '33:34',
'to' => '99:94',
],
],
],
],
],
],
'productsets' => [
[
'id' => 'similique',
'label' => 'occaecati',
'prices' => [
[
'type' => 'takeaway',
'value' => 5,
'vat_rate' => 'g',
],
],
'types' => [],
'level' => 19,
'picture' => 'http://www.raynor.com/sit-repellat-excepturi-consequuntur-veniam',
'weekly_schedule' => [
[
'day' => 1,
'openings' => [
[
'from' => '50:60',
'to' => '53:46',
],
],
],
],
'steps' => [
[
'id' => 'ipsam',
'label' => 'ipsum',
'min' => 14,
'max' => 1,
'free' => 20,
'items' => [
[
'id' => 'sit',
'extra_price' => 18,
],
],
],
],
],
],
'menus' => [
[
'id' => 'sed',
'label' => 'eos',
'families' => [
[
'id' => 'enim',
'label' => 'iure',
'families' => [
[
'id' => 'natus',
'label' => 'ratione',
'families' => [
[
'id' => 'et',
'label' => 'magnam',
'items' => [
[
'id' => 'dolor',
'type' => 'products',
'prices' => [
[
'type' => 'takeaway',
'value' => 11,
'vat_rate' => 'f',
],
],
],
],
],
],
],
],
],
],
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/inventories'
payload = {
"config": {
"lang": "fr"
},
"modifiers": [
{
"id": "dolorem",
"label": "impedit",
"min": 62,
"max": 90,
"multiple": false,
"items": [
{
"id": "velit",
"label": "exercitationem",
"max": 87,
"prices": [
{
"type": "takeaway",
"value": 7
}
]
}
]
}
],
"containers": [
{
"id": "reiciendis",
"label": "amet",
"items": []
}
],
"pagers": [
{
"id": "ipsam",
"label": "aut",
"color": "voluptas",
"type": "all"
}
],
"tagsets": [
{
"id": "veniam",
"label": "temporibus",
"items": [
{
"id": "similique",
"label": "maiores",
"picture": "http:\/\/haley.info\/aut-repellat-explicabo-qui-voluptatum-nihil-nisi"
}
]
}
],
"products": [
{
"description": "Qui impedit cumque ad expedita.",
"id": "deleniti",
"label": "consequatur",
"prices": [
{
"type": "delivery",
"value": 6,
"vat_rate": "w"
}
],
"size": {
"unit": "kg",
"value": "mcwxctjmjlcjwuf"
},
"types": [],
"level": 4,
"picture": "https:\/\/www.moen.org\/molestiae-fugit-soluta-numquam-aut-rerum-veniam-vel-reiciendis",
"pager_id": "quae",
"tagsets": [
{
"id": "fugit"
}
],
"weekly_schedule": [
{
"day": 3,
"openings": [
{
"from": "33:34",
"to": "99:94"
}
]
}
]
}
],
"productsets": [
{
"id": "similique",
"label": "occaecati",
"prices": [
{
"type": "takeaway",
"value": 5,
"vat_rate": "g"
}
],
"types": [],
"level": 19,
"picture": "http:\/\/www.raynor.com\/sit-repellat-excepturi-consequuntur-veniam",
"weekly_schedule": [
{
"day": 1,
"openings": [
{
"from": "50:60",
"to": "53:46"
}
]
}
],
"steps": [
{
"id": "ipsam",
"label": "ipsum",
"min": 14,
"max": 1,
"free": 20,
"items": [
{
"id": "sit",
"extra_price": 18
}
]
}
]
}
],
"menus": [
{
"id": "sed",
"label": "eos",
"families": [
{
"id": "enim",
"label": "iure",
"families": [
{
"id": "natus",
"label": "ratione",
"families": [
{
"id": "et",
"label": "magnam",
"items": [
{
"id": "dolor",
"type": "products",
"prices": [
{
"type": "takeaway",
"value": 11,
"vat_rate": "f"
}
]
}
]
}
]
}
]
}
]
}
]
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Download full inventory
requires authentication inventory-manage
You can download your last successful inventory
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/inventories" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/inventories"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/inventories';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/inventories'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Server Error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Stock - Product
Manage batch of products stock
requires authentication stock-manage
You can manage stock state for a batch of products
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/products" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"in-stock\",
\"ids\": [
\"4084\",
\"705\",
\"7762\"
]
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/products"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "in-stock",
"ids": [
"4084",
"705",
"7762"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/products';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'in-stock',
'ids' => [
'4084',
'705',
'7762',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/products'
payload = {
"state": "in-stock",
"ids": [
"4084",
"705",
"7762"
]
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Product batch processed):
{
"status": 200,
"code": "OK",
"data": {
"data": [
{
"id": "4084",
"in_stock": true
},
{
"id": "705",
"in_stock": true
},
{
"id": "7762",
"in_stock": true
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Manage single product stock
requires authentication stock-manage
You can manage stock state for a single product
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/products/CvhwGFNY3Z" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"in-stock\"
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/products/CvhwGFNY3Z"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "in-stock"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/products/CvhwGFNY3Z';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'in-stock',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/products/CvhwGFNY3Z'
payload = {
"state": "in-stock"
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Product stock state updated):
{
"status": 200,
"code": "OK",
"data": {
"id": "CvhwGFNY3Z",
"in_stock": true
}
}
Example response (404, Product not found):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Stock - Modifier Item
Manage batch of modifier items stock
requires authentication stock-manage
You can manage stock state for a batch of modifier items
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"out-of-stock\",
\"ids\": [
\"8L4DWdYahZ\",
\"8L4DWdYaha\",
\"8L4DWdYahd\"
]
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "out-of-stock",
"ids": [
"8L4DWdYahZ",
"8L4DWdYaha",
"8L4DWdYahd"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'out-of-stock',
'ids' => [
'8L4DWdYahZ',
'8L4DWdYaha',
'8L4DWdYahd',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items'
payload = {
"state": "out-of-stock",
"ids": [
"8L4DWdYahZ",
"8L4DWdYaha",
"8L4DWdYahd"
]
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Modifier item batch processed):
{
"status": 200,
"code": "OK",
"data": {
"data": [
{
"id": "4084",
"in_stock": true
},
{
"id": "705",
"in_stock": true
},
{
"id": "7762",
"in_stock": true
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Manage single modifier item stock
requires authentication stock-manage
You can manage stock state for a single modifier item
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items/8L4DWdYahZ" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"in-stock\"
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items/8L4DWdYahZ"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "in-stock"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items/8L4DWdYahZ';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'in-stock',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/modifiers/items/8L4DWdYahZ'
payload = {
"state": "in-stock"
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Modifier item stock state updated):
{
"status": 200,
"code": "OK",
"data": {
"id": "CvhwGFNY3Z",
"in_stock": true
}
}
Example response (404, Modifier item not found):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Stock - ProductSet
Manage batch of productsets stock
requires authentication stock-manage
You can manage stock state for a batch of productsets
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/productsets" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"in-stock\",
\"ids\": [
\"21073\",
\"19792\",
\"17021\"
]
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/productsets"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "in-stock",
"ids": [
"21073",
"19792",
"17021"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/productsets';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'in-stock',
'ids' => [
'21073',
'19792',
'17021',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/productsets'
payload = {
"state": "in-stock",
"ids": [
"21073",
"19792",
"17021"
]
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Productset batch processed):
{
"status": 200,
"code": "OK",
"data": {
"data": [
{
"id": "4084",
"in_stock": true
},
{
"id": "705",
"in_stock": true
},
{
"id": "7762",
"in_stock": true
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Manage single productset stock
requires authentication stock-manage
You can manage stock state for a single productset
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"state\": \"out-of-stock\"
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"state": "out-of-stock"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'state' => 'out-of-stock',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo'
payload = {
"state": "out-of-stock"
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Productset stock state updated):
{
"status": 200,
"code": "OK",
"data": {
"id": "CvhwGFNY3Z",
"in_stock": true
}
}
Example response (404, Productset not found):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Notification API
Listeners
Subscribe to events by registering listeners.
Each time an event occurs, every listener registered for this event is called.
Listeners must use the HTTPS endpoint.
Webhooks
To authenticate incoming webhooks and validate that the payload has not been tampered with, you must validate the Signature header.
To compute this signature of the incoming webhook, you must compute it using the signingKey
that was given to you :
If the $computedSignature
matches the Signature header
value, then the webhook is legit and can be used.
Otherwise, you must discard the request.
To identify the location associated with the notification, just get x-location-id
header value. This value represents the location in Obypay system and is immutable.
Create a listener
requires authentication
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"events\": [
\"order.created\",
\"order.ready\",
\"order.delivered\",
\"order.canceled\"
],
\"url\": \"https:\\/\\/example.com\\/webhooks\"
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"url": "https:\/\/example.com\/webhooks"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'events' => [
'order.created',
'order.ready',
'order.delivered',
'order.canceled',
],
'url' => 'https://example.com/webhooks',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners'
payload = {
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"url": "https:\/\/example.com\/webhooks"
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (201, Listener created):
{
"status": 201,
"code": "Created",
"data": {
"created_at": "2024-02-26T13:26:54+00:00",
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"id": "65dc919e67743a65790b1342",
"updated_at": "2024-02-26T13:26:54+00:00",
"url": "https://api.docker.localhost/webhooks"
}
}
Example response (422, Request error):
{
"status": 422,
"code": "Failed",
"errors": [
"The events field is required."
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get a listener
requires authentication
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, Listener retrieved):
{
"status": 200,
"code": "OK",
"data": {
"created_at": "2024-02-26T13:26:54+00:00",
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"id": "65dc919e67743a65790b1342",
"updated_at": "2024-02-26T13:26:54+00:00",
"url": "https://api.docker.localhost/webhooks"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get all listeners
requires authentication
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/notifications/listeners" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, Listeners retrieved):
{
"status": 200,
"code": "OK",
"data": {
"data": [
{
"created_at": "2024-02-26T13:25:25+00:00",
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"id": "65dc91453558bb04eb03ae92",
"updated_at": "2024-02-26T13:25:25+00:00",
"url": "https://api.docker.localhost/webhooks"
}
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update a listener
requires authentication
Example request:
curl --request PUT \
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"events\": [
\"order.created\",
\"order.ready\",
\"order.delivered\",
\"order.canceled\"
],
\"url\": \"https:\\/\\/example.com\\/webhooks\"
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"url": "https:\/\/example.com\/webhooks"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92';
$response = $client->put(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'events' => [
'order.created',
'order.ready',
'order.delivered',
'order.canceled',
],
'url' => 'https://example.com/webhooks',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92'
payload = {
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"url": "https:\/\/example.com\/webhooks"
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200, Listener updated):
{
"status": 200,
"code": "OK",
"data": {
"created_at": "2024-02-26T13:26:54+00:00",
"events": [
"order.created",
"order.ready",
"order.delivered",
"order.canceled"
],
"id": "65dc919e67743a65790b1342",
"updated_at": "2024-02-26T13:26:54+00:00",
"url": "https://api.docker.localhost/webhooks"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete a listener
requires authentication
Example request:
curl --request DELETE \
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/notifications/listeners/65dc91453558bb04eb03ae92'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()
Example response (204, Listener deleted):
Empty response
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Order API
Order API
Get an order detail
requires authentication order-fetch
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"with\": [
\"customer\",
\"payment\",
\"products\"
]
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"with": [
"customer",
"payment",
"products"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'with' => [
'customer',
'payment',
'products',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF'
payload = {
"with": [
"customer",
"payment",
"products"
]
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
Example response (200, Order found):
{
"status": 200,
"code": "OK",
"data": {
"clickandcollect": true,
"clickandcollect_pickup_at": "2023-10-23T16:00:00+00:00",
"created_at": "2023-10-23T15:35:00+00:00",
"comment": "",
"currency": "EUR",
"currency_symbol": "€",
"customer": {
"anonymous": true,
"company_name": null,
"email": "[email protected]",
"firstname": "anonymous",
"id": "ANON-obs9xt5cQF",
"lang": "fr",
"lastname": "anonymous",
"phone": null
},
"due_at": "2023-10-23T16:00:00+00:00",
"environment": "consumer-device",
"id": "obs9xt5cQF",
"number": "20231023-2",
"number_short": "2",
"pagers": {
"yMfoIh5Y1T": "12"
},
"price": 26.4,
"price_paid": 26.4,
"payment": {
"amount": 26.4,
"created_at": "2023-10-23T15:35:00+00:00",
"currency": "EUR",
"currency_symbol": "€",
"id": "653692a4093117be530559c4",
"orders": [
"obs9xt5cQF"
],
"sources": [
{
"amount": 10.41,
"id": 1,
"paid": true,
"remaining_amount": 10.41,
"slug": "card"
},
{
"amount": 15.99,
"id": 5,
"paid": true,
"remaining_amount": 15.99,
"slug": "trd"
}
],
"status": "paid",
"updated_at": "2023-10-24T15:42:03+00:00",
"with_payment": true
},
"products": [
{
"discounted": false,
"id": "HzsKRTLKXo",
"name": "Menu burger",
"price": 13,
"price_without_discount": 13,
"quantity": 1,
"steps": [
{
"id": "jv65LjnVkU",
"name": "Dessert",
"products": [
{
"discounted": false,
"id": "gAidXnqmmV",
"modifiers": [],
"name": "Glaces",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
},
{
"discounted": false,
"id": "1PZavMCp5h",
"modifiers": [],
"name": "Cookie",
"pager": "yMfoIh5Y1T",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
},
{
"id": "fAk1UBE3yC",
"name": "boissons",
"products": [
{
"discounted": false,
"id": "vjAadvBbkG",
"modifiers": [],
"name": "biere",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
},
{
"id": "drN9gdMdTx",
"name": "test",
"products": [
{
"discounted": false,
"id": "yXmisbMpbk",
"modifiers": [
{
"id": "J7pPhzccno",
"name": "Extra burger",
"items": [
{
"id": "Mq8DE993Ah",
"name": "Extra 2",
"quantity": 1,
"price": 0,
"external_reference": "Mq8DE993Ah"
}
],
"external_reference": "J7pPhzccno"
}
],
"name": "Cheese Burger",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
}
],
"type": "menu",
"vat_rate": 0.1
},
{
"discounted": false,
"id": "04HvtXgWVM",
"modifiers": [],
"name": "Soupe",
"price": 3,
"price_without_discount": 3,
"quantity": 1,
"type": "product",
"vat_rate": 0.1
},
{
"discounted": false,
"id": "xomnPFPCMW",
"modifiers": [
{
"id": "1haz1UnzaH",
"name": "sauces",
"items": [
{
"id": "YTwAr4hnMP",
"name": "vinaigrette",
"quantity": 1,
"price": 0,
"external_reference": "YTwAr4hnMP"
}
],
"external_reference": "1haz1UnzaH"
},
{
"id": "4bxdGKuzAs",
"name": "Sauces",
"items": [
{
"id": "YtyYef9Wbb",
"name": "Sambal Hot Sauce",
"quantity": 2,
"price": 0,
"external_reference": "YtyYef9Wbb"
}
],
"external_reference": "4bxdGKuzAs"
},
{
"id": "Md1hekAmXe",
"name": "Parfums",
"items": [
{
"id": "8L4DWdYahZ",
"name": "Chocolat",
"quantity": 1,
"price": 1.2,
"external_reference": "8L4DWdYahZ"
}
],
"external_reference": "Md1hekAmXe"
}
],
"name": "Sorbet/glace 2",
"price": 4,
"price_without_discount": 4,
"quantity": 2,
"type": "product",
"vat_rate": 0.1
}
],
"seats": 1,
"status": "delivered",
"takeaway": "onsite",
"tip": 0,
"updated_at": "2023-10-24T04:00:56+00:00",
"with_payment": true
}
}
Example response (404, Order not found):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Example response (422, Request error):
{
"status": 422,
"code": "Failed",
"errors": [
"The selected with is invalid."
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update an order state
requires authentication order-manage
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF/states/"ready"" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF/states/"ready""
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF/states/"ready"';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/orders/obs9xt5cQF/states/"ready"'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()
Example response (200, Order found):
{
"status": 200,
"code": "OK",
"data": {
"clickandcollect": true,
"clickandcollect_pickup_at": "2023-10-23T16:00:00+00:00",
"created_at": "2023-10-23T15:35:00+00:00",
"comment": "",
"currency": "EUR",
"currency_symbol": "€",
"customer": {
"anonymous": true,
"company_name": null,
"email": "[email protected]",
"firstname": "anonymous",
"id": "ANON-obs9xt5cQF",
"lang": "fr",
"lastname": "anonymous",
"phone": null
},
"due_at": "2023-10-23T16:00:00+00:00",
"environment": "consumer-device",
"id": "obs9xt5cQF",
"number": "20231023-2",
"number_short": "2",
"pagers": {
"yMfoIh5Y1T": "12"
},
"price": 26.4,
"price_paid": 26.4,
"payment": {
"amount": 26.4,
"created_at": "2023-10-23T15:35:00+00:00",
"currency": "EUR",
"currency_symbol": "€",
"id": "653692a4093117be530559c4",
"orders": [
"obs9xt5cQF"
],
"sources": [
{
"amount": 10.41,
"id": 1,
"paid": true,
"remaining_amount": 10.41,
"slug": "card"
},
{
"amount": 15.99,
"id": 5,
"paid": true,
"remaining_amount": 15.99,
"slug": "trd"
}
],
"status": "paid",
"updated_at": "2023-10-24T15:42:03+00:00",
"with_payment": true
},
"products": [
{
"discounted": false,
"id": "HzsKRTLKXo",
"name": "Menu burger",
"price": 13,
"price_without_discount": 13,
"quantity": 1,
"steps": [
{
"id": "jv65LjnVkU",
"name": "Dessert",
"products": [
{
"discounted": false,
"id": "gAidXnqmmV",
"modifiers": [],
"name": "Glaces",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
},
{
"discounted": false,
"id": "1PZavMCp5h",
"modifiers": [],
"name": "Cookie",
"pager": "yMfoIh5Y1T",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
},
{
"id": "fAk1UBE3yC",
"name": "boissons",
"products": [
{
"discounted": false,
"id": "vjAadvBbkG",
"modifiers": [],
"name": "biere",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
},
{
"id": "drN9gdMdTx",
"name": "test",
"products": [
{
"discounted": false,
"id": "yXmisbMpbk",
"modifiers": [
{
"id": "J7pPhzccno",
"name": "Extra burger",
"items": [
{
"id": "Mq8DE993Ah",
"name": "Extra 2",
"quantity": 1,
"price": 0,
"external_reference": "Mq8DE993Ah"
}
],
"external_reference": "J7pPhzccno"
}
],
"name": "Cheese Burger",
"price": 0,
"price_without_discount": null,
"quantity": 1,
"type": "product",
"vat_rate": null
}
]
}
],
"type": "menu",
"vat_rate": 0.1
},
{
"discounted": false,
"id": "04HvtXgWVM",
"modifiers": [],
"name": "Soupe",
"price": 3,
"price_without_discount": 3,
"quantity": 1,
"type": "product",
"vat_rate": 0.1
},
{
"discounted": false,
"id": "xomnPFPCMW",
"modifiers": [
{
"id": "1haz1UnzaH",
"name": "sauces",
"items": [
{
"id": "YTwAr4hnMP",
"name": "vinaigrette",
"quantity": 1,
"price": 0,
"external_reference": "YTwAr4hnMP"
}
],
"external_reference": "1haz1UnzaH"
},
{
"id": "4bxdGKuzAs",
"name": "Sauces",
"items": [
{
"id": "YtyYef9Wbb",
"name": "Sambal Hot Sauce",
"quantity": 2,
"price": 0,
"external_reference": "YtyYef9Wbb"
}
],
"external_reference": "4bxdGKuzAs"
},
{
"id": "Md1hekAmXe",
"name": "Parfums",
"items": [
{
"id": "8L4DWdYahZ",
"name": "Chocolat",
"quantity": 1,
"price": 1.2,
"external_reference": "8L4DWdYahZ"
}
],
"external_reference": "Md1hekAmXe"
}
],
"name": "Sorbet/glace 2",
"price": 4,
"price_without_discount": 4,
"quantity": 2,
"type": "product",
"vat_rate": 0.1
}
],
"seats": 1,
"status": "delivered",
"takeaway": "onsite",
"tip": 0,
"updated_at": "2023-10-24T04:00:56+00:00",
"with_payment": true
}
}
Example response (404, Order not found):
{
"status": 404,
"code": "Not Found",
"errors": [
"Unknown record"
]
}
Example response (422, Request error):
{
"status": 422,
"code": "Failed",
"errors": [
"The selected with is invalid."
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Webextension
Create a webextension link
requires authentication webextension
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/webextensions/link" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"order\": {
\"amount\": 10,
\"id\": \"sint\",
\"lines\": [
{
\"label\": \"maxime\",
\"line_id\": \"rerum\",
\"product_id\": \"minus\",
\"quantity\": 12,
\"unit_price\": 24,
\"modifiers\": [
{
\"label\": \"aut\",
\"product_id\": \"aliquid\",
\"quantity\": 9,
\"unit_price\": 9
}
]
}
],
\"discounts\": [
{
\"amount\": 4,
\"id\": \"xkefslmon\",
\"label\": \"svvbq\"
}
],
\"transactions\": [
{
\"label\": \"dolor\",
\"amount\": 64
}
]
},
\"loyalty\": {
\"id\": \"fmrthxlukhbsecneltpodfzvukneycgtbplzlpfwknlwkr\"
}
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/webextensions/link"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"order": {
"amount": 10,
"id": "sint",
"lines": [
{
"label": "maxime",
"line_id": "rerum",
"product_id": "minus",
"quantity": 12,
"unit_price": 24,
"modifiers": [
{
"label": "aut",
"product_id": "aliquid",
"quantity": 9,
"unit_price": 9
}
]
}
],
"discounts": [
{
"amount": 4,
"id": "xkefslmon",
"label": "svvbq"
}
],
"transactions": [
{
"label": "dolor",
"amount": 64
}
]
},
"loyalty": {
"id": "fmrthxlukhbsecneltpodfzvukneycgtbplzlpfwknlwkr"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/webextensions/link';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'order' => [
'amount' => 10,
'id' => 'sint',
'lines' => [
[
'label' => 'maxime',
'line_id' => 'rerum',
'product_id' => 'minus',
'quantity' => 12,
'unit_price' => 24,
'modifiers' => [
[
'label' => 'aut',
'product_id' => 'aliquid',
'quantity' => 9,
'unit_price' => 9,
],
],
],
],
'discounts' => [
[
'amount' => 4,
'id' => 'xkefslmon',
'label' => 'svvbq',
],
],
'transactions' => [
[
'label' => 'dolor',
'amount' => 64,
],
],
],
'loyalty' => [
'id' => 'fmrthxlukhbsecneltpodfzvukneycgtbplzlpfwknlwkr',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/webextensions/link'
payload = {
"order": {
"amount": 10,
"id": "sint",
"lines": [
{
"label": "maxime",
"line_id": "rerum",
"product_id": "minus",
"quantity": 12,
"unit_price": 24,
"modifiers": [
{
"label": "aut",
"product_id": "aliquid",
"quantity": 9,
"unit_price": 9
}
]
}
],
"discounts": [
{
"amount": 4,
"id": "xkefslmon",
"label": "svvbq"
}
],
"transactions": [
{
"label": "dolor",
"amount": 64
}
]
},
"loyalty": {
"id": "fmrthxlukhbsecneltpodfzvukneycgtbplzlpfwknlwkr"
}
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, Existing Webextension link retrieved):
{
"status": 200,
"code": "OK",
"data": {
"id": "6687f9e6788bd47a45009b42",
"order_id": "abcdef",
"link": "https://domain.tld/82701d25c6d75c91f3c0cd00464a98bc5e13f628/fr?integration=generic&location_id=oUxkeGLhDg&order_id=abcdef"
}
}
Example response (201, Webextension link created):
{
"status": 201,
"code": "Created",
"data": {
"id": "6687f9e6788bd47a45009b42",
"order_id": "abcdef",
"link": "https://domain.tld/82701d25c6d75c91f3c0cd00464a98bc5e13f628/fr?integration=generic&location_id=oUxkeGLhDg&order_id=abcdef"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Payment API
Instruments
Display instruments
requires authentication payment-manage
Display configured instruments
Example request:
curl --request GET \
--get "https://public-api-obypay.obypay.net/api/v1/payments/instruments" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/payments/instruments"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/payments/instruments';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/payments/instruments'
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200, Payment instruments found):
{
"status": 200,
"code": "OK",
"data": {
"pos": {
"card": "pos_card",
"lunchvoucher": "pos_lunchvoucher"
},
"online": {
"card": "online_card",
"wallet": "online_wallet",
"bancontact": "online_bancontact",
"lunchvoucher": "online_lunchvoucher",
"intercard": "online_intercard",
"bankroll": "online_bankroll",
"epro": "online_epro"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update instruments
requires authentication payment-manage
Map your instruments to Obypay instruments in order to flag every payment made correctly
Example request:
curl --request POST \
"https://public-api-obypay.obypay.net/api/v1/payments/instruments" \
--header "Authorization: Bearer YOUR_AUTH_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"pos\": {
\"card\": \"recusandae\",
\"lunchvoucher\": \"vitae\"
},
\"online\": {
\"card\": \"delectus\",
\"wallet\": \"et\",
\"bancontact\": \"qui\",
\"lunchvoucher\": \"laborum\",
\"intercard\": \"tempora\",
\"bankroll\": \"et\",
\"epro\": \"ut\"
}
}"
const url = new URL(
"https://public-api-obypay.obypay.net/api/v1/payments/instruments"
);
const headers = {
"Authorization": "Bearer YOUR_AUTH_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"pos": {
"card": "recusandae",
"lunchvoucher": "vitae"
},
"online": {
"card": "delectus",
"wallet": "et",
"bancontact": "qui",
"lunchvoucher": "laborum",
"intercard": "tempora",
"bankroll": "et",
"epro": "ut"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api-obypay.obypay.net/api/v1/payments/instruments';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer YOUR_AUTH_KEY',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'pos' => [
'card' => 'recusandae',
'lunchvoucher' => 'vitae',
],
'online' => [
'card' => 'delectus',
'wallet' => 'et',
'bancontact' => 'qui',
'lunchvoucher' => 'laborum',
'intercard' => 'tempora',
'bankroll' => 'et',
'epro' => 'ut',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://public-api-obypay.obypay.net/api/v1/payments/instruments'
payload = {
"pos": {
"card": "recusandae",
"lunchvoucher": "vitae"
},
"online": {
"card": "delectus",
"wallet": "et",
"bancontact": "qui",
"lunchvoucher": "laborum",
"intercard": "tempora",
"bankroll": "et",
"epro": "ut"
}
}
headers = {
'Authorization': 'Bearer YOUR_AUTH_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.