Create subscription API

Hi,

I’m trying to follow the steps in the Subscription Api docs:

And now I’m stuck at the last step: Create subscription API
which asks for a customer id but I’m not trying to subscribe a customer to my service. Rather I’m trying to subscribe a merchant to use my KDS app.

The reason for handling the subscription our selves is that my company is located in Canada and according to Square company the subscription is not available outside of US yet.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
https://developer.squareup.com/docs/app-marketplace/requirements/subscriptions-api

Additional Documentation

https://developer.squareup.com/docs/get-started/create-an-account
Take a Credit Card Payment
Get Started

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Since your using the Subscriptions API to charge sellers a subscription to use your integration the merchant will be your customer. You should create a customer profile for that seller and use the generated customer_id when creating the subscription. :slightly_smiling_face:

create a customer profile for the merchant? where? on the merchant side?

With the Customers API or in your Square account. :slightly_smiling_face:

It is weird but ok. I did that and created a customer on the merchant side using its own location data. However, I got stuck again. Because the Subscription Api is failing because the customer which I created does not have an email address. Which is a problem because the merchant itself doesn’t have an email address that I can find in the location data.

Is there another place to look for such info? also, that means new clients cannot subscribe to my app if they don’t have an email address that is already present in their Square account.

What should I do next?

Another issue, the subscription api is not working.

POST /v2/subscriptions/search

“query”: {
“filter”: {
“source_names”: [
“My App”
]}}

returns empty object {} even though I know that I have a new active subscribed user.

“query”: {
“filter”: {
“location_ids”: [
“location_id-1”
]}}

this fails with the following even though the id is a valid location id:
{"code": "LOCATION_MISMATCH","detail": "The provided location ID L8ZG1S4PC**** cannot be accessed by the authorized merchant.","category": "INVALID_REQUEST_ERROR"}

“query”: {
“filter”: {
“customer_ids”: [
“customer-id-1”
],}}

fails with the following even though the customer id is a valid:
{"code": "CUSTOMER_NOT_FOUND","detail": "The provided customer ID 6BE0ZDGPF****************** does not match any known customer.","category": "INVALID_REQUEST_ERROR"}

any idea?

If you SearchTeamMembers and query for is_owner that team member profile will have the email address of the Square account. :slightly_smiling_face:

ok, I will try that.

What about the subscription api failures?

What’s your application ID? :slightly_smiling_face:

Expo KDS
sq0idp-KU0LNcFrgw4XGCdlKTaW7A

Sorry Bryan, you are not being responsive and I don’t see lots of posts that might keep you so busy from completing such a trivial task. So I will flag this issue next time

Please note that we have other support channels that aren’t public facing that we have to respond to developer issues. Also where did you get the customer_id. Was it from your customer directory? :slightly_smiling_face:

Please be more responsive,

  1. you started by leaving my questions unanswered for couple days before commenting
  2. Then leaving a question pending your answer from Friday to Monday even though it takes a minute to answer like the one posted 6 hours ago
  3. And now it is a second level, you ignore my question and you only answered because I had to repeat my question for a second time. You have seen the two questions but intentionally ignored one of them. You did not even leave a follow up message

Please just understand that any business has a limited resources and time.

forget the customer id. why the subscription api is returning an empty object {} when I query for source_names.

If an empty response was returned that means that the source_name that you queried for doesn’t exist. :slightly_smiling_face:

The source_name that I used is my app name Expo KDS which has at least one subscriber

The source_name query is currently only available with subscriptions that are for App Subscription Billing. Since you create a subscription with the Subscriptions API since App Subscription Billing isn’t currently available outside of the US it won’t return results based on your application name. You’ll have to filter based on the customer_ids you create for each subscription that will represent a customer that’s using your application. :slightly_smiling_face:

The only way to know how many subscribers my app has is to query with the customer ids?

There is no other ways?

At this time that’s the only way to know since App Subscription Billing isn’t available outside of the US. :slightly_smiling_face: