My application uses custom connected accounts. I'm having issues with updating dispute evidence via Stripe's API. Every time I try to update it says, "No such dispute: dp_XXXXXX".
From what I understand I need to pass my stripe key, the dispute id, and any details I want to be updated as an evidence
object.
I was having no luck passing data collected from my form to Stripe. So I tried just hardcoding the example request from Stripe's docs with several different dispute IDs that I'm getting back from the Stripe disputes list endpoint. Again no luck here.
Current setup with node:
export async function update(data): Promise<any> {
return await stripe.disputes.update(data.id, { evidence: data.evidence })
.then((response) => {
return {
type: 'success',
message: 'Dispute updated.'
};
}).catch((error) => {
return {
type: 'error',
message: error.message,
errors: error
};
});
}
Using example from docs:
export async function update(): Promise<any> {
return await stripe.disputes.update(
'dp_XXXXXXXXXXXXXXX',
{
evidence: {
customer_name: 'Natalie Thomas',
product_description: 'Comfortable cotton t-shirt'
}
}
);
}
I've also just tried to use curl to test that it wasn't something I was doing wrong in Node.
curl https://api.stripe.com/v1/disputes/dp_XXXXXXX \
-u sk_test_XXXXXX: \
-d evidence[customer_name]="Jacob Garcia" \
-d evidence[product_description]="Comfortable cotton t-shirt"
This is currently in development so I'm using all test keys/test environment. This is the first issue I've run into with the API.
These disputes are created using Stripe's test card 4000000000000259
.
Any ideas?
Update:
I've also tested retrieving a specific dispute and closing a specific dispute via curl. I get the same error for both of these.
Solved my issue here.
When trying to update a connected account you also have to pass the connected account's ID into the API call. So for my original question, it would be:
stripe.disputes.update(
data.id,
{ evidence: data.evidence },
{ stripe_account: data.accountId }
)
If it's not a connected account then you should be fine just passing the dispute ID.