Create a credit
POST
/credits
const url = 'https://apisandbox.puurk.com/credits';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"example","oid":"example","name":"example","description":"example","default_amount":1,"max_amount":1,"default_percentage":1,"max_percentage":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://apisandbox.puurk.com/credits \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "oid": "example", "name": "example", "description": "example", "default_amount": 1, "max_amount": 1, "default_percentage": 1, "max_percentage": 1 }'Create a new credit for an organization
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Request body
Media typeapplication/json
object
id
string
oid
Organization ID
string
name
string
description
string
default_amount
Default credit amount in cents
integer
max_amount
Maximum credit amount in cents
integer
default_percentage
number
max_percentage
number
Examplegenerated
{ "id": "example", "oid": "example", "name": "example", "description": "example", "default_amount": 1, "max_amount": 1, "default_percentage": 1, "max_percentage": 1}Responses
Section titled “Responses”Credit created
Media typeapplication/json
object
id
string
oid
Organization ID
string
name
string
description
string
default_amount
Default credit amount in cents
integer
max_amount
Maximum credit amount in cents
integer
default_percentage
number
max_percentage
number
Examplegenerated
{ "id": "example", "oid": "example", "name": "example", "description": "example", "default_amount": 1, "max_amount": 1, "default_percentage": 1, "max_percentage": 1}Invalid input
Unauthorized