Linking CustPymt to CustInvc in NetSuite API - netsuite

I am dealing with integrating with NetSuite API.
I'm stuck as to how to link a CustPymt (Customer Payment) to the CustInvc (Customer Invoice) it's linked to on NetSuite.
On Netsuite I can visibly see these linkages, but I cannot recreate them via the API.
I'm currently syncing JSON responses from Transactions and TransactionLine. Am I missing something?
I can't find anything in the children of Transactions (Lines) to link either transaction together via a common key or a reference to the invoice within the Transaction or Transaction Line.

Related

Stripe Payment Links with Customer Id

I am currently building an application where we want to user Stripe Payment links rather then building our own version of UI to support the same functionality. However I notice that Stripe Payment Links create a new customer every single time. Is there a way to attach my customer id to the payment link so that a new customer is not created when they attempt to buy more then one product? I would prefer not to have to have a single user have multiple customer ids inside of my database.
Thanks!
Payment Links are not specific to a Customer record. The documentation does include examples of how you might append data to them to aid in reconciling payments to a specific individual.
If you want to make use of the Stripe hosted UI while still assigning specific Customer records then I would recommend making use of Stripe Checkout.

stripe api: is it possible to expand invoice discounts from the events api?

In the stripe API there is no endpoint to load discounts by Id, so typically when querying the invoices api you append ?expand[]=data.discounts to the request and it populates the details of the discounts in the returned objects. This is the only way I know of to get the discounts from the API.
In the events api you get back lots of different kinds of objects, but for the invoices I would like to also expand the discounts because I do not know how to get them otherwise. I have tried appending the following expand paramaters to the events api and always get back an invalid_request_error from their api telling me that the field I request can not be expanded.
?expand[]=discounts
?expand[]=object.discounts
?expand[]=data.discounts
?expand[]=data.object.discounts
?expand[]=data.data.object.discounts
?expand[]=data.data.discounts
Is it possible to expand the discounts on invoices from the stripe events api?
From synthrider on Stripe Developer Community Discord:
hello! No, events can't be expanded , you'd need to request this from the related API directly

With Stripe, how to attach a single payment method created from Setup Intent API for multiple customers

With Stripe, how to use the payment method created from setup intent for multiple customers?
According tp the Create Setup Intent API, it only let us define one customer ID.
param name: customer (optional)
description of this param:
attached to the Customer on successful setup. Payment methods attached
to other Customers cannot be used with this SetupIntent.ID of the Customer this SetupIntent belongs to, ifone exists. If present, the SetupIntent’s payment method will be
TLDR
I want to let the same user to reuse same payment method to subscribe items with different presentment currencies,
I assume I should solve this requirement by directly creating multiple customer objects for a single user, and using create Setup Intent API to attach his/her same payment method for multiple "customer objects".
But, I am not sure if this is possible, therefore I welcome any recommendation for alternative approaches, such as using attach payment method to customers API, or any workarounds.
PS: Detail info (for why I am interested to ask this question)
Business requirement:
My business requirement is that customers have to subscribe to international services that must be presented with different presentment currencies. To makes thing even harder, each customer has to use the same list of saved payment methods to subscribe to services with different presentment currencies in the future. In other words, users should not have to re-enter card info again if they subscribe to items in different presentment currencies.
Limitation of the Stripe API:
Why not just use single customer object for subscribing to services (aka "price" objects) with multiple presentment currency?
I tried and it results in an error. According to this Stripe documentation, it indeed says that each customer can only be used for transactions in single currency.
If the user in my app want to subscribe to another service with another
currency, I need to create new "Customer" object in Stripe.
Why not just use /v1/payment_methods/:pm_id/attach api to attch payment method to multiple customer object?
Because according to this Attact payment method to customer API doc, Stripe does not recommend, yet I do not fully understand the risk of not performing any necessary steps as it warns. Therefore, it is just my risk averse instinct to avoid this.
To attach a new PaymentMethod to a customer for future payments, we
recommend you use a SetupIntent or a PaymentIntent with
setup_future_usage. These approaches will perform any necessary steps
to ensure that the PaymentMethod can be used in a future payment.
This is not supported. A payment method can only be consumed once if not attached, and attaching to a customer counts as a consumption. A PM can only be attached to a single customer, so you'll need to collect the payment details for each.
Stripe recommends using that customer's currency for all presentment to optimize for their experience, though that may not be suitable for all use cases.

Docusign and Stripe integration - Payments are created without a customer

I'm trying to integrate the Docusign eSignature API with Stripe.
I've created a Quickstart application and have successfully run through the process, signing the contract and making a test payment.
However, I noticed that the payment in Stripe does not have a customer object attached to it:
I'd like to know if it's possible to specify a customerId, or create one as part of the process. I did notice that the PaymentDetails constructor accepts a customerId parameter, but I could not see any relevant documentation for this, and specifying it in my request didn't seem to make any difference.
Any advice appreciated.
Thanks
Dan,
For regular payments that are one time and right away - DocuSign will not create a customer record. This is "by design" and is meant to support quick payments without any customer record.
You can set recurring/future payments and then you'll get customer records when you set the gateway. If you want, your recurring payment or future payment can be just one time in the near future and then you can achieve what you want and get a customer record.

NetSuite Script to Block the order if payment is rejected

I using Web Services to integrate to NetSuite and passing the internal ID of the credit card on file for the customer with my sales order transaction header.
I would like NetSuite to fail to create the order completely if the card that I am passing cannot be authorized (for example if it's expired). Is this possible using a script in the custom form?
I don't believe there is a pre-auth in NetSuite. You would need to make a call to AuthNet or something first. Or you can close/reject the order if the CC fails after saved.

Resources