MENU navbar-image

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

Error responses

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.net/api/v1/me" \
    --header "Authorization: Bearer YOUR_AUTH_KEY" \
    --header "Accept: application/json"
const url = new URL(
    "https://public-api.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.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.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"
        }
    }
}
 

Request      

GET api/v1/me

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Auth API

Manage your access token

Renew an existing token

requires authentication

Example request:
curl --request POST \
    "https://public-api.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.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.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.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"
    ]
}
 

Request      

POST api/v1/auth/tokens/renew

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

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.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.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.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.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 (200, 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."
    ]
}
 

Request      

POST api/v1/notifications/listeners

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

events   string[]   

List of events to subscribe to.

Must be one of:
  • order.created
  • order.ready
  • order.delivered
  • order.canceled
url   string   

The url to call. Example: https://example.com/webhooks

Get a listener

requires authentication

Example request:
curl --request GET \
    --get "https://public-api.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.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.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.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"
    }
}
 

Request      

GET api/v1/notifications/listeners/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

URL Parameters

id   string   

The id of the listener. Example: 65dc91453558bb04eb03ae92

Get all listeners

requires authentication

Example request:
curl --request GET \
    --get "https://public-api.obypay.net/api/v1/notifications/listeners" \
    --header "Authorization: Bearer YOUR_AUTH_KEY" \
    --header "Accept: application/json"
const url = new URL(
    "https://public-api.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.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.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"
            }
        ]
    }
}
 

Request      

GET api/v1/notifications/listeners

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Update a listener

requires authentication

Example request:
curl --request PUT \
    "https://public-api.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.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.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.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"
    }
}
 

Request      

PUT api/v1/notifications/listeners/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   string   

The id of the listener. Example: 65dc91453558bb04eb03ae92

Body Parameters

events   string[]   

List of events to subscribe to.

Must be one of:
  • order.created
  • order.ready
  • order.delivered
  • order.canceled
url   string   

The url to call. Example: https://example.com/webhooks

Delete a listener

requires authentication

Example request:
curl --request DELETE \
    "https://public-api.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.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.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.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
 

Request      

DELETE api/v1/notifications/listeners/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

URL Parameters

id   string   

The id of the listener. Example: 65dc91453558bb04eb03ae92

Order API

Order API

Get an order detail

requires authentication

Example request:
curl --request GET \
    --get "https://public-api.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.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.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.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."
    ]
}
 

Request      

GET api/v1/orders/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   string   

The id of the order. Example: obs9xt5cQF

Body Parameters

with   string[]  optional  

List of extra fields to add to response.

Must be one of:
  • customer
  • payment
  • products

Update an order state

requires authentication

Example request:
curl --request POST \
    "https://public-api.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.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.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.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."
    ]
}
 

Request      

POST api/v1/orders/{id}/states/{state}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

URL Parameters

id   string   

The id of the order. Example: obs9xt5cQF

state   string   

The new state of the order. Example: "ready"

Must be one of:
  • "ready"
  • "delivered"
  • "canceled"

Payment API

Instruments

Display instruments

requires authentication

Display configured instruments

Example request:
curl --request GET \
    --get "https://public-api.obypay.net/api/v1/payments/instruments" \
    --header "Authorization: Bearer YOUR_AUTH_KEY" \
    --header "Accept: application/json"
const url = new URL(
    "https://public-api.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.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.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"
        }
    }
}
 

Request      

GET api/v1/payments/instruments

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Update instruments

requires authentication

Map your instruments to Obypay instruments in order to flag every payment made correctly

Example request:
curl --request POST \
    "https://public-api.obypay.net/api/v1/payments/instruments" \
    --header "Authorization: Bearer YOUR_AUTH_KEY" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"pos\": {
        \"card\": \"illum\",
        \"lunchvoucher\": \"minima\"
    },
    \"online\": {
        \"card\": \"ut\",
        \"wallet\": \"alias\",
        \"bancontact\": \"cumque\",
        \"lunchvoucher\": \"consequatur\",
        \"intercard\": \"ex\",
        \"bankroll\": \"illo\",
        \"epro\": \"aut\"
    }
}"
const url = new URL(
    "https://public-api.obypay.net/api/v1/payments/instruments"
);

const headers = {
    "Authorization": "Bearer YOUR_AUTH_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "pos": {
        "card": "illum",
        "lunchvoucher": "minima"
    },
    "online": {
        "card": "ut",
        "wallet": "alias",
        "bancontact": "cumque",
        "lunchvoucher": "consequatur",
        "intercard": "ex",
        "bankroll": "illo",
        "epro": "aut"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://public-api.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' => 'illum',
                'lunchvoucher' => 'minima',
            ],
            'online' => [
                'card' => 'ut',
                'wallet' => 'alias',
                'bancontact' => 'cumque',
                'lunchvoucher' => 'consequatur',
                'intercard' => 'ex',
                'bankroll' => 'illo',
                'epro' => 'aut',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://public-api.obypay.net/api/v1/payments/instruments'
payload = {
    "pos": {
        "card": "illum",
        "lunchvoucher": "minima"
    },
    "online": {
        "card": "ut",
        "wallet": "alias",
        "bancontact": "cumque",
        "lunchvoucher": "consequatur",
        "intercard": "ex",
        "bankroll": "illo",
        "epro": "aut"
    }
}
headers = {
  'Authorization': 'Bearer YOUR_AUTH_KEY',
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Request      

POST api/v1/payments/instruments

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

pos   object   
card   string   

Example: illum

lunchvoucher   string   

Example: minima

online   object   
card   string   

Example: ut

wallet   string   

Example: alias

bancontact   string   

Example: cumque

lunchvoucher   string   

Example: consequatur

intercard   string   

Example: ex

bankroll   string   

Example: illo

epro   string   

Example: aut

Stock API

Product

Manage batch of products stock

requires authentication

You can manage stock state for a batch of products

Example request:
curl --request POST \
    "https://public-api.obypay.net/api/v1/stocks/products" \
    --header "Authorization: Bearer YOUR_AUTH_KEY" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --data "{
    \"state\": \"out-of-stock\",
    \"ids\": [
        \"4084\",
        \"705\",
        \"7762\"
    ]
}"
const url = new URL(
    "https://public-api.obypay.net/api/v1/stocks/products"
);

const headers = {
    "Authorization": "Bearer YOUR_AUTH_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "state": "out-of-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.net/api/v1/stocks/products';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer YOUR_AUTH_KEY',
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'state' => 'out-of-stock',
            'ids' => [
                '4084',
                '705',
                '7762',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://public-api.obypay.net/api/v1/stocks/products'
payload = {
    "state": "out-of-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
            }
        ]
    }
}
 

Request      

POST api/v1/stocks/products

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

state   string   

Example: out-of-stock

Must be one of:
  • in-stock
  • out-of-stock
ids   string[]   

List of product ids to update.

Manage single product stock

requires authentication

You can manage stock state for a single product

Example request:
curl --request POST \
    "https://public-api.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.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.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.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"
    ]
}
 

Request      

POST api/v1/stocks/products/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   string   

The id of the product. Example: CvhwGFNY3Z

Body Parameters

state   string   

Example: in-stock

Must be one of:
  • in-stock
  • out-of-stock

Modifier Item

Manage batch of modifier items stock

requires authentication

You can manage stock state for a batch of modifier items

Example request:
curl --request POST \
    "https://public-api.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.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.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.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
            }
        ]
    }
}
 

Request      

POST api/v1/stocks/modifiers/items

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

state   string   

Example: out-of-stock

Must be one of:
  • in-stock
  • out-of-stock
ids   string[]   

List of modifier item ids to update.

Manage single modifier item stock

requires authentication

You can manage stock state for a single modifier item

Example request:
curl --request POST \
    "https://public-api.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.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.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.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"
    ]
}
 

Request      

POST api/v1/stocks/modifiers/items/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   string   

The id of the modifier item. Example: 8L4DWdYahZ

Body Parameters

state   string   

Example: in-stock

Must be one of:
  • in-stock
  • out-of-stock

ProductSet

Manage batch of productsets stock

requires authentication

You can manage stock state for a batch of productsets

Example request:
curl --request POST \
    "https://public-api.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.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.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.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
            }
        ]
    }
}
 

Request      

POST api/v1/stocks/productsets

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

Body Parameters

state   string   

Example: in-stock

Must be one of:
  • in-stock
  • out-of-stock
ids   string[]   

List of productset ids to update.

Manage single productset stock

requires authentication

You can manage stock state for a single productset

Example request:
curl --request POST \
    "https://public-api.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo" \
    --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.net/api/v1/stocks/productsets/HzsKRTLKXo"
);

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.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' => 'in-stock',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://public-api.obypay.net/api/v1/stocks/productsets/HzsKRTLKXo'
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, 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"
    ]
}
 

Request      

POST api/v1/stocks/productsets/{id}

Headers

Authorization      

Example: Bearer YOUR_AUTH_KEY

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

id   string   

The id of the productset. Example: HzsKRTLKXo

Body Parameters

state   string   

Example: in-stock

Must be one of:
  • in-stock
  • out-of-stock