Skip to content

Latest commit

 

History

History
375 lines (252 loc) · 10.2 KB

CreditNotesApi.md

File metadata and controls

375 lines (252 loc) · 10.2 KB

LagoClient\CreditNotesApi

All URIs are relative to https://api.getlago.com/api/v1, except if the operation defines another base path.

Method HTTP request Description
createCreditNote() POST /credit_notes Create a new Credit note
downloadCreditNote() POST /credit_notes/{id}/download Download an existing credit note
findAllCreditNotes() GET /credit_notes Find Credit notes
findCreditNote() GET /credit_notes/{id} Find credit note
updateCreditNote() PUT /credit_notes/{id} Update an existing credit note
voidCreditNote() PUT /credit_notes/{id}/void Void existing credit note

createCreditNote()

createCreditNote($credit_note_input): \LagoClient\Model\CreditNote

Create a new Credit note

Create a new credit note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$credit_note_input = new \LagoClient\Model\CreditNoteInput(); // \LagoClient\Model\CreditNoteInput | Credit note payload

try {
    $result = $apiInstance->createCreditNote($credit_note_input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->createCreditNote: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
credit_note_input \LagoClient\Model\CreditNoteInput Credit note payload

Return type

\LagoClient\Model\CreditNote

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

downloadCreditNote()

downloadCreditNote($id): \LagoClient\Model\CreditNote

Download an existing credit note

Download an existing credit note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 1a901a90-1a90-1a90-1a90-1a901a901a90; // string | ID of the existing Lago Credit note

try {
    $result = $apiInstance->downloadCreditNote($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->downloadCreditNote: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string ID of the existing Lago Credit note

Return type

\LagoClient\Model\CreditNote

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findAllCreditNotes()

findAllCreditNotes($external_customer_id): \LagoClient\Model\CreditNotes

Find Credit notes

Find all credit notes in certain organisation

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$external_customer_id = 12345; // string | External customer ID

try {
    $result = $apiInstance->findAllCreditNotes($external_customer_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->findAllCreditNotes: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
external_customer_id string External customer ID [optional]

Return type

\LagoClient\Model\CreditNotes

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

findCreditNote()

findCreditNote($id): \LagoClient\Model\CreditNote

Find credit note

Return a single credit note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 12345; // string | Id of the existing credit note

try {
    $result = $apiInstance->findCreditNote($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->findCreditNote: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Id of the existing credit note

Return type

\LagoClient\Model\CreditNote

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateCreditNote()

updateCreditNote($id, $credit_note_update_input): \LagoClient\Model\CreditNote

Update an existing credit note

Update an existing credit note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 12345; // string | Id of the existing credit note
$credit_note_update_input = new \LagoClient\Model\CreditNoteUpdateInput(); // \LagoClient\Model\CreditNoteUpdateInput | Update an existing credit note

try {
    $result = $apiInstance->updateCreditNote($id, $credit_note_update_input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->updateCreditNote: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string Id of the existing credit note
credit_note_update_input \LagoClient\Model\CreditNoteUpdateInput Update an existing credit note

Return type

\LagoClient\Model\CreditNote

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

voidCreditNote()

voidCreditNote($id): \LagoClient\Model\CreditNote

Void existing credit note

Void an existing credit note

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer authorization: bearerAuth
$config = LagoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new LagoClient\Api\CreditNotesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 1a901a90-1a90-1a90-1a90-1a901a901a90; // string | ID of the existing Lago Credit note

try {
    $result = $apiInstance->voidCreditNote($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CreditNotesApi->voidCreditNote: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
id string ID of the existing Lago Credit note

Return type

\LagoClient\Model\CreditNote

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]