This is for spaces that have a restaurant/café with a POS (point of sale) system. Usually the restaurant will serve members of the space (who are on Cobot) as well as guests (not on Cobot). Guests pay immediately via the POS system, but you might want to allow members to pay via the payment method they already have entered in Cobot.
For this to work, the POS, instead of charging someone directly, has to send the payment information to Cobot via our API. The steps are generally the following:
- Know the subdomain of the space on Cobot (can be entered manually once or hard-coded).
- Identify the paying person's membership on Cobot
- Create one or more charges on Cobot (description, amount, currency).
- Optionally generate an invoice and charge/send it. If you leave this out, Cobot will add the charges to the member's next monthly invoice.
Let's look at the steps above in more detail:
- When developing a system for multiple spaces, you can get a list of spaces available to the current user by making a request to
https://www.cobot.me/api/user. This will give you a list of spaces that the user is an admin of (see the
admin_of list at https://www.cobot.me/api-docs/users#get-user-details).
Otherwise just let the user enter the subdomain or hard-code it.
- Fetch the list of members (see https://www.cobot.me/api-docs/memberships#list-members) and display them in a drop-down. Store the membership's id for the next step.
- Send a POST request to our charges endpoint (see https://www.cobot.me/api-docs/one-time-charges#create-charge), including the amount/currency to charge and a description.
- If you want to charge/invoice the person immediately, generate an invoice based on the charge you created in the previous step (see https://www.cobot.me/api-docs/invoices#create-invoice-for-current-charges). Afterwards you can also charge their payment method and send the invoice via email.