curl --request POST 'https://api.mayar.id/credit/v1/credit/customer/spend' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data '{
    "memberId" : "KKGOL1MV", // optionally mandatory
    "productId": "40f26fbe-f4d8-4693-975f-e6d105d291e6",
    "membershipTierId": "9bbbfa01-1bf8-4e4d-8470-cdf7066b6ea2",
    "amount": 10
}'
{
    "statusCode": 200,
    "message": "Successfully spent 10. MEMBERSHIP: 10, ADD_ON: 0"
}
curl --request POST 'https://api.mayar.id/credit/v1/credit/customer/spend' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data '{
    "memberId" : "KKGOL1MV", // optionally mandatory
    "productId": "40f26fbe-f4d8-4693-975f-e6d105d291e6",
    "membershipTierId": "9bbbfa01-1bf8-4e4d-8470-cdf7066b6ea2",
    "amount": 10
}'
{
    "statusCode": 200,
    "message": "Successfully spent 10. MEMBERSHIP: 10, ADD_ON: 0"
}
Endpoint:
https://api.mayar.id/credit/v1/credit/customer/spend

Authorization

Authorization
string
required
Example:Authorization | Bearer Paste-Your-API-Key-Here

Request Body

memberId
string
The unique identifier of the customer whose credit will be spent.
customerId
string
The unique identifier of the member whose credit will be spent.
productId
string
required
The unique identifier of the product associated with the credit.
membershipTierId
string
required
The unique identifier of the membership tier associated with the credit.
amount
integer
required
The amount of credit to deduct (positive integer).
At least one of customerId or memberId must be provided.

Response

Successful Response
statusCode
integer
required
Status code form API.
messages
string
required
Status message that describes the status code.