#ibgoldbergs_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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?
{ 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", }
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
Gotcha, I don't think that is a limitation with Account Sessions in general, but rather is a limitation for the account_onboarding component specifically:
https://docs.stripe.com/connect/supported-embedded-components#account-onboarding:~:text=Account onboarding is available for Custom connected accounts
so we cant do onboarding embedded with express?
Correct
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?
When you say "a credit", are you referring to a Customer's credit balance?
yes
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.
Hmm okay thank you Toby
How can I get into beta for Creating negative line items?
Hm, I didn't think that needed beta access, are you encountering an error message indicating otherwise?
Ah, I wasn't referring to Credit Notes, I was referring to creating an Invoice Item for that Subscription with a negative amount
https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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.
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
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.
so maybe look at upcoming.invoice then?