Import a gift card
curl --request POST \
--url https://app.eat-now.io/api/partner/v1/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_ref": "<string>",
"code": "<string>",
"amount": 1,
"currency": "<string>",
"type": "MONETARY",
"label": "<string>",
"covers": 1,
"product_id": "<string>",
"variant_id": "<string>",
"expires_on": "2023-12-25",
"holder_name": "<string>"
}
'import requests
url = "https://app.eat-now.io/api/partner/v1/gift-cards"
payload = {
"external_ref": "<string>",
"code": "<string>",
"amount": 1,
"currency": "<string>",
"type": "MONETARY",
"label": "<string>",
"covers": 1,
"product_id": "<string>",
"variant_id": "<string>",
"expires_on": "2023-12-25",
"holder_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_ref: '<string>',
code: '<string>',
amount: 1,
currency: '<string>',
type: 'MONETARY',
label: '<string>',
covers: 1,
product_id: '<string>',
variant_id: '<string>',
expires_on: '2023-12-25',
holder_name: '<string>'
})
};
fetch('https://app.eat-now.io/api/partner/v1/gift-cards', 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/gift-cards",
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([
'external_ref' => '<string>',
'code' => '<string>',
'amount' => 1,
'currency' => '<string>',
'type' => 'MONETARY',
'label' => '<string>',
'covers' => 1,
'product_id' => '<string>',
'variant_id' => '<string>',
'expires_on' => '2023-12-25',
'holder_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/gift-cards"
payload := strings.NewReader("{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/gift-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eat-now.io/api/partner/v1/gift-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"object": "gift_card",
"code": "<string>",
"masked_code": "<string>",
"external_ref": "<string>",
"origin": "ONLINE",
"type": "MONETARY",
"status": "SCHEDULED",
"currency": "<string>",
"initial_amount": 123,
"balance_amount": 123,
"label": "<string>",
"covers": 123,
"expires_on": "2023-12-25",
"holder_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"result": "created"
}{
"data": {
"id": "<string>",
"object": "gift_card",
"code": "<string>",
"masked_code": "<string>",
"external_ref": "<string>",
"origin": "ONLINE",
"type": "MONETARY",
"status": "SCHEDULED",
"currency": "<string>",
"initial_amount": 123,
"balance_amount": 123,
"label": "<string>",
"covers": 123,
"expires_on": "2023-12-25",
"holder_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"result": "created"
}{
"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": {}
}
}Gift cards
Import a gift card
Imports a card EatNow keeps the register of: it can be redeemed in the restaurant and online at once, and EatNow never contacts its holder. external_ref makes the call idempotent: replaying it returns the card with result: matched. Requires GIFT_CARDS_ISSUE and the restaurant’s gift cards module.
POST
/
api
/
partner
/
v1
/
gift-cards
Import a gift card
curl --request POST \
--url https://app.eat-now.io/api/partner/v1/gift-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_ref": "<string>",
"code": "<string>",
"amount": 1,
"currency": "<string>",
"type": "MONETARY",
"label": "<string>",
"covers": 1,
"product_id": "<string>",
"variant_id": "<string>",
"expires_on": "2023-12-25",
"holder_name": "<string>"
}
'import requests
url = "https://app.eat-now.io/api/partner/v1/gift-cards"
payload = {
"external_ref": "<string>",
"code": "<string>",
"amount": 1,
"currency": "<string>",
"type": "MONETARY",
"label": "<string>",
"covers": 1,
"product_id": "<string>",
"variant_id": "<string>",
"expires_on": "2023-12-25",
"holder_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_ref: '<string>',
code: '<string>',
amount: 1,
currency: '<string>',
type: 'MONETARY',
label: '<string>',
covers: 1,
product_id: '<string>',
variant_id: '<string>',
expires_on: '2023-12-25',
holder_name: '<string>'
})
};
fetch('https://app.eat-now.io/api/partner/v1/gift-cards', 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/gift-cards",
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([
'external_ref' => '<string>',
'code' => '<string>',
'amount' => 1,
'currency' => '<string>',
'type' => 'MONETARY',
'label' => '<string>',
'covers' => 1,
'product_id' => '<string>',
'variant_id' => '<string>',
'expires_on' => '2023-12-25',
'holder_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/gift-cards"
payload := strings.NewReader("{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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/gift-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.eat-now.io/api/partner/v1/gift-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_ref\": \"<string>\",\n \"code\": \"<string>\",\n \"amount\": 1,\n \"currency\": \"<string>\",\n \"type\": \"MONETARY\",\n \"label\": \"<string>\",\n \"covers\": 1,\n \"product_id\": \"<string>\",\n \"variant_id\": \"<string>\",\n \"expires_on\": \"2023-12-25\",\n \"holder_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"object": "gift_card",
"code": "<string>",
"masked_code": "<string>",
"external_ref": "<string>",
"origin": "ONLINE",
"type": "MONETARY",
"status": "SCHEDULED",
"currency": "<string>",
"initial_amount": 123,
"balance_amount": 123,
"label": "<string>",
"covers": 123,
"expires_on": "2023-12-25",
"holder_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"result": "created"
}{
"data": {
"id": "<string>",
"object": "gift_card",
"code": "<string>",
"masked_code": "<string>",
"external_ref": "<string>",
"origin": "ONLINE",
"type": "MONETARY",
"status": "SCHEDULED",
"currency": "<string>",
"initial_amount": 123,
"balance_amount": 123,
"label": "<string>",
"covers": 123,
"expires_on": "2023-12-25",
"holder_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"result": "created"
}{
"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
Body
application/json