Update Payment Status
POST {{base-url}}/status/{{payment-id}}
Update the status of a payment with the given ID.
Parameters
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | The API key to use. |
Path
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The UUID of the payment. |
Request
{
"apiKey": "string",
"id": "string",
"status": "string",
"trust_Seed": "string",
"trust_Value": "string",
"alt_Trust_Value": "string"
}
payload
| Name | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | The API key to use. |
| id | string | Yes | The UUID of the payment. |
| status | string | Yes | The new status. |
| trust_Seed | string | Yes | The trust seed value. |
| trust_Value | string | Yes | The trust value. |
| alt_Trust_Value | string | Yes | The alternative trust value. |
Example
{
"apiKey": "your-api-key",
"id": "b8f2d832-72e2-4e47-8b8a-7f6a3a3e7abe",
"status": "completed",
"trust_Seed": "your-trust-seed",
"trust_Value": "your-trust-value",
"alt_Trust_Value": "your-alt-trust-value"
}
Response
{
"success": true
}
payload
| Name | Type | Required | Description |
|---|---|---|---|
| success | boolean | Yes | Indicates if the update was successful. |
Example
{
"success": true
}
Errors
| Code | Description |
|---|---|
| 400 | Bad Request |
| 500 | Internal Server Error |
Bad Request Example
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "698b5f0f-6a3e-4d7b-a2e6-9025a1a7cf8e",
"errors": {
"apiKey": ["The apiKey field is required."],
"id": ["The id field is required."]
}
}
Internal Server Error Example
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "An error occurred.",
"status": 500,
"traceId": "05faffa9-1dca-4629-934c-cea9b8637b5c"
}
Example Usage
Here's an example of how to make a POST request to the /api/v1/status/{payment-id} endpoint using Javascript and the fetch API:
let headersList = {
"Accept": "*/*",
"api-key": "your_api_key",
"Content-Type": "application/json"
}
let bodyContent = JSON.stringify({
"status": "cancelled",
"trust_value": "c10cd9445121e4ed6ad0ab47cdde2882",
"trust_seed": "ew0KCQkJCQkJIm5hbWUiOiJISVNFTlNFIDEwMEw1RiAxMDAmcXVvdDsgTEFTRVIgVFYxIiwNCgkJCQkJCSJza3UiOiIxMDBMNUYiLA0KCQkJCQkJInF1YW50aXR5IjoiMSIsDQoJCQkJCQkicHJpY2UiOiIxMjY1Ny4wMCIsDQoJCQkJCQkiZGVzY3JpcHRpb24iOiAic3RyaW5nIiwNCgkJCQkJCSJicmFuZCI6ICJzdHJpbmciLA0KCQkJCQkJIm1lcmNoYW50X3Byb2R1Y3RfaWQiOiI1Mzc4MyIsDQoJCQkJCQkidmVuZG9yIjogew0KCQkJCQkJCSJ2ZW5kb3JfaWQiOiAic3RyaW5nIiwNCgkJCQkJCQkidXJsIjogInN0cmluZyIsDQoJCQkJCQkJIm5hbWUiOiAic3RyaW5nIg0KCQkJCQkJfSwNCgkJCQkJCSJpbWFnZXMiOiBbDQoJCQkJCQkJImh0dHBzOi8vYXRvbWljdGVzdC5jby56YS93cC1jb250ZW50L3VwbG9hZHMvMjAyMS8xMS8xMDBMNUYuanBlZyIgDQoJCQkJCQldLA0KCQkJCQkJImJhcmNvZGVzIjogWw0KCQkJCQkJCSIiDQoJCQkJCQldLA0KCQkJCQkJImNhdGVnb3JpZXMiOiBbIA0KCQkJCQkJXSwNCgkJCQkJCSJwcm9wZXJ0aWVzIjogWw0KCQkJCQkJCXsNCgkJCQkJCQkia2V5IjogInN0cmluZyIsDQoJCQkJCQkJInZhbHVlIjogInN0cmluZyINCgkJCQkJCQl9DQoJCQkJCQldDQoJCQkJCX0s"
});
let response = await fetch("http://localhost:3000/api/v1/status/590fbc3e-784e-4519-95b0-08db35c30d2b", {
method: "POST",
body: bodyContent,
headers: headersList
});
let data = await response.text();
console.log(data);
Replace your_api_key with your actual API key.
Expected Response
This is an example of the expected response:
{
"success": true
}