Skip to content

Latest commit

 

History

History
378 lines (272 loc) · 10.6 KB

PaymentsApi.md

File metadata and controls

378 lines (272 loc) · 10.6 KB

BillaBear.PaymentsApi

All URIs are relative to https://{customerId}.billabear.cloud/api/v1

Method HTTP request Description
chargeInvoice POST /invoice/{invoiceId}/charge Charge Invoice
downloadInvoice GET /invoice/{invoiceId}/download Download Invoice
downloadReceipt GET /receipt/{receiptId}/download Download Receipt
getInvoicesForCustomer GET /customer/{customerId}/invoices List Customer Invoices
getPaymentsForCustomer GET /customer/{customerId}/payment List Customer Payments
listPayment GET /payment List
refundPayment POST /payment/{paymentId}/refund Refund Payment

chargeInvoice

InlineResponse20012 chargeInvoice(invoiceId)

Charge Invoice

Attempts to charge a card that is on file for the invoice amount

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let invoiceId = "invoiceId_example"; // String | The id of the invoice

apiInstance.chargeInvoice(invoiceId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
invoiceId String The id of the invoice

Return type

InlineResponse20012

Authorization

ApiKeyAuth

HTTP request headers

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

downloadInvoice

'Blob' downloadInvoice(invoiceId)

Download Invoice

Returns the pdf blob for the invoice

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let invoiceId = "invoiceId_example"; // String | The id of the invoice

apiInstance.downloadInvoice(invoiceId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
invoiceId String The id of the invoice

Return type

'Blob'

Authorization

ApiKeyAuth

HTTP request headers

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

downloadReceipt

'Blob' downloadReceipt(receipt)

Download Receipt

Returns the pdf blob for the Receipt

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let receipt = "receipt_example"; // String | The id of the receipt

apiInstance.downloadReceipt(receipt, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
receipt String The id of the receipt

Return type

'Blob'

Authorization

ApiKeyAuth

HTTP request headers

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

getInvoicesForCustomer

InlineResponse2004 getInvoicesForCustomer(customerId)

List Customer Invoices

List Customer Invoices

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve

apiInstance.getInvoicesForCustomer(customerId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
customerId String The id of the customer to retrieve

Return type

InlineResponse2004

Authorization

ApiKeyAuth

HTTP request headers

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

getPaymentsForCustomer

InlineResponse2003 getPaymentsForCustomer(customerId, opts)

List Customer Payments

List Customer Payment

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let customerId = "customerId_example"; // String | The id of the customer to retrieve
let opts = { 
  'limit': 56, // Number | How many items to return at one time (max 100)
  'lastKey': "lastKey_example", // String | The key to be used in pagination to say what the last key of the previous page was
  'name': "name_example" // String | The name to search for
};
apiInstance.getPaymentsForCustomer(customerId, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
customerId String The id of the customer to retrieve
limit Number How many items to return at one time (max 100) [optional]
lastKey String The key to be used in pagination to say what the last key of the previous page was [optional]
name String The name to search for [optional]

Return type

InlineResponse2003

Authorization

ApiKeyAuth

HTTP request headers

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

listPayment

InlineResponse2007 listPayment(opts)

List

List all payment

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let opts = { 
  'limit': 56, // Number | How many items to return at one time (max 100)
  'lastKey': "lastKey_example", // String | The key to be used in pagination to say what the last key of the previous page was
  'name': "name_example" // String | The name to search for
};
apiInstance.listPayment(opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
limit Number How many items to return at one time (max 100) [optional]
lastKey String The key to be used in pagination to say what the last key of the previous page was [optional]
name String The name to search for [optional]

Return type

InlineResponse2007

Authorization

ApiKeyAuth

HTTP request headers

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

refundPayment

'String' refundPayment(body, paymentId)

Refund Payment

Issue a refund for payment

Example

import {BillaBear} from 'billa_bear';
let defaultClient = BillaBear.ApiClient.instance;

// Configure API key authorization: ApiKeyAuth
let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix = 'Token';

let apiInstance = new BillaBear.PaymentsApi();
let body = new BillaBear.IssueRefundPayment(); // IssueRefundPayment | 
let paymentId = "paymentId_example"; // String | The id of the payment

apiInstance.refundPayment(body, paymentId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
body IssueRefundPayment
paymentId String The id of the payment

Return type

'String'

Authorization

ApiKeyAuth

HTTP request headers

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