#.saberkhan
1 messages · Page 1 of 1 (latest)
Hi there, are you talking about the tax_rates field ? https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-tax_rates
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 have read it but output fields are not in the above linked document.
line_items are not included in response by default, you need to expand it https://stripe.com/docs/api/expanding_objects
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 need to know the output fields that are displayed when input is tax_rate_id during creation of Checkout session.
You can just create a checkout session and check it out yourself. Did you expand the line_items field in the creation request?
No
Ok, you should expand it
Ok
There are several fields for line_items, which one is relevant to get response of detail information of tax collected by Stripe.
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
This is the response when I expanded line items. Am I missing any fields from the response for the Checkout session?
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 10000
},
I am not getting tax_rate_id. Is there a way to get tax_rate_id?
Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
cs_test_b1nAFcyMpHtiSXI97xLGJVASeKNyIpoHY3WW5ntZVdGMJGCYns6W9oMwF9
This is the request https://dashboard.stripe.com/test/logs/req_hFluocFWanzuiT
You should expand the breakdown field
https://stripe.com/docs/api/expanding_objects refer to this doc to learn how to expand the response
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is "total_details.breakdown" field available during creation of Checkout session. I have not seen in the Stipe documentation.
I have seen "total_details.breakdown" field in Checkout session object but it is not inlcuded in "Create Checkout session". Am I missing anything here?
Yes total_details.breakdown' is included in the checkout session creation response if you add expand: ['total_details.breakdown'] in your requet.
Let me try
total_details[breakdown][taxes][rate][id] and I am getting the following error "code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: total_details",
"param": "total_details",
Request ID?
{
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: total_details",
"param": "total_details",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_nuzIfqzUa8NmRV?t=1689901886",
"type": "invalid_request_error"
}
}
No request id.
This is the request ID req_nuzIfqzUa8NmRV
Are you trying to set a total_details in your request?
I set it using an unique string id and getting above error.
This is expected. You can't set a total_details whenc creating a checkout session. https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session refer to the API reference for the list of params that you can set in a creation request.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok
"total_details[breakdown][taxes][rate][id]. I did not add any input but still getting above error? Am I missing something here?
https://dashboard.stripe.com/test/logs/req_nuzIfqzUa8NmRV
You have added a
total_details: {
breakdown: {
taxes: {
rate: {
id: "txr_1NUt3tCjwmDvqQqqYq289oQW",
},
},
},
in your request
Let me try
And this isn't a param that checkout session creation APi acceipt
So how can I get response using total_details[breakdown][taxes][rate][id]?
Just to clarify, you want total_details[breakdown] included in the response, am I right?
Correct
total_details.breakdown' is included in the checkout session creation response if you add expand: ['total_details.breakdown'] in your request.
https://stripe.com/docs/api/expanding_objects Have you read this article to understand how to expand a response?
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 added this code ['total_details.breakdown'] in the request, still getting the same error.
Send me the Request ID
"error": {
"code": "parameter_unknown",
"doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
"message": "Received unknown parameter: 'total_details.breakdown'",
"param": "'total_details.breakdown'",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_5PhUr5oTUKXt1g?t=1689902701",
"type": "invalid_request_error"
}
}
I do not have request id
And your code
Code is in postment. Difficult to copy and paste.
You should replace
with
expand: ['total_details.breakdown']
Let me try
"error": {
"message": "Invalid array",
"param": "expand",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_MP1FDnsBxoK5Rb?t=1689902930",
"type": "invalid_request_error"
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You are sending expand: "['total_details.breakdown']", and it isn't a valid array.
It should be expand: ['total_details.breakdown']
Is it possible for you to check if "Expand" feature is allowed in postman?