Create Credit Reason - m3ter Documentation
Create Credit Reason
cURL
curl --request POST \
--url https://api.m3ter.com/organizations/{orgId}/picklists/creditreasons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '\n{\n "name": "<string>",\n "version": 123,\n "code": "code",\n "archived": true\n}\n'\n```
### Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/picklists/creditreasons"
payload = {\n "name": "
print(response.text)
### JavaScript
const options = {\n method: 'POST',\n headers: {Authorization: 'Bearer
### PHP
"https://api.m3ter.com/organizations/{orgId}/picklists/creditreasons",\
CURLOPT_RETURNTRANSFER => true,\
CURLOPT_ENCODING => "",\
CURLOPT_MAXREDIRS => 10,\
CURLOPT_TIMEOUT => 30,\
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\
CURLOPT_CUSTOMREQUEST => "POST",\
CURLOPT_POSTFIELDS => json_encode([\
'name' => '
### Go
package main
import (\n\t"fmt"\n\t"strings"\n\t"net/http"\n\t"io"\n)
func main() {
\turl := "https://api.m3ter.com/organizations/{orgId}/picklists/creditreasons"
\tpayload := strings.NewReader("{\n "name": "
\treq, _ := http.NewRequest("POST", url, payload)
\treq.Header.Add("Authorization", "Bearer
\tres, _ := http.DefaultClient.Do(req)
\tdefer res.Body.Close() \tbody, _ := io.ReadAll(res.Body)
\tfmt.Println(string(body)) }
### Unirest (Java)
HttpResponse
### Ruby
require 'uri'\nrequire 'net/http'\n
url = URI("https://api.m3ter.com/organizations/{orgId}/picklists/creditreasons")\n
http = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n
request = Net::HTTP::Post.new(url)\nrequest["Authorization"] = 'Bearer
Response Structure
Success Response (200)
{
"id": "<string>",
"version": 123,
"code": "<string>",
"name": "<string>",
"archived": true,
"dtCreated": "2023-11-07T05:31:56Z",
"dtLastModified": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedBy": "<string>"
}
Error Responses (4XX, 5XX)
{
"message": "<string>"
}
Authorization
- Authorization: string (required) – m3ter supports machine to machine authentication using the
clientCredentialsOAuth2 flow.
Body Parameters
name: string (required) – The name of the entity. Required string length:1 - 200version: integer (required) – The version number of the entity.code: string – The short code for the entity.archived: boolean (required) – A Boolean TRUE / FALSE flag indicating whether the entity is archived.