PosApi
- Create Item
- List Items
- Delete Item
- Get Item
- Update Item
- Create Location
- List Locations
- Delete Location
- Get Location
- Update Location
- Create Merchant
- List Merchants
- Delete Merchant
- Get Merchant
- Update Merchant
- Create Modifier Group
- List Modifier Groups
- Delete Modifier Group
- Get Modifier Group
- Update Modifier Group
- Create Modifier
- List Modifiers
- Delete Modifier
- Get Modifier
- Update Modifier
- Create Order Type
- List Order Types
- Delete Order Type
- Get Order Type
- Update Order Type
- Create Order
- List Orders
- Delete Order
- Get Order
- Pay Order
- Update Order
- Create Payment
- List Payments
- Delete Payment
- Get Payment
- Update Payment
- Create Tender
- List Tenders
- Delete Tender
- Get Tender
- Update Tender
Method: itemsAdd
posApi.itemsAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
item | Item | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Items |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
item: {
id: '#cocoa',
idempotency_key: 'random_string',
name: 'Cocoa',
description: 'Hot Chocolate',
abbreviation: 'Ch',
product_type: 'regular',
price_amount: 10,
pricing_type: 'fixed',
price_currency: 'USD',
cost: 2,
tax_ids: [
'12345',
'67890'
],
is_revenue: false,
use_default_tax_rates: false,
absent_at_location_ids: [
'12345',
'67890'
],
present_at_all_locations: false,
available_for_pickup: false,
available_online: false,
sku: '11910345',
code: '11910345',
categories: [
{
id: '12345',
name: 'Food',
image_ids: [
'12345',
'67890'
]
}
],
options: [
{
id: '12345',
name: 'Option 1',
attribute_id: '12345'
}
],
variations: [
{
id: '12345',
name: 'Food',
sku: '11910345',
item_id: '12345',
sequence: 0,
pricing_type: 'fixed',
price_amount: 10,
price_currency: 'USD',
image_ids: [
'12345',
'67890'
]
}
],
modifier_groups: [
{
id: '12345'
}
],
available: true,
hidden: true,
deleted: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.itemsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: itemsAll
posApi.itemsAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Items |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.itemsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: itemsDelete
posApi.itemsDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Items |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.itemsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: itemsOne
posApi.itemsOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Items |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.itemsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: itemsUpdate
posApi.itemsUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
item | Item | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Items |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
item: {
id: '#cocoa',
idempotency_key: 'random_string',
name: 'Cocoa',
description: 'Hot Chocolate',
abbreviation: 'Ch',
product_type: 'regular',
price_amount: 10,
pricing_type: 'fixed',
price_currency: 'USD',
cost: 2,
tax_ids: [
'12345',
'67890'
],
is_revenue: false,
use_default_tax_rates: false,
absent_at_location_ids: [
'12345',
'67890'
],
present_at_all_locations: false,
available_for_pickup: false,
available_online: false,
sku: '11910345',
code: '11910345',
categories: [
{
id: '12345',
name: 'Food',
image_ids: [
'12345',
'67890'
]
}
],
options: [
{
id: '12345',
name: 'Option 1',
attribute_id: '12345'
}
],
variations: [
{
id: '12345',
name: 'Food',
sku: '11910345',
item_id: '12345',
sequence: 0,
pricing_type: 'fixed',
price_amount: 10,
price_currency: 'USD',
image_ids: [
'12345',
'67890'
]
}
],
modifier_groups: [
{
id: '12345'
}
],
available: true,
hidden: true,
deleted: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.itemsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: locationsAdd
posApi.locationsAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
location | Location | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Locations |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
location: {
name: 'Dunkin Donuts',
business_name: 'Dunkin Donuts LLC',
address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
status: 'active',
merchant_id: '12345',
currency: 'USD',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.locationsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: locationsAll
posApi.locationsAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Locations |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.locationsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: locationsDelete
posApi.locationsDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Locations |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.locationsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: locationsOne
posApi.locationsOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Locations |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.locationsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: locationsUpdate
posApi.locationsUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
location | Location | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Locations |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
location: {
name: 'Dunkin Donuts',
business_name: 'Dunkin Donuts LLC',
address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
status: 'active',
merchant_id: '12345',
currency: 'USD',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.locationsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: merchantsAdd
posApi.merchantsAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
merchant | Merchant | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Merchants |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
merchant: {
name: 'Dunkin Donuts',
address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
owner_id: '12345',
main_location_id: '12345',
status: 'active',
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
language: 'EN',
currency: 'USD',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.merchantsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: merchantsAll
posApi.merchantsAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Merchants |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.merchantsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: merchantsDelete
posApi.merchantsDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Merchants |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.merchantsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: merchantsOne
posApi.merchantsOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Merchants |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.merchantsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: merchantsUpdate
posApi.merchantsUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
merchant | Merchant | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Merchants |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
merchant: {
name: 'Dunkin Donuts',
address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
owner_id: '12345',
main_location_id: '12345',
status: 'active',
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
language: 'EN',
currency: 'USD',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.merchantsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifierGroupsAdd
posApi.modifierGroupsAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
modifierGroup | ModifierGroup | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | ModifierGroups |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
modifierGroup: {
name: 'Modifier',
alternate_name: 'Modifier New',
minimum_required: 1,
maximum_allowed: 5,
selection_type: 'single',
present_at_all_locations: false,
modifiers: [
{
id: '12345',
name: 'Modifier',
alternate_name: 'Modifier New',
price_amount: 10,
currency: 'USD',
available: true
}
],
deleted: true,
row_version: '1-12345',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.modifierGroupsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifierGroupsAll
posApi.modifierGroupsAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | ModifierGroups |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.modifierGroupsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifierGroupsDelete
posApi.modifierGroupsDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | ModifierGroups |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.modifierGroupsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifierGroupsOne
posApi.modifierGroupsOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | ModifierGroups |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.modifierGroupsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifierGroupsUpdate
posApi.modifierGroupsUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
modifierGroup | ModifierGroup | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | ModifierGroups |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
modifierGroup: {
name: 'Modifier',
alternate_name: 'Modifier New',
minimum_required: 1,
maximum_allowed: 5,
selection_type: 'single',
present_at_all_locations: false,
modifiers: [
{
id: '12345',
name: 'Modifier',
alternate_name: 'Modifier New',
price_amount: 10,
currency: 'USD',
available: true
}
],
deleted: true,
row_version: '1-12345',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.modifierGroupsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifiersAdd
posApi.modifiersAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
modifier | Modifier | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Modifiers |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
modifier: {
idempotency_key: 'random_string',
name: 'Modifier',
alternate_name: 'Modifier New',
price_amount: 10,
currency: 'USD',
modifier_group_id: '123',
available: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.modifiersAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifiersAll
posApi.modifiersAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Modifiers |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.modifiersAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifiersDelete
posApi.modifiersDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
filter | ModifierGroupFilter | Apply filters | (optional) |
Status code | Description |
---|---|
200 | Modifiers |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.modifiersDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifiersOne
posApi.modifiersOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
filter | ModifierGroupFilter | Apply filters | (optional) |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Modifiers |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.modifiersOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: modifiersUpdate
posApi.modifiersUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
modifier | Modifier | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Modifiers |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
modifier: {
idempotency_key: 'random_string',
name: 'Modifier',
alternate_name: 'Modifier New',
price_amount: 10,
currency: 'USD',
modifier_group_id: '123',
available: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.modifiersUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: orderTypesAdd
posApi.orderTypesAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
orderType | OrderType | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | OrderTypes |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
orderType: {
name: 'Default order type',
default: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.orderTypesAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: orderTypesAll
posApi.orderTypesAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | OrderTypes |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.orderTypesAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: orderTypesDelete
posApi.orderTypesDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | OrderTypes |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.orderTypesDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: orderTypesOne
posApi.orderTypesOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | OrderTypes |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.orderTypesOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: orderTypesUpdate
posApi.orderTypesUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
orderType | OrderType | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | OrderTypes |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
orderType: {
name: 'Default order type',
default: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.orderTypesUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersAdd
posApi.ordersAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
order | Order | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
order: {
idempotency_key: 'random_string',
order_number: '1F',
order_date: '2022-08-12',
closed_date: '2022-08-13',
reference_id: 'my-order-001',
status: 'open',
payment_status: 'open',
currency: 'USD',
title: 'string',
note: 'string',
merchant_id: '12345',
customer_id: '12345',
employee_id: '12345',
location_id: '12345',
order_type_id: '12345',
table: '1F',
seat: '23F',
total_amount: 275,
total_tip: 700,
total_tax: 275,
total_discount: 300,
total_refund: 0,
total_service_charge: 0,
refunded: false,
customers: [
{
id: '12345',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: '[email protected]',
type: 'primary'
}
]
}
],
fulfillments: [
{
id: '12345',
status: 'proposed',
type: 'shipment',
pickup_details: {
auto_complete_duration: 'P1W3D',
cancel_reason: 'Not hungry',
expires_at: '2016-09-04T23:59:33.123Z',
schedule_type: 'scheduled',
pickup_at: '2016-09-04T23:59:33.123Z',
pickup_window_duration: 'P1W3D',
prep_time_duration: 'P1W3D',
note: 'Pickup in the back.',
placed_at: '2016-09-04T23:59:33.123Z',
rejected_at: '2016-09-04T23:59:33.123Z',
ready_at: '2016-09-04T23:59:33.123Z',
expired_at: '2016-09-04T23:59:33.123Z',
picked_up_at: '2016-09-04T23:59:33.123Z',
canceled_at: '2016-09-04T23:59:33.123Z',
is_curbside_pickup: true,
curbside_pickup_details: {
curbside_details: 'string',
buyer_arrived_at: '2016-09-04T23:59:33.123Z'
},
recipient: {
customer_id: '12345',
display_name: 'Elon Musk',
address: [Object],
phone_number: [Object],
email: [Object]
}
},
shipment_details: {}
}
],
line_items: [
{
name: 'New York Strip Steak',
item: {},
total_tax: 2000,
total_discount: 3000,
total_amount: 27500,
quantity: 1,
unit_price: 27500.5,
applied_taxes: [
{
tax_id: 'sales-tax',
amount: 27500,
currency: 'USD'
}
],
applied_discounts: [
{
discount_id: '12345',
amount: 27500,
currency: 'USD'
}
],
modifiers: [
{
id: '12345',
name: 'New York Strip Steak - no cheese',
amount: 27500,
currency: 'USD',
alternate_name: 'Modifier New',
modifier_group_id: '123'
}
]
}
],
payments: [
{
amount: 27500,
currency: 'USD'
}
],
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
refunds: [
{
amount: 27500,
currency: 'USD',
reason: 'The reason for the refund being issued.',
status: 'pending'
}
],
taxes: [
{
id: 'state-sales-tax',
name: 'State Sales Tax',
amount: 27500,
currency: 'USD',
percentage: 15,
scope: 'order',
type: 'unknown',
auto_applied: true
}
],
discounts: [
{
name: '10% off',
type: 'percentage',
amount: 27500,
currency: 'USD',
scope: 'order'
}
],
tenders: [
{
name: '10% off',
type: 'cash',
note: 'An optional note associated with the tender at the time of payment.',
amount: 27500,
percentage: 10,
currency: 'USD',
total_amount: 275,
total_tip: 7,
total_processing_fee: 0,
total_tax: 2.75,
total_discount: 3,
total_refund: 0,
total_service_charge: 0,
buyer_tendered_cash_amount: 27500,
change_back_cash_amount: 27500,
card: {
bin: '41111',
card_brand: 'visa',
card_type: 'credit',
prepaid_type: 'prepaid',
cardholder_name: 'John Doe',
customer_id: '12345',
merchant_id: '12345',
exp_month: 1,
exp_year: 2022,
fingerprint: ' Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.',
last_4: 'The last 4 digits of the card number.',
enabled: true,
billing_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
reference_id: 'card-001',
version: '230320320320'
},
card_status: 'authorized',
card_entry_method: 'swiped'
}
],
voided: false,
version: '230320320320',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.ordersAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersAll
posApi.ordersAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
locationId | [string] | ID of the location. | (optional) |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.ordersAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersDelete
posApi.ordersDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.ordersDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersOne
posApi.ordersOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.ordersOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersPay
posApi.ordersPay(body)
Name | Type | Description | Notes |
---|---|---|---|
order | Order | ||
id | [string] | ID of the record you are acting upon. | |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
201 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
order: {
idempotency_key: 'random_string',
order_number: '1F',
order_date: '2022-08-12',
closed_date: '2022-08-13',
reference_id: 'my-order-001',
status: 'open',
payment_status: 'open',
currency: 'USD',
title: 'string',
note: 'string',
merchant_id: '12345',
customer_id: '12345',
employee_id: '12345',
location_id: '12345',
order_type_id: '12345',
table: '1F',
seat: '23F',
total_amount: 275,
total_tip: 700,
total_tax: 275,
total_discount: 300,
total_refund: 0,
total_service_charge: 0,
refunded: false,
customers: [
{
id: '12345',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: '[email protected]',
type: 'primary'
}
]
}
],
fulfillments: [
{
id: '12345',
status: 'proposed',
type: 'shipment',
pickup_details: {
auto_complete_duration: 'P1W3D',
cancel_reason: 'Not hungry',
expires_at: '2016-09-04T23:59:33.123Z',
schedule_type: 'scheduled',
pickup_at: '2016-09-04T23:59:33.123Z',
pickup_window_duration: 'P1W3D',
prep_time_duration: 'P1W3D',
note: 'Pickup in the back.',
placed_at: '2016-09-04T23:59:33.123Z',
rejected_at: '2016-09-04T23:59:33.123Z',
ready_at: '2016-09-04T23:59:33.123Z',
expired_at: '2016-09-04T23:59:33.123Z',
picked_up_at: '2016-09-04T23:59:33.123Z',
canceled_at: '2016-09-04T23:59:33.123Z',
is_curbside_pickup: true,
curbside_pickup_details: {
curbside_details: 'string',
buyer_arrived_at: '2016-09-04T23:59:33.123Z'
},
recipient: {
customer_id: '12345',
display_name: 'Elon Musk',
address: [Object],
phone_number: [Object],
email: [Object]
}
},
shipment_details: {}
}
],
line_items: [
{
name: 'New York Strip Steak',
item: {},
total_tax: 2000,
total_discount: 3000,
total_amount: 27500,
quantity: 1,
unit_price: 27500.5,
applied_taxes: [
{
tax_id: 'sales-tax',
amount: 27500,
currency: 'USD'
}
],
applied_discounts: [
{
discount_id: '12345',
amount: 27500,
currency: 'USD'
}
],
modifiers: [
{
id: '12345',
name: 'New York Strip Steak - no cheese',
amount: 27500,
currency: 'USD',
alternate_name: 'Modifier New',
modifier_group_id: '123'
}
]
}
],
payments: [
{
amount: 27500,
currency: 'USD'
}
],
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
refunds: [
{
amount: 27500,
currency: 'USD',
reason: 'The reason for the refund being issued.',
status: 'pending'
}
],
taxes: [
{
id: 'state-sales-tax',
name: 'State Sales Tax',
amount: 27500,
currency: 'USD',
percentage: 15,
scope: 'order',
type: 'unknown',
auto_applied: true
}
],
discounts: [
{
name: '10% off',
type: 'percentage',
amount: 27500,
currency: 'USD',
scope: 'order'
}
],
tenders: [
{
name: '10% off',
type: 'cash',
note: 'An optional note associated with the tender at the time of payment.',
amount: 27500,
percentage: 10,
currency: 'USD',
total_amount: 275,
total_tip: 7,
total_processing_fee: 0,
total_tax: 2.75,
total_discount: 3,
total_refund: 0,
total_service_charge: 0,
buyer_tendered_cash_amount: 27500,
change_back_cash_amount: 27500,
card: {
bin: '41111',
card_brand: 'visa',
card_type: 'credit',
prepaid_type: 'prepaid',
cardholder_name: 'John Doe',
customer_id: '12345',
merchant_id: '12345',
exp_month: 1,
exp_year: 2022,
fingerprint: ' Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.',
last_4: 'The last 4 digits of the card number.',
enabled: true,
billing_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
reference_id: 'card-001',
version: '230320320320'
},
card_status: 'authorized',
card_entry_method: 'swiped'
}
],
voided: false,
version: '230320320320',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.ordersPay(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: ordersUpdate
posApi.ordersUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
order | Order | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Orders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
order: {
idempotency_key: 'random_string',
order_number: '1F',
order_date: '2022-08-12',
closed_date: '2022-08-13',
reference_id: 'my-order-001',
status: 'open',
payment_status: 'open',
currency: 'USD',
title: 'string',
note: 'string',
merchant_id: '12345',
customer_id: '12345',
employee_id: '12345',
location_id: '12345',
order_type_id: '12345',
table: '1F',
seat: '23F',
total_amount: 275,
total_tip: 700,
total_tax: 275,
total_discount: 300,
total_refund: 0,
total_service_charge: 0,
refunded: false,
customers: [
{
id: '12345',
first_name: 'Elon',
middle_name: 'D.',
last_name: 'Musk',
phone_numbers: [
{
id: '12345',
country_code: '1',
area_code: '323',
number: '111-111-1111',
extension: '105',
type: 'primary'
}
],
emails: [
{
id: '123',
email: '[email protected]',
type: 'primary'
}
]
}
],
fulfillments: [
{
id: '12345',
status: 'proposed',
type: 'shipment',
pickup_details: {
auto_complete_duration: 'P1W3D',
cancel_reason: 'Not hungry',
expires_at: '2016-09-04T23:59:33.123Z',
schedule_type: 'scheduled',
pickup_at: '2016-09-04T23:59:33.123Z',
pickup_window_duration: 'P1W3D',
prep_time_duration: 'P1W3D',
note: 'Pickup in the back.',
placed_at: '2016-09-04T23:59:33.123Z',
rejected_at: '2016-09-04T23:59:33.123Z',
ready_at: '2016-09-04T23:59:33.123Z',
expired_at: '2016-09-04T23:59:33.123Z',
picked_up_at: '2016-09-04T23:59:33.123Z',
canceled_at: '2016-09-04T23:59:33.123Z',
is_curbside_pickup: true,
curbside_pickup_details: {
curbside_details: 'string',
buyer_arrived_at: '2016-09-04T23:59:33.123Z'
},
recipient: {
customer_id: '12345',
display_name: 'Elon Musk',
address: [Object],
phone_number: [Object],
email: [Object]
}
},
shipment_details: {}
}
],
line_items: [
{
name: 'New York Strip Steak',
item: {},
total_tax: 2000,
total_discount: 3000,
total_amount: 27500,
quantity: 1,
unit_price: 27500.5,
applied_taxes: [
{
tax_id: 'sales-tax',
amount: 27500,
currency: 'USD'
}
],
applied_discounts: [
{
discount_id: '12345',
amount: 27500,
currency: 'USD'
}
],
modifiers: [
{
id: '12345',
name: 'New York Strip Steak - no cheese',
amount: 27500,
currency: 'USD',
alternate_name: 'Modifier New',
modifier_group_id: '123'
}
]
}
],
payments: [
{
amount: 27500,
currency: 'USD'
}
],
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
refunds: [
{
amount: 27500,
currency: 'USD',
reason: 'The reason for the refund being issued.',
status: 'pending'
}
],
taxes: [
{
id: 'state-sales-tax',
name: 'State Sales Tax',
amount: 27500,
currency: 'USD',
percentage: 15,
scope: 'order',
type: 'unknown',
auto_applied: true
}
],
discounts: [
{
name: '10% off',
type: 'percentage',
amount: 27500,
currency: 'USD',
scope: 'order'
}
],
tenders: [
{
name: '10% off',
type: 'cash',
note: 'An optional note associated with the tender at the time of payment.',
amount: 27500,
percentage: 10,
currency: 'USD',
total_amount: 275,
total_tip: 7,
total_processing_fee: 0,
total_tax: 2.75,
total_discount: 3,
total_refund: 0,
total_service_charge: 0,
buyer_tendered_cash_amount: 27500,
change_back_cash_amount: 27500,
card: {
bin: '41111',
card_brand: 'visa',
card_type: 'credit',
prepaid_type: 'prepaid',
cardholder_name: 'John Doe',
customer_id: '12345',
merchant_id: '12345',
exp_month: 1,
exp_year: 2022,
fingerprint: ' Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.',
last_4: 'The last 4 digits of the card number.',
enabled: true,
billing_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
reference_id: 'card-001',
version: '230320320320'
},
card_status: 'authorized',
card_entry_method: 'swiped'
}
],
voided: false,
version: '230320320320',
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.ordersUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: paymentsAdd
posApi.paymentsAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
payment | PosPayment | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | PosPayments |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
payment: {
source_id: '12345',
order_id: '12345',
merchant_id: '12345',
customer_id: '12345',
employee_id: '12345',
location_id: '12345',
device_id: '12345',
tender_id: '12345',
external_payment_id: '12345',
idempotency_key: 'random_string',
amount: 27.5,
currency: 'USD',
tip: 7,
tax: 20,
total: 37.5,
app_fee: 3,
change_back_cash_amount: 20,
approved: 37.5,
refunded: 37.5,
processing_fees: [
{
amount: 1.05,
effective_at: '2020-09-30T07:43:32.000Z',
processing_type: 'initial'
}
],
source: 'external',
status: 'approved',
cash: {
amount: null,
charge_back_amount: null
},
card_details: {
card: {
bin: '41111',
card_brand: 'visa',
card_type: 'credit',
prepaid_type: 'prepaid',
cardholder_name: 'John Doe',
customer_id: '12345',
merchant_id: '12345',
exp_month: 1,
exp_year: 2022,
fingerprint: ' Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.',
last_4: 'The last 4 digits of the card number.',
enabled: true,
billing_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
reference_id: 'card-001',
version: '230320320320'
}
},
bank_account: {
bank_name: 'string',
transfer_type: 'string',
account_ownership_type: 'string',
fingerprint: 'string',
country: 'US',
statement_description: 'string',
ach_details: {
routing_number: 'string',
account_number_suffix: 'stri',
account_type: 'string'
}
},
wallet: {
status: 'authorized'
},
external_details: {
type: 'check',
source: 'string',
source_id: 'string',
source_fee_amount: 2.5
},
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.paymentsAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: paymentsAll
posApi.paymentsAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | PosPayments |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.paymentsAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: paymentsDelete
posApi.paymentsDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | PosPayments |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.paymentsDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: paymentsOne
posApi.paymentsOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | PosPayments |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.paymentsOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: paymentsUpdate
posApi.paymentsUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
payment | PosPayment | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | PosPayments |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
payment: {
source_id: '12345',
order_id: '12345',
merchant_id: '12345',
customer_id: '12345',
employee_id: '12345',
location_id: '12345',
device_id: '12345',
tender_id: '12345',
external_payment_id: '12345',
idempotency_key: 'random_string',
amount: 27.5,
currency: 'USD',
tip: 7,
tax: 20,
total: 37.5,
app_fee: 3,
change_back_cash_amount: 20,
approved: 37.5,
refunded: 37.5,
processing_fees: [
{
amount: 1.05,
effective_at: '2020-09-30T07:43:32.000Z',
processing_type: 'initial'
}
],
source: 'external',
status: 'approved',
cash: {
amount: null,
charge_back_amount: null
},
card_details: {
card: {
bin: '41111',
card_brand: 'visa',
card_type: 'credit',
prepaid_type: 'prepaid',
cardholder_name: 'John Doe',
customer_id: '12345',
merchant_id: '12345',
exp_month: 1,
exp_year: 2022,
fingerprint: ' Intended as a POS-assigned identifier, based on the card number, to identify the card across multiple locations within a single application.',
last_4: 'The last 4 digits of the card number.',
enabled: true,
billing_address: {
id: '123',
type: 'primary',
string: '25 Spring Street, Blackburn, VIC 3130',
name: 'HQ US',
line1: 'Main street',
line2: 'apt #',
line3: 'Suite #',
line4: 'delivery instructions',
street_number: '25',
city: 'San Francisco',
state: 'CA',
postal_code: '94104',
country: 'US',
latitude: '40.759211',
longitude: '-73.984638',
county: 'Santa Clara',
contact_name: 'Elon Musk',
salutation: 'Mr',
phone_number: '111-111-1111',
fax: '122-111-1111',
email: '[email protected]',
website: 'https://elonmusk.com',
notes: 'Address notes or delivery instructions.',
row_version: '1-12345'
},
reference_id: 'card-001',
version: '230320320320'
}
},
bank_account: {
bank_name: 'string',
transfer_type: 'string',
account_ownership_type: 'string',
fingerprint: 'string',
country: 'US',
statement_description: 'string',
ach_details: {
routing_number: 'string',
account_number_suffix: 'stri',
account_type: 'string'
}
},
wallet: {
status: 'authorized'
},
external_details: {
type: 'check',
source: 'string',
source_id: 'string',
source_fee_amount: 2.5
},
service_charges: [
{
name: 'Charge for delivery',
amount: 27500,
percentage: 12.5,
currency: 'USD',
active: true,
type: 'auto_gratuity'
}
],
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.paymentsUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: tendersAdd
posApi.tendersAdd(body)
Name | Type | Description | Notes |
---|---|---|---|
tender | Tender | ||
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
Status code | Description |
---|---|
201 | Tenders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
tender: {
key: 'com.clover.tender.cash',
label: 'Cash',
active: true,
hidden: true,
editable: true,
opens_cash_drawer: true,
allows_tipping: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.tendersAdd(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: tendersAll
posApi.tendersAll(body)
Name | Type | Description | Notes |
---|---|---|---|
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
cursor | [string] | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | (optional) |
limit | [number] | Number of results to return. Minimum 1, Maximum 200, Default 20 | (optional) defaults to 20 |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Tenders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {}
try {
const { data } = await apideck.pos.tendersAll(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: tendersDelete
posApi.tendersDelete(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Tenders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.tendersDelete(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: tendersOne
posApi.tendersOne(body)
Name | Type | Description | Notes |
---|---|---|---|
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
fields | [string] | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. Example: `fields=name,email,addresses.city` In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. |
(optional) |
Status code | Description |
---|---|
200 | Tenders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example'
}
try {
const { data } = await apideck.pos.tendersOne(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}
[Back to top] [Back to API list] [Back to README]
Method: tendersUpdate
posApi.tendersUpdate(body)
Name | Type | Description | Notes |
---|---|---|---|
tender | Tender | ||
id | [string] | ID of the record you are acting upon. | |
consumerId | [string] | ID of the consumer which you want to get or push data from | (optional) |
appId | [string] | The ID of your Unify application | (optional) |
serviceId | [string] | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | (optional) |
raw | [boolean] | Include raw response. Mostly used for debugging purposes | (optional) defaults to false |
Status code | Description |
---|---|
200 | Tenders |
400 | Bad Request |
401 | Unauthorized |
402 | Payment Required |
404 | The specified resource was not found |
422 | Unprocessable |
4/5xx | Unexpected error |
import { Apideck } from '@apideck/node';
const apideck = new Apideck({
apiKey: 'REPLACE_WITH_API_KEY',
appId: 'REPLACE_WITH_APP_ID',
consumerId: 'REPLACE_WITH_CONSUMER_ID'
});
const params = {
id: 'id_example',
tender: {
key: 'com.clover.tender.cash',
label: 'Cash',
active: true,
hidden: true,
editable: true,
opens_cash_drawer: true,
allows_tipping: true,
pass_through: [
{
service_id: 'string',
operation_id: 'string',
extend_object: {},
extend_paths: [
{
path: '$.nested.property',
value: [Object]
}
]
}
]
}
}
try {
const { data } = await apideck.pos.tendersUpdate(params)
console.log('API called successfully', data)
} catch (error) {
console.error(error)
return error.json()
}