/organization/currencies/update v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Organizations
postOrganizationCurrenciesUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": [
"code",
"rate"
],
"properties": {
"code": {
"type": "string",
"description": "Currency code (e.g., USD, EUR)",
"example": "USD"
},
"rate": {
"type": "number",
"description": "Exchange rate for the currency",
"example": 1.12
},
"available": {
"type": "number",
"description": "Flag indicating if the currency is available (optional)",
"example": 1
},
"deleted": {
"type": "number",
"description": "Flag indicating if the currency is deleted (optional)",
"example": 0
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/organization/currencies/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /organization/currencies/update
Update the organization's currency
Updates currency details (code, rate, availability) for the organization. Requires admin role.
Body parameter
{
"type": "object",
"properties": {
"params": {
"type": "object",
"required": ["code", "rate"],
"properties": {
"code": {
"type": "string",
"description": "Currency code (e.g., USD, EUR)",
"example": "USD"
},
"rate": {
"type": "number",
"description": "Exchange rate for the currency",
"example": 1.12
},
"available": {
"type": "number",
"description": "Flag indicating if the currency is available (optional)",
"example": 1
},
"deleted": {
"type": "number",
"description": "Flag indicating if the currency is deleted (optional)",
"example": 0
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » params | body | object | false | none |
| »» code | body | string | true | Currency code (e.g., USD, EUR) |
| »» rate | body | number | true | Exchange rate for the currency |
| »» available | body | number | false | Flag indicating if the currency is available (optional) |
| »» deleted | body | number | false | Flag indicating if the currency is deleted (optional) |
Example responses
200 Response
{
"type": "object",
"properties": null
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Currency updated successfully | Inline |
| 404 | Not Found | Organization not found | string |
| 406 | Not Acceptable | Maximum number of currencies reached for subscription tier | string |
| 500 | Internal Server Error | Internal server error | string |
