Coder Social home page Coder Social logo

n11soap-api's Introduction

Cover

N11 Soap API - Soap Api implementation for php

License Issues Total Downloads Latest Stable Version

This library implements the PSR-4 interface that you can type-hint against in your own libraries to keep a maximum of interoperability.

Installation

Install the latest version with

$ composer require metineren/n11soap-api

Basic Usage

<?php

use N11\SoapClient;

// for get current api version
SoapClient::getVersion();

// for get all available api services
SoapClient::getAvailableServices();

CategoryService Usages

<?php
use N11\CategoryService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new CategoryService(false, $authentication);

print_r($service->GetTopLevelCategories());
print_r($service->GetCategoryAttributes(1000001, 1, 30));
print_r($service->GetParentCategory(1000006));
print_r($service->GetCategoryAttributesId(1000001));
print_r($service->GetCategoryAttributeValue(7086918, 1, 30));
print_r($service->GetSubCategories(1000001));

CityService Usages

<?php
use N11\CityService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new CityService(false, $authentication);

print_r($service->GetCities());
print_r($service->GetCity(34));
print_r($service->GetDistrict(34));
print_r($service->GetNeighborhoods(22350));

OrderService Usages

<?php
use N11\OrderService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new OrderService(false, $authentication);

// service methods coming soon

ProductSellingService Usages

<?php
use N11\ProductSellingService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new \N11\ProductStockService(false, $authentication);

// service methods coming soon

ProductService Usages

<?php
use N11\ProductService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new ProdcutService(false, $authentication);

// service methods coming soon

ProductStockService Usages

<?php
use N11\ProductStockService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new ProductStockService(false, $authentication);

// service methods coming soon

SapBankStatementEInvoiceService Usages

<?php
use N11\SapBankStatementEInvoiceService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new SapBankStatementEInvoiceService(false, $authentication);

print_r($service->GetSapBankStatementEInvoice('2020-01-01', '2020-02-24'));

SapCommissionEInvoiceDetailService Usages

<?php
use N11\SapCommissionEInvoiceDetailService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new SapCommissionEInvoiceDetailService(false, $authentication);

print_r($service->GetSapCommissionEInvoiceDetail('2020-02-24'));

SettlementService Usages

<?php
use N11\SettlementService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new SettlementService(false, $authentication);

print_r($service->GetSettlementList('2020-01-01', '2020-02-24', 1, 30));
print_r($service->GetSettlementDetail('2020-02-24', 1, 30));

ShipmentCompanyService Usages

<?php
use N11\ShipmentCompanyService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new ShipmentCompanyService(false, $authentication);

print_r($service->GetShipmentCompanies());

ShipmentService Usages

<?php
use N11\ShipmentService;
use N11\complexType\Authentication;

use N11\complexType\ShipmentApiModel;

use N11\complexType\ShipmentSaveAddress;
use N11\complexType\ShipmentCompanyApiModelList;
use N11\complexType\CityApiModelList;
use N11\complexType\ShipmentCompanyApiModel;

use N11\complexType\DistrictApiModel;
use N11\complexType\CityApiModel;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new ShipmentService(false, $authentication);

print_r($service->GetShipmentTemplateList());
print_r($service->GetShipmentTemplate('templateName'));


// Start Of ShipmentApiModel vars
$templateName = 'templateName';
$installmentInfo = 'installmentInfo';
$exchangeInfo = 'exchangeInfo';
$shippingInfo = 'shippingInfo';
$specialDelivery = false;
$deliveryFeeType = 'deliveryFeeType';
$combinedShipmentAllowed = false;
$shipmentMethod = 'shipmentMethod';
$cargoAccountNo = null;
$useDmallCargo = false;

// Start of $warehouseAddress & $exchangeAddress vars
$title = 'title';
$address = 'address';
$district = new DistrictApiModel('Avcılar', 22350);
$city = new CityApiModel('İstanbul', 34);
$postalCode = '34000';
// End of $warehouseAddress & $exchangeAddress vars

$warehouseAddress = new ShipmentSaveAddress($title, $address, $district, $city, $postalCode);
$exchangeAddress = new ShipmentSaveAddress($title, $address, $district, $city, $postalCode);
$shipmentCompanies = new ShipmentCompanyApiModelList();
$shipmentCompanies->add('Aras Kargo', 'ars');
$deliverableCities = new CityApiModelList(); // or null 
$deliverableCities->add('İstanbul', 34)->add('Bursa', 16)->add('İzmir', 35);
$claimShipmentCompany = new ShipmentCompanyApiModel('Aras Kargo', 'ars');
// End of ShipmentApiModel vars

$shipment = new ShipmentApiModel(
    $templateName,
    $installmentInfo,
    $exchangeInfo,
    $shippingInfo,
    $specialDelivery,
    $deliveryFeeType,
    $combinedShipmentAllowed,
    $shipmentMethod,
    $warehouseAddress,
    $exchangeAddress,
    $shipmentCompanies,
    $deliverableCities,
    $claimShipmentCompany,
    $cargoAccountNo,
    $useDmallCargo
);

var_dump($service->CreateOrUpdateShipmentTemplate($shipment));

TicketService Usages

<?php
use N11\TicketService;
use N11\complexType\Authentication;

$apiKey = ''; // Your N11 Api Key
$apiSecret = ''; // Your N11 Api Key Secret

$authentication = new Authentication($apiKey, $apiSecret);
$service = new TicketService(false, $authentication);

print_r($service->TicketListingBelongsToSeller(12, 1, 30));
print_r($service->TicketReasons());
var_dump($service->TicketRead(12345332, 12));
print_r($service->TicketListingAssignedToSeller(12, 1, 30));
var_dump($service->TicketAnswer(12, 1231231231231233123, 'ticket answer here'));
var_dump($service->TicketCreate(143872, 12, 'Ticket title here', 'Ticket question here'));

n11soap-api's People

Contributors

metineren avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.