Authorization
string
required
Example:
Authorization | Bearer Paste-Your-API-Key-HerePath Parameters
string
required
The unique identifier of the membership member to bill.Example:
MBR8X2QKRequest Body
productId may be supplied in the request body OR as a query parameter (see
Query Parameters). At least one location is required.
string
required
The unique identifier of the product the member belongs to. Accepted here in the
JSON body, or alternatively as a query parameter.Example:
7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5fQuery Parameters
string
Alternative location for
productId when you prefer not to send a request body.
Use either the body field or this query parameter.Example:?productId=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5fIdempotency (term-based)
Invoices are idempotent per billing term. The endpoint keys on the member’s current billing period: if an unpaid invoice already exists for the current period it is reused and returned instead of creating a duplicate. Calling this endpoint repeatedly within the same billing term therefore returns the same invoice (and the samemembershipBillUrl).
Response
Successful ResponseMain Structure (Root Object)
integer
Status code from the API.
200 on success.string
Status message that describes the result. Note the singular
message key
(write endpoints use message; read/list endpoints use the plural messages).object
The created (or reused) membership invoice object for the current billing term.
string
The unique identifier of the invoice.
string
The identifier of the underlying transaction associated with the invoice.
string
The identifier of the customer being billed.
string
The identifier of the member’s tier.
number
The amount due for the billing term.
string
Current status of the invoice (for example
created).string
Invoice expiration time in ISO 8601 format (UTC).
string
The membership bill URL the customer can use to pay. Built from the tenant’s shop
subdomain in the shape
https://<tenant>.mayar.shop/pl/<link> — this is not an
api.mayar.id URL.Errors
All errors use the envelope{ "statusCode": <code>, "message": "<reason>" } (singular message).
Error Example 400
integer
The HTTP status code of the error.
string
A human-readable description of the error.
