PHP SDK

Initialising

The required libraries can be downloaded to your directory using composer. Contact us to receive the composer command to download the SDK resource files.
Find the .env file in the following directory created: “vendor\arcadier\arcadier-php\src” and replace the variables with the relevant values:

Remember to load the SDK by including the following line in all your PHP scripts:

Relevant values

PHP scripts

Update Marketplace Info

POST /api/v2/marketplaces/

$updated_mp

Authentication and SSO

Single Sign On

POST /api/v2/sso

Arguments: 

  • $exUserId- (Required) The user’s ID from the external platform (string) 
  • $userEmail- (Optional) This will be registered as the new user’s notification email

POST /api/v2/sso

Log In/Get Admin Token

POST /token

Get Admin Token:

Log a user in:

User Accounts

Get A User’s details

GET /api/v2/users/{userID}

Arguments: 
  • $id- (Required) User GUID (string) 
  • $includes- (Optional) Takes the following values (string): 
    • "addresses"

GET /api/v2/users/{userID}

Get All Buyers

GET /api/v2/admins/{adminID}/users/?role=buyer

Arguments: 
  • $keywords - (Optional) Search all merchants having a certain keyword in their details (name/e-mail). (string) 
  • $pageSize- (Optional) The number of results in one response. (integer) 
  • $pageNumber- (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)

GET /api/v2/admins/{adminID}/users/?role=buyer

Get All Merchants

GET /api/v2/admins/{adminID}/users/?role=merchant

Arguments: 
  • $keywords - (Optional) Search all merchants having a certain keyword in their details (name/e-mail). (string) 
  • $pageSize- (Optional) The number of results in one response. (integer) 
  • $pageNumber- (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)

Get All Users

GET /api/v2/admins/{adminID}/api/v2/admins/{adminID}/users/?role=buyer

Arguments: 
  • $keywords - (Optional) Search all merchants having a certain keyword in their details (name/e-mail). (string) 
  • $pageSize- (Optional) The number of results in one response. (integer) 
  • $pageNumber- (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)

GET /api/v2/admins/{adminID}/users/?role=buyer

Update User information

POST /api/v2/users/{userID}

Arguments: 
  • $id - (Required) User GUID (string) 
  • $data- (Optional) If omitted, user will be unaffected. 

PUT /api/v2/users/{userID}

$data

Upgrade User Role

POST /api/v2/admins/{adminID}/users/{userID}/roles/{role}

Arguments: 
  • $id - (Required) User GUID (string) 
  • $role - (Required) Takes one of the following values (string) 
    • “merchant”
    • “Admin”

PUT /api/v2/admins/{adminID}/users/{userID}/roles/{role}

Delete User

DELETE /api/v2/admins/{adminID}/users/{userID}

Arguments: 
  • $id - (Required) User GUID (string) 

DELETE /api/v2/admins/{adminID}/users/{userID}

Get Password Reset Token

POST /api/v2/admins/{adminID}/password

POST /api/v2/admins/{adminID}/password

Update Password

POST /api/v2/users/{userID}/password

Arguments: 
  • $userId - (Required) User GUID (string) 
  • $data- (Required) 

$data

Addresses

Get User Address

GET /api/v2/users/{userID}/addresses/{addressID} is mapped to getUserAddress($id, $addressID)

Arguments: 
  • $id - (Required) User GUID (string) 
  • $addressID - (Optional) Address GUID (string). Ommitting it will return all addresses of that user. 

Create User Address

POST /api/v2/users/{userID}/addresses is mapped to createUserAddress($id, $data)

Arguments: 
  • $id - (Required) User GUID (string) 
  • $data - (Required) 

$data

Update User Address

POST /api/v2/users/{userID}/addresses/{addressID} is mapped to updateUserAddress($id, $addressID, $data)

Arguments: 
  • $id - (Required) User GUID (string) 
  • $addressID - (Required) Address GUID (string) 
  • $data - (Required) 

$data

Delete User Address

DELETE /api/v2/users/{userID}/addresses/{addressID} is mapped to deleteUserAddress($id, $addressID)

Arguments: 
  • $id - (Required) User GUID (string) 
  • $addressID - (Optional) Address GUID (string). Ommitting it will return all addresses of that user.

Items

Get Item Information

GET /api/v2/items/{itemID} is mapped to getItemInfo($id)

Arguments: 
  • $id - (Required) Item GUID (string) 

Get All Items

GET /api/v2/items is mapped to getAllItems($pageSize = null, $pageNumber = null);

Arguments: 
  • $pageSize - (Optional) The number of results in one response. (integer) 
  • $pageNumber - (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer) 

get all items

Search for an item

POST /api/v2/items is mapped to searchItems($data);

Search filters are passed to the function as an object:

Search for an item

Create Item

POST /api/v2/merchants/{merchantID}/items is mapped to createItem($data, $merchantId)

Arguments: 
  • $merchantId- (Required) Merchant GUID (string) 
  • $data- Item details (Object) 

$data

Create Listing/Booking

POST /api/v2/merchants/{merchantID}/items is mapped to createItem($data, $merchantId)

Arguments: 
  • $merchantId - (Required) Merchant GUID (string) 
  • $data - Item details (Object) 

Documentation and $data details can be found here here

Fields similar to Create Item have the same requirement.

$data

Edit Item/Listing/Booking

PUT /api/v2/merchants/{merchantID}/items/{itemID} is mapped to editItem($data, $merchantId, $itemId)

Arguments: 
  • $merchantId - (Required) Merchant GUID (string) 
  • $itemId - (Required) Item GUID (string) 
  • $data - Item details (Object) 

Documentation and $data details can be found here here

Delete Item/Listing/Booking

DELETE /api/v2/merchants/{merchantID}/items/{itemID} is mapped to deleteItem($merchantId, $itemId)

Arguments: 
  • $merchantId - (Required) Merchant GUID (string) 
  • $itemId - (Required) Item GUID (string) 

Tag Item/Listing/Booking

POST /api/v2/merchants/{merchantID}/items/{itemID}/tags is mapped to tagItem($data, $merchantId, $itemId)

Arguments: 
  • $merchantId - (Required) Merchant GUID (string) 
  • $itemId - (Required) Item GUID (string) 
  • $data - Item details (Array of strings) 

Tag item

Get Item Tags

GET /api/v2/tags is mapped to getItemTags($pageSize = null, $pageNumber = null)

Arguments: 
  • $pageSize - (Optional) The number of results in one response. (integer) 
  • $pageNumber - (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer) 

More about pagination here

Get item tags

Delete Item Tags

DELETE /api/v2/tags is mapped to deleteTags($data)

Delete item tag

Cart

Get Buyer's Cart

GET /api/v2/users/{buyerID}/carts

Arguments: 
  • $buyerId - (Required) The buyer’s GUID (string)

Get buyer cart

Add Item to Cart

POST /api/v2/users/{buyerID}/carts

Arguments: 
  • $buyerId - (Required) The buyer’s GUID (string)
  • $ data : ```php $data = [ ‘ItemDetail’=> [ ‘ID’=> ‘00000000-0000-0000-0000-000000000000’ // Required. String. Item GUID. If an item has child items, this will be the child item GUID. ], ‘Quantity’=> 0, //integer. Required ‘CartItemType’=> ‘delivery’, //optional ‘ShippingMethod’=> [ ‘ID’=> ‘00000000-0000-0000-0000-000000000000’ //optional. Shipping Method GUID ] ];

$cart = $sdk->addToCart($data, $buyerId); echo $cart;

Add item to cart

Delete Item from Cart

DELETE /api/v2/users/{buyerID}/carts/{cart-item-ID}

Arguments: 
  • $buyerId - (Required) The buyer’s GUID (string)
  • $cartItemId - (Required) The Cart Item ID obtained from the response of Add item to Cart API

$cart

Orders

Get Order by Order GUID

GET /api/v2/users/{merchantID}/orders/{orderID}

Arguments: 
  • $id - (Required) The order GUID (string) 
  • $userId - (Required) Can be either the Admin GUID or the merchant GUID of the the merchant who owns the order. 

$orderinfo

Get All Orders of a merchant

GET /api/v2/users/{merchantID}/orders/{orderID}

Arguments: 
  • $merchantId - (Required) The merchant GUID (string) 
  • $pageSize - (Optional) The number of results in one response. (integer) 
  • $pageNumber- (O ptional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer) 

$orderList

Get All Orders within an Invoice

GET /api/v2/merchants/{merchantID}/transactions/{invoiceID}

Arguments: 
  • $merchantId - (Required) The merchant GUID (string) 
  • $invoiceId - (Required) The invoice number (string) 

$orderList

Update An Order

POST /api/v2/merchants/{merchantID}/orders/{orderID}

Arguments: 
  • $merchantId - the GUID of the merchant who is the owner of the order. This can also be the Admin GUID (string) 
  • $orderId - The order GUID (string) 
  • $data

Field Definitions for $data can be foundhere.

Update an order

Edit Several Orders’ Details

POST /api/v2/admins/{adminID}/orders

Field Definitions for $data can be found here.

Edit several orders' details

Transactions & Invoices

Get Transaction Info by Invoice number

GET /api/v2/admins/{adminID}/transactions/{invoiceID}

Arguments: 
  • $invoiceNo - (Required) The invoice number (string)

$transac_info

Get all Transactions of marketplace

GET /api/v2/admins/{adminID}/transactions is mapped to Transactions.getTransactions(pageSize, pageNumber, keywords, startDate, endDate)

Arguments: 
  • pageSize - The number of results in one response. (integer)
  • pageNumber - Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)
  • keywords - (Optional) Search term as keyword to find within transactions.
  • startDate - (Optional) The lower limit of the time at which you want to start filtering. (integer - Unix timestamp)
  • endDate - (Optional) The upper limit of the time at which you want to end filetering. (integer - Unix timestamp)

transactions

Get all Transactions of a Buyer

GET /api/v2/users/{buyerID}/transactions

Arguments: 
  • $buyerId - (Required) The buyer GUID (string)

$transactions['Records']

Update Seeral Transaction Details

PUT /api/v2/admins/{adminID}/invoices/{invoiceID}

Arguments: 
  • $invoiceNo - the invoice number of the invoice to be updated
  • $data

Field Definitions for $data can be found here.

$updated_transaction

Custom Tables

Get Custom Table Contents

GET api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/

Arguments: 
  • $packageId - (Required) The Plug-In ID (string)
  • $tableName - (Required) The table name (string)

$custom_table['Records']

Create Row

POST /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows

Arguments: 
  • $packageId - (Required) The Plug-In ID (string)
  • $tableName - (Required) The table name (string)

$new_row

Update Row

PUT /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows/{rowId}

Arguments: 
  • $packageId - (Required) The Plug-In ID (string)
  • $tableName - (Required) The table name (string)
  • $rowId - (Required) The ID of the row (string)

$update_row

Delete Row

DELETE /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows/{rowId}

Arguments: 
  • $packageId - (Required) The Plug-In ID (string)
  • $tableName - (Required) The table name (string)
  • $rowId - (Required) The ID of the row (string)

$deleted_row

Event Triggers

Get Event Triggers


$event_trigger_list

Create Event Trigger

POST /api/v2/event-triggers/

Field definitions: 
  • 'Uri' - The URL of the webhook to send the payload to.
  • 'Filters' => [] - Array of names of the events which act as trigger. More details here
  • 'Description' - Short description of the event trigger
  • 'IsPaused' - (Boolean) Halts the triggering of this event to the specified URI. This does not delete the event trigger.
  • 'Headers' => [] - Array of headers paramaters you wish to send with the payload to the webhook server.

$new_event_trigger

Edit Event Trigger

PUT /api/v2/event-triggers/{event_trigger_ID}

Arguments: 
  • $eventTriggerId - the ID of the event trigger obtained after creating it (string)
  • $data
Field definitions: 
  • 'Uri' - The URL of the webhook to send the payload to.
  • 'Filters' => [] - Array of names of the events which act as trigger. More details here
  • 'Description' - Short description of the event trigger
  • 'IsPaused' - (Boolean) Halts the triggering of this event to the specified URI. This does not delete the event trigger.
  • 'Headers' => [] - Array of headers paramaters you wish to send with the payload to the webhook server.

$edit_event_trigger

Delete Event Trigger

DELETE /api/v2/event-triggers/{event_trigger_ID}

Arguments: 
  • $eventTriggerId - the ID of the event trigger obtained after creating it (string)

$delete_event_trigger

E-Mail

Send Email

POST /api/v2/admins/{adminID}/emails

Arguments: 
  • $from - The sender's email (string)
  • $to - The recipient's email (string)
  • $html - Stringified HTML content of the email
  • $subject - The subject of the email (string)

$sendEmail

Send Email for Invoice number

POST /api/v2/emails

Arguments: 
  • $invoiceno - The invoice number (string)

$sendEmail

Static

Get Fulfilment Statuses

GET /api/v2/static/fulfilment-statuses

$fulfilment_statuses['Records']

Get Currencies

GET /api/v2/static/currencies

$currencies['Records']

Get Countries

GET /api/v2/static/countries

$countries['Records']

Get Order Statuses

GET /api/v2/static/order-statuses

$order_statuses['Records']

Get Payment Statuses

GET /api/v2/static/payment-statuses

$payment_statuses['Records']

Get TimeZones

GET /api/v2/static/timezones

$timezones['Records']

Categories

Get Category List

GET /api/v2/categories

Arguments: 
  • $pageSize - (Optional) The number of results in one response. (integer)
  • $pageNumber - (Optional) Depending on $pageSize and the total number of results, specifying this will display different sets of results. (integer)

$category_list['Records']

Get Category Hierarchy

GET /api/v2/categories/hierarchy

$category_hierarchy

Create a Category

POST /api/v2/admins/{adminID}/categories

Field definitions: 
  • 'Name' - Name of the category
  • 'Description' - Short Description of the category
  • 'SortOrder' - Rank in which it will appear on category lists
  • 'Media' => [ 'MediaUrl'] - The URL of the image to be set for the category
  • 'ParentCategoryID' - The GUID of the category which will be the parent of this new category. Omit this field if the category is going to be a parent/main category
  • 'Level' - Parent Categories have a level of 0. subsequent levels of child categories have higher levels.

$new_category

Edit a Category

PUT /api/v2/admins/{adminID}/categories/{categoryID}

Arguments: 
  • $categoryId - the category GUID of the category to edit
  • $data
Field definitions: 
  • 'Name' - Name of the category
  • 'Description' - Short Description of the category
  • 'SortOrder' - Rank in which it will appear on category lists
  • 'Media' => [ 'MediaUrl'] - The URL of the image to be set for the category
  • 'ParentCategoryID' - The GUID of the category which will be the parent of this new category. Omit this field if the category is going to be a parent/main category
  • 'Level' - Parent Categories have a level of 0. subsequent levels of child categories have higher levels.

$edited_category

Sort Categories

PUT /api/v2/admins/{adminID}/categories

$sorted_list

Delete a Category

DELETE /api/v2/admins/{adminID}/categories/{categoryID}

Arguments: 
  • $categoryId - the category GUID of the category to edit

$deleted_category

Marketplace

Get Marketplace Info

GET /api/v2/marketplaces/

$mp

Customize/Shorten URL

POST /api/v2/rewrite-rules

Field definitions: 
  • 'Key' - The custom URL slug
  • 'Value' - The default URL slug to replace

$res

Custom Fields

Get Custom Field Definitions

GET /api/v2/admins/{adminID}/custom-field-definitions/

$cf['Records']

Get Custom Fields of a Plug-In

GET /api/v2/packages/{packageID}/custom-field-definitions

Arguments: 
  • $packageId - The ID of the Plug-In (string)

$plugin_cf

Create A Custom Field

POST /api/v2/admins/{adminID}/custom-field-definitions

Field Definitions for $data: All the field definitions for this request can be found here

$new_cf

Edit A Custom Field

PUT /api/v2/admins/{adminID}/custom-field-definitions/{customfield-code}

Arguments: 
  • $code - The custom field code obtained after creating it/getting its definition

Field Definitions for $data: All the field definitions for this request can be found here

$updated_cf

Delete A Custom Field

DELETE /api/v2/admins/{adminID}/custom-field-definitions/{custom-field-code}

Arguments: 
  • $code - The custom field code obtained after creating it/getting its definition

$deleted_cf

Shipping/Delivery Methods

Get Shipping Methods

GET /api/v2/merchants/{merchantID}/shipping-methods/

$shipping_methods

Get Delivery Rates (Weight/Price)

GET /api/v2/merchants/{adminID}/shipping-methods/

$delivery_rates

Create Shipping Method/Delivery Rate

POST /api/v2/merchants/{merchantID}/shipping-methods

Arguments: 
  • $merchantId - The merchant's GUID (string)
  • $data
Field definitions: 
  • 'Courier' - The shipping method name
  • 'Price' and 'CombinedPrice' Detailed explanations of how to use these 2 fields together is explained here
  • 'CurrencyCode' - The currency in which the shipping method operates, eg: USD or SGD
  • 'Description' - Short description of the shipping method.

$new_shipping

Edit Shipping Method/Delivery Rate

PUT /api/v2/merchants/{merchantID}/shipping-methods/{shippingmethodID}

Arguments: 
  • $merchantId - The merchant's GUID (string)
  • $shippingMethodId - The shipping GUID to be edited (string)
  • $data
Field definitions: 
  • 'Courier' - The shipping method name
  • 'Price' and 'CombinedPrice' Detailed explanations of how to use these 2 fields together is explained here
  • 'CurrencyCode' - The currency in which the shipping method operates, eg: USD or SGD
  • 'Description' - Short description of the shipping method.

$edited_shipping

Delete Shipping Method/Delivery Rate

DELETE /api/v2/merchants/{merchantID}/shipping-methods/{shippingmethodID}

Arguments: 
  • $merchantId - The merchant's GUID (string)
  • $shippingMethodId - The shipping GUID to be deleted (string)

$deleted_shipping

Checkout

Generate Invoice and Order Details from cart

POST /api/v2/users/{buyerID}/invoices/carts

Arguments: 
  • $buyerID - The BUyer's GUID (string)
  • $data

Field Definitions in $data: the difference between an "item ID" and a "cart item ID" is explained here

$generate_details

Node.Js SDK

Initialising

To download the required libraries to your node-modules directory, contact us to receive the command line to execute in Node.

Create a directory for your web app's scripts. In this directory, create a config.js files containing your marketplace's credentials

Remember to load the SDK and the config.js in all your scripts. For example, if you create a directory for all your scripts, then import them using the following lines at the top of your files

Marketplace's Credentials

Load SDK

Addresses

Get User Address

GET /api/v2/users/{userID}/addresses/{addressID} is mapped to Addresses.getUserAddresses(userId)

Arguments: 
  • userId - (Required) User GUID (string)

addresses

Create User Address

POST /api/v2/users/{userID}/addresses is mapped to Addresses.createAddress(userId, body)

Arguments: 
  • userId - (Required) User GUID (string)
  • body - (Required)

newAddress

Delete User Address

DELETE /api/v2/users/{userID}/addresses/{addressID} is mapped to Addresses.deleteAddress(userId, addressId)

Arguments: 
  • userId - (Required) User GUID (string)
  • addressId - (Optional) Address GUID (string). Ommitting it will return all addresses of that user.

deletedAddress

Items

Get Item Information

GET /api/v2/items/{itemID} is mapped to Items.getItemDetails(itemId)

Arguments: 
  • itemId - (Required) Item GUID (string)

itemDetails

Get All Items

GET /api/v2/items is mapped to Items.getAllItems(pageSize, pageNumber)

Arguments: 
  • pageSize - (Optional) The number of results in one response. (integer)
  • pageNumber - (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)

item_list

Search for an item

POST /api/v2/items is mapped to Items.searchItems(body)

Search filters are passed to the function as an object:

response

Create Item

POST /api/v2/merchants/{merchantID}/items is mapped to Items.createItem(body)

new_item

Edit Item

PUT /api/v2/merchants/{merchantID}/items/{itemID} is mapped to Items.EditNewItem(body)

Documentation and body details can be found here.

edit_item

Delete Item

DELETE /api/v2/merchants/{merchantID}/items/{itemID} is mapped to Items.deleteItem(body)

delete_item

Carts

Get Buyer's Cart

GET /api/v2/users/{buyerID}/carts is mapped to Carts.getCarts(body)

cart

Add Item to Cart

POST /api/v2/users/{buyerID}/carts is mapped to Carts.addItem(body)

cart

Edit Item in Cart

PUT /api/v2/users/{buyerID}/carts/{cart-item-ID} is mapped to Carts.editCart(body)

edited_cart

Delete Item from Cart

DELETE /api/v2/users/{buyerID}/carts/{cart-item-ID} is mapped to Carts.deleteItem(body)

delete_cart_item

Orders

Get Order by Order GUID

GET /api/v2/users/{merchantID}/orders/{orderID} is mapped to Orders.getOrderDetails

orderInfo

Get All Orders of a merchant

GET /api/v2/merchants/{merchantID}/transactions is mapped to Orders.getHistory(body)

orderList

Get All Orders within an Invoice

GET /api/v2/merchants/{merchantID}/transactions/{invoiceID} is mapped to Orders.getHistoryDetail

orderList

Transactions

Get all Transactions of marketplace

GET /api/v2/admins/{adminID}/transactions is mapped to Transactions.getTransactions(pageSize, pageNumber, keywords, startDate, endDate)

Arguments: 
  • pageSize - (Optional) The number of results in one response. (integer)
  • pageNumber - (Optional) Depending on pageSize and the total number of results, specifying this will display different sets of results. (integer)
  • keywords - (Optional) Search term as keyword to find within transactions.
  • startDate - (Optional) The lower limit of the time at which you want to start filtering. (integer - Unix timestamp)
  • endDate - (Optional) The upper limit of the time at which you want to end filetering. (integer - Unix timestamp)

transactions

Custom Tables

Get Custom Table Contents

GET api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/ is mapped to CustomTables.getCustomTableContents(body)

custom_table

Create Row

POST /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows is mapped to CustomTables.createCustomTableRow(body)

new_row

Update Row

PUT /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows/{rowId} is mapped to CustomTables.updateCustomTableRow(body)

update_row

Delete Row

DELETE /api/v2/plugins/{packageID}/custom-tables/{custom-table-name}/rows/{rowId} is mapped to CustomTables.deleteCustomTableRow(body)

deleted_row

Marketplace

Get Marketplace Info

GET /api/v2/marketplaces/ is mapped to Marketplaces.getMarketplaceInfo()

mp