Mayar Headless API API Reference
Ini adalah bagian pertama dalam panduan development untuk menggunakan Mayar sebagai backend eCommerce headless anda. Jika Anda tidak terbiasa dengan headless commerce sebagai sebuah konsep, anda dapat mulai dengan membaca blog Mayar berikut: Headless Commerce atau BigCommerce Headless
Secara konsep anda dapat menggunakan Mayar sebagai CMS untuk mengatur produk dan order, lalu menggunakan Headless API untuk menarik data produk ke front-end anda dimana pelanggan dapat melihat dan membeli produk.
Untuk web anda dapat menggunakan NextJS atau Vue Storefront dan hosting halaman frontend anda di Netlify atau Vercel
API Endpoints
Production / Live:
https://api.mayar.id/headless
Terms of Service: https://www.mayar.id/id/kebijakan-layanan
Contact: info@mayar.id
Version: 1.0.0
Paths
Fetch 'PaymentLink' field
PaymentLink adalah objek yang dalam perspektif merchant adalah Produk. PaymentLink (Produk) di Mayar ada beberapa tipe yaitu:
-
generic-link
atau Link Pembayaran -
payment_request
atau Permintaan Pembayaran -
subscription
atau Paket Berlangganan -
digital_product
atau Digital Download -
webinar
atau Webinar -
payme
atau PayMe -
fundraising
atau Galang Dana -
invoice
atau Invoice -
physical_product
atau Produk Fisik -
event
atau Event -
coaching
atau Coaching -
course
atau Kelas Online (OD) -
zakat
atau ZakatSetiap PaymentLink akan memiliki
invoiceUrl
yang dapat anda gunakan untuk checkout dari front-end anda baik dengan mengarahkan keURL
tersebut atau melalui pop-up embed
(no description)
(no description)
(no description)
(no description)
(no description)
(no description)
Example
Request Content-Types:
application/json
Query
query getPaymentLinkPageDev($page: Int, $pageSize: Int, $search: PaymentLinkSearchInput, $searchAny: PaymentLinkSearchInput, $sortDirection: SortDirection, $sortField: PaymentLinkSortField){
getPaymentLinkPageDev(page: $page, pageSize: $pageSize, search: $search, searchAny: $searchAny, sortDirection: $sortDirection, sortField: $sortField){
total
page
offset
totalPage
prevPage
nextPage
items{
invoiceUrl
amount
description
id
name
notes
status
type
coverImage{
url
}
}
}
}
Variables
{
"page": "integer",
"pageSize": "integer",
"search": {
"amount": [
{
"operator": "string",
"value": "string"
}
],
"name": [
{
"operator": "string",
"value": "string"
}
],
"status": [
{
"operator": "string",
"value": "string"
}
],
"type": [
{
"operator": "string",
"value": "string"
}
]
},
"searchAny": {
"amount": [
{
"operator": "string",
"value": "string"
}
],
"name": [
{
"operator": "string",
"value": "string"
}
],
"status": [
{
"operator": "string",
"value": "string"
}
],
"type": [
{
"operator": "string",
"value": "string"
}
]
},
"sortDirection": "string",
"sortField": "string"
}
Try it now
query getPaymentLinkPageDev($page: Int, $pageSize: Int, $search: PaymentLinkSearchInput, $searchAny: PaymentLinkSearchInput, $sortDirection: SortDirection, $sortField: PaymentLinkSortField){
getPaymentLinkPageDev(page: $page, pageSize: $pageSize, search: $search, searchAny: $searchAny, sortDirection: $sortDirection, sortField: $sortField){
total
page
offset
totalPage
prevPage
nextPage
items{
invoiceUrl
amount
description
id
name
notes
status
type
coverImage{
url
}
}
}
}
{
"page": "integer",
"pageSize": "integer",
"search": {
"amount": [
{
"operator": "string",
"value": "string"
}
],
"name": [
{
"operator": "string",
"value": "string"
}
],
"status": [
{
"operator": "string",
"value": "string"
}
],
"type": [
{
"operator": "string",
"value": "string"
}
]
},
"searchAny": {
"amount": [
{
"operator": "string",
"value": "string"
}
],
"name": [
{
"operator": "string",
"value": "string"
}
],
"status": [
{
"operator": "string",
"value": "string"
}
],
"type": [
{
"operator": "string",
"value": "string"
}
]
},
"sortDirection": "string",
"sortField": "string"
}
Successful operation
Response Content-Types: application/json
Response Example (200 OK)
{
"data": {
"getPaymentLinkPageDev": {
"total": "integer",
"page": "integer",
"offset": "integer",
"totalPage": "integer",
"prevPage": "integer",
"nextPage": "integer",
"items": [
{
"invoiceUrl": "string",
"amount": "number",
"description": "string",
"id": "string",
"name": "string",
"notes": "string",
"coverImage": {
"url": "string"
}
}
]
}
}
}
Schema Definitions
Float: number
The Float
scalar type represents signed double-precision fractional values as specified by
IEEE 754.
Example
number
ID: object
The ID
scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4"
) or integer (such as 4
) input value will be accepted as an ID.
Example
object
Int: number
The Int
scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
number
PaymentLink: object
- invoiceUrl:
- amount:
- description:
- id:
- name:
- notes:
- status:
- type:
- coverImage:
Example
{
"invoiceUrl": "string",
"amount": "number",
"description": "string",
"id": "object",
"name": "string",
"notes": "string",
"status": "string",
"type": "string",
"coverImage": {
"url": "string"
}
}
PaymentLinkPage: object
Example
{
"total": "number",
"page": "number",
"offset": "number",
"totalPage": "number",
"prevPage": "number",
"nextPage": "number",
"items": [
{
"invoiceUrl": "string",
"amount": "number",
"description": "string",
"id": "object",
"name": "string",
"notes": "string",
"status": "string",
"type": "string",
"coverImage": {
"url": "string"
}
}
]
}
PaymentLinkSearchInput: object
- amount:
- name:
- status:
- type:
Example
{
"amount": [
{
"operator": "string",
"value": "string"
}
],
"name": [
{
"operator": "string",
"value": "string"
}
],
"status": [
{
"operator": "string",
"value": "string"
}
],
"type": [
{
"operator": "string",
"value": "string"
}
]
}
PaymentLinkSortField: string
-
objectamount
-
objectcategory
-
objectcoverImageId
-
objectcreatedAt
-
objectcustomerId
-
objectdescription
-
objectdownloadFileId
-
objecteventEndAt
-
objecteventStartAt
-
objecteventUrl
-
objectexpiredAt
-
objectformId
-
objectfundraisingSettings
-
objectitems
-
objectlimit
-
objectlink
-
objectmultipleImageId
-
objectname
-
objectnotes
-
objectoneAccountTransaction
-
objectpaymentType
-
objectqty
-
objectreason
-
objectreceiver
-
objectredirectUrl
-
objectstatus
-
objectsubType
-
objectsubscriptionId
-
objecttarget
-
objecttax
-
objectterm
-
objectterms
-
objecttype
-
objectupdatedAt
-
objectusage
-
objectuserId
PaymentLinkType: string
-
objectgeneric_link
-
objectpayment_request
-
objectsubscription
-
objectdigital_product
-
objectwebinar
-
objectpayme
-
objectfundraising
-
objectinvoice
-
objectphysical_product
-
objectevent
-
objectcoaching
-
objectcourse
-
objectzakat
SearchParameterOperator: string
-
objectlt
-
less than
-
objectlte
-
less than equals
-
objecteq
-
equals
-
objectgte
-
greater than equals
-
objectgt
-
greater than
-
objectlike
-
like
-
objectnot
-
not
-
objectisEmpty
-
objectnotEmpty