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.

Mayar Headless Architecture

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 Zakat

    Setiap PaymentLink akan memiliki invoiceUrl yang dapat anda gunakan untuk checkout dari front-end anda baik dengan mengarahkan ke URL tersebut atau melalui pop-up embed

page:
integer

(no description)

pageSize:
integer

(no description)

(no description)

(no description)

sortDirection:

(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
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

Boolean: boolean

The Boolean scalar type represents true or false.

Example
boolean

Example: object

id:
Example
{
  "id": "string"
}

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

Image: object

url:
Example
{
  "url": "string"
}

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

PaymentLinkPage: object

total:
Int
page:
Int
offset:
Int
totalPage:
Int
prevPage:
Int
nextPage:
Int
items:
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

Example
{
  "amount": [
    {
      "operator": "string",
      "value": "string"
    }
  ],
  "name": [
    {
      "operator": "string",
      "value": "string"
    }
  ],
  "status": [
    {
      "operator": "string",
      "value": "string"
    }
  ],
  "type": [
    {
      "operator": "string",
      "value": "string"
    }
  ]
}

PaymentLinkSortField: string

object
amount
object
category
object
coverImageId
object
createdAt
object
customerId
object
description
object
downloadFileId
object
eventEndAt
object
eventStartAt
object
eventUrl
object
expiredAt
object
formId
object
fundraisingSettings
object
items
object
limit
object
link
object
multipleImageId
object
name
object
notes
object
oneAccountTransaction
object
paymentType
object
qty
object
reason
object
receiver
object
redirectUrl
object
status
object
subType
object
subscriptionId
object
target
object
tax
object
term
object
terms
object
type
object
updatedAt
object
usage
object
userId

PaymentLinkStatus: string

object
active
object
paid
object
closed
object
unpaid
object
archived

PaymentLinkType: string

object
generic_link
object
payment_request
object
subscription
object
digital_product
object
webinar
object
payme
object
fundraising
object
invoice
object
physical_product
object
event
object
coaching
object
course
object
zakat

SearchParameterInput: object

operator:
value:
Example
{
  "operator": "string",
  "value": "string"
}

SearchParameterOperator: string

object
lt

less than

object
lte

less than equals

object
eq

equals

object
gte

greater than equals

object
gt

greater than

object
like

like

object
not

not

object
isEmpty
object
notEmpty

SortDirection: string

object
ASC
object
DESC

String: string

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.