#ahsannajam

1 messages · Page 1 of 1 (latest)

thorny bloom
#

Hello! Looks like you have several threads and individual messages scattered above, can you ask your full question with all details in this thread so we can keep everything all in one place?

thorny bloom
strong pelican
#

{
"add_invoice_items": {
"0": {
"price": "price_1KxWtiIDIaGCKxK2NIk5VtDP",
"quantity": "1"
}
},
"customer": "cus_Letvy0WRxXqNbZ",
"items": {
"0": {
"price": "price_1KxWtiIDIaGCKxK2NIk5VtDP",
"quantity": "1"
}
},
"expand": {
"0": "latest_invoice.payment_intent"
}
}
Request POST body
{
"add_invoice_items": {
"0": {
"price": "price_1KxWtiIDIaGCKxK2NIk5VtDP",
"quantity": "1"
}
},
"customer": "cus_Letvy0WRxXqNbZ",
"items": {
"0": {
"price": "price_1KxWtiIDIaGCKxK2NIk5VtDP",
"quantity": "1"
}
},
"expand": {
"0": "latest_invoice.payment_intent"
}
}
Request query parameters
No query parameters
Response body
{
"error": {
"message": "The price specified is set to type=recurring but this field only accepts prices with type=one_time.",
"param": "add_invoice_items[0][price]",
"type": "invalid_request_error"
}
}

thorny bloom
#

Can you give me the request ID? That ID starting with req_ in the top right corner?

#

Please do not paste the entire JSON in here.

#

Can you tell me what your goal is? What are you trying to do with this code?

strong pelican
#

subscribe to a product and charge them annually or monthly

#

for example: this is a job portal. An employer can buy 180$ subscription for yearly to post jobs.

thorny bloom
strong pelican
#

It charges automatically every year

#

May I remove add_invoice_items ?

#

from this code?

thorny bloom
#

If you don't want any one-time items added to the first Invoice, yes.

thorny bloom
#

Did that work?

strong pelican
#

yes, excellent man

#

u r awesome