OrdersApi
extends BaseApi
in package
Table of Contents
Constants
- ORDER_STATUS = ['ON_HOLD', 'SCHEDULED', 'PROCESSING', 'MAILED', 'CANCELED']
- PAYMENT_STATUS = ['PENDING', 'PAID', 'PAYMENT_FAILED', 'NOT_CHARGED']
- SOURCE = ['OLC_CLIENT', 'ZAPIER', 'HUBSPOT', 'SALESFORCE', 'PODIO', 'GOHIGHLEVEL']
Properties
Methods
- __construct() : mixed
- BaseApi constructor.
- all() : array{message: string, data: array}
- Get orders history <code> <?php $response = $olc->orders()->all([ //'page' => 1, //'pageSize' => 10, ]); ?> </code>
- bulkActions() : array<string|int, mixed>
- Execute a bulk action against an order<br> <code> <?php $response = $olc->orders()->bulkActions([ 'ids' => [30], 'action' => 'remove order items', 'orderId' => 20, ]); ?> </code>'
- calculateCost() : array{message: string, data: array}
- Calculate a cost<br> <code> <?php $response = $olc->orders()->calculateCost([ 'tag' => 69, 'productId' => 791926, ]); ?> </code>'
- create() : array<string|int, mixed>
- Create an order<br> **Note:** Please note that one of the params `contactIds`, `reqId` or `tag` is required <code> <?php $response = $olc->orders()->create([ 'productId' => 59, 'templateId' => 38, 'returnAddress' => null, 'tag' => -1, ]); ?> </code>'
- filtersData() : array{message: string, data: array{source: string[], paymentStatus: string[], orderStatus: string[]}}
- Get order filters data <code> <?php $response = $olc->orders()->filtersData([ //'source' => 'HUBSPOT', //'paymentStatus' => 'PAID', //'orderStatus' => 'MAILED', ]); ?> </code>
- get() : array<string|int, mixed>
- Get order details against the given id <code> <?php $response = $olc->orders()->get(1); ?> </code>
- getExpectedMailedDate() : array<string|int, mixed>
- Get expected mailed date<br> <code> <?php $response = $olc->orders()->getExpectedMailedDate([ 'scheduledDate' => 'ASAP', ]); ?> </code>'
- viewProof() : array{message: string, data: array}
- Create a view proof<br> <code> <?php $response = $olc->orders()->viewProof([ 'templateId' => 69, 'returnContactId' => 791926, 'contactId' => 791927, ]); ?> </code>'
- getInstance() : OlcInstance
- Gets the OlcInstance that this API is associated with.
Constants
ORDER_STATUS
protected
mixed
ORDER_STATUS
= ['ON_HOLD', 'SCHEDULED', 'PROCESSING', 'MAILED', 'CANCELED']
PAYMENT_STATUS
protected
mixed
PAYMENT_STATUS
= ['PENDING', 'PAID', 'PAYMENT_FAILED', 'NOT_CHARGED']
SOURCE
protected
mixed
SOURCE
= ['OLC_CLIENT', 'ZAPIER', 'HUBSPOT', 'SALESFORCE', 'PODIO', 'GOHIGHLEVEL']
Properties
$_olcInstance
private
OlcInstance
$_olcInstance
Methods
__construct()
BaseApi constructor.
public
__construct(OlcInstance $_olcInstance) : mixed
Parameters
- $_olcInstance : OlcInstance
-
OlcInstance that this API is associated with
all()
Get orders history <code> <?php $response = $olc->orders()->all([ //'page' => 1, //'pageSize' => 10, ]); ?> </code>
public
all([array{page?: int, pageSize?: int} $params = [] ]) : array{message: string, data: array}
Parameters
- $params : array{page?: int, pageSize?: int} = []
-
Parameters to send with the request.
Tags
Return values
array{message: string, data: array} —The response data.
bulkActions()
Execute a bulk action against an order<br> <code> <?php $response = $olc->orders()->bulkActions([ 'ids' => [30], 'action' => 'remove order items', 'orderId' => 20, ]); ?> </code>'
public
bulkActions(int $params) : array<string|int, mixed>
Parameters
- $params : int
-
['orderId'] - The order ID
Tags
Return values
array<string|int, mixed> —The result of the request
calculateCost()
Calculate a cost<br> <code> <?php $response = $olc->orders()->calculateCost([ 'tag' => 69, 'productId' => 791926, ]); ?> </code>'
public
calculateCost(int $params) : array{message: string, data: array}
Parameters
- $params : int
-
['productId'] - The product ID
Tags
Return values
array{message: string, data: array} —The result of the request
create()
Create an order<br> **Note:** Please note that one of the params `contactIds`, `reqId` or `tag` is required <code> <?php $response = $olc->orders()->create([ 'productId' => 59, 'templateId' => 38, 'returnAddress' => null, 'tag' => -1, ]); ?> </code>'
public
create(string $params) : array<string|int, mixed>
Parameters
- $params : string
-
['crmMode'] - (optional) CRM mode
Tags
Return values
array<string|int, mixed> —The result of the request
filtersData()
Get order filters data <code> <?php $response = $olc->orders()->filtersData([ //'source' => 'HUBSPOT', //'paymentStatus' => 'PAID', //'orderStatus' => 'MAILED', ]); ?> </code>
public
filtersData([mixed $params = [] ]) : array{message: string, data: array{source: string[], paymentStatus: string[], orderStatus: string[]}}
Parameters
- $params : mixed = []
-
['orderStatus'] (optional) The order status, should be one of them:
-
'ON_HOLD'
-
'SCHEDULED'
-
'PROCESSING'
-
'MAILED'
-
'CANCELED'
-
Tags
Return values
array{message: string, data: array{source: string[], paymentStatus: string[], orderStatus: string[]}} —The response data.
get()
Get order details against the given id <code> <?php $response = $olc->orders()->get(1); ?> </code>
public
get(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The order ID
Tags
Return values
array<string|int, mixed> —The response data.
getExpectedMailedDate()
Get expected mailed date<br> <code> <?php $response = $olc->orders()->getExpectedMailedDate([ 'scheduledDate' => 'ASAP', ]); ?> </code>'
public
getExpectedMailedDate(string $params) : array<string|int, mixed>
Parameters
- $params : string
-
['scheduledDate'] - The ISO date (YYYY-MM-DD) / 'ASAP'
Tags
Return values
array<string|int, mixed> —The result of the request
viewProof()
Create a view proof<br> <code> <?php $response = $olc->orders()->viewProof([ 'templateId' => 69, 'returnContactId' => 791926, 'contactId' => 791927, ]); ?> </code>'
public
viewProof(int $params) : array{message: string, data: array}
Parameters
- $params : int
-
['contactId'] - The contact ID
Tags
Return values
array{message: string, data: array} —The result of the request
getInstance()
Gets the OlcInstance that this API is associated with.
protected
getInstance() : OlcInstance