Collect a payment line
curl --request POST \
--url https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"method": "CASH"
}
'import requests
url = "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect"
payload = { "method": "CASH" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({method: 'CASH'})
};
fetch('https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'CASH'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect"
payload := strings.NewReader("{\n \"method\": \"CASH\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"CASH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"CASH\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"external_id": "<string>",
"status": "PENDING",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"duration_minutes": 2,
"party_size": 1,
"source": "WALK_IN",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"phone_number": "<string>",
"lang": "FR"
},
"room": {
"id": "<string>",
"name": "<string>"
},
"tables": [
{
"id": "<string>",
"name": "<string>",
"min_pax": 123,
"max_pax": 123
}
],
"waiter": {
"id": "<string>",
"name": "<string>"
},
"shift": {
"id": "<string>",
"name": "<string>",
"start_time": "<string>",
"end_time": "<string>"
},
"discount": {
"id": "<string>",
"value": 123,
"message": "<string>"
},
"prescriber": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>"
},
"custom_message": "<string>",
"allergies": "<string>",
"metadata": {},
"feedback": {
"rating": 123,
"comment": "<string>",
"answer": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"answered_at": "2023-11-07T05:31:56Z"
},
"cancellation_reason": "<string>",
"attached_files": [
"<string>"
],
"tags": [
"<string>"
],
"send_followup_email": true,
"is_table_definitive": true,
"is_force_inserted": true,
"total_amount_paid": 123,
"payment_summary": {
"currency": "MAD",
"total_amount": 123,
"paid_amount": 123,
"gift_card_amount": 123,
"authorized_amount": 123,
"pending_amount": 123,
"refunded_amount": 123,
"statuses": [
"FREE"
]
},
"payments": [
{
"id": "<string>",
"provider_id": "<string>",
"payment_type": "DEPOSIT",
"payment_mode": "SOFT_PREAUTH",
"provider": "PAYZONE",
"status": "FREE",
"amount": 123,
"gift_card_amount": 123,
"quantity": 123,
"unit_price": 123,
"percent_of_total": 123,
"currency": "MAD",
"is_refundable": true,
"external_reference": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"max_cancellation_date": "2023-11-07T05:31:56Z",
"authorized_at": "2023-11-07T05:31:56Z",
"capture_deadline": "2023-11-07T05:31:56Z",
"captured_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"linked_product": {
"id": "<string>",
"name": "<string>"
},
"linked_variant": {
"id": "<string>",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"seated_at": "2023-11-07T05:31:56Z",
"left_at": "2023-11-07T05:31:56Z",
"is_hotel_guest": true,
"hotel_room_number": "<string>",
"pms_reference": {
"stay_id": "<string>"
},
"sensitive_data_included": true,
"payment_url": "<string>"
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}Payments
Collect a payment line
Records a line still owed as paid: taken by the venue (CASH, CREDIT_CARD, WIRE_TRANSFER) or by you (PARTNER, with your reference). A reservation awaiting its payment is confirmed. Only a charge still owed on a booking the restaurant accepted; not while the guest is paying it online. Send an Idempotency-Key header: the same key and body answer the same again (even a refusal: retry a refusal with a new key), another body under it is refused; keys are per API key and kept 30 days. Requires PAYMENTS_WRITE; the line in full also RESERVATIONS_READ_SENSITIVE.
POST
/
api
/
partner
/
v1
/
reservations
/
{id}
/
payments
/
{paymentId}
/
collect
Collect a payment line
curl --request POST \
--url https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"method": "CASH"
}
'import requests
url = "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect"
payload = { "method": "CASH" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({method: 'CASH'})
};
fetch('https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'CASH'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect"
payload := strings.NewReader("{\n \"method\": \"CASH\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"CASH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eat-now.io/api/partner/v1/reservations/{id}/payments/{paymentId}/collect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"CASH\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"external_id": "<string>",
"status": "PENDING",
"start_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"duration_minutes": 2,
"party_size": 1,
"source": "WALK_IN",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"phone_number": "<string>",
"lang": "FR"
},
"room": {
"id": "<string>",
"name": "<string>"
},
"tables": [
{
"id": "<string>",
"name": "<string>",
"min_pax": 123,
"max_pax": 123
}
],
"waiter": {
"id": "<string>",
"name": "<string>"
},
"shift": {
"id": "<string>",
"name": "<string>",
"start_time": "<string>",
"end_time": "<string>"
},
"discount": {
"id": "<string>",
"value": 123,
"message": "<string>"
},
"prescriber": {
"id": "<string>",
"name": "<string>",
"phone_number": "<string>"
},
"custom_message": "<string>",
"allergies": "<string>",
"metadata": {},
"feedback": {
"rating": 123,
"comment": "<string>",
"answer": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"answered_at": "2023-11-07T05:31:56Z"
},
"cancellation_reason": "<string>",
"attached_files": [
"<string>"
],
"tags": [
"<string>"
],
"send_followup_email": true,
"is_table_definitive": true,
"is_force_inserted": true,
"total_amount_paid": 123,
"payment_summary": {
"currency": "MAD",
"total_amount": 123,
"paid_amount": 123,
"gift_card_amount": 123,
"authorized_amount": 123,
"pending_amount": 123,
"refunded_amount": 123,
"statuses": [
"FREE"
]
},
"payments": [
{
"id": "<string>",
"provider_id": "<string>",
"payment_type": "DEPOSIT",
"payment_mode": "SOFT_PREAUTH",
"provider": "PAYZONE",
"status": "FREE",
"amount": 123,
"gift_card_amount": 123,
"quantity": 123,
"unit_price": 123,
"percent_of_total": 123,
"currency": "MAD",
"is_refundable": true,
"external_reference": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"max_cancellation_date": "2023-11-07T05:31:56Z",
"authorized_at": "2023-11-07T05:31:56Z",
"capture_deadline": "2023-11-07T05:31:56Z",
"captured_at": "2023-11-07T05:31:56Z",
"voided_at": "2023-11-07T05:31:56Z",
"linked_product": {
"id": "<string>",
"name": "<string>"
},
"linked_variant": {
"id": "<string>",
"name": "<string>"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"seated_at": "2023-11-07T05:31:56Z",
"left_at": "2023-11-07T05:31:56Z",
"is_hotel_guest": true,
"hotel_room_number": "<string>",
"pms_reference": {
"stay_id": "<string>"
},
"sensitive_data_included": true,
"payment_url": "<string>"
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "AUTHENTICATION_REQUIRED",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}Authorizations
Headers
Path Parameters
Body
application/json