Payments
Simulate a payment action
Advances a payment through its lifecycle for testing: approve or decline the risk review, collect or deliver the funds, or simulate a collection or delivery failure. The action runs against the real payment, so the status change and any webhooks fire just as in production. Available in non-production environments only.
POST
/
simulations
/
payments
/
{paymentId}
/
actions
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 'risk-approve'})
};
fetch('https://api.melio.com/v2/simulations/payments/{paymentId}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
"error": {
"type": "invalid_request_error",
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}Headers
Body
application/json
Response
Action applied.
const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({action: 'risk-approve'})
};
fetch('https://api.melio.com/v2/simulations/payments/{paymentId}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
"error": {
"type": "invalid_request_error",
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}