Hi everyone,
I’m working on an integration between our Reservation Service and SambaPOS.
The expected flow is:
-
Customer makes a reservation.
-
Customer pays a deposit (DP) in our Reservation Service.
-
Reservation Service creates the customer in SambaPOS.
-
SambaPOS creates an Account for that customer.
-
We post the deposit amount into the customer’s account.
Creating the customer through GraphQL works:
mutation {
addEntity(entity: {
entityType: "Customers",
name: "Ceem",
customData: [
{ name: "Phone", value: "1234567890" },
{ name: "Tanggal DP", value: "08/21/2026 12:00 am" },
{ name: "Booking Date & Time", value: "08/21/2026 12:00 am" }
]
}) {
id
accountId
type
name
}
}
The entity is successfully created, but accountId is 0.
I checked the GraphQL schema for EntityInputType and it only contains:
entityType
name
customData
There is no accountId or createAccount field.
I also checked all available mutations through introspection and I couldn’t find any createAccount / addAccount mutation.
What I tried with Automation
I created a SambaPOS script that calls:
api.Entity("Ceem").CreateAccount();
When I run/test this script directly from SambaPOS, it works correctly and the account is created.
I then created an Automation Rule:
Event:
Automation Command Executed
Automation Command:
Create Customer Account
Action:
Execute Script
If I trigger the rule from inside SambaPOS, it also works.
However, when I trigger the Automation Command through GraphQL:
mutation {
executeAutomationCommand(
name: "Create Customer Account"
terminal: "Kasir"
department: "DINE IN"
user: "Administrator"
ticketType: "Ticket"
)
}
the mutation succeeds, but the expected account creation does not happen.
GraphQL Parameters Issue
I also tried passing the customer name through parameters.
For example:
parameters: [
{ name: "CustomerName", value: "Ceem" }
]
but SambaPOS returns:
System.MissingMethodException:
No parameterless constructor defined for this object.
GraphQL.ObjectExtensions.ToObject(...)
I get the same error when trying notifyEvent with parameters.
Without parameters, executeAutomationCommand works.
I also tried notifyEvent with AutomationCommandExecuted, but using parameters results in the same MissingMethodException.
What I’m trying to achieve
Ultimately I want this to happen without any manual action in SambaPOS:
Reservation Service
|
| Customer Paid Deposit
v
SambaPOS GraphQL
|
+--> Create Customer Entity
|
+--> Create Customer Account
|
+--> Post Deposit to Customer Account
Currently the blocking part is:
Entity created successfully
↓
accountId = 0
↓
How can I create/link the account automatically?
Is there a supported way through GraphQL to:
-
Create an Entity and automatically create its Account?
-
Call something equivalent to
api.Entity(name).CreateAccount()? -
Trigger an Automation Rule from GraphQL in the same context as triggering it from SambaPOS?
-
Or is there another recommended approach for posting customer deposits from an external application?
The important requirement is that this needs to run server-side automatically, without someone having to open SambaPOS and manually create the account or enter the deposit.
Any guidance on the recommended SambaPOS approach would be greatly appreciated.