#Dakurai

1 messages ยท Page 1 of 1 (latest)

signal pecanBOT
mortal edge
#

Here is what I have tried:
{
"cancel_at_period_end": false,
"proration_behavior": "none",
"billing_cycle_anchor":"now",
"items": [
{
"id": "si_NrmQPCondqWU5g",
"price": "price_1N3p5nEvcMarCnz5H3gajRiX"
}
]
}

slate dove
#

Can you share the failing request IDs here?

mortal edge
#

req_NpN9jRIB4jUrTo

#

wait no thats the wrong one

#

I cant see the failing calls in the logs

slate dove
#

Where are you seeing the errors then? You mentioned "getting generic 400 errors"

mortal edge
#

On the platform I am making the calls from. Im trying to figure out if I have the log filters wrong or something

slate dove
#

Can you copy the full error you do see?

#

It should include a request ID in the object

#

It's also in the response headers

mortal edge
#

400 Bad Request: {
"error": {
"message": "Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at https://support.stripe.com/.",
"type": "invalid_request_error"
}
}

slate dove
#

ah

#

You need to use url form encoding

#

are you sending using json body encoding?

mortal edge
#

Ah man reading is hard ๐Ÿ˜‚ Updated the encoding and have a new error: req_bFuQwqEXQLu96Y

signal pecanBOT
slate ruin
#

๐Ÿ‘‹ Hopping in here since synthrider has to head out - is there a reason you're passing in the array to items.data? Instead you should just be passing in the array to items

mortal edge
#

Hi Karbi! What would a correctly formatted request look like?

slate ruin
#

Right now your request body has

  items: {
    data: [
      {
        id: "si_NrmQPCondqWU5g",
        price: "price_1N3p5nEvcMarCnz5H3gajRiX",
      },
    ],
  },

it needs to be more like:

  items: [
      {
        id: "si_NrmQPCondqWU5g",
        price: "price_1N3p5nEvcMarCnz5H3gajRiX",
      },
    ],