ResourcesCredits
Record a credit transaction
Atomically grant, consume, or administratively adjust integer credit units.
Authorization
bearerAuth storeAuth AuthorizationBearer <token>
Provide your SellApp API key as a bearer token.
In: header
X-STORE<token>
Select the SellApp store for this API request.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://sell.app/api/v2/credit-transactions" \ -H "Content-Type: application/json" \ -d '{ "customer_id": 0, "product_id": 0, "kind": "grant", "amount_units": 0, "idempotency_key": "string" }'{
"data": {
"id": 0,
"store_id": 0,
"customer_id": 0,
"product_id": 0,
"kind": "grant",
"amount_units": 0,
"balance_after_units": 0,
"idempotency_key": "string",
"source_type": "string",
"source_id": "string",
"reason": "string",
"metadata": {},
"actor_user_id": 0,
"created_at": "2019-08-24T14:15:22Z"
}
}{
"data": {
"id": 0,
"store_id": 0,
"customer_id": 0,
"product_id": 0,
"kind": "grant",
"amount_units": 0,
"balance_after_units": 0,
"idempotency_key": "string",
"source_type": "string",
"source_id": "string",
"reason": "string",
"metadata": {},
"actor_user_id": 0,
"created_at": "2019-08-24T14:15:22Z"
}
}{
"message": "Unauthenticated."
}{
"message": "This action is unauthorized."
}{
"message": "The given data was invalid.",
"errors": {
"data": [
"The data field is required."
]
}
}