#ibgoldbergs_api

1 messages ยท Page 1 of 1 (latest)

worn hareBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1216736631432941678

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

ashen orbit
#

Hi ๐Ÿ‘‹ offhand, I believe that is possible. Can you share the full error message you're encountering, along with the ID of a request which returned that error?

modern narwhal
#

{ message: "You are trying to create an Account Session for an account that is not supported.", request_log_url: "https://dashboard.stripe.com/test/logs/req_T2iR5Ey4Q4XEBv?t=1710163428", type: "invalid_request_error", headers: { server: "nginx", date: "Mon, 11 Mar 2024 13:23:48 GMT", "content-type": "application/json", "content-length": "254", connection: "keep-alive", "access-control-allow-credentials": "true", "access-control-allow-methods": "GET,HEAD,PUT,PATCH,POST,DELETE", "access-control-allow-origin": "*", "access-control-expose-headers": "Request-Id, Stripe-Manage-Version, Stripe-Should-Retry, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required", "access-control-max-age": "300", "cache-control": "no-cache, no-store", "content-security-policy": "report-uri https://q.stripe.com/csp-report?p=v1%2Faccount_sessions; block-all-mixed-content; default-src 'none'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'; img-src 'self'; script-src 'self' 'report-sample'; style-src 'self'", "cross-origin-opener-policy-report-only": "same-origin; report-to=https://q.stripe.com/coop-report", "idempotency-key": "stripe-node-retry-3b146c83-49bf-4bc0-9b46-6e93f018a8a6", "original-request": "req_T2iR5Ey4Q4XEBv", "request-id": "req_T2iR5Ey4Q4XEBv", "stripe-should-retry": "false", "stripe-version": "2023-10-16", vary: "Origin", "x-stripe-routing-context-priority-tier": "api-testmode", "strict-transport-security": "max-age=63072000; includeSubDomains; preload", }, statusCode: 400, requestId: "req_T2iR5Ey4Q4XEBv", }

#

Request id req_T2iR5Ey4Q4XEBv

#

code that creates the account:

        type: 'express',
        country: 'US',
        email: partner.billingEmail,
        capabilities: {
          card_payments: { requested: true },
          transfers: { requested: true },
          tax_reporting_us_1099_k: { requested: true },
          us_bank_account_ach_payments: { requested: true },
          // @ts-ignore
          link_payments: { requested: true },
        },
      };
      const account = await this.stripe.accounts.create(
        createAccountParams,
      ); ```
#

code that creates the sesson:

      account: accountId,
      components: {
        account_onboarding: {
          enabled: true,
          features: {},
        },
      },
    });```
#

changing type from 'express' to 'custom' makes it all work as expected, but we want to create express accounts

ashen orbit
modern narwhal
#

so we cant do onboarding embedded with express?

ashen orbit
#

Correct

modern narwhal
#

ok thanks...

Another question.

Is there any way for a credit to be tied to a specific subscription?

Scenario:

  • customer has 2 subscriptions
  • we want to apply a credit that only applies to one of them
  • How do we handle?
ashen orbit
#

When you say "a credit", are you referring to a Customer's credit balance?

modern narwhal
#

yes

ashen orbit
#

No, we don't have prebuilt functionality for that, you would need to build a custom flow to try to accomplish that.

#

Credit balances are automatically applied to the next finalized Invoice for a Customer, you can't specify that it should only apply to certain Subscription's Invoices.

#

You could explore building a flow that detects changes in a Customer's credit balance, creates an Invoice Item for a specific Subscription when that happens using a negative amount, and then make a request to adjust the customer's balance accordingly.

modern narwhal
#

Hmm okay thank you Toby

#

How can I get into beta for Creating negative line items?

ashen orbit
#

Hm, I didn't think that needed beta access, are you encountering an error message indicating otherwise?

modern narwhal
ashen orbit
modern narwhal
#

wouldn't credit notes satisfy what im trying to achiee?

#

achieve*

ashen orbit
#

I didn't think so, because it sounded like you wanted to create a credit that would apply to a future Invoice, where as Credit Notes are created for existing Invoices. But I may be mistaken or misunderstanding some of the context here.

modern narwhal
#

Well, we could listen to the invoice.created webhook and if its an invoice we want to provide credit to, we could apply the credit note

#

seems like that would be a good option

ashen orbit
#

The credit balance gets applied as soon as the next Invoice is finalized, so you may not have time to trigger the flows to make credit adjustments before the balance is consumed, but it's definitiely an option you can explore.

modern narwhal
#

so maybe look at upcoming.invoice then?